summaryrefslogtreecommitdiff
path: root/src/parsers
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-12 20:16:21 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-12 20:16:21 +0300
commitccdc319dc8cd8570be6ed01418c544c6f448c9dc (patch)
tree57cc96c395b66f3dff6fac6971899bd87534dbe6 /src/parsers
parent8f87b62956ce4cdc0a735d227ebc53746caa9575 (diff)
downloadparanucker-ccdc319dc8cd8570be6ed01418c544c6f448c9dc.tar.gz
paranucker-ccdc319dc8cd8570be6ed01418c544c6f448c9dc.tar.bz2
paranucker-ccdc319dc8cd8570be6ed01418c544c6f448c9dc.tar.xz
paranucker-ccdc319dc8cd8570be6ed01418c544c6f448c9dc.zip
Add parsing node CONSTRUCTOR.
Diffstat (limited to 'src/parsers')
-rw-r--r--src/parsers/constructor.cpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/parsers/constructor.cpp b/src/parsers/constructor.cpp
new file mode 100644
index 0000000..144f349
--- /dev/null
+++ b/src/parsers/constructor.cpp
@@ -0,0 +1,56 @@
+/*
+ * 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(Constructor);
+
+
+#include "nodes/constructor.h"
+
+namespace Generic
+{
+
+void parseConstructorNode(ConstructorNode *node)
+{
+ fillType(node);
+ Log::dump(node);
+
+ node->constructorType = static_cast<TypeNode*>(createParseNode(
+ node,
+ TREE_TYPE(node->gccNode),
+ "constructor type"));
+
+ unsigned HOST_WIDE_INT cnt;
+ tree index;
+ tree value;
+ FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (node->gccNode), cnt, index, value)
+ {
+ node->indexes.push_back(createParseNode(
+ node,
+ index,
+ "index"));
+ node->values.push_back(createParseNode(
+ node,
+ value,
+ "value"));
+ }
+}
+
+}