summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-13 16:24:27 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-13 16:24:27 +0300
commit9217cb3fb59aa1890cdb36adbaffb0fa858a68d0 (patch)
treef1e66b146afb81d4ebbc9db9a8480b0e6a1faba8
parent756085a352ce12873c9cb382bfd9df98ad61b66b (diff)
downloadparanucker-9217cb3fb59aa1890cdb36adbaffb0fa858a68d0.tar.gz
paranucker-9217cb3fb59aa1890cdb36adbaffb0fa858a68d0.tar.bz2
paranucker-9217cb3fb59aa1890cdb36adbaffb0fa858a68d0.tar.xz
paranucker-9217cb3fb59aa1890cdb36adbaffb0fa858a68d0.zip
Add parsing node NEGATE_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/negate_expr.h35
-rw-r--r--src/parsers/expr/negate_expr.cpp40
6 files changed, 81 insertions, 1 deletions
diff --git a/src/Makefile.files b/src/Makefile.files
index 75741e4..e056089 100644
--- a/src/Makefile.files
+++ b/src/Makefile.files
@@ -211,4 +211,6 @@ SRC = analysis/analysis.cpp \
nodes/expr/ceilmod_expr.h \
parsers/expr/ceilmod_expr.cpp \
nodes/expr/roundmod_expr.h \
- parsers/expr/roundmod_expr.cpp \ No newline at end of file
+ parsers/expr/roundmod_expr.cpp \
+ nodes/expr/negate_expr.h \
+ parsers/expr/negate_expr.cpp \ No newline at end of file
diff --git a/src/includes/nodeincludes.h b/src/includes/nodeincludes.h
index 4c5cbfc..2ebd342 100644
--- a/src/includes/nodeincludes.h
+++ b/src/includes/nodeincludes.h
@@ -85,3 +85,4 @@
#include "nodes/expr/floormod_expr.h"
#include "nodes/expr/ceilmod_expr.h"
#include "nodes/expr/roundmod_expr.h"
+#include "nodes/expr/negate_expr.h"
diff --git a/src/includes/nodeshandling.inc b/src/includes/nodeshandling.inc
index 1ce0a96..e5904b0 100644
--- a/src/includes/nodeshandling.inc
+++ b/src/includes/nodeshandling.inc
@@ -84,3 +84,4 @@ handleNodeType(TRUNC_MOD_EXPR, TruncModExpr)
handleNodeType(FLOOR_MOD_EXPR, FloorModExpr)
handleNodeType(CEIL_MOD_EXPR, CeilModExpr)
handleNodeType(ROUND_MOD_EXPR, RoundModExpr)
+handleNodeType(NEGATE_EXPR, NegateExpr)
diff --git a/src/includes/parserdefines.inc b/src/includes/parserdefines.inc
index 6efd9b9..33ea1a0 100644
--- a/src/includes/parserdefines.inc
+++ b/src/includes/parserdefines.inc
@@ -84,3 +84,4 @@ parserDefine(TruncModExpr);
parserDefine(FloorModExpr);
parserDefine(CeilModExpr);
parserDefine(RoundModExpr);
+parserDefine(NegateExpr);
diff --git a/src/nodes/expr/negate_expr.h b/src/nodes/expr/negate_expr.h
new file mode 100644
index 0000000..7dd10d5
--- /dev/null
+++ b/src/nodes/expr/negate_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_NEGATEEXPRNODE_H
+#define NODES_EXPR_NEGATEEXPRNODE_H
+
+#include "nodes/base/expr.h"
+
+#include <string>
+
+struct NegateExprNode : public ExprNode
+{
+ NegateExprNode() :
+ ExprNode()
+ {
+ }
+};
+
+#endif // NODES_EXPR_NEGATEEXPRNODE_H
diff --git a/src/parsers/expr/negate_expr.cpp b/src/parsers/expr/negate_expr.cpp
new file mode 100644
index 0000000..d8a9e00
--- /dev/null
+++ b/src/parsers/expr/negate_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(NegateExpr);
+
+#include "parsers/base/expr.h"
+
+#include "nodes/expr/negate_expr.h"
+
+namespace Generic
+{
+
+void parseNegateExprNode(NegateExprNode *node)
+{
+ fillType(node);
+ fillExprLocation(node);
+ Log::dump(node);
+
+ fillExprOperands(node);
+}
+
+}