diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-06-13 22:21:11 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-06-13 22:21:11 +0300 |
commit | 412938c6bebd07afbd592ff7a9d75be7110af7c7 (patch) | |
tree | f66cc01449954b1a2b0f97ae221f0034863c2a28 /src | |
parent | 20e220fe8580eb692a9b1e50406e4765db775f98 (diff) | |
download | paranucker-412938c6bebd07afbd592ff7a9d75be7110af7c7.tar.gz paranucker-412938c6bebd07afbd592ff7a9d75be7110af7c7.tar.bz2 paranucker-412938c6bebd07afbd592ff7a9d75be7110af7c7.tar.xz paranucker-412938c6bebd07afbd592ff7a9d75be7110af7c7.zip |
Add parsing node CAST_EXPR.
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.files | 4 | ||||
-rw-r--r-- | src/includes/nodeincludes.h | 1 | ||||
-rw-r--r-- | src/includes/nodeshandling.inc | 1 | ||||
-rw-r--r-- | src/includes/parserdefines.inc | 1 | ||||
-rw-r--r-- | src/nodes/expr/cast_expr.h | 35 | ||||
-rw-r--r-- | src/parsers/expr/cast_expr.cpp | 40 |
6 files changed, 81 insertions, 1 deletions
diff --git a/src/Makefile.files b/src/Makefile.files index 93cbb73..31c3de5 100644 --- a/src/Makefile.files +++ b/src/Makefile.files @@ -248,4 +248,6 @@ SRC = analysis/analysis.cpp \ nodes/vec/tree_vec.h \ parsers/vec/tree_vec.cpp \ nodes/block/try_block.h \ - parsers/block/try_block.cpp
\ No newline at end of file + parsers/block/try_block.cpp \ + nodes/expr/cast_expr.h \ + parsers/expr/cast_expr.cpp
\ No newline at end of file diff --git a/src/includes/nodeincludes.h b/src/includes/nodeincludes.h index be8c5b2..1f150c7 100644 --- a/src/includes/nodeincludes.h +++ b/src/includes/nodeincludes.h @@ -102,3 +102,4 @@ #include "nodes/expr/exactdiv_expr.h" #include "nodes/vec/tree_vec.h" #include "nodes/block/try_block.h" +#include "nodes/expr/cast_expr.h" diff --git a/src/includes/nodeshandling.inc b/src/includes/nodeshandling.inc index e4a769d..488fad7 100644 --- a/src/includes/nodeshandling.inc +++ b/src/includes/nodeshandling.inc @@ -101,3 +101,4 @@ handleNodeType(TEMPLATE_DECL, TemplateDecl) handleNodeType(EXACT_DIV_EXPR, ExactDivExpr) handleNodeType(TREE_VEC, TreeVec) handleNodeType(TRY_BLOCK, TryBlock) +handleNodeType(CAST_EXPR, CastExpr) diff --git a/src/includes/parserdefines.inc b/src/includes/parserdefines.inc index fd44758..74d5261 100644 --- a/src/includes/parserdefines.inc +++ b/src/includes/parserdefines.inc @@ -101,3 +101,4 @@ parserDefine(TemplateDecl); parserDefine(ExactDivExpr); parserDefine(TreeVec); parserDefine(TryBlock); +parserDefine(CastExpr); diff --git a/src/nodes/expr/cast_expr.h b/src/nodes/expr/cast_expr.h new file mode 100644 index 0000000..f4728e1 --- /dev/null +++ b/src/nodes/expr/cast_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_CASTEXPRNODE_H +#define NODES_EXPR_CASTEXPRNODE_H + +#include "nodes/base/expr.h" + +#include <string> + +struct CastExprNode : public ExprNode +{ + CastExprNode() : + ExprNode() + { + } +}; + +#endif // NODES_EXPR_CASTEXPRNODE_H diff --git a/src/parsers/expr/cast_expr.cpp b/src/parsers/expr/cast_expr.cpp new file mode 100644 index 0000000..cea9fc6 --- /dev/null +++ b/src/parsers/expr/cast_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(CastExpr); + +#include "parsers/base/expr.h" + +#include "nodes/expr/cast_expr.h" + +namespace Generic +{ + +void parseCastExprNode(CastExprNode *node) +{ + fillType(node); + fillExprLocation(node); + Log::dump(node); + + fillExprOperands(node); +} + +} |