What kinds of trees can be parsed?
ANTLR tree parsers can walk any tree that implements the AST interface, which imposes a child-sibling like structure to whatever tree data-structure you may have. The important navigation methods are: • getFirstChild: Return a reference to the first child of the sibling list. • getNextSibling: Return a reference to the next child in the list of siblings. Each AST node is considered to have a list of children, some text, and a “token type”. Trees are self-similar in that a tree node is also a tree. An AST is defined completely as: /** Minimal AST node interface used by ANTLR AST generation * and tree-walker. */ public interface AST { /** Add a (rightmost) child to this node */ public void addChild(AST c); public boolean equals(AST t); public boolean equalsList(AST t); public boolean equalsListPartial(AST t); public boolean equalsTree(AST t); public boolean equalsTreePartial(AST t); public ASTEnumeration findAll(AST tree); public ASTEnumeration findAllPartial(AST subtree); /** Get the fi