sidekick.ecmascript.parser
Class EcmaScript

java.lang.Object
  extended by sidekick.ecmascript.parser.EcmaScript
All Implemented Interfaces:
EcmaScriptConstants, EcmaScriptTreeConstants

public class EcmaScript
extends java.lang.Object
implements EcmaScriptTreeConstants, EcmaScriptConstants


Field Summary
 Token jj_nt
           
protected  JJTEcmaScriptState jjtree
           
 boolean lookingAhead
           
 Token token
           
 EcmaScriptTokenManager token_source
           
 
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
 
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
 
Constructor Summary
EcmaScript(EcmaScriptTokenManager tm)
           
EcmaScript(java.io.InputStream stream)
           
EcmaScript(java.io.InputStream stream, java.lang.String encoding)
           
EcmaScript(java.io.Reader stream)
           
 
Method Summary
 void AdditiveExpression()
           
 void AdditiveOperator()
           
 void AllocationExpression()
           
 void ArgumentList()
           
 void Arguments()
           
 void ArrayLiteral()
           
 void AssignmentExpression()
           
 void AssignmentExpressionNoIn()
           
 void AssignmentOperator()
           
 void BitwiseANDExpression()
           
 void BitwiseANDExpressionNoIn()
           
 void BitwiseANDOperator()
           
 void BitwiseORExpression()
           
 void BitwiseORExpressionNoIn()
           
 void BitwiseOROperator()
           
 void BitwiseXORExpression()
           
 void BitwiseXORExpressionNoIn()
           
 void BitwiseXOROperator()
           
 void Block()
           
 void BreakStatement()
           
 void CallExpression()
           
 void CallExpressionForIn()
           
 void CallExpressionPart()
           
 void CaseBlock()
           
 void CaseClause()
           
 void CaseClauses()
           
 void Catch()
           
 void ConditionalExpression()
           
 void ConditionalExpressionNoIn()
           
 void ContinueStatement()
           
 void DefaultClause()
           
 void disable_tracing()
           
 void ElementList()
           
 void Elision()
           
 void EmptyStatement()
           
 void enable_tracing()
           
 void EqualityExpression()
           
 void EqualityExpressionNoIn()
           
 void EqualityOperator()
           
 void Expression()
           
 void ExpressionNoIn()
           
 void ExpressionStatement()
           
 void Finally()
           
 void FormalParameterList()
           
 void FunctionBody()
           
 void FunctionDeclaration()
           
 void FunctionExpression()
           
 ParseException generateParseException()
           
 sidekick.util.Location getEndLocation(Token t)
           
 Token getNextToken()
           
 java.util.List<sidekick.util.ParseError> getParseErrors()
           
 sidekick.util.Location getStartLocation(Token t)
           
 int getTabSize()
           
 Token getToken(int index)
           
 void Identifier()
           
 void IfStatement()
           
 void ImportStatement()
           
 void Initialiser()
           
 void InitialiserNoIn()
           
 void IterationStatement()
           
 void JScriptVarDeclaration()
           
 void JScriptVarDeclarationList()
           
 void JScriptVarStatement()
           
 void LabelledStatement()
           
 void LeftHandSideExpression()
           
 void LeftHandSideExpressionForIn()
           
 void Literal()
           
 void LogicalANDExpression()
           
 void LogicalANDExpressionNoIn()
           
 void LogicalANDOperator()
           
 void LogicalORExpression()
           
 void LogicalORExpressionNoIn()
           
 void LogicalOROperator()
           
