summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-16 22:09:25 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-16 22:09:25 +0300
commit37cf922007f11b2c10f4f6691bf35748847db27d (patch)
tree7f41f12f9420c07610472b71301741becef33de0
parent0ba303d8f3fc8c0175d1f369cd99638ea03d6932 (diff)
downloadparanucker-37cf922007f11b2c10f4f6691bf35748847db27d.tar.gz
paranucker-37cf922007f11b2c10f4f6691bf35748847db27d.tar.bz2
paranucker-37cf922007f11b2c10f4f6691bf35748847db27d.tar.xz
paranucker-37cf922007f11b2c10f4f6691bf35748847db27d.zip
Add parsing node DO_STMT.
-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/stmt/do_stmt.h40
-rw-r--r--src/parsers/stmt/do_stmt.cpp52
6 files changed, 98 insertions, 1 deletions
diff --git a/src/Makefile.files b/src/Makefile.files
index fe46759..7dc324b 100644
--- a/src/Makefile.files
+++ b/src/Makefile.files
@@ -272,4 +272,6 @@ SRC = analysis/analysis.cpp \
nodes/ref/bitfield_ref.h \
parsers/ref/bitfield_ref.cpp \
nodes/stmt/continue_stmt.h \
- parsers/stmt/continue_stmt.cpp \ No newline at end of file
+ parsers/stmt/continue_stmt.cpp \
+ nodes/stmt/do_stmt.h \
+ parsers/stmt/do_stmt.cpp \ No newline at end of file
diff --git a/src/includes/nodeincludes.h b/src/includes/nodeincludes.h
index 7885bc0..174de61 100644
--- a/src/includes/nodeincludes.h
+++ b/src/includes/nodeincludes.h
@@ -114,3 +114,4 @@
#include "nodes/ref/array_ref.h"
#include "nodes/ref/bitfield_ref.h"
#include "nodes/stmt/continue_stmt.h"
+#include "nodes/stmt/do_stmt.h"
diff --git a/src/includes/nodeshandling.inc b/src/includes/nodeshandling.inc
index c29c718..ec67fde 100644
--- a/src/includes/nodeshandling.inc
+++ b/src/includes/nodeshandling.inc
@@ -113,3 +113,4 @@ handleNodeType(THROW_EXPR, ThrowExpr)
handleNodeType(ARRAY_REF, ArrayRef)
handleNodeType(BIT_FIELD_REF, BitFieldRef)
handleNodeType(CONTINUE_STMT, ContinueStmt)
+handleNodeType(DO_STMT, DoStmt)
diff --git a/src/includes/parserdefines.inc b/src/includes/parserdefines.inc
index 4aecfd8..95ae0a7 100644
--- a/src/includes/parserdefines.inc
+++ b/src/includes/parserdefines.inc
@@ -113,3 +113,4 @@ parserDefine(ThrowExpr);
parserDefine(ArrayRef);
parserDefine(BitFieldRef);
parserDefine(ContinueStmt);
+parserDefine(DoStmt);
diff --git a/src/nodes/stmt/do_stmt.h b/src/nodes/stmt/do_stmt.h
new file mode 100644
index 0000000..2e98266
--- /dev/null
+++ b/src/nodes/stmt/do_stmt.h
@@ -0,0 +1,40 @@
+/*
+ * 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_STMT_DOSTMTNODE_H
+#define NODES_STMT_DOSTMTNODE_H
+
+#include "nodes/base/stmt.h"
+
+#include <string>
+
+struct DoStmtNode : public StmtNode
+{
+ DoStmtNode() :
+ StmtNode(),
+ body(nullptr),
+ condition(nullptr)
+ {
+ }
+
+ Node *body;
+ ExprNode *condition;
+};
+
+#endif // NODES_STMT_DOSTMTNODE_H
diff --git a/src/parsers/stmt/do_stmt.cpp b/src/parsers/stmt/do_stmt.cpp
new file mode 100644
index 0000000..1b485bc
--- /dev/null
+++ b/src/parsers/stmt/do_stmt.cpp
@@ -0,0 +1,52 @@
+/*
+ * 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(DoStmt);
+
+
+#include "parsers/base/expr.h"
+#include "parsers/base/stmt.h"
+
+#include "nodes/base/expr.h"
+
+#include "nodes/stmt/do_stmt.h"
+
+namespace Generic
+{
+
+void parseDoStmtNode(DoStmtNode *node)
+{
+ fillType(node);
+ fillExprLocation(node);
+ Log::dump(node);
+
+ node->condition = static_cast<ExprNode*>(createParseNode(
+ node,
+ DO_COND(node->gccNode),
+ "condition"));
+
+ node->body = createParseNode(
+ node,
+ DO_BODY(node->gccNode),
+ "body");
+}
+
+}