From d02c81f8a05473217da284f516803d9677d16f66 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 13 Jun 2015 16:00:49 +0300 Subject: Add parsing node POSTDECREMENT_EXPR. --- src/Makefile.files | 4 +++- src/includes/nodeincludes.h | 1 + src/includes/nodeshandling.inc | 1 + src/includes/parserdefines.inc | 1 + src/nodes/expr/postdecrement_expr.h | 35 +++++++++++++++++++++++++++++ src/parsers/expr/postdecrement_expr.cpp | 40 +++++++++++++++++++++++++++++++++ 6 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 src/nodes/expr/postdecrement_expr.h create mode 100644 src/parsers/expr/postdecrement_expr.cpp diff --git a/src/Makefile.files b/src/Makefile.files index e9e1009..794ad1b 100644 --- a/src/Makefile.files +++ b/src/Makefile.files @@ -193,4 +193,6 @@ SRC = analysis/analysis.cpp \ nodes/expr/preincrement_expr.h \ parsers/expr/preincrement_expr.cpp \ nodes/expr/predecrement_expr.h \ - parsers/expr/predecrement_expr.cpp \ No newline at end of file + parsers/expr/predecrement_expr.cpp \ + nodes/expr/postdecrement_expr.h \ + parsers/expr/postdecrement_expr.cpp \ No newline at end of file diff --git a/src/includes/nodeincludes.h b/src/includes/nodeincludes.h index 09f1f38..7e42897 100644 --- a/src/includes/nodeincludes.h +++ b/src/includes/nodeincludes.h @@ -76,3 +76,4 @@ #include "nodes/expr/truthnot_expr.h" #include "nodes/expr/preincrement_expr.h" #include "nodes/expr/predecrement_expr.h" +#include "nodes/expr/postdecrement_expr.h" diff --git a/src/includes/nodeshandling.inc b/src/includes/nodeshandling.inc index d0d3d74..78cf5eb 100644 --- a/src/includes/nodeshandling.inc +++ b/src/includes/nodeshandling.inc @@ -75,3 +75,4 @@ handleNodeType(BIT_NOT_EXPR, BitNotExpr) handleNodeType(TRUTH_NOT_EXPR, TruthNotExpr) handleNodeType(PREINCREMENT_EXPR, PreIncrementExpr) handleNodeType(PREDECREMENT_EXPR, PreDecrementExpr) +handleNodeType(POSTDECREMENT_EXPR, PostDecrementExpr) diff --git a/src/includes/parserdefines.inc b/src/includes/parserdefines.inc index d4d4a7e..74243ce 100644 --- a/src/includes/parserdefines.inc +++ b/src/includes/parserdefines.inc @@ -75,3 +75,4 @@ parserDefine(BitNotExpr); parserDefine(TruthNotExpr); parserDefine(PreIncrementExpr); parserDefine(PreDecrementExpr); +parserDefine(PostDecrementExpr); diff --git a/src/nodes/expr/postdecrement_expr.h b/src/nodes/expr/postdecrement_expr.h new file mode 100644 index 0000000..df34628 --- /dev/null +++ b/src/nodes/expr/postdecrement_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 . + */ + +#ifndef NODES_EXPR_POSTDECREMENTEXPRNODE_H +#define NODES_EXPR_POSTDECREMENTEXPRNODE_H + +#include "nodes/base/expr.h" + +#include + +struct PostDecrementExprNode : public ExprNode +{ + PostDecrementExprNode() : + ExprNode() + { + } +}; + +#endif // NODES_EXPR_POSTDECREMENTEXPRNODE_H diff --git a/src/parsers/expr/postdecrement_expr.cpp b/src/parsers/expr/postdecrement_expr.cpp new file mode 100644 index 0000000..14671c6 --- /dev/null +++ b/src/parsers/expr/postdecrement_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 . + */ + +#include "includes/parserincludes.h" + +parserDefine(PostDecrementExpr); + +#include "parsers/base/expr.h" + +#include "nodes/expr/postdecrement_expr.h" + +namespace Generic +{ + +void parsePostDecrementExprNode(PostDecrementExprNode *node) +{ + fillType(node); + fillExprLocation(node); + Log::dump(node); + + fillExprOperands(node); +} + +} -- cgit v1.2.3-60-g2f50