Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

TreeParser Class Reference

#include <TreeParser.hpp>

List of all members.

Public Methods

 TreeParser ()
 TreeParser (const TreeParserSharedInputState &state)
virtual ~TreeParser ()
virtual RefAST getAST ()=0
 Get the AST return value squirreled away in the parser.

virtual void match (RefAST t, const BitSet &b)
virtual void setASTFactory (ASTFactory *factory)
virtual ASTFactorygetASTFactory () const
 Return pointer to ASTFactory.

virtual const char * getTokenName (int num) const=0
 Get the name for token 'num'.

virtual int getNumTokens () const=0
 Return the number of tokens defined.

virtual const char *const * getTokenNames () const=0
 Return an array of getNumTokens() token names.

virtual void reportError (const RecognitionException &ex)
 Parser error-reporting function can be overridden in subclass.

virtual void reportError (const ANTLR_USE_NAMESPACE(std) string &s)
 Parser error-reporting function can be overridden in subclass.

virtual void reportWarning (const ANTLR_USE_NAMESPACE(std) string &s)
 Parser warning-reporting function can be overridden in subclass.

virtual void panic ()
virtual void traceIndent ()
 These are used during when traceTreeParser commandline option is passed.

virtual void traceIn (const char *rname, RefAST t)
virtual void traceOut (const char *rname, RefAST t)

Static Public Attributes

RefAST ASTNULL

Protected Methods

virtual void match (RefAST t, int ttype)
virtual void matchNot (RefAST t, int ttype)

Protected Attributes

ASTFactoryastFactory
TreeParserSharedInputState inputState
 The input state of this tree parser.

int traceDepth


Constructor & Destructor Documentation

TreeParser::TreeParser  
 

TreeParser::TreeParser const TreeParserSharedInputState   state
 

TreeParser::~TreeParser   [virtual]
 


Member Function Documentation

virtual RefAST TreeParser::getAST   [pure virtual]
 

Get the AST return value squirreled away in the parser.

virtual ASTFactory* TreeParser::getASTFactory   const [inline, virtual]
 

Return pointer to ASTFactory.

virtual int TreeParser::getNumTokens   [pure virtual]
 

Return the number of tokens defined.

virtual const char* TreeParser::getTokenName int    num const [pure virtual]
 

Get the name for token 'num'.

virtual const char* const* TreeParser::getTokenNames   [pure virtual]
 

Return an array of getNumTokens() token names.

void TreeParser::match RefAST    t,
int    ttype
[protected, virtual]
 

void TreeParser::match RefAST    t,
const BitSet   b
[virtual]
 

Make sure current lookahead symbol matches the given set Throw an exception upon mismatch, which is catch by either the error handler or by the syntactic predicate.

void TreeParser::matchNot RefAST    t,
int    ttype
[protected, virtual]
 

void TreeParser::panic   [virtual]
 

Give panic message and exit the program. can be overridden in subclass

Deprecated:
this method is unused and will dissappear in the next release

void TreeParser::reportError const ANTLR_USE_NAMESPACE(std) string &    s [virtual]
 

Parser error-reporting function can be overridden in subclass.

Parser error-reporting function can be overridden in subclass

void TreeParser::reportError const RecognitionException   ex [virtual]
 

Parser error-reporting function can be overridden in subclass.

Parser error-reporting function can be overridden in subclass

void TreeParser::reportWarning const ANTLR_USE_NAMESPACE(std) string &    s [virtual]
 

Parser warning-reporting function can be overridden in subclass.

Parser warning-reporting function can be overridden in subclass

virtual void TreeParser::setASTFactory ASTFactory   factory [inline, virtual]
 

Specify the AST factory to be used during tree building. (Compulsory) Setting the factory is compulsory (if you intend to modify the tree in the treeparser). The AST Factory is shared between parser (who builds the initial AST) and treeparser.

See also:
Parser::getASTFactory()

void TreeParser::traceIn const char *    rname,
RefAST    t
[virtual]
 

void TreeParser::traceIndent   [virtual]
 

These are used during when traceTreeParser commandline option is passed.

Procedure to write out an indent for traceIn and traceOut

void TreeParser::traceOut const char *    rname,
RefAST    t
[virtual]
 


Member Data Documentation

ASTFactory* TreeParser::astFactory [protected]
 

AST support code; parser and treeparser delegate to this object

RefAST TreeParser::ASTNULL [static]
 

The AST Null object; the parsing cursor is set to this when it is found to be null. This way, we can test the token type of a node without having to have tests for 0 everywhere.

TreeParserSharedInputState TreeParser::inputState [protected]
 

The input state of this tree parser.

int TreeParser::traceDepth [protected]
 

Used to keep track of indent depth with -traceTreeParser


The documentation for this class was generated from the following files:
Generated on Wed Nov 3 13:00:00 2004 for Lemur Toolkit by doxygen1.2.18