static void main(java.lang.String[] args)
           
 void MemberExpression()
           
 void MemberExpressionForIn()
           
 void MemberExpressionPart()
           
 void MultiplicativeExpression()
           
 void MultiplicativeOperator()
           
 void Name()
           
 void ObjectLiteral()
           
 void PostfixExpression()
           
 void PostfixOperator()
           
 void PrimaryExpression()
          ECMA SYNTACTIC GRAMMARS STARTS HERE *
 ASTProgram Program()
           
 void PropertyName()
           
 void PropertyNameAndValue()
           
 void PropertyNameAndValueList()
           
 void ReInit(EcmaScriptTokenManager tm)
           
 void ReInit(java.io.InputStream stream)
           
 void ReInit(java.io.InputStream stream, java.lang.String encoding)
           
 void ReInit(java.io.Reader stream)
           
 void RelationalExpression()
           
 void RelationalExpressionNoIn()
           
 void RelationalNoInOperator()
           
 void RelationalOperator()
           
 void ReturnStatement()
           
 void setLineOffset(int offset)
           
 void setTabSize(int size)
           
 void ShiftExpression()
           
 void ShiftOperator()
           
 void SourceElement()
           
 void SourceElements()
           
 void Statement()
           
 void StatementList()
           
 void SwitchStatement()
           
 void ThrowStatement()
           
 void TryStatement()
           
 void UnaryExpression()
           
 void UnaryOperator()
           
 void VariableDeclaration()
           
 void VariableDeclarationList()
           
 void VariableDeclarationListNoIn()
           
 void VariableDeclarationNoIn()
           
 void VariableStatement()
           
 void WithStatement()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jjtree

protected JJTEcmaScriptState jjtree

token_source

public EcmaScriptTokenManager token_source

token

public Token token

jj_nt

public Token jj_nt

lookingAhead

public boolean lookingAhead
Constructor Detail

EcmaScript

public EcmaScript(java.io.InputStream stream)

EcmaScript

public EcmaScript(java.io.InputStream stream,
                  java.lang.String encoding)

EcmaScript

public EcmaScript(java.io.Reader stream)

EcmaScript

public EcmaScript(EcmaScriptTokenManager tm)
Method Detail

main

public static void main(java.lang.String[] args)

getStartLocation

public sidekick.util.Location getStartLocation(Token t)

getEndLocation

public sidekick.util.Location getEndLocation(Token t)

setLineOffset

public void setLineOffset(int offset)

setTabSize

public void setTabSize(int size)

getTabSize

public int getTabSize()

getParseErrors

public java.util.List<sidekick.util.ParseError> getParseErrors()

PrimaryExpression

public final void PrimaryExpression()
                             throws ParseException
ECMA SYNTACTIC GRAMMARS STARTS HERE *

Throws:
ParseException

Literal

public final void Literal()
                   throws ParseException
Throws:
ParseException

Identifier

public final void Identifier()
                      throws ParseException
Throws:
ParseException

ArrayLiteral

public final void ArrayLiteral()
                        throws ParseException
Throws:
ParseException

ElementList

public final void ElementList()
                       throws ParseException
Throws:
ParseException

Elision

public final void Elision()
                   throws ParseException
Throws:
ParseException

ObjectLiteral

public final void ObjectLiteral()
                         throws ParseException
Throws:
ParseException

PropertyNameAndValueList

public final void PropertyNameAndValueList()
                                    throws ParseException
Throws:
ParseException

PropertyNameAndValue

public final void PropertyNameAndValue()
                                throws ParseException
Throws:
ParseException

PropertyName

public final void PropertyName()
                        throws ParseException
Throws:
ParseException

MemberExpression

public final void MemberExpression()
                            throws ParseException
Throws:
ParseException

MemberExpressionForIn

public final void MemberExpressionForIn()
                                 throws ParseException
Throws:
ParseException

AllocationExpression

public final void AllocationExpression()
                                throws ParseException
Throws:
ParseException

MemberExpressionPart

public final void MemberExpressionPart()
                                throws ParseException
Throws:
ParseException

CallExpression

public final void CallExpression()
                          throws ParseException
Throws:
ParseException

CallExpressionForIn

public final void CallExpressionForIn()
                               throws ParseException
Throws:
ParseException

CallExpressionPart

public final void CallExpressionPart()
                              throws ParseException
Throws:
ParseException

Arguments

public final void Arguments()
                     throws ParseException
Throws:
ParseException

ArgumentList

public final void ArgumentList()
                        throws ParseException
Throws:
ParseException

LeftHandSideExpression

public final void LeftHandSideExpression()
                                  throws ParseException
Throws:
ParseException

LeftHandSideExpressionForIn

public final void LeftHandSideExpressionForIn()
                                       throws ParseException
Throws:
ParseException

PostfixExpression

public final void PostfixExpression()
                             throws ParseException
Throws:
ParseException

PostfixOperator

public final void PostfixOperator()
                           throws ParseException
Throws:
ParseException

