/bundles/plugins-trunk/XML/sidekick/ecmascript/parser/EcmaScript.java
Java | 2234 lines | 1891 code | 63 blank | 280 comment | 254 complexity | 0ef31a8dd1234ab49f5b16b50109c04b MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
- /* Generated By:JJTree&JavaCC: Do not edit this line. EcmaScript.java */
- package sidekick.ecmascript.parser;
- import java.io.*;
- import java.util.*;
- import java.util.regex.*;
- import sidekick.util.*;
- public class EcmaScript/*@bgen(jjtree)*/implements EcmaScriptTreeConstants, EcmaScriptConstants {/*@bgen(jjtree)*/
- protected JJTEcmaScriptState jjtree = new JJTEcmaScriptState();
- private int lineOffset = 0;
- private List<ParseError> parseErrors = new ArrayList<ParseError>();
- public static void main(String args[]){
- EcmaScript parser;
- if(args.length == 0){
- System.out.println("EcmaScript Parser: Reading from standard input . . .");
- parser = new EcmaScript(System.in);
- } else if(args.length == 1){
- System.out.println("EcmaScript Parser: Reading from file " + args[0] + " . . .");
- try {
- parser = new EcmaScript(new FileInputStream(args[0]), "UTF-8");
- } catch(java.io.FileNotFoundException e){
- System.out.println("EcmaScript Parser: File " + args[0] + " not found.");
- return;
- }
- } else {
- System.out.println("EcmaScript Parser: Usage is one of:");
- System.out.println(" EcmaScript < inputfile");
- System.out.println("OR");
- System.out.println(" EcmaScript inputfile");
- return;
- }
- try {
- SimpleNode n = parser.Program();
- System.out.println("EcmaScript parser: EcmaScript program parsed successfully.");
- } catch (ParseException e) {
- System.out.println(e.getMessage());
- System.out.println("EcmaScript parser: Encountered errors during parse.");
- }
- }
- void jjtreeOpenNodeScope(Node n){
- Token t = getToken(1);
- if(t != null){
- ((SimpleNode) n).setBeginToken(t);
- ((SimpleNode) n).setStartLocation(getStartLocation(t));
- }
- }
- void jjtreeCloseNodeScope(Node n){
- Token t = getToken(0);
- if(t != null){
- ((SimpleNode) n).setEndToken(t);
- ((SimpleNode) n).setEndLocation(getEndLocation(t));
- }
- }
- public Location getStartLocation(Token t) {
- if (t == null)
- return new Location(0 + lineOffset, 0);
- return new Location(t.beginLine + lineOffset, t.beginColumn);
- }
- public Location getEndLocation(Token t) {
- if (t == null)
- return new Location(0 + lineOffset, 0);
- return new Location(t.endLine + lineOffset, t.endColumn + 1);
- }
- public void setLineOffset(int offset) {
- lineOffset = offset > 0 ? offset : 0;
- }
- public void setTabSize(int size) {
- jj_input_stream.setTabSize(size);
- }
- public int getTabSize() {
- return jj_input_stream.getTabSize(0);
- }
- private void addException(ParseException pe) {
- // check for a jsp tag, these can appear in several places and will cause
- // a parse error, but they can be ignored. It's easier to catch them and
- // ignore them than rewrite the grammar to allow them in all the appropriate
- // places.
- Token t = pe.currentToken;
- if (t != null) {
- if (t.next != null && t.next.image.startsWith("<%")) {
- return;
- }
- }
- Range range = getExceptionLocation( pe );
- parseErrors.add(new ParseError(pe.getMessage(), range));
- }
- public List<ParseError> getParseErrors() {
- return parseErrors;
- }
- /**
- * @return attempts to return a Location indicating the location of a parser
- * exception. If the ParseException contains a Token reference, all is well,
- * otherwise, this method attempts to parse the message string for the
- * exception.
- */
- private Range getExceptionLocation( ParseException pe ) {
- Token t = pe.currentToken;
- if ( t != null ) {
- return new Range( new Location( t.next.beginLine + lineOffset, t.next.beginColumn ), new Location( t.next.endLine + lineOffset, t.next.endColumn ) );
- }
- // ParseException message look like: "Parse error at line 116, column 5. Encountered: }"
- try {
- Pattern p = Pattern.compile( "(.*?)(\\d+)(.*?)(\\d+)(.*?)" );
- Matcher m = p.matcher( pe.getMessage() );
- if ( m.matches() ) {
- String ln = m.group( 2 );
- String cn = m.group( 4 );
- int line_number = -1;
- int column_number = 0;
- if ( ln != null )
- line_number = Integer.parseInt( ln );
- if ( cn != null )
- column_number = Integer.parseInt( cn );
- return line_number > -1 ? new Range( new Location( line_number + lineOffset, column_number - 1 ), new Location( line_number + lineOffset, column_number ) ) : null;
- }
- return new Range();
- }
- catch ( Exception e ) {
- //e.printStackTrace();
- return new Range();
- }
- }
- /*
-
- <DEFAULT>
- TOKEN:
- {
- < REGULAR_EXPRESSION_LITERAL:
- "/" <REGULAR_EXPRESSION_BODY> "/" <REGULAR_EXPRESSION_FLAGS>
- > : IN_REGEX
- |
- < #REGULAR_EXPRESSION_BODY: <REGULAR_EXPRESSION_FIRSTCHAR> <REGULAR_EXPRESSION_CHARS> >
- |
- < #REGULAR_EXPRESSION_CHARS: (<REGULAR_EXPRESSION_CHAR>)* >
- |
- < #REGULAR_EXPRESSION_FIRSTCHAR:
- // ~["*","\\","/"] <NON_TERMINATOR>
- <NON_TERMINATOR_FIRSTCHAR>
- | <BACKSLASH_SEQUENCE>
- >
- |
- < #REGULAR_EXPRESSION_CHAR:
- //~["\\","/"] <NON_TERMINATOR> <NON_TERMINATOR_CHAR>
- | <BACKSLASH_SEQUENCE>
- >
- |
- < #BACKSLASH_SEQUENCE: "\\" <NON_TERMINATOR> >
- |
- < #NON_TERMINATOR_FIRSTCHAR: ~["\n","\r","?","?","*","\\","/"] >
- |
- < #NON_TERMINATOR_CHAR: ~["\n","\r","?","?","\\","/"] >
- |
- < #NON_TERMINATOR: ~["\n","\r","?","?"] >
- |
- < #REGULAR_EXPRESSION_FLAGS: (<IDENTIFIER_PART>)* >
- }
-
- */
- /*****************************************
- * NUMERIC STRING GRAMMAR STARTS HERE *
- *****************************************/
- /* Section 9.3: String-to-Number Conversion */
- /*
- MORE:
- {
- <STRING_NUMERIC_LITERAL: (<STR_WHITESPACE>)? (<STR_NUMERIC_LITERAL> (<STR_WHITESPACE>)?)? >
- }
-
- MORE:
- {
- < STR_WHITESPACE: (<STR_WHITESPACE_CHAR>)+ >
- }
-
- MORE:
- {
- < STR_WHITESPACE_CHAR:
- <TAB>
- | <SP>
- | <NBSP>
- | <FF>
- | <VT>
- | <CR>
- | <LF>
- | <LS>
- | <PS>
- | <USP>
- >
- }
-
-
- MORE:
- {
- < STR_NUMERIC_LITERAL:
- <STR_DECIMAL_LITERAL> | <HEX_INTEGER_LITERAL>
- >
- }
-
- MORE:
- {
- <STR_DECIMAL_LITERAL: <STR_UNSIGNED_DECIMAL_LITERAL> ("+" | "-") <STR_UNSIGNED_DECIMAL_LITERAL> >
- }
-
- MORE:
- {
- < STR_UNSIGNED_DECIMAL_LITERAL:
- "Infinity"
- | <DECIMAL_DIGITS> "." (<DECIMAL_DIGITS>)* (<EXPONENT_PART>)*
- >
- }
-
- */
- /* A.6 Universal Resource Identifier Character Classes */
- /*
-
- TOKEN:
- {
- < URIRESERVED : [";" , "/" , "?" , ":" , "@" , "&" , "=" , "+" , "$" , ","] >
- }
-
- TOKEN:
- {
- < URI_ALPHA : ["a"-"z","A"-"Z"] >
- }
-
- TOKEN:
- {
- < URI_MARK : ["-" , "_" , "." , "!" , "~" , "*" , "'" , "(" , ")"] >
- }
-
- void uri() :
- {}
- {
- (uriCharacters())?
- }
-
- void uriCharacters() :
- {}
- {
- (uriCharacter())+
- }
-
- void uriCharacter() :
- {}
- {
- <URIRESERVED>
- | uriUnescaped()
- | uriEscaped()
- }
-
- void uriUnescaped() :
- {}
- {
- <URI_ALPHA>
- | <DECIMAL_DIGIT>
- | <URI_MARK>
- }
-
- void uriEscaped() :
- {}
- {
- "%" <HEX_DIGIT> <HEX_DIGIT>
- }
-
- */
- /* A.7 Regular Expressions */
- /*
-
- MORE :
- {
- "/^" : INSIDE_PATTERN
- }
-
- <INSIDE_PATTERN, IN_PATTERN>
- TOKEN:
- {
- < PATTERN : <DISJUNCTION> > : DEFAULT
- |
- < #DISJUNCTION : (<ALTERNATIVE>)+ >
- |
- < #ALTERNATIVE : (<TERM>)* >
- |
- < #TERM : <ASSERTION> | <ATOM> (<QUANTIFIER>)? >
- |
- < #ASSERTION :
- "^"
- | "$"
- | "\\" ("b" | "B")
- >
- |
- < #QUANTIFIER : <QUANTIFIERPREFIX> ("?")? >
- |
- < #QUANTIFIERPREFIX : "*" | "+" | "?" | ( "{" <DECIMAL_DIGITS> ("," (<DECIMAL_DIGITS>)?)? "}" ) >
- |
- < #ATOM :
- <PATTERN_CHARACTER>
- | "."
- | "\\" <ATOMESCAPE>
- | <CHARACTERCLASS>
- //| "(" ("?" (":" | "=" | "!"))? <DISJUNCTION> ")"
- | "(" ("?" (":" | "=" | "!"))? ")"
- >
- |
- < #PATTERN_CHARACTER : ~["^", "$", "\\", ".", "*", "+", "?", "(", ")", "[", "]", "{", "}", "|"] >
- |
- < #ATOMESCAPE : <DECIMALESCAPE> | <CHARACTERESCAPE> | <CHARACTER_CLASS_ESCAPE> >
- |
- < #CHARACTER_CLASS_ESCAPE : ["d", "D", "s", "S", "w", "W"] >
- |
- < #CHARACTERESCAPE :
- <CONTROL_ESCAPE>
- | "c" <CONTROL_LETTER>
- | <HEX_ESCAPE_SEQUENCE>
- | <UNICODE_ESCAPE_SEQUENCE>
- | <IDENTITY_ESCAPE>
- >
- |
- < #CONTROL_ESCAPE : ["f" , "n" , "r" , "t" , "v"] >
- |
- < #CONTROL_LETTER : ["a"-"z","A"-"Z"] >
- |
- < #IDENTITY_ESCAPE : ~["0"-"9", "A"-"Z", "a"-"z","-"] >
- |
- < #DECIMALESCAPE : <DECIMAL_INTEGER_LITERAL> >
- |
- < #CHARACTERCLASS : "[" ("^")? <CLASSRANGES> "]" >
- |
- < #CLASSRANGES : (<NONEMPTYCLASSRANGES>)? >
- |
- //< #NONEMPTYCLASSRANGES : <CLASSATOM> (<NONEMPTYCLASSRANGESNODASH> | "-" <CLASSATOM> <CLASSRANGES>) >
- < #NONEMPTYCLASSRANGES : <CLASSATOM> (<NONEMPTYCLASSRANGESNODASH> | "-" <CLASSATOM>) >
- |
- //< #NONEMPTYCLASSRANGESNODASH : <CLASSATOM> | <CLASSATOMNODASH> ( <NONEMPTYCLASSRANGESNODASH> | "-" <CLASSATOM> <CLASSRANGES> ) >
- < #NONEMPTYCLASSRANGESNODASH : <CLASSATOM> | <CLASSATOMNODASH> ( <CLASSATOM> | "-" <CLASSATOM> ) >
- |
- < #CLASSATOM : "-" <CLASSATOMNODASH> >
- |
- < #CLASSATOMNODASH : <CLASS_ATOM_NODASH_TOKEN> | "\\" <CLASSESCAPE> >
- |
- < #CLASS_ATOM_NODASH_TOKEN : ~["\\", "]", "-"] >
- |
- < #CLASSESCAPE :
- <DECIMALESCAPE>
- | "b"
- | <CHARACTERESCAPE>
- | <CHARACTER_CLASS_ESCAPE>
- >
- }
-
- */
- /*****************************************
- * ECMA SYNTACTIC GRAMMARS STARTS HERE *
- *****************************************/
- /* Section 11.1: Primary Expressions */
- final public void PrimaryExpression() throws ParseException {
- try {
- if (jj_2_1(2147483647)) {
- ASTThisReference jjtn001 = new ASTThisReference(JJTTHISREFERENCE);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- jjtreeOpenNodeScope(jjtn001);
- try {
- jj_consume_token(THIS);
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, true);
- jjtreeCloseNodeScope(jjtn001);
- }
- }
- } else if (jj_2_2(2147483647)) {
- ObjectLiteral();
- } else if (jj_2_3(2147483647)) {
- ASTParenExpression jjtn002 = new ASTParenExpression(JJTPARENEXPRESSION);
- boolean jjtc002 = true;
- jjtree.openNodeScope(jjtn002);
- jjtreeOpenNodeScope(jjtn002);
- try {
- jj_consume_token(LPAREN);
- Expression();
- jj_consume_token(RPAREN);
- } catch (Throwable jjte002) {
- if (jjtc002) {
- jjtree.clearNodeScope(jjtn002);
- jjtc002 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte002 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte002;}
- }
- if (jjte002 instanceof ParseException) {
- {if (true) throw (ParseException)jjte002;}
- }
- {if (true) throw (Error)jjte002;}
- } finally {
- if (jjtc002) {
- jjtree.closeNodeScope(jjtn002, true);
- jjtreeCloseNodeScope(jjtn002);
- }
- }
- } else if (jj_2_4(2147483647)) {
- Identifier();
- } else if (jj_2_5(2147483647)) {
- ArrayLiteral();
- } else if (jj_2_6(2)) {
- Literal();
- } else {
- jj_consume_token(-1);
- throw new ParseException();
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- }
- /* Section 7.8: Literals */
- final public void Literal() throws ParseException {
- /*@bgen(jjtree) Literal */
- ASTLiteral jjtn000 = new ASTLiteral(JJTLITERAL);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);Token t;
- Map objLiteral;
- List arrayLiteral;
- try {
- try {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case DECIMAL_LITERAL:
- t = jj_consume_token(DECIMAL_LITERAL);
- jjtree.closeNodeScope(jjtn000, true);
- jjtc000 = false;
- jjtreeCloseNodeScope(jjtn000);
- jjtn000.setDecimalValue(t.image);
- break;
- case HEX_INTEGER_LITERAL:
- t = jj_consume_token(HEX_INTEGER_LITERAL);
- jjtree.closeNodeScope(jjtn000, true);
- jjtc000 = false;
- jjtreeCloseNodeScope(jjtn000);
- jjtn000.setHexValue(t.image);
- break;
- case STRING_LITERAL:
- t = jj_consume_token(STRING_LITERAL);
- jjtree.closeNodeScope(jjtn000, true);
- jjtc000 = false;
- jjtreeCloseNodeScope(jjtn000);
- jjtn000.setStringValue(t.image);
- break;
- case BOOLEAN_LITERAL:
- t = jj_consume_token(BOOLEAN_LITERAL);
- jjtree.closeNodeScope(jjtn000, true);
- jjtc000 = false;
- jjtreeCloseNodeScope(jjtn000);
- jjtn000.setBooleanValue(t.image);
- break;
- case NULL_LITERAL:
- t = jj_consume_token(NULL_LITERAL);
- jjtree.closeNodeScope(jjtn000, true);
- jjtc000 = false;
- jjtreeCloseNodeScope(jjtn000);
- jjtn000.setNullValue();
- break;
- case REGULAR_EXPRESSION_LITERAL:
- t = jj_consume_token(REGULAR_EXPRESSION_LITERAL);
- jjtree.closeNodeScope(jjtn000, true);
- jjtc000 = false;
- jjtreeCloseNodeScope(jjtn000);
- jjtn000.setRegexValue(t.image);
- break;
- default:
- jj_la1[0] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- final public void Identifier() throws ParseException {
- /*@bgen(jjtree) Identifier */
- ASTIdentifier jjtn000 = new ASTIdentifier(JJTIDENTIFIER);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);Token t;
- try {
- try {
- t = jj_consume_token(IDENTIFIER_NAME);
- jjtree.closeNodeScope(jjtn000, true);
- jjtc000 = false;
- jjtreeCloseNodeScope(jjtn000);
- jjtn000.setName(t.image);
- } catch (ParseException pe) {
- addException(pe);
- }
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- /* Section 11.1.4: Array Initialiser */
- final public void ArrayLiteral() throws ParseException {
- /*@bgen(jjtree) ArrayLiteral */
- ASTArrayLiteral jjtn000 = new ASTArrayLiteral(JJTARRAYLITERAL);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- try {
- jj_consume_token(LBRACKET);
- if (jj_2_7(2)) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
- Elision();
- break;
- default:
- jj_la1[1] = jj_gen;
- ;
- }
- jj_consume_token(RBRACKET);
- } else if (jj_2_8(2147483647)) {
- ElementList();
- Elision();
- jj_consume_token(RBRACKET);
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case DELETE:
- case FUNCTION:
- case NEW:
- case THIS:
- case TYPEOF:
- case VOID:
- case LBRACE:
- case LPAREN:
- case LBRACKET:
- case RBRACKET:
- case COMMA:
- case PLUS:
- case MINUS:
- case INCR:
- case DECR:
- case BANG:
- case TILDE:
- case DECIMAL_LITERAL:
- case HEX_INTEGER_LITERAL:
- case NULL_LITERAL:
- case BOOLEAN_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER_NAME:
- case REGULAR_EXPRESSION_LITERAL:
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case DELETE:
- case FUNCTION:
- case NEW:
- case THIS:
- case TYPEOF:
- case VOID:
- case LBRACE:
- case LPAREN:
- case LBRACKET:
- case COMMA:
- case PLUS:
- case MINUS:
- case INCR:
- case DECR:
- case BANG:
- case TILDE:
- case DECIMAL_LITERAL:
- case HEX_INTEGER_LITERAL:
- case NULL_LITERAL:
- case BOOLEAN_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER_NAME:
- case REGULAR_EXPRESSION_LITERAL:
- ElementList();
- break;
- default:
- jj_la1[2] = jj_gen;
- ;
- }
- jj_consume_token(RBRACKET);
- break;
- default:
- jj_la1[3] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte000;}
- }
- if (jjte000 instanceof ParseException) {
- {if (true) throw (ParseException)jjte000;}
- }
- {if (true) throw (Error)jjte000;}
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- final public void ElementList() throws ParseException {
- try {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
- Elision();
- break;
- default:
- jj_la1[4] = jj_gen;
- ;
- }
- AssignmentExpression();
- label_1:
- while (true) {
- if (jj_2_9(2147483647)) {
- ;
- } else {
- break label_1;
- }
- Elision();
- AssignmentExpression();
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- }
- final public void Elision() throws ParseException {
- try {
- label_2:
- while (true) {
- jj_consume_token(COMMA);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
- ;
- break;
- default:
- jj_la1[5] = jj_gen;
- break label_2;
- }
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- }
- /* Section 11.1.5: Object Initialiser */
- final public void ObjectLiteral() throws ParseException {
- /*@bgen(jjtree) ObjectLiteral */
- ASTObjectLiteral jjtn000 = new ASTObjectLiteral(JJTOBJECTLITERAL);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- try {
- jj_consume_token(LBRACE);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case DECIMAL_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER_NAME:
- PropertyNameAndValueList();
- break;
- default:
- jj_la1[6] = jj_gen;
- ;
- }
- jj_consume_token(RBRACE);
- } catch (ParseException pe) {
- addException(pe);
- }
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte000;}
- }
- if (jjte000 instanceof ParseException) {
- {if (true) throw (ParseException)jjte000;}
- }
- {if (true) throw (Error)jjte000;}
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- final public void PropertyNameAndValueList() throws ParseException {
- try {
- PropertyNameAndValue();
- label_3:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
- ;
- break;
- default:
- jj_la1[7] = jj_gen;
- break label_3;
- }
- if (jj_2_10(2147483647)) {
- jj_consume_token(COMMA);
- PropertyNameAndValue();
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
- jj_consume_token(COMMA);
- break;
- default:
- jj_la1[8] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- }
- final public void PropertyNameAndValue() throws ParseException {
- /*@bgen(jjtree) LiteralField */
- ASTLiteralField jjtn000 = new ASTLiteralField(JJTLITERALFIELD);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- try {
- PropertyName();
- jj_consume_token(COLON);
- if (jj_2_11(2147483647)) {
- FunctionExpression();
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case DELETE:
- case FUNCTION:
- case NEW:
- case THIS:
- case TYPEOF:
- case VOID:
- case LBRACE:
- case LPAREN:
- case LBRACKET:
- case PLUS:
- case MINUS:
- case INCR:
- case DECR:
- case BANG:
- case TILDE:
- case DECIMAL_LITERAL:
- case HEX_INTEGER_LITERAL:
- case NULL_LITERAL:
- case BOOLEAN_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER_NAME:
- case REGULAR_EXPRESSION_LITERAL:
- AssignmentExpression();
- break;
- default:
- jj_la1[9] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte000;}
- }
- if (jjte000 instanceof ParseException) {
- {if (true) throw (ParseException)jjte000;}
- }
- {if (true) throw (Error)jjte000;}
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- final public void PropertyName() throws ParseException {
- try {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case IDENTIFIER_NAME:
- Identifier();
- break;
- case STRING_LITERAL:
- ASTLiteral jjtn001 = new ASTLiteral(JJTLITERAL);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- jjtreeOpenNodeScope(jjtn001);
- try {
- jj_consume_token(STRING_LITERAL);
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, true);
- jjtreeCloseNodeScope(jjtn001);
- }
- }
- break;
- case DECIMAL_LITERAL:
- ASTLiteral jjtn002 = new ASTLiteral(JJTLITERAL);
- boolean jjtc002 = true;
- jjtree.openNodeScope(jjtn002);
- jjtreeOpenNodeScope(jjtn002);
- try {
- jj_consume_token(DECIMAL_LITERAL);
- } finally {
- if (jjtc002) {
- jjtree.closeNodeScope(jjtn002, true);
- jjtreeCloseNodeScope(jjtn002);
- }
- }
- break;
- default:
- jj_la1[10] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- }
- /* Section 11.2: Left-Hand-Side Expressions */
- final public void MemberExpression() throws ParseException {
- try {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case FUNCTION:
- case THIS:
- case LBRACE:
- case LPAREN:
- case LBRACKET:
- case DECIMAL_LITERAL:
- case HEX_INTEGER_LITERAL:
- case NULL_LITERAL:
- case BOOLEAN_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER_NAME:
- case REGULAR_EXPRESSION_LITERAL:
- ASTCompositeReference jjtn001 = new ASTCompositeReference(JJTCOMPOSITEREFERENCE);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- jjtreeOpenNodeScope(jjtn001);
- try {
- if (jj_2_12(2147483647)) {
- FunctionExpression();
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case THIS:
- case LBRACE:
- case LPAREN:
- case LBRACKET:
- case DECIMAL_LITERAL:
- case HEX_INTEGER_LITERAL:
- case NULL_LITERAL:
- case BOOLEAN_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER_NAME:
- case REGULAR_EXPRESSION_LITERAL:
- PrimaryExpression();
- break;
- default:
- jj_la1[11] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- label_4:
- while (true) {
- if (jj_2_13(2)) {
- ;
- } else {
- break label_4;
- }
- MemberExpressionPart();
- }
- } catch (Throwable jjte001) {
- if (jjtc001) {
- jjtree.clearNodeScope(jjtn001);
- jjtc001 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte001 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte001;}
- }
- if (jjte001 instanceof ParseException) {
- {if (true) throw (ParseException)jjte001;}
- }
- {if (true) throw (Error)jjte001;}
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, jjtree.nodeArity() > 1);
- jjtreeCloseNodeScope(jjtn001);
- }
- }
- break;
- case NEW:
- AllocationExpression();
- break;
- default:
- jj_la1[12] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- }
- final public void MemberExpressionForIn() throws ParseException {
- try {
- ASTCompositeReference jjtn001 = new ASTCompositeReference(JJTCOMPOSITEREFERENCE);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- jjtreeOpenNodeScope(jjtn001);
- try {
- if (jj_2_14(2147483647)) {
- FunctionExpression();
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case THIS:
- case LBRACE:
- case LPAREN:
- case LBRACKET:
- case DECIMAL_LITERAL:
- case HEX_INTEGER_LITERAL:
- case NULL_LITERAL:
- case BOOLEAN_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER_NAME:
- case REGULAR_EXPRESSION_LITERAL:
- PrimaryExpression();
- break;
- default:
- jj_la1[13] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- label_5:
- while (true) {
- if (jj_2_15(2)) {
- ;
- } else {
- break label_5;
- }
- MemberExpressionPart();
- }
- } catch (Throwable jjte001) {
- if (jjtc001) {
- jjtree.clearNodeScope(jjtn001);
- jjtc001 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte001 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte001;}
- }
- if (jjte001 instanceof ParseException) {
- {if (true) throw (ParseException)jjte001;}
- }
- {if (true) throw (Error)jjte001;}
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, jjtree.nodeArity() > 1);
- jjtreeCloseNodeScope(jjtn001);
- }
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- }
- final public void AllocationExpression() throws ParseException {
- /*@bgen(jjtree) AllocationExpression */
- ASTAllocationExpression jjtn000 = new ASTAllocationExpression(JJTALLOCATIONEXPRESSION);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- try {
- ASTCompositeReference jjtn001 = new ASTCompositeReference(JJTCOMPOSITEREFERENCE);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- jjtreeOpenNodeScope(jjtn001);
- try {
- jj_consume_token(NEW);
- MemberExpression();
- label_6:
- while (true) {
- if (jj_2_16(2147483647)) {
- ;
- } else {
- break label_6;
- }
- Arguments();
- label_7:
- while (true) {
- if (jj_2_17(2)) {
- ;
- } else {
- break label_7;
- }
- MemberExpressionPart();
- }
- }
- } catch (Throwable jjte001) {
- if (jjtc001) {
- jjtree.clearNodeScope(jjtn001);
- jjtc001 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte001 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte001;}
- }
- if (jjte001 instanceof ParseException) {
- {if (true) throw (ParseException)jjte001;}
- }
- {if (true) throw (Error)jjte001;}
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, jjtree.nodeArity() > 1);
- jjtreeCloseNodeScope(jjtn001);
- }
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte000;}
- }
- if (jjte000 instanceof ParseException) {
- {if (true) throw (ParseException)jjte000;}
- }
- {if (true) throw (Error)jjte000;}
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- final public void MemberExpressionPart() throws ParseException {
- try {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LBRACKET:
- ASTPropertyValueReference jjtn001 = new ASTPropertyValueReference(JJTPROPERTYVALUEREFERENCE);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- jjtreeOpenNodeScope(jjtn001);
- try {
- jj_consume_token(LBRACKET);
- Expression();
- jj_consume_token(RBRACKET);
- } catch (Throwable jjte001) {
- if (jjtc001) {
- jjtree.clearNodeScope(jjtn001);
- jjtc001 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte001 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte001;}
- }
- if (jjte001 instanceof ParseException) {
- {if (true) throw (ParseException)jjte001;}
- }
- {if (true) throw (Error)jjte001;}
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, true);
- jjtreeCloseNodeScope(jjtn001);
- }
- }
- break;
- case DOT:
- ASTPropertyIdentifierReference jjtn002 = new ASTPropertyIdentifierReference(JJTPROPERTYIDENTIFIERREFERENCE);
- boolean jjtc002 = true;
- jjtree.openNodeScope(jjtn002);
- jjtreeOpenNodeScope(jjtn002);
- try {
- jj_consume_token(DOT);
- Identifier();
- } catch (Throwable jjte002) {
- if (jjtc002) {
- jjtree.clearNodeScope(jjtn002);
- jjtc002 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte002 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte002;}
- }
- if (jjte002 instanceof ParseException) {
- {if (true) throw (ParseException)jjte002;}
- }
- {if (true) throw (Error)jjte002;}
- } finally {
- if (jjtc002) {
- jjtree.closeNodeScope(jjtn002, true);
- jjtreeCloseNodeScope(jjtn002);
- }
- }
- break;
- default:
- jj_la1[14] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- }
- final public void CallExpression() throws ParseException {
- /*@bgen(jjtree) #CompositeReference(> 1) */
- ASTCompositeReference jjtn000 = new ASTCompositeReference(JJTCOMPOSITEREFERENCE);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- try {
- MemberExpression();
- Arguments();
- label_8:
- while (true) {
- if (jj_2_18(2)) {
- ;
- } else {
- break label_8;
- }
- CallExpressionPart();
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte000;}
- }
- if (jjte000 instanceof ParseException) {
- {if (true) throw (ParseException)jjte000;}
- }
- {if (true) throw (Error)jjte000;}
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- final public void CallExpressionForIn() throws ParseException {
- /*@bgen(jjtree) #CompositeReference(> 1) */
- ASTCompositeReference jjtn000 = new ASTCompositeReference(JJTCOMPOSITEREFERENCE);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- try {
- MemberExpressionForIn();
- Arguments();
- label_9:
- while (true) {
- if (jj_2_19(2)) {
- ;
- } else {
- break label_9;
- }
- CallExpressionPart();
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte000;}
- }
- if (jjte000 instanceof ParseException) {
- {if (true) throw (ParseException)jjte000;}
- }
- {if (true) throw (Error)jjte000;}
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- final public void CallExpressionPart() throws ParseException {
- try {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LPAREN:
- Arguments();
- break;
- case LBRACKET:
- ASTPropertyValueReference jjtn001 = new ASTPropertyValueReference(JJTPROPERTYVALUEREFERENCE);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- jjtreeOpenNodeScope(jjtn001);
- try {
- jj_consume_token(LBRACKET);
- Expression();
- jj_consume_token(RBRACKET);
- } catch (Throwable jjte001) {
- if (jjtc001) {
- jjtree.clearNodeScope(jjtn001);
- jjtc001 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte001 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte001;}
- }
- if (jjte001 instanceof ParseException) {
- {if (true) throw (ParseException)jjte001;}
- }
- {if (true) throw (Error)jjte001;}
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, true);
- jjtreeCloseNodeScope(jjtn001);
- }
- }
- break;
- case DOT:
- ASTPropertyIdentifierReference jjtn002 = new ASTPropertyIdentifierReference(JJTPROPERTYIDENTIFIERREFERENCE);
- boolean jjtc002 = true;
- jjtree.openNodeScope(jjtn002);
- jjtreeOpenNodeScope(jjtn002);
- try {
- jj_consume_token(DOT);
- Identifier();
- } catch (Throwable jjte002) {
- if (jjtc002) {
- jjtree.clearNodeScope(jjtn002);
- jjtc002 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte002 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte002;}
- }
- if (jjte002 instanceof ParseException) {
- {if (true) throw (ParseException)jjte002;}
- }
- {if (true) throw (Error)jjte002;}
- } finally {
- if (jjtc002) {
- jjtree.closeNodeScope(jjtn002, true);
- jjtreeCloseNodeScope(jjtn002);
- }
- }
- break;
- default:
- jj_la1[15] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- }
- final public void Arguments() throws ParseException {
- /*@bgen(jjtree) FunctionCallParameters */
- ASTFunctionCallParameters jjtn000 = new ASTFunctionCallParameters(JJTFUNCTIONCALLPARAMETERS);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- try {
- jj_consume_token(LPAREN);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case DELETE:
- case FUNCTION:
- case NEW:
- case THIS:
- case TYPEOF:
- case VOID:
- case LBRACE:
- case LPAREN:
- case LBRACKET:
- case PLUS:
- case MINUS:
- case INCR:
- case DECR:
- case BANG:
- case TILDE:
- case DECIMAL_LITERAL:
- case HEX_INTEGER_LITERAL:
- case NULL_LITERAL:
- case BOOLEAN_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER_NAME:
- case REGULAR_EXPRESSION_LITERAL:
- ArgumentList();
- break;
- default:
- jj_la1[16] = jj_gen;
- ;
- }
- jj_consume_token(RPAREN);
- } catch (ParseException pe) {
- addException(pe);
- }
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte000;}
- }
- if (jjte000 instanceof ParseException) {
- {if (true) throw (ParseException)jjte000;}
- }
- {if (true) throw (Error)jjte000;}
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- final public void ArgumentList() throws ParseException {
- try {
- AssignmentExpression();
- label_10:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
- ;
- break;
- default:
- jj_la1[17] = jj_gen;
- break label_10;
- }
- jj_consume_token(COMMA);
- AssignmentExpression();
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- }
- final public void LeftHandSideExpression() throws ParseException {
- try {
- if (jj_2_20(2147483647)) {
- CallExpression();
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case FUNCTION:
- case NEW:
- case THIS:
- case LBRACE:
- case LPAREN:
- case LBRACKET:
- case DECIMAL_LITERAL:
- case HEX_INTEGER_LITERAL:
- case NULL_LITERAL:
- case BOOLEAN_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER_NAME:
- case REGULAR_EXPRESSION_LITERAL:
- MemberExpression();
- break;
- default:
- jj_la1[18] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- }
- final public void LeftHandSideExpressionForIn() throws ParseException {
- try {
- if (jj_2_21(2147483647)) {
- CallExpressionForIn();
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case FUNCTION:
- case THIS:
- case LBRACE:
- case LPAREN:
- case LBRACKET:
- case DECIMAL_LITERAL:
- case HEX_INTEGER_LITERAL:
- case NULL_LITERAL:
- case BOOLEAN_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER_NAME:
- case REGULAR_EXPRESSION_LITERAL:
- MemberExpressionForIn();
- break;
- default:
- jj_la1[19] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- }
- /* Section 11.3 Postfix Expressions */
- final public void PostfixExpression() throws ParseException {
- /*@bgen(jjtree) #PostfixExpression(> 1) */
- ASTPostfixExpression jjtn000 = new ASTPostfixExpression(JJTPOSTFIXEXPRESSION);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- try {
- LeftHandSideExpression();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case INCR:
- case DECR:
- PostfixOperator();
- break;
- default:
- jj_la1[20] = jj_gen;
- ;
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte000;}
- }
- if (jjte000 instanceof ParseException) {
- {if (true) throw (ParseException)jjte000;}
- }
- {if (true) throw (Error)jjte000;}
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- final public void PostfixOperator() throws ParseException {
- /*@bgen(jjtree) Operator */
- ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- try {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case INCR:
- jj_consume_token(INCR);
- break;
- case DECR:
- jj_consume_token(DECR);
- break;
- default:
- jj_la1[21] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- /* Section 11.4 Unary Operators */
- final public void UnaryExpression() throws ParseException {
- /*@bgen(jjtree) #UnaryExpression(> 1) */
- ASTUnaryExpression jjtn000 = new ASTUnaryExpression(JJTUNARYEXPRESSION);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- try {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case FUNCTION:
- case NEW:
- case THIS:
- case LBRACE:
- case LPAREN:
- case LBRACKET:
- case DECIMAL_LITERAL:
- case HEX_INTEGER_LITERAL:
- case NULL_LITERAL:
- case BOOLEAN_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER_NAME:
- case REGULAR_EXPRESSION_LITERAL:
- PostfixExpression();
- break;
- case DELETE:
- case TYPEOF:
- case VOID:
- case PLUS:
- case MINUS:
- case INCR:
- case DECR:
- case BANG:
- case TILDE:
- label_11:
- while (true) {
- UnaryOperator();
- UnaryExpression();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case DELETE:
- case TYPEOF:
- case VOID:
- case PLUS:
- case MINUS:
- case INCR:
- case DECR:
- case BANG:
- case TILDE:
- ;
- break;
- default:
- jj_la1[22] = jj_gen;
- break label_11;
- }
- }
- break;
- default:
- jj_la1[23] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte000;}
- }
- if (jjte000 instanceof ParseException) {
- {if (true) throw (ParseException)jjte000;}
- }
- {if (true) throw (Error)jjte000;}
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- final public void UnaryOperator() throws ParseException {
- /*@bgen(jjtree) Operator */
- ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- try {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case DELETE:
- jj_consume_token(DELETE);
- break;
- case VOID:
- jj_consume_token(VOID);
- break;
- case TYPEOF:
- jj_consume_token(TYPEOF);
- break;
- case INCR:
- jj_consume_token(INCR);
- break;
- case DECR:
- jj_consume_token(DECR);
- break;
- case PLUS:
- jj_consume_token(PLUS);
- break;
- case MINUS:
- jj_consume_token(MINUS);
- break;
- case TILDE:
- jj_consume_token(TILDE);
- break;
- case BANG:
- jj_consume_token(BANG);
- break;
- default:
- jj_la1[24] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- /* Section 11.5: Multiplicative Operators */
- final public void MultiplicativeExpression() throws ParseException {
- /*@bgen(jjtree) #BinaryExpressionSequence(> 1) */
- ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- try {
- UnaryExpression();
- label_12:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case STAR:
- case REM:
- case SLASH:
- ;
- break;
- default:
- jj_la1[25] = jj_gen;
- break label_12;
- }
- MultiplicativeOperator();
- UnaryExpression();
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte000;}
- }
- if (jjte000 instanceof ParseException) {
- {if (true) throw (ParseException)jjte000;}
- }
- {if (true) throw (Error)jjte000;}
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- final public void MultiplicativeOperator() throws ParseException {
- /*@bgen(jjtree) Operator */
- ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- try {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case STAR:
- jj_consume_token(STAR);
- break;
- case SLASH:
- jj_consume_token(SLASH);
- break;
- case REM:
- jj_consume_token(REM);
- break;
- default:
- jj_la1[26] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- /* Section 11.6: Additive Operators */
- final public void AdditiveExpression() throws ParseException {
- /*@bgen(jjtree) #BinaryExpressionSequence(> 1) */
- ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- try {
- MultiplicativeExpression();
- label_13:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case PLUS:
- case MINUS:
- ;
- break;
- default:
- jj_la1[27] = jj_gen;
- break label_13;
- }
- AdditiveOperator();
- MultiplicativeExpression();
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte000;}
- }
- if (jjte000 instanceof ParseException) {
- {if (true) throw (ParseException)jjte000;}
- }
- {if (true) throw (Error)jjte000;}
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- final public void AdditiveOperator() throws ParseException {
- /*@bgen(jjtree) Operator */
- ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- try {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case PLUS:
- jj_consume_token(PLUS);
- break;
- case MINUS:
- jj_consume_token(MINUS);
- break;
- default:
- jj_la1[28] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- /* Section 11.7: Bitwise Shift Operators */
- final public void ShiftExpression() throws ParseException {
- /*@bgen(jjtree) #BinaryExpressionSequence(> 1) */
- ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- try {
- AdditiveExpression();
- label_14:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LSHIFT:
- case RSHIFT:
- case RUNSHIFT:
- ;
- break;
- default:
- jj_la1[29] = jj_gen;
- break label_14;
- }
- ShiftOperator();
- AdditiveExpression();
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte000;}
- }
- if (jjte000 instanceof ParseException) {
- {if (true) throw (ParseException)jjte000;}
- }
- {if (true) throw (Error)jjte000;}
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- final public void ShiftOperator() throws ParseException {
- /*@bgen(jjtree) Operator */
- ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- try {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LSHIFT:
- jj_consume_token(LSHIFT);
- break;
- case RSHIFT:
- jj_consume_token(RSHIFT);
- break;
- case RUNSHIFT:
- jj_consume_token(RUNSHIFT);
- break;
- default:
- jj_la1[30] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- /* Section 11.4: Relational Operators */
- final public void RelationalExpression() throws ParseException {
- /*@bgen(jjtree) #BinaryExpressionSequence(> 1) */
- ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- try {
- ShiftExpression();
- label_15:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case IN:
- case LT:
- case GT:
- case LE:
- case GE:
- case INTANCE_OF:
- ;
- break;
- default:
- jj_la1[31] = jj_gen;
- break label_15;
- }
- RelationalOperator();
- ShiftExpression();
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte000;}
- }
- if (jjte000 instanceof ParseException) {
- {if (true) throw (ParseException)jjte000;}
- }
- {if (true) throw (Error)jjte000;}
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- final public void RelationalOperator() throws ParseException {
- /*@bgen(jjtree) Operator */
- ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- try {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LT:
- jj_consume_token(LT);
- break;
- case GT:
- jj_consume_token(GT);
- break;
- case LE:
- jj_consume_token(LE);
- break;
- case GE:
- jj_consume_token(GE);
- break;
- case INTANCE_OF:
- jj_consume_token(INTANCE_OF);
- break;
- case IN:
- jj_consume_token(IN);
- break;
- default:
- jj_la1[32] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- final public void RelationalExpressionNoIn() throws ParseException {
- /*@bgen(jjtree) #BinaryExpressionSequence(> 1) */
- ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- try {
- ShiftExpression();
- label_16:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LT:
- case GT:
- case LE:
- case GE:
- case INTANCE_OF:
- ;
- break;
- default:
- jj_la1[33] = jj_gen;
- break label_16;
- }
- RelationalNoInOperator();
- ShiftExpression();
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte000;}
- }
- if (jjte000 instanceof ParseException) {
- {if (true) throw (ParseException)jjte000;}
- }
- {if (true) throw (Error)jjte000;}
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- final public void RelationalNoInOperator() throws ParseException {
- /*@bgen(jjtree) Operator */
- ASTOperator jjtn000 = new ASTOperator(JJTOPERATOR);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- try {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LT:
- jj_consume_token(LT);
- break;
- case GT:
- jj_consume_token(GT);
- break;
- case LE:
- jj_consume_token(LE);
- break;
- case GE:
- jj_consume_token(GE);
- break;
- case INTANCE_OF:
- jj_consume_token(INTANCE_OF);
- break;
- default:
- jj_la1[34] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- /* Section 11.9: Equality Operators */
- final public void EqualityExpression() throws ParseException {
- /*@bgen(jjtree) #BinaryExpressionSequence(> 1) */
- ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- try {
- RelationalExpression();
- label_17:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case EQ:
- case NE:
- case SEQ:
- case SNEQ:
- ;
- break;
- default:
- jj_la1[35] = jj_gen;
- break label_17;
- }
- EqualityOperator();
- RelationalExpression();
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte000;}
- }
- if (jjte000 instanceof ParseException) {
- {if (true) throw (ParseException)jjte000;}
- }
- {if (true) throw (Error)jjte000;}
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, jjtree.nodeArity() > 1);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- final public void EqualityExpressionNoIn() throws ParseException {
- /*@bgen(jjtree) #BinaryExpressionSequence(> 1) */
- ASTBinaryExpressionSequence jjtn000 = new ASTBinaryExpressionSequence(JJTBINARYEXPRESSIONSEQUENCE);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- try {
- RelationalExpressionNoIn();
- label_18:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case EQ:
- case NE:
- case SEQ:
- case SNEQ:
- ;
- break;
- default:
- jj_la1[36] = jj_gen;
- break label_18;
- }
- EqualityOperator();
- RelationalExpressionNoIn();
- }
- } catch (ParseException pe) {
- addException(pe);
- }
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte000;}
- }
- if (jjte000