Logo Search packages:      
Sourcecode: antlr version File versions

antlr::BaseAST Class Reference

Inheritance diagram for antlr::BaseAST:

antlr::collections::AST antlr::collections::AST antlr::CommonAST antlr::CommonAST antlr::CommonASTWithHiddenTokens antlr::CommonASTWithHiddenTokens ASTType49 ASTType49 MyAST MyAST antlr::CommonASTWithHiddenTokens antlr::CommonASTWithHiddenTokens ASTType49 ASTType49 MyAST MyAST INTNode INTNode INTNode INTNode INTNode INTNode

List of all members.


Detailed Description

A Child-Sibling Tree.

A tree with PLUS at the root and with two children 3 and 4 is structured as:

PLUS | 3 -- 4

and can be specified easily in LISP notation as

(PLUS 3 4)

where every '(' starts a new subtree.

These trees are particular useful for translators because of the flexibility of the children lists. They are also very easy to walk automatically, whereas trees with specific children reference fields can't easily be walked automatically.

This class contains the basic support for an AST. Most people will create ASTs that are subclasses of BaseAST or of CommonAST.

Definition at line 44 of file BaseAST.java.


Public Member Functions

virtual void addChild (AST node)
void addChild (AST node)
virtual object Clone ()
virtual bool Equals (AST t)
override bool Equals (Object obj)
boolean equals (AST t)
virtual bool EqualsList (AST t)
boolean equalsList (AST t)
virtual bool EqualsListPartial (AST sub)
boolean equalsListPartial (AST sub)
virtual bool EqualsTree (AST t)
boolean equalsTree (AST t)
virtual bool EqualsTreePartial (AST sub)
boolean equalsTreePartial (AST sub)
virtual IEnumerator findAll (AST target)
ASTEnumeration findAll (AST target)
virtual IEnumerator findAllPartial (AST sub)
ASTEnumeration findAllPartial (AST sub)
virtual AST getFirstChild ()
AST getFirstChild ()
override Int32 GetHashCode ()
virtual AST getNextSibling ()
AST getNextSibling ()
int getNumberOfChildren ()
 Get number of children of this node; if leaf, returns 0.
int getNumberOfChildren ()
virtual string getText ()
String getText ()
int getType ()
abstract void initialize (Token t)
abstract void initialize (AST t)
abstract void initialize (int t, string txt)
abstract void initialize (Token t)
abstract void initialize (AST t)
abstract void initialize (int t, String txt)
virtual void removeChildren ()
void removeChildren ()
virtual void setFirstChild (AST c)
void setFirstChild (AST c)
virtual void setNextSibling (AST n)
void setNextSibling (AST n)
virtual void setText (string text)
void setText (String text)
virtual void setType (int ttype)
void setType (int ttype)
override string ToString ()
String toString ()
virtual string ToStringList ()
String toStringList ()
string ToStringTree (string prefix)
virtual string ToStringTree ()
String toStringTree ()
virtual void xmlSerialize (TextWriter outWriter)
void xmlSerialize (Writer out) throws IOException
virtual void xmlSerializeNode (TextWriter outWriter)
void xmlSerializeNode (Writer out) throws IOException
virtual void xmlSerializeRootClose (TextWriter outWriter)
void xmlSerializeRootClose (Writer out) throws IOException
virtual void xmlSerializeRootOpen (TextWriter outWriter)
void xmlSerializeRootOpen (Writer out) throws IOException

Static Public Member Functions

static string decode (string text)
static String decode (String text)
static string encode (string text)
static String encode (String text)
static void setVerboseStringConversion (bool verbose, string[] names)
static void setVerboseStringConversion (boolean verbose, String[] names)

Protected Attributes

internal BaseAST down
BaseAST down
internal BaseAST right
BaseAST right

Properties

virtual int Type [get, set]

Private Member Functions

void doWorkForFindAll (ArrayList v, AST target, bool partialMatch)
void doWorkForFindAll (Vector v, AST target, boolean partialMatch)

Static Private Attributes

static string[] tokenNames = null
static String[] tokenNames = null
static bool verboseStringConversion = false
static boolean verboseStringConversion = false

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index