diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-06-17 01:38:57 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-06-17 01:38:57 +0300 |
commit | 88f88d80582ee232f1bbd1abd904cb290354d609 (patch) | |
tree | 7b07aafc1197ac5ff8b0d64e059d6ae0c9263b25 | |
parent | a0223bd55fb867fe3a0e6a348d4b4c0b5c488894 (diff) | |
download | paranucker-88f88d80582ee232f1bbd1abd904cb290354d609.tar.gz paranucker-88f88d80582ee232f1bbd1abd904cb290354d609.tar.bz2 paranucker-88f88d80582ee232f1bbd1abd904cb290354d609.tar.xz paranucker-88f88d80582ee232f1bbd1abd904cb290354d609.zip |
Add parsing node TYPENAME_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/typename_type.h | 44 | ||||
-rw-r--r-- | src/parsers/type/typename_type.cpp | 49 |
6 files changed, 99 insertions, 1 deletions
diff --git a/src/Makefile.files b/src/Makefile.files index 80829c2..1fdff55 100644 --- a/src/Makefile.files +++ b/src/Makefile.files @@ -308,4 +308,6 @@ SRC = analysis/analysis.cpp \ nodes/expr/truthor_expr.h \ parsers/expr/truthor_expr.cpp \ nodes/expr/truthxor_expr.h \ - parsers/expr/truthxor_expr.cpp
\ No newline at end of file + parsers/expr/truthxor_expr.cpp \ + nodes/type/typename_type.h \ + parsers/type/typename_type.cpp
\ No newline at end of file diff --git a/src/includes/nodeincludes.h b/src/includes/nodeincludes.h index a04b154..ea97d3f 100644 --- a/src/includes/nodeincludes.h +++ b/src/includes/nodeincludes.h @@ -132,3 +132,4 @@ #include "nodes/expr/truthand_expr.h" #include "nodes/expr/truthor_expr.h" #include "nodes/expr/truthxor_expr.h" +#include "nodes/type/typename_type.h" diff --git a/src/includes/nodeshandling.inc b/src/includes/nodeshandling.inc index 4a28b22..30a04b2 100644 --- a/src/includes/nodeshandling.inc +++ b/src/includes/nodeshandling.inc @@ -131,3 +131,4 @@ handleNodeType(TEMPLATE_TYPE_PARM, TemplateTypeParm) handleNodeType(TRUTH_AND_EXPR, TruthAndExpr) handleNodeType(TRUTH_OR_EXPR, TruthOrExpr) handleNodeType(TRUTH_XOR_EXPR, TruthXorExpr) +handleNodeType(TYPENAME_TYPE, TypeNameType) diff --git a/src/includes/parserdefines.inc b/src/includes/parserdefines.inc index 124caf5..9ecc4f6 100644 --- a/src/includes/parserdefines.inc +++ b/src/includes/parserdefines.inc @@ -131,3 +131,4 @@ parserDefine(TemplateTypeParm); parserDefine(TruthAndExpr); parserDefine(TruthOrExpr); parserDefine(TruthXorExpr); +parserDefine(TypeNameType); diff --git a/src/nodes/type/typename_type.h b/src/nodes/type/typename_type.h new file mode 100644 index 0000000..454fbbf --- /dev/null +++ b/src/nodes/type/typename_type.h @@ -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/>. + */ + +#ifndef NODES_TYPE_TYPENAMETYPENODE_H +#define NODES_TYPE_TYPENAMETYPENODE_H + +#include "nodes/base/type.h" + +#include <string> + +struct TypeNameTypeNode : public TypeNode +{ + TypeNameTypeNode() : + TypeNode(), + fullName(nullptr), + isClass(false), + isEnum(false), + isResolving(false) + { + } + + Node *fullName; + bool isClass; + bool isEnum; + bool isResolving; +}; + +#endif // NODES_TYPE_TYPENAMETYPENODE_H diff --git a/src/parsers/type/typename_type.cpp b/src/parsers/type/typename_type.cpp new file mode 100644 index 0000000..8d183d3 --- /dev/null +++ b/src/parsers/type/typename_type.cpp @@ -0,0 +1,49 @@ +/* + * 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(TypeNameType); + +#include "parsers/base/type.h" + +#include "nodes/type/typename_type.h" + +namespace Generic +{ + +void parseTypeNameTypeNode(TypeNameTypeNode *node) +{ + fillType(node); + Log::dump(node); + + setPrintField(node, TYPENAME_IS_ENUM_P, isEnum); + setPrintField(node, TYPENAME_IS_CLASS_P, isClass); + setPrintField(node, TYPENAME_IS_RESOLVING_P, isResolving); + + fillTypeName(node); + fillTypeAttributes(node); + + node->fullName = createParseNode( + node, + TYPENAME_TYPE_FULLNAME(node->gccNode), + "full name"); +} + +} |