public class NodeFactory extends Object
Constructor and Description |
---|
NodeFactory(XJep xj) |
Modifier and Type | Method and Description |
---|---|
ASTConstant |
buildConstantNode(ASTConstant node)
Create an ASTConstant with same value as argument.
|
ASTConstant |
buildConstantNode(Object value)
Creates an ASTConstant node with specified value.
|
ASTConstant |
buildConstantNode(Operator op,
Node child1)
Creates a ASTConstant whose value of applying a unary operator to its arguments.
|
ASTConstant |
buildConstantNode(Operator op,
Node[] children)
Creates a ASTConstant whose value of applying the operator to its arguments.
|
ASTConstant |
buildConstantNode(Operator op,
Node child1,
Node child2)
Creates a ASTConstant whose value of applying binary operator to its arguments.
|
ASTConstant |
buildConstantNode(PostfixMathCommandI pfmc,
Node[] children)
Creates a ASTConstant whose value of applying the operator to its arguments.
|
ASTFunNode |
buildFunctionNode(ASTFunNode node,
Node[] arguments)
Builds a function with n arguments and same fun as specified in arguments.
|
ASTFunNode |
buildFunctionNode(String name,
PostfixMathCommandI pfmc,
Node[] arguments)
Builds a function with n arguments
This method should be sub-classed
|
ASTFunNode |
buildOperatorNode(Operator op,
Node child)
creates a unary function.
|
ASTFunNode |
buildOperatorNode(Operator op,
Node[] arguments)
Builds a operator node with n arguments
This method should be sub-classed
|
ASTFunNode |
buildOperatorNode(Operator op,
Node lhs,
Node rhs)
creates a binary function.
|
ASTFunNode |
buildUnfinishedOperatorNode(Operator op)
An unfinished node.
|
ASTVarNode |
buildVariableNode(ASTVarNode node)
creates a new ASTVarNode with the same name as argument.
|
ASTVarNode |
buildVariableNode(String name,
Object value) |
ASTVarNode |
buildVariableNode(Variable var)
creates a new ASTVarNode with a given variable.
|
void |
copyChildren(Node node,
Node[] children)
Sets the children of node to be those specified in array.
|
public NodeFactory(XJep xj)
public void copyChildren(Node node, Node[] children)
node
- the node whose children will be set.children
- an array of nodes which will be the children of the node.public ASTConstant buildConstantNode(Object value) throws ParseException
ParseException
public ASTConstant buildConstantNode(ASTConstant node) throws ParseException
ParseException
public ASTConstant buildConstantNode(PostfixMathCommandI pfmc, Node[] children) throws IllegalArgumentException, ParseException
public ASTConstant buildConstantNode(Operator op, Node[] children) throws IllegalArgumentException, ParseException
public ASTConstant buildConstantNode(Operator op, Node child1, Node child2) throws IllegalArgumentException, ParseException
public ASTConstant buildConstantNode(Operator op, Node child1) throws IllegalArgumentException, ParseException
public ASTVarNode buildVariableNode(ASTVarNode node) throws ParseException
ParseException
public ASTVarNode buildVariableNode(Variable var) throws ParseException
ParseException
public ASTVarNode buildVariableNode(String name, Object value) throws ParseException
ParseException
public ASTFunNode buildOperatorNode(Operator op, Node[] arguments) throws ParseException
op
- the operator to usearguments
- the arguments to the function.ParseException
public ASTFunNode buildFunctionNode(String name, PostfixMathCommandI pfmc, Node[] arguments) throws ParseException
name
- of function.pfmc
- PostfixMathCommand for function.arguments
- the arguments to the function.ParseException
public ASTFunNode buildUnfinishedOperatorNode(Operator op)
public ASTFunNode buildOperatorNode(Operator op, Node child) throws ParseException
ParseException
public ASTFunNode buildOperatorNode(Operator op, Node lhs, Node rhs) throws ParseException
ParseException
public ASTFunNode buildFunctionNode(ASTFunNode node, Node[] arguments) throws ParseException
node
- the properties (name and pfmc) of this node will be copied.arguments
- the arguments to the function.ParseException
Jas4pp 1.5 © Java Analysis Studio for Particle Physics