summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-06 23:48:46 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-06 23:48:46 +0300
commit602f18f834797aeebdf76fb3fd92af0cb04cbe1d (patch)
treef41177aac63e54661acb96b99f1c5f28bae58719 /src
parent7669b85688ca5240b65adff8127c1c28a4c93053 (diff)
downloadparanucker-602f18f834797aeebdf76fb3fd92af0cb04cbe1d.tar.gz
paranucker-602f18f834797aeebdf76fb3fd92af0cb04cbe1d.tar.bz2
paranucker-602f18f834797aeebdf76fb3fd92af0cb04cbe1d.tar.xz
paranucker-602f18f834797aeebdf76fb3fd92af0cb04cbe1d.zip
Add parsing INIT_EXPR node type.
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/init_expr.h35
-rw-r--r--src/parsers/expr/init_expr.cpp42
6 files changed, 83 insertions, 1 deletions
diff --git a/src/Makefile.files b/src/Makefile.files
index 1a17956..0b8a339 100644
--- a/src/Makefile.files
+++ b/src/Makefile.files
@@ -51,4 +51,6 @@ SRC = nodes/base/cst.h \
nodes/expr/bind_expr.h \
parsers/expr/bind_expr.cpp \
nodes/expr/decl_expr.h \
- parsers/expr/decl_expr.cpp \ No newline at end of file
+ parsers/expr/decl_expr.cpp \
+ nodes/expr/init_expr.h \
+ parsers/expr/init_expr.cpp \ No newline at end of file
diff --git a/src/includes/nodeincludes.h b/src/includes/nodeincludes.h
index dca72b0..4c35ac9 100644
--- a/src/includes/nodeincludes.h
+++ b/src/includes/nodeincludes.h
@@ -14,3 +14,4 @@
#include "nodes/type/void_type.h"
#include "nodes/expr/bind_expr.h"
#include "nodes/expr/decl_expr.h"
+#include "nodes/expr/init_expr.h"
diff --git a/src/includes/nodeshandling.inc b/src/includes/nodeshandling.inc
index 6f5b67a..d9a4f5a 100644
--- a/src/includes/nodeshandling.inc
+++ b/src/includes/nodeshandling.inc
@@ -13,3 +13,4 @@ handleNodeType(INTEGER_CST, IntegerCst)
handleNodeType(STATEMENT_LIST, StatementList)
handleNodeType(BIND_EXPR, BindExpr)
handleNodeType(DECL_EXPR, DeclExpr)
+handleNodeType(INIT_EXPR, InitExpr)
diff --git a/src/includes/parserdefines.inc b/src/includes/parserdefines.inc
index c8f2b1e..bb401cf 100644
--- a/src/includes/parserdefines.inc
+++ b/src/includes/parserdefines.inc
@@ -13,3 +13,4 @@ parserDefine(IntegerCst);
parserDefine(StatementList);
parserDefine(BindExpr);
parserDefine(DeclExpr);
+parserDefine(InitExpr);
diff --git a/src/nodes/expr/init_expr.h b/src/nodes/expr/init_expr.h
new file mode 100644
index 0000000..55540cc
--- /dev/null
+++ b/src/nodes/expr/init_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_INITEXPRNODE_H
+#define NODES_EXPR_INITEXPRNODE_H
+
+#include "nodes/base/expr.h"
+
+#include <string>
+
+struct InitExprNode : public ExprNode
+{
+ InitExprNode() :
+ ExprNode()
+ {
+ }
+};
+
+#endif // NODES_EXPR_INITEXPRNODE_H
diff --git a/src/parsers/expr/init_expr.cpp b/src/parsers/expr/init_expr.cpp
new file mode 100644
index 0000000..9e4f303
--- /dev/null
+++ b/src/parsers/expr/init_expr.cpp
@@ -0,0 +1,42 @@
+/*
+ * 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(InitExpr);
+
+#include "parsers/base/expr.h"
+
+#include "nodes/expr/init_expr.h"
+
+namespace Generic
+{
+
+void parseInitExprNode(InitExprNode *node)
+{
+ fillType(node);
+ Log::log(node);
+
+ fillExprOperands(node);
+
+ // args 0 - left side
+ // args 1 - right side
+}
+
+}