sidekick.ecmascript.parser
Class SimpleNode

java.lang.Object
  extended by sidekick.ecmascript.parser.SimpleNode
All Implemented Interfaces:
EcmaScriptConstants, EcmaScriptTreeConstants, Node, sidekick.util.SideKickElement
Direct Known Subclasses:
ASTAllocationExpression, ASTAndExpressionSequence, ASTArrayLiteral, ASTAssignmentExpression, ASTBinaryExpressionSequence, ASTBlock, ASTBreakStatement, ASTCaseGroup, ASTCaseGroups, ASTCaseGuard, ASTCatchClause, ASTCompositeReference, ASTConditionalExpression, ASTContinueStatement, ASTDoStatement, ASTEmptyExpression, ASTEmptyStatement, ASTExpressionList, ASTExpressionStatement, ASTFinallyClause, ASTForInStatement, ASTFormalParameterList, ASTForStatement, ASTForVarInStatement, ASTForVarStatement, ASTFunctionCallParameters, ASTFunctionDeclaration, ASTFunctionExpression, ASTIdentifier, ASTIfStatement, ASTLiteral, ASTLiteralField, ASTObjectLiteral, ASTOperator, ASTOrExpressionSequence, ASTParenExpression, ASTPostfixExpression, ASTProgram, ASTPropertyIdentifierReference, ASTPropertyValueReference, ASTRequireStatement, ASTReturnStatement, ASTStatementList, ASTSwitchStatement, ASTThisReference, ASTThrowStatement, ASTTryStatement, ASTUnaryExpression, ASTVariableDeclaration, ASTVariableDeclarationList, ASTVariableStatement, ASTWhileStatement, ASTWithStatement

public class SimpleNode
extends java.lang.Object
implements Node, sidekick.util.SideKickElement, EcmaScriptConstants, EcmaScriptTreeConstants


Field Summary
protected  Token beginToken
           
protected  Node[] children
           
protected  Token endToken
           
protected  int id
           
protected  boolean inserted
           
protected  java.util.LinkedList<Comment> javadocComments
           
protected  Node parent
           
protected  EcmaScript parser
           
 
Fields inherited from interface sidekick.ecmascript.parser.EcmaScriptConstants
_DEFAULT, ANDASSIGN, ASSIGN, BACKSLASH_SEQUENCE, BANG, BIT_AND, BIT_OR, BOOLEAN_LITERAL, BREAK, CASE, CATCH, CHARACTER_ESCAPE_SEQUENCE, CLASS, COLON, COMMA, CONST, CONTINUE, CR, DEBUGGER, DECIMAL_DIGIT, DECIMAL_DIGITS, DECIMAL_INTEGER_LITERAL, DECIMAL_LITERAL, DECR, DEFAULT, DELETE, DO, DOLLAR_SIGN, DOT, DOUBLE_STRING_CHARACTER, DOUBLE_STRING_CHARACTERS, ELSE, ENUM, EOF, EQ, ESCAPE_SEQUENCE, EXPONENT_PART, EXPORT, EXTENDS, FF, FINALLY, FOR, FUNCTION, GE, GT, HEX_DIGIT, HEX_ESCAPE_SEQUENCE, HEX_INTEGER_LITERAL, HOOK, IDENTIFIER_NAME, IDENTIFIER_PART, IDENTIFIER_START, IF, IMPORT, IN, IN_JSP_TAG, IN_MULTI_LINE_COMMENT, IN_PATTERN, IN_REGEX, IN_SINGLE_LINE_COMMENT, INCR, INTANCE_OF, JSP_TAG, LBRACE, LBRACKET, LE, LF, LINE_TERMINATOR, LPAREN, LS, LSHIFT, LSHIFTASSIGN, LT, MC, MINUS, MINUSASSIGN, MN, MULTI_LINE_COMMENT, NBSP, NE, NEW, NON_ESCAPE_CHARACTER, NON_ZERO_DIGIT, NULL_LITERAL, ORASSIGN, PLUS, PLUSASSIGN, PS, RBRACE, RBRACKET, REGULAR_EXPRESSION_LITERAL, REM, REMASSIGN, RETURN, RPAREN, RSHIFT, RSIGNEDSHIFTASSIGN, RUNSHIFT, RUNSIGNEDSHIFTASSIGN, SC_AND, SC_OR, SEMICOLON, SEQ, SINGLE_ESCAPE_CHARACTER, SINGLE_LINE_COMMENT, SINGLE_STRING_CHARACTER, SINGLE_STRING_CHARACTERS, SLASH, SLASHASSIGN, SNEQ, SP, STAR, STARASSIGN, STRING_LITERAL, SUPER, SWITCH, TAB, THIS, THROW, TILDE, tokenImage, TRY, TYPEOF, UNDER_SCORE, UNICODE_COMBINING_MARK, UNICODE_CONNECTOR_PUNCTUATION, UNICODE_DIGIT, UNICODE_ESCAPE_SEQUENCE, UNICODE_LETTER, USP, VAR, VOID, VT, WHILE, WHITE_SPACE, WITH, XOR, XORASSIGN
 