UnaryExpression

public final void UnaryExpression()
                           throws ParseException
Throws:
ParseException

UnaryOperator

public final void UnaryOperator()
                         throws ParseException
Throws:
ParseException

MultiplicativeExpression

public final void MultiplicativeExpression()
                                    throws ParseException
Throws:
ParseException

MultiplicativeOperator

public final void MultiplicativeOperator()
                                  throws ParseException
Throws:
ParseException

AdditiveExpression

public final void AdditiveExpression()
                              throws ParseException
Throws:
ParseException

AdditiveOperator

public final void AdditiveOperator()
                            throws ParseException
Throws:
ParseException

ShiftExpression

public final void ShiftExpression()
                           throws ParseException
Throws:
ParseException

ShiftOperator

public final void ShiftOperator()
                         throws ParseException
Throws:
ParseException

RelationalExpression

public final void RelationalExpression()
                                throws ParseException
Throws:
ParseException

RelationalOperator

public final void RelationalOperator()
                              throws ParseException
Throws:
ParseException

RelationalExpressionNoIn

public final void RelationalExpressionNoIn()
                                    throws ParseException
Throws:
ParseException

RelationalNoInOperator

public final void RelationalNoInOperator()
                                  throws ParseException
Throws:
ParseException

EqualityExpression

public final void EqualityExpression()
                              throws ParseException
Throws:
ParseException

EqualityExpressionNoIn

public final void EqualityExpressionNoIn()
                                  throws ParseException
Throws:
ParseException

EqualityOperator

public final void EqualityOperator()
                            throws ParseException
Throws:
ParseException

BitwiseANDExpression

public final void BitwiseANDExpression()
                                throws ParseException
Throws:
ParseException

BitwiseANDExpressionNoIn

public final void BitwiseANDExpressionNoIn()
                                    throws ParseException
Throws:
ParseException

BitwiseANDOperator

public final void BitwiseANDOperator()
                              throws ParseException
Throws:
ParseException

BitwiseXORExpression

public final void BitwiseXORExpression()
                                throws ParseException
Throws:
ParseException

BitwiseXORExpressionNoIn

public final void BitwiseXORExpressionNoIn()
                                    throws ParseException
Throws:
ParseException

BitwiseXOROperator

public final void BitwiseXOROperator()
                              throws ParseException
Throws:
ParseException

BitwiseORExpression

public final void BitwiseORExpression()
                               throws ParseException
Throws:
ParseException

BitwiseORExpressionNoIn

public final void BitwiseORExpressionNoIn()
                                   throws ParseException
Throws:
ParseException

BitwiseOROperator

public final void BitwiseOROperator()
                             throws ParseException
Throws:
ParseException

LogicalANDExpression

public final void LogicalANDExpression()
                                throws ParseException
Throws:
ParseException

LogicalANDExpressionNoIn

public final void LogicalANDExpressionNoIn()
                                    throws ParseException
Throws:
ParseException

LogicalANDOperator

public final void LogicalANDOperator()
                              throws ParseException
Throws:
ParseException

LogicalORExpression

public final void LogicalORExpression()
                               throws ParseException
Throws:
ParseException

LogicalORExpressionNoIn

public final void LogicalORExpressionNoIn()
                                   throws ParseException
Throws:
ParseException

LogicalOROperator

public final void LogicalOROperator()
                             throws ParseException
Throws:
ParseException

ConditionalExpression

public final void ConditionalExpression()
                                 throws ParseException
Throws:
ParseException

ConditionalExpressionNoIn

public final void ConditionalExpressionNoIn()
                                     throws ParseException
Throws:
ParseException

AssignmentExpression

public final void AssignmentExpression()
                                throws ParseException
Throws:
ParseException

AssignmentExpressionNoIn

public final void AssignmentExpressionNoIn()
                                    throws ParseException
Throws:
ParseException

AssignmentOperator

public final void AssignmentOperator()
                              throws ParseException
Throws:
ParseException

Expression

public final void Expression()
                      throws ParseException
Throws:
ParseException

ExpressionNoIn

public final void ExpressionNoIn()
                          throws ParseException
Throws:
ParseException

Statement

public final void Statement()
                     throws ParseException
Throws:
ParseException

Block

