summaryrefslogtreecommitdiff
path: root/src/parsers
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-12 20:42:14 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-12 20:42:14 +0300
commit6ac07c3849208a948cadd2f8c7d3b461a6f7e525 (patch)
treeafd5ab8603e979681bce40ae20be3aab4d205a47 /src/parsers
parent0df9886fd54e6e35ac29c3ccbf3750aae99d681b (diff)
downloadparanucker-6ac07c3849208a948cadd2f8c7d3b461a6f7e525.tar.gz
paranucker-6ac07c3849208a948cadd2f8c7d3b461a6f7e525.tar.bz2
paranucker-6ac07c3849208a948cadd2f8c7d3b461a6f7e525.tar.xz
paranucker-6ac07c3849208a948cadd2f8c7d3b461a6f7e525.zip
Add parsing node REAL_CST.
Diffstat (limited to 'src/parsers')
-rw-r--r--src/parsers/cst/real_cst.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/parsers/cst/real_cst.cpp b/src/parsers/cst/real_cst.cpp
new file mode 100644
index 0000000..37a2a4a
--- /dev/null
+++ b/src/parsers/cst/real_cst.cpp
@@ -0,0 +1,42 @@
+/*
+ * 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(RealCst);
+
+
+#include "nodes/cst/real_cst.h"
+
+namespace Generic
+{
+
+void parseRealCstNode(RealCstNode *node)
+{
+ fillType(node);
+ Log::dump(node);
+
+ const REAL_VALUE_TYPE *const real = TREE_REAL_CST_PTR(node->gccNode);
+ char buf[32];
+ real_to_decimal(buf, real, sizeof (buf), 0, true);
+ node->realString = buf;
+ Log::dumpRaw(node, "- real number: %s", node->realString.c_str());
+}
+
+}