de.hunsicker.jalopy.language
Class NodeFactory

java.lang.Object
  |
  +--antlr.ASTFactory
        |
        +--de.hunsicker.jalopy.language.NodeFactory

public class NodeFactory
extends antlr.ASTFactory

Central facility to create extended nodes.

Version:
$Revision: 1.2.2.3 $
Author:
Marco Hunsicker

Field Summary
protected static java.lang.String EMPTY_STRING
          The empty string constant.
 
Fields inherited from class antlr.ASTFactory
theASTNodeType, theASTNodeTypeClass, tokenTypeToASTClassMap
 
Constructor Summary
NodeFactory(CompositeFactory compositeFactory)
          Creates a new NodeFactory object.
 
Method Summary
 antlr.collections.AST create()
          Creates a new empty JavaNode node.
 antlr.collections.AST create(antlr.collections.AST node)
          Creates a new empty Node node.
 antlr.collections.AST create(int type)
          Creates a new empty Node node.
 antlr.collections.AST create(int type, java.lang.String text)
          Creates a new empty Node node.
 antlr.collections.AST create(antlr.Token tok)
          Creates a new empty Node node.
 antlr.collections.AST dup(antlr.collections.AST t)
          Copy a single node with same Java AST objec type.
 
Methods inherited from class antlr.ASTFactory
addASTChild, create, create, create, create, createUsingCtor, dupList, dupTree, error, getASTNodeType, getTokenTypeToASTClassMap, make, make, makeASTRoot, setASTNodeClass, setASTNodeClass, setASTNodeType, setTokenTypeASTNodeType, setTokenTypeToASTClassMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_STRING

protected static final java.lang.String EMPTY_STRING
The empty string constant.

Constructor Detail

NodeFactory

public NodeFactory(CompositeFactory compositeFactory)
Creates a new NodeFactory object.

Method Detail

create

public antlr.collections.AST create()
Creates a new empty JavaNode node.

Overrides:
create in class antlr.ASTFactory
Returns:
newly created Node.

dup

public antlr.collections.AST dup(antlr.collections.AST t)
Copy a single node with same Java AST objec type. Ignore the tokenType->Class mapping since you know the type of the node, t.getClass(), and doing a dup. clone() is not used because we want all AST creation to go thru the factory so creation can be tracked. Returns null if t is null.

Overrides:
dup in class antlr.ASTFactory

create

public antlr.collections.AST create(int type)
Creates a new empty Node node.

Overrides:
create in class antlr.ASTFactory
Parameters:
type - information to setup the node with.
Returns:
newly created Node.

create

public antlr.collections.AST create(int type,
                                    java.lang.String text)
Creates a new empty Node node.

Overrides:
create in class antlr.ASTFactory
Parameters:
type - type information to setup the node with.
text - text to setup the node with.
Returns:
newly created Node.

create

public antlr.collections.AST create(antlr.collections.AST node)
Creates a new empty Node node.

Overrides:
create in class antlr.ASTFactory
Parameters:
node - node to setup the new node with.
Returns:
newly created Node.

create

public antlr.collections.AST create(antlr.Token tok)
Creates a new empty Node node.

Overrides:
create in class antlr.ASTFactory
Parameters:
tok - token to setup the new node with.
Returns:
newly created Node.


Copyright © 1997-2005 Jalopy. All Rights Reserved.