summaryrefslogtreecommitdiffstats
path: root/lib/antlr/antlr/CommonASTWithHiddenTokens.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/antlr/antlr/CommonASTWithHiddenTokens.h')
-rw-r--r--lib/antlr/antlr/CommonASTWithHiddenTokens.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/lib/antlr/antlr/CommonASTWithHiddenTokens.h b/lib/antlr/antlr/CommonASTWithHiddenTokens.h
new file mode 100644
index 00000000..01772835
--- /dev/null
+++ b/lib/antlr/antlr/CommonASTWithHiddenTokens.h
@@ -0,0 +1,60 @@
+#ifndef INC_CommonASTWithHiddenTokens_h__
+#define INC_CommonASTWithHiddenTokens_h__
+
+/* 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.h>
+#include <antlr/CommonAST.h>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/** A CommonAST whose initialization copies hidden token
+ * information from the Token used to create a node.
+ */
+class ANTLR_API CommonASTWithHiddenTokens : public CommonAST {
+public:
+ CommonASTWithHiddenTokens();
+ virtual ~CommonASTWithHiddenTokens();
+ virtual const char* typeName( void ) const
+ {
+ return CommonASTWithHiddenTokens::TYPE_NAME;
+ }
+ /// Clone this AST node.
+ virtual RefAST clone( void ) const;
+
+ // Borland C++ builder seems to need the decl's of the first two...
+ virtual void initialize(int t,const ANTLR_USE_NAMESPACE(std)string& txt);
+ virtual void initialize(RefAST t);
+ virtual void initialize(RefToken t);
+
+ virtual RefToken getHiddenAfter() const
+ {
+ return hiddenAfter;
+ }
+
+ virtual RefToken getHiddenBefore() const
+ {
+ return hiddenBefore;
+ }
+
+ static RefAST factory();
+
+ static const char* const TYPE_NAME;
+protected:
+ RefToken hiddenBefore,hiddenAfter; // references to hidden tokens
+};
+
+typedef ASTRefCount<CommonASTWithHiddenTokens> RefCommonASTWithHiddenTokens;
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_CommonASTWithHiddenTokens_h__