| 1 | /* ANTLR Translator Generator | 
| 2 | * Project led by Terence Parr at http://www.jGuru.com | 
| 3 | * Software rights: http://www.antlr.org/license.html | 
| 4 | * | 
| 5 | * $Id$ | 
| 6 | */ | 
| 7 | #include "antlr/config.hpp" | 
| 8 | #include "antlr/AST.hpp" | 
| 9 | #include "antlr/BaseAST.hpp" | 
| 10 | #include "antlr/CommonAST.hpp" | 
| 11 | #include "antlr/CommonASTWithHiddenTokens.hpp" | 
| 12 | #include "antlr/CommonHiddenStreamToken.hpp" | 
| 13 |  | 
| 14 | #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE | 
| 15 | namespace antlr { | 
| 16 | #endif | 
| 17 |  | 
| 18 | const char* const CommonASTWithHiddenTokens::TYPE_NAME = "CommonASTWithHiddenTokens"; | 
| 19 | // RK: Do not put constructor and destructor into the header file here.. | 
| 20 | // this triggers something very obscure in gcc 2.95.3 (and 3.0) | 
| 21 | // missing vtables and stuff. | 
| 22 | // Although this may be a problem with with binutils. | 
| 23 | CommonASTWithHiddenTokens::CommonASTWithHiddenTokens() | 
| 24 | : CommonAST() | 
| 25 | { | 
| 26 | } | 
| 27 |  | 
| 28 | CommonASTWithHiddenTokens::~CommonASTWithHiddenTokens() | 
| 29 | { | 
| 30 | } | 
| 31 |  | 
| 32 | void CommonASTWithHiddenTokens::initialize(int t,const ANTLR_USE_NAMESPACE(std)string& txt) | 
| 33 | { | 
| 34 | CommonAST::initialize(t,txt); | 
| 35 | } | 
| 36 |  | 
| 37 | void CommonASTWithHiddenTokens::initialize(RefAST t) | 
| 38 | { | 
| 39 | CommonAST::initialize(t); | 
| 40 | hiddenBefore = RefCommonASTWithHiddenTokens(t)->getHiddenBefore(); | 
| 41 | hiddenAfter = RefCommonASTWithHiddenTokens(t)->getHiddenAfter(); | 
| 42 | } | 
| 43 |  | 
| 44 | void CommonASTWithHiddenTokens::initialize(RefToken t) | 
| 45 | { | 
| 46 | CommonAST::initialize(t); | 
| 47 | hiddenBefore = static_cast<CommonHiddenStreamToken*>(t.get())->getHiddenBefore(); | 
| 48 | hiddenAfter = static_cast<CommonHiddenStreamToken*>(t.get())->getHiddenAfter(); | 
| 49 | } | 
| 50 |  | 
| 51 | RefAST CommonASTWithHiddenTokens::factory() | 
| 52 | { | 
| 53 | return RefAST(new CommonASTWithHiddenTokens); | 
| 54 | } | 
| 55 |  | 
| 56 | RefAST CommonASTWithHiddenTokens::clone( void ) const | 
| 57 | { | 
| 58 | CommonASTWithHiddenTokens *ast = new CommonASTWithHiddenTokens( *this ); | 
| 59 | return RefAST(ast); | 
| 60 | } | 
| 61 |  | 
| 62 | #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE | 
| 63 | } | 
| 64 | #endif |