summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-07 01:57:22 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-07 01:57:22 +0300
commitdde8c3545c4def770da24b012a04d8320d8bb4a6 (patch)
tree490baf3291139a2d1836e3fcba651844486bbab8
parent602f18f834797aeebdf76fb3fd92af0cb04cbe1d (diff)
downloadparanucker-dde8c3545c4def770da24b012a04d8320d8bb4a6.tar.gz
paranucker-dde8c3545c4def770da24b012a04d8320d8bb4a6.tar.bz2
paranucker-dde8c3545c4def770da24b012a04d8320d8bb4a6.tar.xz
paranucker-dde8c3545c4def770da24b012a04d8320d8bb4a6.zip
Add support for parsing CONVERT_EXPR node.
-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/convert_expr.h35
-rw-r--r--src/parsers/expr/convert_expr.cpp39
6 files changed, 80 insertions, 1 deletions
diff --git a/src/Makefile.files b/src/Makefile.files
index 0b8a339..751dc63 100644
--- a/src/Makefile.files
+++ b/src/Makefile.files
@@ -53,4 +53,6 @@ SRC = nodes/base/cst.h \
nodes/expr/decl_expr.h \
parsers/expr/decl_expr.cpp \
nodes/expr/init_expr.h \
- parsers/expr/init_expr.cpp \ No newline at end of file
+ parsers/expr/init_expr.cpp \
+ nodes/expr/convert_expr.h \
+ parsers/expr/convert_expr.cpp \ No newline at end of file
diff --git a/src/includes/nodeincludes.h b/src/includes/nodeincludes.h
index 4c35ac9..5d1e77d 100644
--- a/src/includes/nodeincludes.h
+++ b/src/includes/nodeincludes.h
@@ -15,3 +15,4 @@
#include "nodes/expr/bind_expr.h"
#include "nodes/expr/decl_expr.h"
#include "nodes/expr/init_expr.h"
+#include "nodes/expr/convert_expr.h"
diff --git a/src/includes/nodeshandling.inc b/src/includes/nodeshandling.inc
index d9a4f5a..ff0efc1 100644
--- a/src/includes/nodeshandling.inc
+++ b/src/includes/nodeshandling.inc
@@ -14,3 +14,4 @@ handleNodeType(STATEMENT_LIST, StatementList)
handleNodeType(BIND_EXPR, BindExpr)
handleNodeType(DECL_EXPR, DeclExpr)
handleNodeType(INIT_EXPR, InitExpr)
+handleNodeType(CONVERT_EXPR, ConvertExpr)
diff --git a/src/includes/parserdefines.inc b/src/includes/parserdefines.inc
index bb401cf..5a2a65c 100644
--- a/src/includes/parserdefines.inc
+++ b/src/includes/parserdefines.inc
@@ -14,3 +14,4 @@ parserDefine(StatementList);
parserDefine(BindExpr);
parserDefine(DeclExpr);
parserDefine(InitExpr);
+parserDefine(ConvertExpr);
diff --git a/src/nodes/expr/convert_expr.h b/src/nodes/expr/convert_expr.h
new file mode 100644
index 0000000..8e6e7ba
--- /dev/null
+++ b/src/nodes/expr/convert_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_CONVERTEXPRNODE_H
+#define NODES_EXPR_CONVERTEXPRNODE_H
+
+#include "nodes/base/expr.h"
+
+#include <string>
+
+struct ConvertExprNode : public ExprNode
+{
+ ConvertExprNode() :
+ ExprNode()
+ {
+ }
+};
+
+#endif // NODES_EXPR_CONVERTEXPRNODE_H
diff --git a/src/parsers/expr/convert_expr.cpp b/src/parsers/expr/convert_expr.cpp
new file mode 100644
index 0000000..841fdca
--- /dev/null
+++ b/src/parsers/expr/convert_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(ConvertExpr);
+
+#include "parsers/base/expr.h"
+
+#include "nodes/expr/convert_expr.h"
+
+namespace Generic
+{
+
+void parseConvertExprNode(ConvertExprNode *node)
+{
+ fillType(node);
+ Log::log(node);
+
+ fillExprOperands(node);
+}
+
+}