public final void Block()
                 throws ParseException
Throws:
ParseException

StatementList

public final void StatementList()
                         throws ParseException
Throws:
ParseException

VariableStatement

public final void VariableStatement()
                             throws ParseException
Throws:
ParseException

VariableDeclarationList

public final void VariableDeclarationList()
                                   throws ParseException
Throws:
ParseException

VariableDeclarationListNoIn

public final void VariableDeclarationListNoIn()
                                       throws ParseException
Throws:
ParseException

VariableDeclaration

public final void VariableDeclaration()
                               throws ParseException
Throws:
ParseException

VariableDeclarationNoIn

public final void VariableDeclarationNoIn()
                                   throws ParseException
Throws:
ParseException

Initialiser

public final void Initialiser()
                       throws ParseException
Throws:
ParseException

InitialiserNoIn

public final void InitialiserNoIn()
                           throws ParseException
Throws:
ParseException

EmptyStatement

public final void EmptyStatement()
                          throws ParseException
Throws:
ParseException

ExpressionStatement

public final void ExpressionStatement()
                               throws ParseException
Throws:
ParseException

IfStatement

public final void IfStatement()
                       throws ParseException
Throws:
ParseException

IterationStatement

public final void IterationStatement()
                              throws ParseException
Throws:
ParseException

ContinueStatement

public final void ContinueStatement()
                             throws ParseException
Throws:
ParseException

BreakStatement

public final void BreakStatement()
                          throws ParseException
Throws:
ParseException

ReturnStatement

public final void ReturnStatement()
                           throws ParseException
Throws:
ParseException

WithStatement

public final void WithStatement()
                         throws ParseException
Throws:
ParseException

SwitchStatement

public final void SwitchStatement()
                           throws ParseException
Throws:
ParseException

CaseBlock

public final void CaseBlock()
                     throws ParseException
Throws:
ParseException

CaseClauses

public final void CaseClauses()
                       throws ParseException
Throws:
ParseException

CaseClause

public final void CaseClause()
                      throws ParseException
Throws:
ParseException

DefaultClause

public final void DefaultClause()
                         throws ParseException
Throws:
ParseException

LabelledStatement

public final void LabelledStatement()
                             throws ParseException
Throws:
ParseException

ThrowStatement

public final void ThrowStatement()
                          throws ParseException
Throws:
ParseException

TryStatement

public final void TryStatement()
                        throws ParseException
Throws:
ParseException

Catch

public final void Catch()
                 throws ParseException
Throws:
ParseException

Finally

public final void Finally()
                   throws ParseException
Throws:
ParseException

FunctionDeclaration

public final void FunctionDeclaration()
                               throws ParseException
Throws:
ParseException

FunctionExpression

public final void FunctionExpression()
                              throws ParseException
Throws:
ParseException

FormalParameterList

public final void FormalParameterList()
                               throws ParseException
Throws:
ParseException

FunctionBody

public final void FunctionBody()
                        throws ParseException
Throws:
ParseException

Program

public final ASTProgram Program()
                         throws ParseException
Throws:
ParseException

SourceElements

public final void SourceElements()
                          throws ParseException
Throws:
ParseException

SourceElement

public final void SourceElement()
                         throws ParseException
Throws:
ParseException

ImportStatement

public final void ImportStatement()
                           throws ParseException
Throws:
ParseException

Name

public final void Name()
                throws ParseException
Throws:
ParseException

JScriptVarStatement

public final void JScriptVarStatement()
                               throws ParseException
Throws:
ParseException

JScriptVarDeclarationList

public final void JScriptVarDeclarationList()
                                     throws ParseException
Throws:
ParseException

JScriptVarDeclaration

public final void JScriptVarDeclaration()
                                 throws ParseException
Throws:
ParseException

ReInit

public void ReInit(java.io.InputStream stream)

ReInit

public void ReInit(java.io.InputStream stream,
                   java.lang.String encoding)

ReInit

public void ReInit(java.io.Reader stream)

ReInit

public void ReInit(EcmaScriptTokenManager tm)

getNextToken

public final Token getNextToken()

getToken

public final Token getToken(int index)

generateParseException

public ParseException generateParseException()

enable_tracing

public final void enable_tracing()

disable_tracing

public final void disable_tracing()