You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.0 KiB
42 lines
1.0 KiB
15 years ago
|
#ifndef INC_CommonASTWithHiddenTokens_hpp__
|
||
|
#define INC_CommonASTWithHiddenTokens_hpp__
|
||
|
|
||
|
/** A CommonAST whose initialization copies hidden token
|
||
|
* information from the Token used to create a node.
|
||
|
*/
|
||
|
|
||
3 years ago
|
#include "antlr/config.h"
|
||
|
#include "antlr/CommonAST.h"
|
||
15 years ago
|
|
||
|
ANTLR_BEGIN_NAMESPACE(antlr)
|
||
|
|
||
|
class CommonASTWithHiddenTokens : public CommonAST {
|
||
|
public:
|
||
|
CommonASTWithHiddenTokens() : CommonAST()
|
||
|
{
|
||
|
}
|
||
|
virtual ~CommonASTWithHiddenTokens()
|
||
|
{
|
||
|
}
|
||
|
protected:
|
||
|
RefToken hiddenBefore,hiddenAfter; // references to hidden tokens
|
||
|
public:
|
||
|
virtual RefToken getHiddenAfter() const
|
||
|
{ return hiddenAfter; }
|
||
|
virtual RefToken getHiddenBefore() const
|
||
|
{ return hiddenBefore; }
|
||
|
|
||
|
// 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);
|
||
|
|
||
|
static RefAST factory();
|
||
|
};
|
||
|
|
||
|
typedef ASTRefCount<CommonASTWithHiddenTokens> RefCommonASTWithHiddenTokens;
|
||
|
|
||
|
ANTLR_END_NAMESPACE
|
||
|
|
||
|
#endif //INC_CommonASTWithHiddenTokens_hpp__
|