diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-06-13 12:12:06 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-06-13 12:12:06 +0300 |
commit | cad4a8a87daed1ddaeb1a4c0905f073b548b312d (patch) | |
tree | ea98cbc5fc4a5aad81522e284e2928ecaba70c00 | |
parent | 73ee70432eee4aa415f882215475e3efab9f1d4d (diff) | |
download | paranucker-cad4a8a87daed1ddaeb1a4c0905f073b548b312d.tar.gz paranucker-cad4a8a87daed1ddaeb1a4c0905f073b548b312d.tar.bz2 paranucker-cad4a8a87daed1ddaeb1a4c0905f073b548b312d.tar.xz paranucker-cad4a8a87daed1ddaeb1a4c0905f073b548b312d.zip |
Add parsing type REFERENCE_TYPE.
-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/type/reference_type.h | 38 | ||||
-rw-r--r-- | src/parsers/type/reference_type.cpp | 44 |
6 files changed, 88 insertions, 1 deletions
diff --git a/src/Makefile.files b/src/Makefile.files index f6bf879..5a94f84 100644 --- a/src/Makefile.files +++ b/src/Makefile.files @@ -164,4 +164,6 @@ SRC = analysis/analysis.cpp \ nodes/type/method_type.h \ parsers/type/method_type.cpp \ nodes/expr/mustnotthrow_expr.h \ - parsers/expr/mustnotthrow_expr.cpp
\ No newline at end of file + parsers/expr/mustnotthrow_expr.cpp \ + nodes/type/reference_type.h \ + parsers/type/reference_type.cpp
\ No newline at end of file diff --git a/src/includes/nodeincludes.h b/src/includes/nodeincludes.h index 3fd42d6..bc844b6 100644 --- a/src/includes/nodeincludes.h +++ b/src/includes/nodeincludes.h @@ -63,3 +63,4 @@ #include "nodes/expr/save_expr.h" #include "nodes/type/method_type.h" #include "nodes/expr/mustnotthrow_expr.h" +#include "nodes/type/reference_type.h" diff --git a/src/includes/nodeshandling.inc b/src/includes/nodeshandling.inc index 9a96ab5..d3ad46d 100644 --- a/src/includes/nodeshandling.inc +++ b/src/includes/nodeshandling.inc @@ -62,3 +62,4 @@ handleNodeType(BIT_XOR_EXPR, BitXorExpr) handleNodeType(SAVE_EXPR, SaveExpr) handleNodeType(METHOD_TYPE, MethodType) handleNodeType(MUST_NOT_THROW_EXPR, MustNotThrowExpr) +handleNodeType(REFERENCE_TYPE, ReferenceType) diff --git a/src/includes/parserdefines.inc b/src/includes/parserdefines.inc index 67f3760..707f9e0 100644 --- a/src/includes/parserdefines.inc +++ b/src/includes/parserdefines.inc @@ -62,3 +62,4 @@ parserDefine(BitXorExpr); parserDefine(SaveExpr); parserDefine(MethodType); parserDefine(MustNotThrowExpr); +parserDefine(ReferenceType); diff --git a/src/nodes/type/reference_type.h b/src/nodes/type/reference_type.h new file mode 100644 index 0000000..dd5217e --- /dev/null +++ b/src/nodes/type/reference_type.h @@ -0,0 +1,38 @@ +/* + * 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_TYPE_REFERENCETYPENODE_H +#define NODES_TYPE_REFERENCETYPENODE_H + +#include "nodes/base/type.h" + +#include <string> + +struct ReferenceTypeNode : public TypeNode +{ + ReferenceTypeNode() : + TypeNode(), + nestedType(nullptr) + { + } + + TypeNode *nestedType; +}; + +#endif // NODES_TYPE_REFERENCETYPENODE_H diff --git a/src/parsers/type/reference_type.cpp b/src/parsers/type/reference_type.cpp new file mode 100644 index 0000000..0327b9b --- /dev/null +++ b/src/parsers/type/reference_type.cpp @@ -0,0 +1,44 @@ +/* + * 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(ReferenceType); + +#include "parsers/base/type.h" + +#include "nodes/type/reference_type.h" + +namespace Generic +{ + +void parseReferenceTypeNode(ReferenceTypeNode *node) +{ + fillType(node); + Log::dump(node); + + fillTypeName(node); + fillTypeAttributes(node); + node->nestedType = static_cast<TypeNode*>(createParseNode( + node, + TREE_TYPE(node->gccNode), + "nested type")); +} + +} |