summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-16 23:42:06 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-16 23:42:06 +0300
commitc30dfff60882585eb2c6e6a3ec2a316209a247cb (patch)
treea5acf9073df2e9e17ae82ac453b0f2c436528dbf
parent2e1208af3d2cf0f466c796aac5c139ced31bb9ca (diff)
downloadparanucker-c30dfff60882585eb2c6e6a3ec2a316209a247cb.tar.gz
paranucker-c30dfff60882585eb2c6e6a3ec2a316209a247cb.tar.bz2
paranucker-c30dfff60882585eb2c6e6a3ec2a316209a247cb.tar.xz
paranucker-c30dfff60882585eb2c6e6a3ec2a316209a247cb.zip
Add parsing node SWITCH_EXPR.
-rw-r--r--src/Makefile.files4
-rw-r--r--src/includes/nodeincludes.h1
-rw-r--r--src/includes/nodeshandling.inc1
-rw-r--r--src/includes/parserdefines.inc1
-rw-r--r--src/nodes/expr/switch_expr.h35
-rw-r--r--src/parsers/expr/switch_expr.cpp44
6 files changed, 85 insertions, 1 deletions
diff --git a/src/Makefile.files b/src/Makefile.files
index c339c1e..272e3f4 100644
--- a/src/Makefile.files
+++ b/src/Makefile.files
@@ -294,4 +294,6 @@ SRC = analysis/analysis.cpp \
nodes/ref/scope_ref.h \
parsers/ref/scope_ref.cpp \
nodes/expr/staticcast_expr.h \
- parsers/expr/staticcast_expr.cpp \ No newline at end of file
+ parsers/expr/staticcast_expr.cpp \
+ nodes/expr/switch_expr.h \
+ parsers/expr/switch_expr.cpp \ No newline at end of file
diff --git a/src/includes/nodeincludes.h b/src/includes/nodeincludes.h
index ab7d90b..5a7b85e 100644
--- a/src/includes/nodeincludes.h
+++ b/src/includes/nodeincludes.h
@@ -125,3 +125,4 @@
#include "nodes/expr/rrotate_expr.h"
#include "nodes/ref/scope_ref.h"
#include "nodes/expr/staticcast_expr.h"
+#include "nodes/expr/switch_expr.h"
diff --git a/src/includes/nodeshandling.inc b/src/includes/nodeshandling.inc
index c6a03f9..f51af23 100644
--- a/src/includes/nodeshandling.inc
+++ b/src/includes/nodeshandling.inc
@@ -124,3 +124,4 @@ handleNodeType(RANGE_EXPR, RangeExpr)
handleNodeType(RROTATE_EXPR, RRotateExpr)
handleNodeType(SCOPE_REF, ScopeRef)
handleNodeType(STATIC_CAST_EXPR, StaticCastExpr)
+handleNodeType(SWITCH_EXPR, SwitchExpr)
diff --git a/src/includes/parserdefines.inc b/src/includes/parserdefines.inc
index 726bfdf..52994af 100644
--- a/src/includes/parserdefines.inc
+++ b/src/includes/parserdefines.inc
@@ -124,3 +124,4 @@ parserDefine(RangeExpr);
parserDefine(RRotateExpr);
parserDefine(ScopeRef);
parserDefine(StaticCastExpr);
+parserDefine(SwitchExpr);
diff --git a/src/nodes/expr/switch_expr.h b/src/nodes/expr/switch_expr.h
new file mode 100644
index 0000000..6fb1394
--- /dev/null
+++ b/src/nodes/expr/switch_expr.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2015 Andrei Karas
+ *
+ * This file is part of AstDumper.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef NODES_EXPR_SWITCHEXPRNODE_H
+#define NODES_EXPR_SWITCHEXPRNODE_H
+
+#include "nodes/base/expr.h"
+
+#include <string>
+
+struct SwitchExprNode : public ExprNode
+{
+ SwitchExprNode() :
+ ExprNode()
+ {
+ }
+};
+
+#endif // NODES_EXPR_SWITCHEXPRNODE_H
diff --git a/src/parsers/expr/switch_expr.cpp b/src/parsers/expr/switch_expr.cpp
new file mode 100644
index 0000000..a90baf0
--- /dev/null
+++ b/src/parsers/expr/switch_expr.cpp
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2015 Andrei Karas
+ *
+ * This file is part of AstDumper.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "includes/parserincludes.h"
+
+parserDefine(SwitchExpr);
+
+#include "parsers/base/expr.h"
+
+#include "nodes/expr/switch_expr.h"
+
+namespace Generic
+{
+
+void parseSwitchExprNode(SwitchExprNode *node)
+{
+ fillType(node);
+ fillExprLocation(node);
+ Log::dump(node);
+
+ fillExprOperands(node);
+
+ // args 0 condition
+ // args 1 body
+ // args 2 labels
+}
+
+}