public class JavaNodeFactory
extends de.hunsicker.antlr.ASTFactory
Constructor and Description |
---|
JavaNodeFactory()
Creates a new JavaNodeFactory object.
|
Modifier and Type | Method and Description |
---|---|
void |
addASTChild(de.hunsicker.antlr.ASTPair currentAST,
de.hunsicker.antlr.collections.AST child)
Add the given node as a child to the given root.
|
de.hunsicker.antlr.collections.AST |
create()
Creates a new empty JavaNode node.
|
de.hunsicker.antlr.collections.AST |
create(de.hunsicker.antlr.collections.AST node)
Creates a new JavaNode node.
|
de.hunsicker.antlr.collections.AST |
create(int type)
Creates a new JavaNode node.
|
de.hunsicker.antlr.collections.AST |
create(int type,
java.lang.String text)
Creates a new JavaNode node.
|
de.hunsicker.antlr.collections.AST |
create(de.hunsicker.antlr.Token token)
Creates a new JavaNode node.
|
de.hunsicker.antlr.collections.AST |
dupList(de.hunsicker.antlr.collections.AST t)
Duplicate the given tree (including all siblings of root).
|
de.hunsicker.antlr.collections.AST |
dupTree(de.hunsicker.antlr.collections.AST t)
Duplicate a tree, assuming this is a root node of a tree -- duplicates that node
and what's below; ignore siblings of root node.
|
void |
error(java.lang.String message)
Logs the given error message.
|
de.hunsicker.antlr.collections.AST |
make(de.hunsicker.antlr.collections.AST[] nodes)
Makes a tree from a list of nodes.
|
void |
makeASTRoot(de.hunsicker.antlr.ASTPair currentAST,
de.hunsicker.antlr.collections.AST root)
DOCUMENT ME!
|
public void addASTChild(de.hunsicker.antlr.ASTPair currentAST, de.hunsicker.antlr.collections.AST child)
addASTChild
in class de.hunsicker.antlr.ASTFactory
currentAST
- root pair.child
- new child to add.public de.hunsicker.antlr.collections.AST create()
create
in class de.hunsicker.antlr.ASTFactory
public de.hunsicker.antlr.collections.AST create(int type)
create
in class de.hunsicker.antlr.ASTFactory
type
- information to setup the node with.public de.hunsicker.antlr.collections.AST create(de.hunsicker.antlr.collections.AST node)
create
in class de.hunsicker.antlr.ASTFactory
node
- node to setup the new node with.public de.hunsicker.antlr.collections.AST create(de.hunsicker.antlr.Token token)
create
in class de.hunsicker.antlr.ASTFactory
token
- token to setup the new node with.public de.hunsicker.antlr.collections.AST create(int type, java.lang.String text)
create
in class de.hunsicker.antlr.ASTFactory
type
- type information to setup the node with.text
- text to setup the node with.public de.hunsicker.antlr.collections.AST dupList(de.hunsicker.antlr.collections.AST t)
dupList
in class de.hunsicker.antlr.ASTFactory
t
- the root node of the tree (or tree portion)public de.hunsicker.antlr.collections.AST dupTree(de.hunsicker.antlr.collections.AST t)
dupTree
in class de.hunsicker.antlr.ASTFactory
t
- the root node of the tree (or tree portion)public void error(java.lang.String message)
error
in class de.hunsicker.antlr.ASTFactory
message
- an error message.public de.hunsicker.antlr.collections.AST make(de.hunsicker.antlr.collections.AST[] nodes)
null
, then the tree is actually a simple list not a
tree. Handles null
children nodes correctly. For example,
build(a, b, null, c)
yields tree (a b c)
.
build(null,a,b)
yields tree (nil a b)
.
Sets also the line/column info of the root node.
make
in class de.hunsicker.antlr.ASTFactory
nodes
- the nodes to create the tree with.public void makeASTRoot(de.hunsicker.antlr.ASTPair currentAST, de.hunsicker.antlr.collections.AST root)
makeASTRoot
in class de.hunsicker.antlr.ASTFactory
currentAST
- DOCUMENT ME!root
- DOCUMENT ME!
Submit a bug or feature.
For further information and documentation, visit the official Jalopy website.
This page generated: March 30 2013