source: trunk/yao/share/antlr-2.7.7/lib/cpp/antlr/CommonASTWithHiddenTokens.hpp @ 1

Last change on this file since 1 was 1, checked in by lnalod, 15 years ago

Initial import of YAO sources

File size: 1.5 KB
Line 
1#ifndef INC_CommonASTWithHiddenTokens_hpp__
2#define INC_CommonASTWithHiddenTokens_hpp__
3
4/* ANTLR Translator Generator
5 * Project led by Terence Parr at http://www.jGuru.com
6 * Software rights: http://www.antlr.org/license.html
7 *
8 * $Id: //depot/code/org.antlr/release/antlr-2.7.7/lib/cpp/antlr/CommonASTWithHiddenTokens.hpp#2 $
9 */
10
11#include <antlr/config.hpp>
12#include <antlr/CommonAST.hpp>
13
14#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
15namespace antlr {
16#endif
17
18/** A CommonAST whose initialization copies hidden token
19 *  information from the Token used to create a node.
20 */
21class ANTLR_API CommonASTWithHiddenTokens : public CommonAST {
22public:
23        CommonASTWithHiddenTokens();
24        virtual ~CommonASTWithHiddenTokens();
25        virtual const char* typeName( void ) const
26        {
27                return CommonASTWithHiddenTokens::TYPE_NAME;
28        }
29        /// Clone this AST node.
30        virtual RefAST clone( void ) const;
31
32        // Borland C++ builder seems to need the decl's of the first two...
33        virtual void initialize(int t,const ANTLR_USE_NAMESPACE(std)string& txt);
34        virtual void initialize(RefAST t);
35        virtual void initialize(RefToken t);
36
37        virtual RefToken getHiddenAfter() const
38        {
39                return hiddenAfter;
40        }
41
42        virtual RefToken getHiddenBefore() const
43        {
44                return hiddenBefore;
45        }
46
47        static RefAST factory();
48
49        static const char* const TYPE_NAME;
50protected:
51        RefToken hiddenBefore,hiddenAfter; // references to hidden tokens
52};
53
54typedef ASTRefCount<CommonASTWithHiddenTokens> RefCommonASTWithHiddenTokens;
55
56#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
57}
58#endif
59
60#endif //INC_CommonASTWithHiddenTokens_hpp__
Note: See TracBrowser for help on using the repository browser.