#include <MyAST.h>
Public Member Functions | |
MyAST (const MyAST &other) | |
MyAST (void) | |
virtual | ~MyAST (void) |
virtual int | getLine (void) const |
virtual void | setLine (int l) |
virtual void | initialize (int t, const ANTLR_USE_NAMESPACE(std) string &txt) |
virtual void | initialize (ANTLR_USE_NAMESPACE(antlr) RefToken t) |
virtual void | initialize (RefMyAST ast) |
void | addChild (RefMyAST c) |
void | setNextSibling (RefMyAST c) |
virtual | ANTLR_USE_NAMESPACE (antlr) RefAST clone(void) |
Static Public Member Functions | |
static | ANTLR_USE_NAMESPACE (antlr) RefAST factory(void) |
Private Attributes | |
int | line |
Custom AST class that adds line numbers to the AST nodes. easily extended with columns. Filenames will take more work since you'll need a custom token class as well (one that contains the filename)
MyAST::MyAST | ( | const MyAST & | other | ) | [inline] |
MyAST::MyAST | ( | void | ) | [inline] |
Referenced by ANTLR_USE_NAMESPACE().
virtual MyAST::~MyAST | ( | void | ) | [inline, virtual] |
void MyAST::addChild | ( | RefMyAST | c | ) | [inline] |
References ANTLR_USE_NAMESPACE().
virtual MyAST::ANTLR_USE_NAMESPACE | ( | antlr | ) | [inline, virtual] |
References ANTLR_USE_NAMESPACE(), and MyAST().
static MyAST::ANTLR_USE_NAMESPACE | ( | antlr | ) | [inline, static] |
References ANTLR_USE_NAMESPACE(), and MyAST().
virtual int MyAST::getLine | ( | void | ) | const [inline, virtual] |
References line.
virtual void MyAST::initialize | ( | ANTLR_USE_NAMESPACE(antlr) RefToken | t | ) | [inline, virtual] |
References initialize(), and line.
virtual void MyAST::initialize | ( | RefMyAST | ast | ) | [inline, virtual] |
References ANTLR_USE_NAMESPACE(), initialize(), and line.
virtual void MyAST::initialize | ( | int | t, | |
const ANTLR_USE_NAMESPACE(std) string & | txt | |||
) | [inline, virtual] |
the initialize methods are called by the tree building constructs depending on which version is called the line number is filled in. e.g. a bit depending on how the node is constructed it will have the line number filled in or not (imaginary nodes!).
References line.
Referenced by initialize().
virtual void MyAST::setLine | ( | int | l | ) | [inline, virtual] |
References line.
void MyAST::setNextSibling | ( | RefMyAST | c | ) | [inline] |
References ANTLR_USE_NAMESPACE().
int MyAST::line [private] |
Referenced by getLine(), initialize(), and setLine().