summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-16 21:29:57 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-16 21:29:57 +0300
commit8fa600f92e2d50ace451eae7e658f762e6bf7136 (patch)
treef2ead1b7a6d0c07626211d283ed04b234653b7b6
parentaeba935c42c31e9f2cf557aaf69dda7cf91d7fdd (diff)
downloadparanucker-8fa600f92e2d50ace451eae7e658f762e6bf7136.tar.gz
paranucker-8fa600f92e2d50ace451eae7e658f762e6bf7136.tar.bz2
paranucker-8fa600f92e2d50ace451eae7e658f762e6bf7136.tar.xz
paranucker-8fa600f92e2d50ace451eae7e658f762e6bf7136.zip
Add parsing node CONTINUE_STMT.
Also add location reading for all statements.
-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/continue_stmt.h35
-rw-r--r--src/parsers/stmt/break_stmt.cpp2
-rw-r--r--src/parsers/stmt/cleanup_stmt.cpp2
-rw-r--r--src/parsers/stmt/continue_stmt.cpp39
-rw-r--r--src/parsers/stmt/expr_stmt.cpp2
-rw-r--r--src/parsers/stmt/for_stmt.cpp2
-rw-r--r--src/parsers/stmt/if_stmt.cpp2
-rw-r--r--src/parsers/stmt/while_stmt.cpp2
12 files changed, 92 insertions, 1 deletions
diff --git a/src/Makefile.files b/src/Makefile.files
index daea543..fe46759 100644
--- a/src/Makefile.files
+++ b/src/Makefile.files
@@ -270,4 +270,6 @@ SRC = analysis/analysis.cpp \
nodes/ref/array_ref.h \
parsers/ref/array_ref.cpp \
nodes/ref/bitfield_ref.h \
- parsers/ref/bitfield_ref.cpp \ No newline at end of file
+ parsers/ref/bitfield_ref.cpp \
+ nodes/stmt/continue_stmt.h \
+ parsers/stmt/continue_stmt.cpp \ No newline at end of file
diff --git a/src/includes/nodeincludes.h b/src/includes/nodeincludes.h
index 40361f0..7885bc0 100644
--- a/src/includes/nodeincludes.h
+++ b/src/includes/nodeincludes.h
@@ -113,3 +113,4 @@
#include "nodes/expr/throw_expr.h"
#include "nodes/ref/array_ref.h"
#include "nodes/ref/bitfield_ref.h"
+#include "nodes/stmt/continue_stmt.h"
diff --git a/src/includes/nodeshandling.inc b/src/includes/nodeshandling.inc
index a601316..c29c718 100644
--- a/src/includes/nodeshandling.inc
+++ b/src/includes/nodeshandling.inc
@@ -112,3 +112,4 @@ handleNodeType(ASM_EXPR, AsmExpr)
handleNodeType(THROW_EXPR, ThrowExpr)
handleNodeType(ARRAY_REF, ArrayRef)
handleNodeType(BIT_FIELD_REF, BitFieldRef)
+handleNodeType(CONTINUE_STMT, ContinueStmt)
diff --git a/src/includes/parserdefines.inc b/src/includes/parserdefines.inc
index 73b527e..4aecfd8 100644
--- a/src/includes/parserdefines.inc
+++ b/src/includes/parserdefines.inc
@@ -112,3 +112,4 @@ parserDefine(AsmExpr);
parserDefine(ThrowExpr);
parserDefine(ArrayRef);
parserDefine(BitFieldRef);
+parserDefine(ContinueStmt);
diff --git a/src/nodes/stmt/continue_stmt.h b/src/nodes/stmt/continue_stmt.h
new file mode 100644
index 0000000..69538aa
--- /dev/null
+++ b/src/nodes/stmt/continue_stmt.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_STMT_CONTINUESTMTNODE_H
+#define NODES_STMT_CONTINUESTMTNODE_H
+
+#include "nodes/base/stmt.h"
+
+#include <string>
+
+struct ContinueStmtNode : public StmtNode
+{
+ ContinueStmtNode() :
+ StmtNode()
+ {
+ }
+};
+
+#endif // NODES_STMT_CONTINUESTMTNODE_H
diff --git a/src/parsers/stmt/break_stmt.cpp b/src/parsers/stmt/break_stmt.cpp
index 0055835..602cfb7 100644
--- a/src/parsers/stmt/break_stmt.cpp
+++ b/src/parsers/stmt/break_stmt.cpp
@@ -21,6 +21,7 @@
parserDefine(BreakStmt);
+#include "parsers/base/expr.h"
#include "parsers/base/stmt.h"
#include "nodes/stmt/break_stmt.h"
@@ -31,6 +32,7 @@ namespace Generic
void parseBreakStmtNode(BreakStmtNode *node)
{
fillType(node);
+ fillExprLocation(node);
Log::dump(node);
}
diff --git a/src/parsers/stmt/cleanup_stmt.cpp b/src/parsers/stmt/cleanup_stmt.cpp
index 026d934..06f9b4e 100644
--- a/src/parsers/stmt/cleanup_stmt.cpp
+++ b/src/parsers/stmt/cleanup_stmt.cpp
@@ -21,6 +21,7 @@
parserDefine(CleanupStmt);
+#include "parsers/base/expr.h"
#include "parsers/base/stmt.h"
#include "nodes/stmt/cleanup_stmt.h"
@@ -31,6 +32,7 @@ namespace Generic
void parseCleanupStmtNode(CleanupStmtNode *node)
{
fillType(node);
+ fillExprLocation(node);
Log::dump(node);
node->body = createParseNode(
diff --git a/src/parsers/stmt/continue_stmt.cpp b/src/parsers/stmt/continue_stmt.cpp
new file mode 100644
index 0000000..2dc54a7
--- /dev/null
+++ b/src/parsers/stmt/continue_stmt.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(ContinueStmt);
+
+#include "parsers/base/expr.h"
+#include "parsers/base/stmt.h"
+
+#include "nodes/stmt/continue_stmt.h"
+
+namespace Generic
+{
+
+void parseContinueStmtNode(ContinueStmtNode *node)
+{
+ fillType(node);
+ fillExprLocation(node);
+ Log::dump(node);
+}
+
+}
diff --git a/src/parsers/stmt/expr_stmt.cpp b/src/parsers/stmt/expr_stmt.cpp
index 3cadbff..a17a2dc 100644
--- a/src/parsers/stmt/expr_stmt.cpp
+++ b/src/parsers/stmt/expr_stmt.cpp
@@ -21,6 +21,7 @@
parserDefine(ExprStmt);
+#include "parsers/base/expr.h"
#include "parsers/base/stmt.h"
#include "nodes/base/expr.h"
@@ -33,6 +34,7 @@ namespace Generic
void parseExprStmtNode(ExprStmtNode *node)
{
fillType(node);
+ fillExprLocation(node);
Log::dump(node);
if (!node->parseChilds)
diff --git a/src/parsers/stmt/for_stmt.cpp b/src/parsers/stmt/for_stmt.cpp
index ba6e18b..d06be43 100644
--- a/src/parsers/stmt/for_stmt.cpp
+++ b/src/parsers/stmt/for_stmt.cpp
@@ -21,6 +21,7 @@
parserDefine(ForStmt);
+#include "parsers/base/expr.h"
#include "parsers/base/stmt.h"
#include "nodes/stmt/for_stmt.h"
@@ -31,6 +32,7 @@ namespace Generic
void parseForStmtNode(ForStmtNode *node)
{
fillType(node);
+ fillExprLocation(node);
Log::dump(node);
node->init = static_cast<StmtNode*>(createParseNode(
diff --git a/src/parsers/stmt/if_stmt.cpp b/src/parsers/stmt/if_stmt.cpp
index 9800f07..92eaff7 100644
--- a/src/parsers/stmt/if_stmt.cpp
+++ b/src/parsers/stmt/if_stmt.cpp
@@ -21,6 +21,7 @@
parserDefine(IfStmt);
+#include "parsers/base/expr.h"
#include "parsers/base/stmt.h"
#include "nodes/stmt/if_stmt.h"
@@ -31,6 +32,7 @@ namespace Generic
void parseIfStmtNode(IfStmtNode *node)
{
fillType(node);
+ fillExprLocation(node);
Log::dump(node);
if (!node->parseChilds)
diff --git a/src/parsers/stmt/while_stmt.cpp b/src/parsers/stmt/while_stmt.cpp
index 1c82aba..bb580f1 100644
--- a/src/parsers/stmt/while_stmt.cpp
+++ b/src/parsers/stmt/while_stmt.cpp
@@ -21,6 +21,7 @@
parserDefine(WhileStmt);
+#include "parsers/base/expr.h"
#include "parsers/base/stmt.h"
#include "nodes/stmt/while_stmt.h"
@@ -31,6 +32,7 @@ namespace Generic
void parseWhileStmtNode(WhileStmtNode *node)
{
fillType(node);
+ fillExprLocation(node);
Log::dump(node);
if (!node->parseChilds)