Fields inherited from interface sidekick.ecmascript.parser.EcmaScriptTreeConstants
JJTALLOCATIONEXPRESSION, JJTANDEXPRESSIONSEQUENCE, JJTARRAYLITERAL, JJTASSIGNMENTEXPRESSION, JJTBINARYEXPRESSIONSEQUENCE, JJTBLOCK, JJTBREAKSTATEMENT, JJTCASEGROUP, JJTCASEGROUPS, JJTCASEGUARD, JJTCATCHCLAUSE, JJTCOMPOSITEREFERENCE, JJTCONDITIONALEXPRESSION, JJTCONTINUESTATEMENT, JJTDOSTATEMENT, JJTEMPTYEXPRESSION, JJTEMPTYSTATEMENT, JJTEXPRESSIONLIST, JJTEXPRESSIONSTATEMENT, JJTFINALLYCLAUSE, JJTFORINSTATEMENT, JJTFORMALPARAMETERLIST, JJTFORSTATEMENT, JJTFORVARINSTATEMENT, JJTFORVARSTATEMENT, JJTFUNCTIONCALLPARAMETERS, JJTFUNCTIONDECLARATION, JJTFUNCTIONEXPRESSION, JJTIDENTIFIER, JJTIFSTATEMENT, JJTLITERAL, JJTLITERALFIELD, jjtNodeName, JJTOBJECTLITERAL, JJTOPERATOR, JJTOREXPRESSIONSEQUENCE, JJTPARENEXPRESSION, JJTPOSTFIXEXPRESSION, JJTPROGRAM, JJTPROPERTYIDENTIFIERREFERENCE, JJTPROPERTYVALUEREFERENCE, JJTRETURNSTATEMENT, JJTSTATEMENTLIST, JJTSWITCHSTATEMENT, JJTTHISREFERENCE, JJTTHROWSTATEMENT, JJTTRYSTATEMENT, JJTUNARYEXPRESSION, JJTVARIABLEDECLARATION, JJTVARIABLEDECLARATIONLIST, JJTVARIABLESTATEMENT, JJTVOID, JJTWHILESTATEMENT, JJTWITHSTATEMENT
 
Constructor Summary
SimpleNode(EcmaScript p, int i)
           
SimpleNode(int i)
           
 
Method Summary
 java.lang.Object childrenAccept(EcmaScriptVisitor visitor, java.lang.Object data)
          Accept the visitor.
 void dump(java.lang.String prefix)
           
 Token getBeginToken()
           
 int getChildIndex(Node n)
           
 java.util.List getChildren()
           
 Comment getComment()
           
 java.util.List getComments()
           
 sidekick.util.Location getEndLocation()
           
 javax.swing.text.Position getEndPosition()
           
 Token getEndToken()
           
 Node getNextSibling()
           
 Node getPrevSibling()
           
 sidekick.util.Location getStartLocation()
           
 javax.swing.text.Position getStartPosition()
           
 boolean hasChildren()
           
 void insertChild(Node n, int i)
           
 boolean inserted()
           
 boolean isVisible()
           
 java.lang.Object jjtAccept(EcmaScriptVisitor visitor, java.lang.Object data)
          Accept the visitor.
 void jjtAddChild(Node n, int i)
          This method tells the node to add its argument to the node's list of children.
 void jjtClose()
          This method is called after all the child nodes have been added.
 Node jjtGetChild(int i)
          This method returns a child node.
 int jjtGetNumChildren()
          Return the number of children the node has.
 Node jjtGetParent()
           
 void jjtOpen()
          This method is called after the node has been made the current node.
 void jjtSetParent(Node n)
          This pair of methods are used to inform the node of its parent.
 void remove()
           
 void removeSafely()
           
 void removeSafely(boolean ignoreSpecialTokens)
           
 void setBeginToken(Token token)
           
 void setChild(Node n, int i)
           
 void setEndLocation(sidekick.util.Location loc)
           
 void setEndPosition(javax.swing.text.Position s)
           
 void setEndToken(Token token)
           
 void setInserted(boolean aFlag)
           
 void setStartLocation(sidekick.util.Location loc)
           
 void setStartPosition(javax.swing.text.Position s)
           
 void setVisible(boolean b)
           
 java.lang.String toString()
           
 java.lang.String toString(java.lang.String prefix)
           
