|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--antlr.ASTFactory | +--de.hunsicker.jalopy.language.antlr.JavaNodeFactory
Central facility to create the nodes for Java parse trees.
Field Summary |
Fields inherited from class antlr.ASTFactory |
theASTNodeType, theASTNodeTypeClass, tokenTypeToASTClassMap |
Constructor Summary | |
JavaNodeFactory(CompositeFactory compositeFactory)
Creates a new JavaNodeFactory object. |
Method Summary | |
void |
addASTChild(antlr.ASTPair currentAST,
antlr.collections.AST child)
Add the given node as a child to the given root. |
antlr.collections.AST |
create(antlr.collections.AST node)
Creates a new JavaNode node. |
antlr.collections.AST |
create(int type)
Creates a new JavaNode node. |
JavaNode |
create(int startLine,
int startColumn,
int endLine,
int endColumn)
|
antlr.collections.AST |
create(int type,
java.lang.String text)
Creates a new JavaNode node. |
antlr.collections.AST |
create(antlr.Token token)
Creates a new JavaNode node. |
antlr.collections.AST |
dup(antlr.collections.AST t)
Copy a single node with same Java AST objec type. |
antlr.collections.AST |
dupList(antlr.collections.AST t)
Duplicate the given tree (including all siblings of root). |
antlr.collections.AST |
dupTree(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. |
antlr.collections.AST |
make(antlr.collections.AST[] nodes)
Makes a tree from a list of nodes. |
void |
makeASTRoot(antlr.ASTPair currentAST,
antlr.collections.AST root)
DOCUMENT ME! |
Methods inherited from class antlr.ASTFactory |
create, create, create, create, create, createUsingCtor, getASTNodeType, getTokenTypeToASTClassMap, make, setASTNodeClass, setASTNodeClass, setASTNodeType, setTokenTypeASTNodeType, setTokenTypeToASTClassMap |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JavaNodeFactory(CompositeFactory compositeFactory)
Method Detail |
public void addASTChild(antlr.ASTPair currentAST, antlr.collections.AST child)
addASTChild
in class antlr.ASTFactory
currentAST
- root pair.child
- new child to add.
TODO Examine what this does ?public antlr.collections.AST create(int type)
create
in class antlr.ASTFactory
type
- information to setup the node with.
public antlr.collections.AST create(antlr.collections.AST node)
create
in class antlr.ASTFactory
node
- node to setup the new node with.
public antlr.collections.AST create(antlr.Token token)
create
in class antlr.ASTFactory
token
- token to setup the new node with.
public antlr.collections.AST create(int type, java.lang.String text)
create
in class antlr.ASTFactory
type
- type information to setup the node with.text
- text to setup the node with.
public antlr.collections.AST dupList(antlr.collections.AST t)
dupList
in class antlr.ASTFactory
t
- the root node of the tree (or tree portion)
public antlr.collections.AST dup(antlr.collections.AST t)
dup
in class antlr.ASTFactory
public antlr.collections.AST dupTree(antlr.collections.AST t)
dupTree
in class antlr.ASTFactory
t
- the root node of the tree (or tree portion)
public void error(java.lang.String message)
error
in class antlr.ASTFactory
message
- an error message.public antlr.collections.AST make(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 antlr.ASTFactory
nodes
- the nodes to create the tree with.
TODO Examine what this does
public void makeASTRoot(antlr.ASTPair currentAST, antlr.collections.AST root)
makeASTRoot
in class antlr.ASTFactory
currentAST
- DOCUMENT ME!root
- DOCUMENT ME!public JavaNode create(int startLine, int startColumn, int endLine, int endColumn)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |