summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-08 02:14:06 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-08 02:14:06 +0300
commitbadf4fc1c880a0c0426cf7d945b9e60a7edb4198 (patch)
treecede4b4a828680564f6782646167f36dc16574e6 /src
parent619149d1ba1fa47020fc134fbfd4bc0bfe746032 (diff)
downloadparanucker-badf4fc1c880a0c0426cf7d945b9e60a7edb4198.tar.gz
paranucker-badf4fc1c880a0c0426cf7d945b9e60a7edb4198.tar.bz2
paranucker-badf4fc1c880a0c0426cf7d945b9e60a7edb4198.tar.xz
paranucker-badf4fc1c880a0c0426cf7d945b9e60a7edb4198.zip
Add parsing node PLUS_EXPR.
Diffstat (limited to 'src')
-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/plus_expr.h35
-rw-r--r--src/parsers/expr/plus_expr.cpp39
6 files changed, 80 insertions, 1 deletions
diff --git a/src/Makefile.files b/src/Makefile.files
index eb71264..ed8f5f4 100644
--- a/src/Makefile.files
+++ b/src/Makefile.files
@@ -70,4 +70,6 @@ SRC = nodes/base/cst.h \
nodes/stmt/if_stmt.h \
parsers/stmt/if_stmt.cpp \
nodes/stmt/while_stmt.h \
- parsers/stmt/while_stmt.cpp \ No newline at end of file
+ parsers/stmt/while_stmt.cpp \
+ nodes/expr/plus_expr.h \
+ parsers/expr/plus_expr.cpp \ No newline at end of file
diff --git a/src/includes/nodeincludes.h b/src/includes/nodeincludes.h
index 72c4c8c..fb469df 100644
--- a/src/includes/nodeincludes.h
+++ b/src/includes/nodeincludes.h
@@ -22,3 +22,4 @@
#include "nodes/stmt/expr_stmt.h"
#include "nodes/stmt/if_stmt.h"
#include "nodes/stmt/while_stmt.h"
+#include "nodes/expr/plus_expr.h"
diff --git a/src/includes/nodeshandling.inc b/src/includes/nodeshandling.inc
index c301c9e..ebd8a65 100644
--- a/src/includes/nodeshandling.inc
+++ b/src/includes/nodeshandling.inc
@@ -21,3 +21,4 @@ handleNodeType(BLOCK, Block)
handleNodeType(EXPR_STMT, ExprStmt)
handleNodeType(IF_STMT, IfStmt)
handleNodeType(WHILE_STMT, WhileStmt)
+handleNodeType(PLUS_EXPR, PlusExpr)
diff --git a/src/includes/parserdefines.inc b/src/includes/parserdefines.inc
index 5494244..bea90cd 100644
--- a/src/includes/parserdefines.inc
+++ b/src/includes/parserdefines.inc
@@ -21,3 +21,4 @@ parserDefine(Block);
parserDefine(ExprStmt);
parserDefine(IfStmt);
parserDefine(WhileStmt);
+parserDefine(PlusExpr);
diff --git a/src/nodes/expr/plus_expr.h b/src/nodes/expr/plus_expr.h
new file mode 100644
index 0000000..29ef0fc
--- /dev/null
+++ b/src/nodes/expr/plus_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_PLUSEXPRNODE_H
+#define NODES_EXPR_PLUSEXPRNODE_H
+
+#include "nodes/base/expr.h"
+
+#include <string>
+
+struct PlusExprNode : public ExprNode
+{
+ PlusExprNode() :
+ ExprNode()
+ {
+ }
+};
+
+#endif // NODES_EXPR_PLUSEXPRNODE_H
diff --git a/src/parsers/expr/plus_expr.cpp b/src/parsers/expr/plus_expr.cpp
new file mode 100644
index 0000000..2450979
--- /dev/null
+++ b/src/parsers/expr/plus_expr.cpp
@@ -0,0 +1,39 @@
+/*
+ * 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(PlusExpr);
+
+#include "parsers/base/expr.h"
+
+#include "nodes/expr/plus_expr.h"
+
+namespace Generic
+{
+
+void parsePlusExprNode(PlusExprNode *node)
+{
+ fillType(node);
+ Log::log(node);
+
+ fillExprOperands(node);
+}
+
+}