static void transferSpecial(Token specialTransfer, Token nextBeginToken)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

parent

protected Node parent

children

protected Node[] children

id

protected int id

parser

protected EcmaScript parser

beginToken

protected Token beginToken

endToken

protected Token endToken

inserted

protected boolean inserted

javadocComments

protected java.util.LinkedList<Comment> javadocComments
Constructor Detail

SimpleNode

public SimpleNode(int i)

SimpleNode

public SimpleNode(EcmaScript p,
                  int i)
Method Detail

jjtOpen

public void jjtOpen()
Description copied from interface: Node
This method is called after the node has been made the current node. It indicates that child nodes can now be added to it.

Specified by:
jjtOpen in interface Node

jjtClose

public void jjtClose()
Description copied from interface: Node
This method is called after all the child nodes have been added.

Specified by:
jjtClose in interface Node

jjtSetParent

public void jjtSetParent(Node n)
Description copied from interface: Node
This pair of methods are used to inform the node of its parent.

Specified by:
jjtSetParent in interface Node

jjtGetParent

public Node jjtGetParent()
Specified by:
jjtGetParent in interface Node

jjtAddChild

public void jjtAddChild(Node n,
                        int i)
Description copied from interface: Node
This method tells the node to add its argument to the node's list of children.

Specified by:
jjtAddChild in interface Node

jjtGetChild

public Node jjtGetChild(int i)
Description copied from interface: Node
This method returns a child node. The children are numbered from zero, left to right.

Specified by:
jjtGetChild in interface Node

jjtGetNumChildren

public int jjtGetNumChildren()
Description copied from interface: Node
Return the number of children the node has.

Specified by:
jjtGetNumChildren in interface Node

hasChildren

public boolean hasChildren()

getChildren

public java.util.List getChildren()

jjtAccept

public java.lang.Object jjtAccept(EcmaScriptVisitor visitor,
                                  java.lang.Object data)
Accept the visitor.

Specified by:
jjtAccept in interface Node

childrenAccept

public java.lang.Object childrenAccept(EcmaScriptVisitor visitor,
                                       java.lang.Object data)
Accept the visitor.


setStartLocation

public void setStartLocation(sidekick.util.Location loc)
Specified by:
setStartLocation in interface sidekick.util.SideKickElement

getStartLocation

public sidekick.util.Location getStartLocation()
Specified by:
getStartLocation in interface sidekick.util.SideKickElement

setEndLocation

public void setEndLocation(sidekick.util.Location loc)
Specified by:
setEndLocation in interface sidekick.util.SideKickElement

getEndLocation

public sidekick.util.Location getEndLocation()
Specified by:
getEndLocation in interface sidekick.util.SideKickElement

setStartPosition

public void setStartPosition(javax.swing.text.Position s)
Specified by:
setStartPosition in interface sidekick.util.SideKickElement

getStartPosition

public javax.swing.text.Position getStartPosition()
Specified by:
getStartPosition in interface sidekick.util.SideKickElement

setEndPosition

public void setEndPosition(javax.swing.text.Position s)
Specified by:
setEndPosition in interface sidekick.util.SideKickElement

getEndPosition

public javax.swing.text.Position getEndPosition()
Specified by:
getEndPosition in interface sidekick.util.SideKickElement

isVisible

public boolean isVisible()

setVisible

public void setVisible(boolean b)

insertChild

public void insertChild(Node n,
                        int i)

getPrevSibling

public Node getPrevSibling()

getNextSibling

public Node getNextSibling()

setChild

public void setChild(Node n,
                     int i)

getChildIndex

public int getChildIndex(Node n)

remove

public void remove()

removeSafely

public void removeSafely()

removeSafely

public void removeSafely(boolean ignoreSpecialTokens)

transferSpecial

public static void transferSpecial(Token specialTransfer,
                                   Token nextBeginToken)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(java.lang.String prefix)

dump

public void dump(java.lang.String prefix)

setBeginToken

public void setBeginToken(Token token)

getBeginToken

public Token getBeginToken()

setEndToken

public void setEndToken(Token token)

getEndToken

public Token getEndToken()

inserted

public boolean inserted()

setInserted

public void setInserted(boolean aFlag)

getComment

public Comment getComment()

getComments

public java.util.List getComments()