summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-13 13:50:09 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-13 13:50:09 +0300
commit51e8be00ecd41374f1561dbc7f02255370e19571 (patch)
tree7d6bab9e49c0fda5c9fecca0cf12319f3c80d908
parent722672fa932e5ec3d4ef881df4b4ea19ec2933c0 (diff)
downloadparanucker-51e8be00ecd41374f1561dbc7f02255370e19571.tar.gz
paranucker-51e8be00ecd41374f1561dbc7f02255370e19571.tar.bz2
paranucker-51e8be00ecd41374f1561dbc7f02255370e19571.tar.xz
paranucker-51e8be00ecd41374f1561dbc7f02255370e19571.zip
Add parsing node TRY_CATCH_EXPR.
-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/trycatch_expr.h35
-rw-r--r--src/parsers/expr/trycatch_expr.cpp40
6 files changed, 81 insertions, 1 deletions
diff --git a/src/Makefile.files b/src/Makefile.files
index b5cfe4a..e9cb708 100644
--- a/src/Makefile.files
+++ b/src/Makefile.files
@@ -173,4 +173,6 @@ SRC = analysis/analysis.cpp \
nodes/ref/component_ref.h \
parsers/ref/component_ref.cpp \
nodes/stmt/cleanup_stmt.h \
- parsers/stmt/cleanup_stmt.cpp \ No newline at end of file
+ parsers/stmt/cleanup_stmt.cpp \
+ nodes/expr/trycatch_expr.h \
+ parsers/expr/trycatch_expr.cpp \ No newline at end of file
diff --git a/src/includes/nodeincludes.h b/src/includes/nodeincludes.h
index 0bb3891..be04215 100644
--- a/src/includes/nodeincludes.h
+++ b/src/includes/nodeincludes.h
@@ -66,3 +66,4 @@
#include "nodes/type/reference_type.h"
#include "nodes/ref/component_ref.h"
#include "nodes/stmt/cleanup_stmt.h"
+#include "nodes/expr/trycatch_expr.h"
diff --git a/src/includes/nodeshandling.inc b/src/includes/nodeshandling.inc
index 8bde4fa..a3862cd 100644
--- a/src/includes/nodeshandling.inc
+++ b/src/includes/nodeshandling.inc
@@ -65,3 +65,4 @@ handleNodeType(MUST_NOT_THROW_EXPR, MustNotThrowExpr)
handleNodeType(REFERENCE_TYPE, ReferenceType)
handleNodeType(COMPONENT_REF, ComponentRef)
handleNodeType(CLEANUP_STMT, CleanupStmt)
+handleNodeType(TRY_CATCH_EXPR, TryCatchExpr)
diff --git a/src/includes/parserdefines.inc b/src/includes/parserdefines.inc
index 7cea281..53e0f81 100644
--- a/src/includes/parserdefines.inc
+++ b/src/includes/parserdefines.inc
@@ -65,3 +65,4 @@ parserDefine(MustNotThrowExpr);
parserDefine(ReferenceType);
parserDefine(ComponentRef);
parserDefine(CleanupStmt);
+parserDefine(TryCatchExpr);
diff --git a/src/nodes/expr/trycatch_expr.h b/src/nodes/expr/trycatch_expr.h
new file mode 100644
index 0000000..345594f
--- /dev/null
+++ b/src/nodes/expr/trycatch_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_TRYCATCHEXPRNODE_H
+#define NODES_EXPR_TRYCATCHEXPRNODE_H
+
+#include "nodes/base/expr.h"
+
+#include <string>
+
+struct TryCatchExprNode : public ExprNode
+{
+ TryCatchExprNode() :
+ ExprNode()
+ {
+ }
+};
+
+#endif // NODES_EXPR_TRYCATCHEXPRNODE_H
diff --git a/src/parsers/expr/trycatch_expr.cpp b/src/parsers/expr/trycatch_expr.cpp
new file mode 100644
index 0000000..4507d2a
--- /dev/null
+++ b/src/parsers/expr/trycatch_expr.cpp
@@ -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/>.
+ */
+
+#include "includes/parserincludes.h"
+
+parserDefine(TryCatchExpr);
+
+#include "parsers/base/expr.h"
+
+#include "nodes/expr/trycatch_expr.h"
+
+namespace Generic
+{
+
+void parseTryCatchExprNode(TryCatchExprNode *node)
+{
+ fillType(node);
+ fillExprLocation(node);
+ Log::dump(node);
+
+ fillExprOperands(node);
+}
+
+}