summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-17 14:09:34 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-17 14:09:34 +0300
commit23bc397e6f0751cbf7016c3e68b5d92e7ab010bc (patch)
tree57d64bef942b93bb17f210a4071857c7668008dd
parent65461f64029c79a8d49d44faa974cf799a2191ff (diff)
downloadparanucker-23bc397e6f0751cbf7016c3e68b5d92e7ab010bc.tar.gz
paranucker-23bc397e6f0751cbf7016c3e68b5d92e7ab010bc.tar.bz2
paranucker-23bc397e6f0751cbf7016c3e68b5d92e7ab010bc.tar.xz
paranucker-23bc397e6f0751cbf7016c3e68b5d92e7ab010bc.zip
Add parsing node TEMPLATE_PARM_INDEX.
-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/templateparmindex.h48
-rw-r--r--src/parsers/templateparmindex.cpp50
6 files changed, 104 insertions, 1 deletions
diff --git a/src/Makefile.files b/src/Makefile.files
index e1be61b..9ffef9d 100644
--- a/src/Makefile.files
+++ b/src/Makefile.files
@@ -314,4 +314,6 @@ SRC = analysis/analysis.cpp \
nodes/expr/vecinit_expr.h \
parsers/expr/vecinit_expr.cpp \
nodes/expr/caselabel_expr.h \
- parsers/expr/caselabel_expr.cpp \ No newline at end of file
+ parsers/expr/caselabel_expr.cpp \
+ nodes/templateparmindex.h \
+ parsers/templateparmindex.cpp \ No newline at end of file
diff --git a/src/includes/nodeincludes.h b/src/includes/nodeincludes.h
index 83ce2ad..43ae03c 100644
--- a/src/includes/nodeincludes.h
+++ b/src/includes/nodeincludes.h
@@ -135,3 +135,4 @@
#include "nodes/type/typename_type.h"
#include "nodes/expr/vecinit_expr.h"
#include "nodes/expr/caselabel_expr.h"
+#include "nodes/templateparmindex.h"
diff --git a/src/includes/nodeshandling.inc b/src/includes/nodeshandling.inc
index ef666d2..a845f80 100644
--- a/src/includes/nodeshandling.inc
+++ b/src/includes/nodeshandling.inc
@@ -134,3 +134,4 @@ handleNodeType(TRUTH_XOR_EXPR, TruthXorExpr)
handleNodeType(TYPENAME_TYPE, TypeNameType)
handleNodeType(VEC_INIT_EXPR, VecInitExpr)
handleNodeType(CASE_LABEL_EXPR, CaseLabelExpr)
+handleNodeType(TEMPLATE_PARM_INDEX, TemplateParmIndex)
diff --git a/src/includes/parserdefines.inc b/src/includes/parserdefines.inc
index 46e12e1..2c1e3ba 100644
--- a/src/includes/parserdefines.inc
+++ b/src/includes/parserdefines.inc
@@ -134,3 +134,4 @@ parserDefine(TruthXorExpr);
parserDefine(TypeNameType);
parserDefine(VecInitExpr);
parserDefine(CaseLabelExpr);
+parserDefine(TemplateParmIndex);
diff --git a/src/nodes/templateparmindex.h b/src/nodes/templateparmindex.h
new file mode 100644
index 0000000..a89288b
--- /dev/null
+++ b/src/nodes/templateparmindex.h
@@ -0,0 +1,48 @@
+/*
+ * 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_TEMPLATEPARMINDEXNODE_H
+#define NODES_TEMPLATEPARMINDEXNODE_H
+
+#include "nodes/base/node.h"
+
+#include <string>
+
+struct TemplateParmIndexNode : public Node
+{
+ TemplateParmIndexNode() :
+ Node(),
+ descendants(nullptr),
+ parmDecl(nullptr),
+ isParameterPack(0),
+ parmIdx(0),
+ parmLevel(0),
+ parmOrigLevel(0)
+ {
+ }
+
+ Node *descendants;
+ Node *parmDecl;
+ int isParameterPack;
+ int parmIdx;
+ int parmLevel;
+ int parmOrigLevel;
+};
+
+#endif // NODES_TEMPLATEPARMINDEXNODE_H
diff --git a/src/parsers/templateparmindex.cpp b/src/parsers/templateparmindex.cpp
new file mode 100644
index 0000000..493aefe
--- /dev/null
+++ b/src/parsers/templateparmindex.cpp
@@ -0,0 +1,50 @@
+/*
+ * 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(TemplateParmIndex);
+
+
+#include "nodes/templateparmindex.h"
+
+namespace Generic
+{
+
+void parseTemplateParmIndexNode(TemplateParmIndexNode *node)
+{
+ fillType(node);
+ Log::dump(node);
+
+ setPrintField(node, TEMPLATE_PARM_IDX, parmIdx);
+ setPrintField(node, TEMPLATE_PARM_LEVEL, parmLevel);
+ setPrintField(node, TEMPLATE_PARM_ORIG_LEVEL, parmOrigLevel);
+ setPrintField(node, TEMPLATE_PARM_PARAMETER_PACK, isParameterPack);
+
+ node->descendants = createParseNode(
+ node,
+ TEMPLATE_PARM_DESCENDANTS(node->gccNode),
+ "descendants");
+ node->parmDecl = createParseNode(
+ node,
+ TEMPLATE_PARM_DECL(node->gccNode),
+ "parm decl");
+}
+
+}