4
#include <antlr/CommonAST.hpp>
7
typedef antlr::ASTRefCount<AdaAST> RefAdaAST;
9
class AdaAST : public antlr::CommonAST {
11
AdaAST() : m_line (0), m_column (0) {}
15
int getLine () const { return m_line; }
16
void setLine (int line) { m_line = line; }
18
int getColumn () const { return m_column; }
19
void setColumn (int column) { m_column = column; }
21
void initialize (antlr::RefToken t) {
22
antlr::CommonAST::initialize (t);
23
m_line = t->getLine () - 1;
24
m_column = t->getColumn () - 1;
27
void initialize (int t, const std::string& txt) {
34
RefAdaAST duplicate (void) const {
35
AdaAST *ast = new AdaAST (*this);
36
return RefAdaAST (ast);
39
void set (int t, const std::string& txt) {
44
void addChild (RefAdaAST c) {
45
antlr::RefAST n( c.get() );
46
antlr::BaseAST::addChild (n);
49
RefAdaAST down () const {
50
return RefAdaAST (antlr::BaseAST::getFirstChild ());
53
RefAdaAST right () const {
54
return RefAdaAST (antlr::BaseAST::getNextSibling ());
57
/* bool equals(RefAdaAST t) const {
58
return ((antlr::BaseAST*)this)->equals (t);
61
static antlr::RefAST factory (void) {
62
RefAdaAST n( new AdaAST );
66
static const RefAdaAST nullAdaAST;
73
#define Set(n, t) (n)->set(t, #t)
74
// for Java compatibility: