summaryrefslogtreecommitdiffstats
path: root/lib/antlr/src/CommonAST.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit114a878c64ce6f8223cfd22d76a20eb16d177e5e (patch)
treeacaf47eb0fa12142d3896416a69e74cbf5a72242 /lib/antlr/src/CommonAST.cpp
downloadtdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.tar.gz
tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/antlr/src/CommonAST.cpp')
-rw-r--r--lib/antlr/src/CommonAST.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/lib/antlr/src/CommonAST.cpp b/lib/antlr/src/CommonAST.cpp
new file mode 100644
index 00000000..e132c0aa
--- /dev/null
+++ b/lib/antlr/src/CommonAST.cpp
@@ -0,0 +1,49 @@
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+#include "antlr/config.hpp"
+
+#include <cstdlib>
+#include <iostream>
+
+#include "antlr/CommonAST.hpp"
+#include "antlr/ANTLRUtil.hpp"
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+const char* const CommonAST::TYPE_NAME = "CommonAST";
+
+#ifdef ANTLR_SUPPORT_XML
+void CommonAST::initialize( ANTLR_USE_NAMESPACE(std)istream& in )
+{
+ ANTLR_USE_NAMESPACE(std)string t1, t2, text;
+
+ // text
+ read_AttributeNValue( in, t1, text );
+
+ read_AttributeNValue( in, t1, t2 );
+#ifdef ANTLR_ATOI_IN_STD
+ int type = ANTLR_USE_NAMESPACE(std)atoi(t2.c_str());
+#else
+ int type = atoi(t2.c_str());
+#endif
+
+ // initialize first part of AST.
+ this->initialize( type, text );
+}
+#endif
+
+RefAST CommonAST::factory()
+{
+ return RefAST(new CommonAST);
+}
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+