summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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/type/reference_type.h38
-rw-r--r--src/parsers/type/reference_type.cpp44
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"));
+}
+
+}