Top Fields Constructors Methods
bsh

pack-priv Class SimpleNode

extends Object
implements Node
Class Inheritance
All Implemented Interfaces
bsh.Node, java.io.Serializable
Known Direct Subclasses
bsh.BSHWhileStatement, bsh.BSHVariableDeclarator, bsh.BSHUnaryExpression, bsh.BSHTypedVariableDeclaration, bsh.BSHType, bsh.BSHTryStatement, bsh.BSHThrowStatement, bsh.BSHTernaryExpression, bsh.BSHSwitchStatement, bsh.BSHSwitchLabel, bsh.BSHStatementExpressionList, bsh.BSHReturnType, bsh.BSHReturnStatement, bsh.BSHPrimitiveType, bsh.BSHPrimarySuffix, bsh.BSHPrimaryExpression, bsh.BSHPackageDeclaration, bsh.BSHMethodInvocation, bsh.BSHMethodDeclaration, bsh.BSHLiteral, bsh.BSHImportDeclaration, bsh.BSHIfStatement, bsh.BSHFormalParameters, bsh.BSHFormalParameter, bsh.BSHFormalComment, bsh.BSHForStatement, bsh.BSHEnhancedForStatement, bsh.BSHClassDeclaration, bsh.BSHCastExpression, bsh.BSHBlock, bsh.BSHBinaryExpression, bsh.BSHAssignment, bsh.BSHArrayInitializer, bsh.BSHArrayDimensions, bsh.BSHArguments, bsh.BSHAmbiguousName, bsh.BSHAllocationExpression

Field Summary

Modifier and TypeField and Description
protected Node[]
pack-priv Token
protected int
public static SimpleNode
pack-priv Token
protected Node
pack-priv String
sourceFile

the source of the text from which this was parsed

Constructor Summary

AccessConstructor and Description
public
SimpleNode(int i)

Method Summary

Modifier and TypeMethod and Description
public void
dump(String prefix)

public Object
eval(CallStack callstack, Interpreter interpreter)

This is the general signature for evaluation of a node.

public SimpleNode
getChild(int i)

public int
getLineNumber()

Get the line number of the starting token

public String
getSourceFile()

Get the name of the source file (or more generally source) of the text from which this node was parsed.

public String
getText()

Get the text of the tokens comprising this node.

public void
jjtAddChild(Node n, int i)

Implements bsh.Node.jjtAddChild.

This method tells the node to add its argument to the node's list of children.
public void
jjtClose()

Implements bsh.Node.jjtClose.

This method is called after all the child nodes have been added.
public Node
jjtGetChild(int i)

Implements bsh.Node.jjtGetChild.

This method returns a child node.
public int
jjtGetNumChildren()

Implements bsh.Node.jjtGetNumChildren.

Return the number of children the node has.
public Node
public void
jjtOpen()

Implements bsh.Node.jjtOpen.

This method is called after the node has been made the current node.
public void
jjtSetParent(Node n)

Implements bsh.Node.jjtSetParent.

This pair of methods are used to inform the node of its parent.
public void
prune()

Detach this node from its parent.

public void
setSourceFile(String sourceFile)

Set the name of the source file (or more generally source) of the text from which this node was parsed.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public String
toString(String prefix)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

childrenback to summary
protected Node[] children
firstTokenback to summary
pack-priv Token firstToken
idback to summary
protected int id
JAVACODEback to summary
public static SimpleNode JAVACODE
lastTokenback to summary
pack-priv Token lastToken
parentback to summary
protected Node parent
sourceFileback to summary
pack-priv String sourceFile

the source of the text from which this was parsed

Constructor Detail

SimpleNodeback to summary
public SimpleNode(int i)

Method Detail

dumpback to summary
public void dump(String prefix)
evalback to summary
public Object eval(CallStack callstack, Interpreter interpreter) throws EvalError

This is the general signature for evaluation of a node.

getChildback to summary
public SimpleNode getChild(int i)
getLineNumberback to summary
public int getLineNumber()

Get the line number of the starting token

getSourceFileback to summary
public String getSourceFile()

Get the name of the source file (or more generally source) of the text from which this node was parsed. This will recursively search up the chain of parent nodes until a source is found or return a string indicating that the source is unknown.

getTextback to summary
public String getText()

Get the text of the tokens comprising this node.

jjtAddChildback to summary
public void jjtAddChild(Node n, int i)

Implements bsh.Node.jjtAddChild.

Doc from bsh.Node.jjtAddChild.

This method tells the node to add its argument to the node's list of children.

jjtCloseback to summary
public void jjtClose()

Implements bsh.Node.jjtClose.

Doc from bsh.Node.jjtClose.

This method is called after all the child nodes have been added.

jjtGetChildback to summary
public Node jjtGetChild(int i)

Implements bsh.Node.jjtGetChild.

Doc from bsh.Node.jjtGetChild.

This method returns a child node. The children are numbered from zero, left to right.

jjtGetNumChildrenback to summary
public int jjtGetNumChildren()

Implements bsh.Node.jjtGetNumChildren.

Doc from bsh.Node.jjtGetNumChildren.

Return the number of children the node has.

jjtGetParentback to summary
public Node jjtGetParent()

Implements bsh.Node.jjtGetParent.

jjtOpenback to summary
public void jjtOpen()

Implements bsh.Node.jjtOpen.

Doc from bsh.Node.jjtOpen.

This method is called after the node has been made the current node. It indicates that child nodes can now be added to it.

jjtSetParentback to summary
public void jjtSetParent(Node n)

Implements bsh.Node.jjtSetParent.

Doc from bsh.Node.jjtSetParent.

This pair of methods are used to inform the node of its parent.

pruneback to summary
public void prune()

Detach this node from its parent. This is primarily useful in node serialization. (see BSHMethodDeclaration)

setSourceFileback to summary
public void setSourceFile(String sourceFile)

Set the name of the source file (or more generally source) of the text from which this node was parsed.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

toStringback to summary
public String toString(String prefix)