0001 /*@bgen(jjtree) Generated By:JJTree: Do not edit this line. JJTree.jj */
0002 /*@egen*//* Copyright (c) 2006, Sun Microsystems, Inc.
0003  * All rights reserved.
0004  *
0005  * Redistribution and use in source and binary forms, with or without
0006  * modification, are permitted provided that the following conditions are met:
0007  *
0008  *     * Redistributions of source code must retain the above copyright notice,
0009  *       this list of conditions and the following disclaimer.
0010  *     * Redistributions in binary form must reproduce the above copyright
0011  *       notice, this list of conditions and the following disclaimer in the
0012  *       documentation and/or other materials provided with the distribution.
0013  *     * Neither the name of the Sun Microsystems, Inc. nor the names of its
0014  *       contributors may be used to endorse or promote products derived from
0015  *       this software without specific prior written permission.
0016  *
0017  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0018  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0020  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0021  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0022  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0023  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0024  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0025  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0026  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
0027  * THE POSSIBILITY OF SUCH DAMAGE.
0028  */
0029 
0030 /*
0031  * Modified by Jianjun Liu for JavaDoq (last modified 2011/09/10)
0032  */
0033 
0034 /*
0035  *  JavaDoq 1.0 - DOCUment JAVA In Source
0036  *  Copyright (C) 2008-2011  J.J.Liu<jianjunliu@126.com> <http://www.javadoq.com>
0037  *  
0038  *  This program is free software: you can redistribute it and/or modify
0039  *  it under the terms of the GNU Affero General Public License as published by
0040  *  the Free Software Foundation, either version 3 of the License, or
0041  *  (at your option) any later version.
0042  *  
0043  *  This program is distributed in the hope that it will be useful,
0044  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
0045  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0046  *  GNU Affero General Public License for more details.
0047  *  
0048  *  You should have received a copy of the GNU Affero General Public License
0049  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
0050  */
0051 
0052 options {
0053   JDK_VERSION = "1.5";
0054   JAVA_UNICODE_ESCAPE = true;
0055                
0056                          
0057                            
0058                          
0059                           
0060   STATIC = false;
0061   TOKEN_EXTENDS = "AbstractToken";
0062   UNICODE_INPUT = true;
0063                  
0064 }
0065 
0066 PARSER_BEGIN(JJTreeParser)
0067 
0068 package com.javadoq.jjtree;
0069 
0070 public class JJTreeParser/*@bgen(jjtree)*/implements JJTreeParserTreeConstants/*@egen*/ {/*@bgen(jjtree)*/
0071   protected JJTJJTreeParserState jjtree = new JJTJJTreeParserState();
0072 
0073 /*@egen*/
0074 
0075     void jjtreeOpenNodeScope(Node n) {
0076         ((ASTNode)n).firstToken = getToken(1);
0077     }
0078 
0079     void jjtreeCloseNodeScope(Node n) {
0080         ((ASTNode)n).lastToken = getToken(0);
0081     }
0082 
0083 
0084   /**
0085    * Returns true if the next token is not in the FOLLOW list of "expansion".
0086    * It is used to decide when the end of an "expansion" has been reached.
0087    */
0088   private boolean notTailOfExpansionUnit() {
0089     Token t;
0090     t = getToken(1);
0091     if (t.kind == BIT_OR || t.kind == COMMA || t.kind == RPAREN || t.kind == RBRACE || t.kind == RBRACKET) return false;
0092     return true;
0093   }
0094 
0095 }
0096 
0097 PARSER_END(JJTreeParser)
0098 
0099 
0100 /**********************************************
0101  * THE JAVACC TOKEN SPECIFICATION STARTS HERE *
0102  **********************************************/
0103 
0104 /* JAVACC RESERVED WORDS: These are the only tokens in JavaCC but not in Java */
0105 
0106 TOKEN :
0107 {
0108 //  Options is no longer a reserved word (Issue 126)
0109 //  < _OPTIONS: "options" >
0110   < _LOOKAHEAD: "LOOKAHEAD" >
0111 | < _IGNORE_CASE: "IGNORE_CASE" >
0112 | < _PARSER_BEGIN: "PARSER_BEGIN" >
0113 | < _PARSER_END: "PARSER_END" >
0114 | < _JAVACODE: "JAVACODE" >
0115 | < _TOKEN: "TOKEN" >
0116 | < _SPECIAL_TOKEN: "SPECIAL_TOKEN" >
0117 | < _MORE: "MORE" >
0118 | < _SKIP: "SKIP" >
0119 | < _TOKEN_MGR_DECLS: "TOKEN_MGR_DECLS" >
0120 | < _EOF: "EOF" >
0121 }
0122 
0123 /*
0124  * The remainder of the tokens are exactly (except for the removal of tokens
0125  * containing ">>" and "<<") as in the Java grammar and must be diff equivalent
0126  * (again with the exceptions above) to it.
0127  */
0128 
0129 /* WHITE SPACE */
0130 
0131 SPECIAL_TOKEN :
0132 {
0133   " "
0134 | "\t"
0135 | "\n"
0136 | "\r"
0137 | "\f"
0138 }
0139 
0140 /* COMMENTS */
0141 
0142 MORE :
0143 {
0144   "//" : IN_SINGLE_LINE_COMMENT
0145 |
0146   <"/**" ~["/"]> { input_stream.backup(1); } : IN_FORMAL_COMMENT
0147 |
0148   "/*" : IN_MULTI_LINE_COMMENT
0149 }
0150 
0151 
0152 <IN_SINGLE_LINE_COMMENT>
0153 SPECIAL_TOKEN :
0154 {
0155   <SINGLE_LINE_COMMENT: "\n" | "\r" | "\r\n" > : DEFAULT
0156 }
0157 
0158 <IN_FORMAL_COMMENT>
0159 SPECIAL_TOKEN :
0160 {
0161   <FORMAL_COMMENT: "*/" > : DEFAULT
0162 }
0163 
0164 <IN_MULTI_LINE_COMMENT>
0165 SPECIAL_TOKEN :
0166 {
0167   <MULTI_LINE_COMMENT: "*/" > : DEFAULT
0168 }
0169 
0170 <IN_SINGLE_LINE_COMMENT,IN_FORMAL_COMMENT,IN_MULTI_LINE_COMMENT>
0171 MORE :
0172 {
0173   < ~[] >
0174 }
0175 
0176 /* JAVA RESERVED WORDS AND LITERALS */
0177 
0178 TOKEN :
0179 {
0180   < ABSTRACT: "abstract" >
0181 | < BOOLEAN: "boolean" >
0182 | < BREAK: "break" >
0183 | < BYTE: "byte" >
0184 | < CASE: "case" >
0185 | < CATCH: "catch" >
0186 | < CHAR: "char" >
0187 | < CLASS: "class" >
0188 | < CONST: "const" >
0189 | < CONTINUE: "continue" >
0190 | < _DEFAULT: "default" >
0191 | < DO: "do" >
0192 | < DOUBLE: "double" >
0193 | < ELSE: "else" >
0194 | < EXTENDS: "extends" >
0195 | < FALSE: "false" >
0196 | < FINAL: "final" >
0197 | < FINALLY: "finally" >
0198 | < FLOAT: "float" >
0199 | < FOR: "for" >
0200 | < GOTO: "goto" >
0201 | < IF: "if" >
0202 | < IMPLEMENTS: "implements" >
0203 | < IMPORT: "import" >
0204 | < INSTANCEOF: "instanceof" >
0205 | < INT: "int" >
0206 | < INTERFACE: "interface" >
0207 | < LONG: "long" >
0208 | < NATIVE: "native" >
0209 | < NEW: "new" >
0210 | < NULL: "null" >
0211 | < PACKAGE: "package">
0212 | < PRIVATE: "private" >
0213 | < PROTECTED: "protected" >
0214 | < PUBLIC: "public" >
0215 | < RETURN: "return" >
0216 | < SHORT: "short" >
0217 | < STATIC: "static" >
0218 | < STRICTFP: "strictfp" >
0219 | < SUPER: "super" >
0220 | < SWITCH: "switch" >
0221 | < SYNCHRONIZED: "synchronized" >
0222 | < THIS: "this" >
0223 | < THROW: "throw" >
0224 | < THROWS: "throws" >
0225 | < TRANSIENT: "transient" >
0226 | < TRUE: "true" >
0227 | < TRY: "try" >
0228 | < VOID: "void" >
0229 | < VOLATILE: "volatile" >
0230 | < WHILE: "while" >
0231 }
0232 
0233 /* JAVA LITERALS */
0234 
0235 TOKEN :
0236 {
0237   < INTEGER_LITERAL:
0238         <DECIMAL_LITERAL> (["l","L"])?
0239       | <HEX_LITERAL> (["l","L"])?
0240       | <OCTAL_LITERAL> (["l","L"])?
0241   >
0242 |
0243   < #DECIMAL_LITERAL: ["1"-"9"] (["0"-"9"])* >
0244 |
0245   < #HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+ >
0246 |
0247   < #OCTAL_LITERAL: "0" (["0"-"7"])* >
0248 |
0249   < FLOATING_POINT_LITERAL:
0250         <DECIMAL_FLOATING_POINT_LITERAL>
0251       | <HEXADECIMAL_FLOATING_POINT_LITERAL>
0252   >
0253 |
0254   < #DECIMAL_FLOATING_POINT_LITERAL:
0255         (["0"-"9"])+ "." (["0"-"9"])* (<DECIMAL_EXPONENT>)? (["f","F","d","D"])?
0256       | "." (["0"-"9"])+ (<DECIMAL_EXPONENT>)? (["f","F","d","D"])?
0257       | (["0"-"9"])+ <DECIMAL_EXPONENT> (["f","F","d","D"])?
0258       | (["0"-"9"])+ (<DECIMAL_EXPONENT>)? ["f","F","d","D"]
0259   >
0260 |
0261   < #DECIMAL_EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+ >
0262 |
0263   < #HEXADECIMAL_FLOATING_POINT_LITERAL:
0264         "0" ["x", "X"] (["0"-"9","a"-"f","A"-"F"])+ (".")? <HEXADECIMAL_EXPONENT> (["f","F","d","D"])?
0265       | "0" ["x", "X"] (["0"-"9","a"-"f","A"-"F"])* "." (["0"-"9","a"-"f","A"-"F"])+ <HEXADECIMAL_EXPONENT> (["f","F","d","D"])?
0266   >
0267 |
0268   < #HEXADECIMAL_EXPONENT: ["p","P"] (["+","-"])? (["0"-"9"])+ >
0269 |
0270   < CHARACTER_LITERAL:
0271       "'"
0272       (   (~["'","\\","\n","\r"])
0273         | ("\\"
0274             ( ["n","t","b","r","f","\\","'","\""]
0275             | ["0"-"7"] ( ["0"-"7"] )?
0276             | ["0"-"3"] ["0"-"7"] ["0"-"7"]
0277             )
0278           )
0279       )
0280       "'"
0281   >
0282 |
0283   < STRING_LITERAL:
0284       "\""
0285       (   (~["\"","\\","\n","\r"])
0286         | ("\\"
0287             ( ["n","t","b","r","f","\\","'","\""]
0288             | ["0"-"7"] ( ["0"-"7"] )?
0289             | ["0"-"3"] ["0"-"7"] ["0"-"7"]
0290             )
0291           )
0292       )*
0293       "\""
0294   >
0295 }
0296 
0297 /* SEPARATORS */
0298 
0299 TOKEN :
0300 {
0301   < LPAREN: "(" >
0302 | < RPAREN: ")" >
0303 | < LBRACE: "{" >
0304 | < RBRACE: "}" >
0305 | < LBRACKET: "[" >
0306 | < RBRACKET: "]" >
0307 | < SEMICOLON: ";" >
0308 | < COMMA: "," >
0309 | < DOT: "." >
0310 | < AT: "@" >
0311 }
0312 
0313 /* OPERATORS */
0314 
0315 TOKEN :
0316 {
0317   < ASSIGN: "=" >
0318 //| < GT: ">" >
0319 | < LT: "<" >
0320 | < BANG: "!" >
0321 | < TILDE: "~" >
0322 | < HOOK: "?" >
0323 | < COLON: ":" >
0324 | < EQ: "==" >
0325 | < LE: "<=" >
0326 | < GE: ">=" >
0327 | < NE: "!=" >
0328 | < SC_OR: "||" >
0329 | < SC_AND: "&&" >
0330 | < INCR: "++" >
0331 | < DECR: "--" >
0332 | < PLUS: "+" >
0333 | < MINUS: "-" >
0334 | < STAR: "*" >
0335 | < SLASH: "/" >
0336 | < BIT_AND: "&" >
0337 | < BIT_OR: "|" >
0338 | < XOR: "^" >
0339 | < REM: "%" >
0340 //  | < LSHIFT: "<<" >
0341 //  | < RSIGNEDSHIFT: ">>" >
0342 //  | < RUNSIGNEDSHIFT: ">>>" >
0343 | < PLUSASSIGN: "+=" >
0344 | < MINUSASSIGN: "-=" >
0345 | < STARASSIGN: "*=" >
0346 | < SLASHASSIGN: "/=" >
0347 | < ANDASSIGN: "&=" >
0348 | < ORASSIGN: "|=" >
0349 | < XORASSIGN: "^=" >
0350 | < REMASSIGN: "%=" >
0351 //  | < LSHIFTASSIGN: "<<=" >
0352 //  | < RSIGNEDSHIFTASSIGN: ">>=" >
0353 //  | < RUNSIGNEDSHIFTASSIGN: ">>>=" >
0354 | < ELLIPSIS: "..." >
0355 }
0356 
0357 
0358 /* >'s need special attention due to generics syntax. */
0359 TOKEN :
0360 {
0361   < RUNSIGNEDSHIFT: ">>>" >
0362   {
0363      matchedToken.kind = GT;
0364      matchedToken.realKind = RUNSIGNEDSHIFT;
0365      input_stream.backup(2);
0366      matchedToken.image = ">";
0367   }
0368 | < RSIGNEDSHIFT: ">>" >
0369   {
0370      matchedToken.kind = GT;
0371      matchedToken.realKind = RSIGNEDSHIFT;
0372      input_stream.backup(1);
0373      matchedToken.image = ">";
0374   }
0375 | < GT: ">" >
0376 }
0377 
0378 
0379 /************************************************
0380  * THE JAVACC GRAMMAR SPECIFICATION STARTS HERE *
0381  ************************************************/
0382 
0383 ASTGrammar javacc_input()          :
0384 {/*@bgen(jjtree) Grammar */
0385   ASTGrammar jjtn000 = new ASTGrammar(this, JJTGRAMMAR);
0386   boolean jjtc000 = true;
0387   jjtree.openNodeScope(jjtn000);
0388   jjtreeOpenNodeScope(jjtn000);
0389 /*@egen*/}
0390 {/*@bgen(jjtree) Grammar */
0391   try {
0392 /*@egen*/
0393   javacc_options()
0394   (
0395     "PARSER_BEGIN" "(" identifier() ")"
0396     CompilationUnit()
0397     "PARSER_END" "(" identifier() ")"
0398   )
0399   (
0400     ( production() )+
0401   )
0402   <EOF>/*@bgen(jjtree)*/
0403   {
0404     jjtree.closeNodeScope(jjtn000, true);
0405     jjtc000 = false;
0406     jjtreeCloseNodeScope(jjtn000);
0407   }
0408 /*@egen*/
0409   {
0410     return jjtn000;
0411   }/*@bgen(jjtree)*/
0412   } catch (Throwable jjte000) {
0413     if (jjtc000) {
0414       jjtree.clearNodeScope(jjtn000);
0415       jjtc000 = false;
0416     } else {
0417       jjtree.popNode();
0418     }
0419     if (jjte000 instanceof RuntimeException) {
0420       throw (RuntimeException)jjte000;
0421     }
0422     if (jjte000 instanceof ParseException) {
0423       throw (ParseException)jjte000;
0424     }
0425     throw (Error)jjte000;
0426   } finally {
0427     if (jjtc000) {
0428       jjtree.closeNodeScope(jjtn000, true);
0429       jjtreeCloseNodeScope(jjtn000);
0430     }
0431   }
0432 /*@egen*/
0433 }
0434 
0435 void javacc_options() :
0436 {}
0437 {
0438   [ LOOKAHEAD( { getToken(1).image.equals("options") }) ( <IDENTIFIER> "{" ( option_binding() )* "}" ) ]
0439 }
0440 
0441 void option_binding() :
0442 {}
0443 {
0444   ( <IDENTIFIER> | "LOOKAHEAD" | "IGNORE_CASE" | "static" )
0445   "="
0446   (
0447      IntegerLiteral()
0448    | BooleanLiteral()
0449    | StringLiteral()
0450   ) ";"
0451 }
0452 
0453 void production() :
0454 {}
0455 {
0456   LOOKAHEAD(1)
0457   /*
0458    * Since JAVACODE is both a JavaCC reserved word and a Java identifier,
0459    * we need to give preference to "javacode_production" over
0460    * "bnf_production".
0461    */
0462   javacode_production()
0463 |
0464   LOOKAHEAD(1)
0465   /*
0466    * Since SKIP, TOKEN, etc. are both JavaCC reserved words and Java
0467    * identifiers, we need to give preference to "regular_expression_production"
0468    * over "bnf_production".
0469    */
0470   regular_expr_production()
0471 |
0472   LOOKAHEAD(1)
0473   /*
0474    * Since TOKEN_MGR_DECLS is both a JavaCC reserved word and a Java identifier,
0475    * we need to give preference to "token_manager_decls" over
0476    * "bnf_production".
0477    */
0478   token_manager_decls()
0479 |
0480   bnf_production()
0481 }
0482 
0483 void javacode_production() :
0484 {}
0485 {
0486   "JAVACODE"
0487   AccessModifier() ResultType() identifier() FormalParameters()
0488     [
0489       "throws" Name()
0490       ( "," Name()
0491       )*
0492     ]
0493     [ node_descriptor() ]
0494 
0495     // This is really a Block()
0496     "{"
0497     (
0498       ( BlockStatement() )*
0499     )
0500     "}"
0501 }
0502 
0503 void bnf_production() :
0504 {}
0505 {
0506   AccessModifier() ResultType() identifier() FormalParameters()
0507   [
0508     "throws" Name()
0509     ( "," Name()
0510     )*
0511   ]
0512   [ node_descriptor() ]
0513   ":"
0514 
0515   // This is really a Block()
0516   "{"
0517   (
0518     ( BlockStatement() )*
0519   )
0520   "}"
0521 
0522   "{"
0523   (
0524     expansion_choices()
0525   )
0526  "}"
0527 }
0528 
0529 void AccessModifier() :
0530 {}
0531 {
0532     ( "public" | "protected" | "private" )?
0533 }
0534 
0535 void regular_expr_production() :
0536 {}
0537 {
0538   [
0539     LOOKAHEAD(2) "<" "*" ">"
0540   |
0541     "<" <IDENTIFIER> ( "," <IDENTIFIER> )* ">"
0542   ]
0543   regexpr_kind() [ "[" "IGNORE_CASE" "]" ] ":"
0544   "{" regexpr_spec() ( "|" regexpr_spec() )* "}"
0545 }
0546 
0547 void token_manager_decls() :
0548 {}
0549 {
0550   "TOKEN_MGR_DECLS" ":" ClassOrInterfaceBody(false)
0551 }
0552 
0553 void regexpr_kind() :
0554 {}
0555 {
0556   "TOKEN"
0557 |
0558   "SPECIAL_TOKEN"
0559 |
0560   "SKIP"
0561 |
0562   "MORE"
0563 }
0564 
0565 void regexpr_spec() :
0566 {}
0567 {
0568   regular_expression() [ Block() ] [ ":" <IDENTIFIER> ]
0569 }
0570 
0571 void expansion_choices() :
0572 {}
0573 {
0574   expansion() ( "|" expansion() )*
0575 }
0576 
0577 void expansion() :
0578 {}
0579 {
0580   (
0581     LOOKAHEAD(1)
0582     ( "LOOKAHEAD" "(" local_lookahead() ")" )
0583   )?
0584   (
0585    LOOKAHEAD(0, { notTailOfExpansionUnit() } )
0586    (
0587      expansion_unit()
0588      [ node_descriptor() ]
0589    )
0590   )+
0591 }
0592 
0593 void local_lookahead() :
0594 {
0595   boolean commaAtEnd = false, emptyLA = true;
0596 }
0597 {
0598   [
0599     /*
0600      * The lookahead of 1 is to turn off the warning message that lets
0601      * us know that an expansion choice can also start with an integer
0602      * literal because a primary expression can do the same.  But we
0603      * know that this is what we want.
0604      */
0605     LOOKAHEAD(1)
0606     IntegerLiteral()
0607     {
0608       emptyLA = false;
0609     }
0610   ]
0611   [ LOOKAHEAD(0, { !emptyLA && (getToken(1).kind != RPAREN) } )
0612     ","
0613     {
0614       commaAtEnd = true;
0615     }
0616   ]
0617   [ LOOKAHEAD(0, { getToken(1).kind != RPAREN && getToken(1).kind != LBRACE } )
0618     expansion_choices()
0619     {
0620       emptyLA = false; commaAtEnd = false;
0621     }
0622   ]
0623   [ LOOKAHEAD(0, { !emptyLA && !commaAtEnd && (getToken(1).kind != RPAREN) } )
0624     ","
0625     {
0626       commaAtEnd = true;
0627     }
0628   ]
0629   [ LOOKAHEAD(0, { emptyLA || commaAtEnd } )
0630     "{" Expression() "}"
0631   ]
0632 }
0633 
0634 void expansion_unit() :
0635 {}
0636 {
0637 (
0638   LOOKAHEAD(1)
0639   /*
0640    * We give this priority over primary expressions which use LOOKAHEAD as the
0641    * name of its identifier.
0642    */
0643   (
0644     "LOOKAHEAD" "(" local_lookahead() ")"
0645   )
0646 |
0647   Block()
0648 |
0649   (
0650     "[" expansion_choices() "]"
0651   )
0652 |
0653   (
0654     "try" "{" expansion_choices() "}"
0655     ( "catch" "(" Name() <IDENTIFIER> ")" Block() )*
0656     [ "finally" Block() ]
0657   )
0658 |
0659   LOOKAHEAD( identifier() | StringLiteral() | "<" | PrimaryExpression() "=" )
0660 (
0661   [
0662     LOOKAHEAD(PrimaryExpression() "=")
0663     PrimaryExpression() "="
0664   ]
0665   (
0666     regular_expression() [ "." <IDENTIFIER>  ]
0667   | ( identifier() Arguments() )
0668   )
0669     
0670 )
0671 |
0672   "(" expansion_choices() ")"
0673   (
0674     "+"
0675   |
0676     "*"
0677   |
0678     "?"
0679   |
0680     {}
0681   )
0682 )
0683 }
0684 
0685 void regular_expression() :
0686 {}
0687 {
0688   StringLiteral()
0689 |
0690   LOOKAHEAD(3)
0691   (
0692     "<" [ [ "#" ] identifier() ":" ] complex_regular_expression_choices() ">"
0693   )
0694 |
0695   LOOKAHEAD(2)
0696   (
0697     "<" identifier() ">"
0698   )
0699 |
0700   (
0701     "<" "EOF" ">"
0702   )
0703 }
0704 
0705 void complex_regular_expression_choices() :
0706 {}
0707 {
0708   complex_regular_expression() ( "|" complex_regular_expression() )*
0709 }
0710 
0711 void complex_regular_expression() :
0712 {}
0713 {
0714   ( complex_regular_expression_unit() )+
0715 }
0716 
0717 void complex_regular_expression_unit() :
0718 {}
0719 {
0720   StringLiteral()
0721 |
0722   ( "<" identifier() ">" )
0723 |
0724   character_list()
0725 |
0726   "(" complex_regular_expression_choices() ")"
0727   (
0728     "+"
0729   |
0730     "*"
0731   |
0732     "?"
0733   |  "{" IntegerLiteral() [ ","  [ IntegerLiteral() ] ] "}"
0734   |
0735     {}
0736   )
0737 }
0738 
0739 void character_list() :
0740 {}
0741 {
0742   [ "~" ] "[" [ character_descriptor() ( "," character_descriptor() )* ] "]"
0743 }
0744 
0745 void character_descriptor() :
0746 {}
0747 {
0748   StringLiteral() [ "-" StringLiteral() ]
0749 }
0750 
0751 Token identifier() :
0752 {
0753   Token t;
0754 }
0755 {
0756   t=<IDENTIFIER>
0757   {
0758       return t;
0759   }
0760 }
0761 
0762 
0763 /**********************************************
0764  * THE JJTREE PRODUCTIONS START HERE          *
0765  **********************************************/
0766 
0767 void node_descriptor() :
0768 {}
0769 {
0770   "#"
0771   (
0772     Name() | <VOID>
0773   )
0774   [
0775    LOOKAHEAD(1)
0776    "("
0777       [ ">" ]
0778       node_descriptor_expression()
0779    ")"
0780   ]
0781 }
0782 
0783 
0784 JAVACODE
0785 void node_descriptor_expression()
0786 {
0787   Token tok;
0788   int nesting = 1;
0789   while (true) {
0790     tok = getToken(1);
0791     if (tok.kind == 0) {
0792       throw new ParseException();
0793     }
0794     if (tok.kind == LPAREN) nesting++;
0795     if (tok.kind == RPAREN) {
0796       nesting--;
0797       if (nesting == 0) break;
0798     }
0799     tok = getNextToken();
0800   }
0801 }
0802 
0803 
0804 /**********************************************
0805  * THE JAVA GRAMMAR SPECIFICATION STARTS HERE *
0806  **********************************************/
0807 
0808 /*
0809  * The Java grammar is modified to use sequences of tokens
0810  * for the missing tokens - those that include "<<" and ">>".
0811  */
0812 
0813 /*
0814  * The following production defines Java identifiers - it
0815  * includes the reserved words of JavaCC also.
0816  */
0817 
0818 String JavaIdentifier() :
0819 {}
0820 {
0821 (  <IDENTIFIER>
0822 | "LOOKAHEAD"
0823 | "IGNORE_CASE"
0824 | "PARSER_BEGIN"
0825 | "PARSER_END"
0826 | "JAVACODE"
0827 | "TOKEN"
0828 | "SPECIAL_TOKEN"
0829 | "MORE"
0830 | "SKIP"
0831 | "TOKEN_MGR_DECLS"
0832 | "EOF"
0833 )
0834   {
0835           return token.image;
0836   }
0837 }
0838 
0839 /*
0840  * Program structuring syntax follows.
0841  */
0842 
0843 ASTCompilationUnit CompilationUnit()                  :
0844 {/*@bgen(jjtree) CompilationUnit */
0845  ASTCompilationUnit jjtn000 = new ASTCompilationUnit(this, JJTCOMPILATIONUNIT);
0846  boolean jjtc000 = true;
0847  jjtree.openNodeScope(jjtn000);
0848  jjtreeOpenNodeScope(jjtn000);
0849 /*@egen*/String s = "";}
0850 {/*@bgen(jjtree) CompilationUnit */
0851   try {
0852 /*@egen*/
0853   [ LOOKAHEAD( ( Annotation() )* "package" ) s=PackageDeclaration() ]
0854   ( ImportDeclaration() )*
0855   ( TypeDeclaration() )*/*@bgen(jjtree)*/
0856   {
0857     jjtree.closeNodeScope(jjtn000, true);
0858     jjtc000 = false;
0859     jjtreeCloseNodeScope(jjtn000);
0860   }
0861 /*@egen*/
0862   {
0863     jjtn000.packageName = s;
0864     return jjtn000;
0865   }/*@bgen(jjtree)*/
0866   } catch (Throwable jjte000) {
0867     if (jjtc000) {
0868       jjtree.clearNodeScope(jjtn000);
0869       jjtc000 = false;
0870     } else {
0871       jjtree.popNode();
0872     }
0873     if (jjte000 instanceof RuntimeException) {
0874       throw (RuntimeException)jjte000;
0875     }
0876     if (jjte000 instanceof ParseException) {
0877       throw (ParseException)jjte000;
0878     }
0879     throw (Error)jjte000;
0880   } finally {
0881     if (jjtc000) {
0882       jjtree.closeNodeScope(jjtn000, true);
0883       jjtreeCloseNodeScope(jjtn000);
0884     }
0885   }
0886 /*@egen*/
0887 }
0888 
0889 String PackageDeclaration() :
0890 {
0891   String s=null;
0892 }
0893 {
0894   Modifiers() "package" s=PackageName() ";"
0895   {
0896     return s;
0897   }
0898 }
0899 
0900 String PackageName()              :
0901 /*
0902  * A lookahead of 2 is required below since "Name" can be followed
0903  * by a ".*" when used in the context of an "ImportDeclaration".
0904  */
0905 {/*@bgen(jjtree) PackageName */
0906   ASTPackageName jjtn000 = new ASTPackageName(this, JJTPACKAGENAME);
0907   boolean jjtc000 = true;
0908   jjtree.openNodeScope(jjtn000);
0909   jjtreeOpenNodeScope(jjtn000);
0910 /*@egen*/
0911   String s, ss;
0912 }
0913 {/*@bgen(jjtree) PackageName */
0914   try {
0915 /*@egen*/
0916   s=JavaIdentifier()
0917   ( LOOKAHEAD(2) "." ss=JavaIdentifier() { s += "." + ss; } )*/*@bgen(jjtree)*/
0918         {
0919           jjtree.closeNodeScope(jjtn000, true);
0920           jjtc000 = false;
0921           jjtreeCloseNodeScope(jjtn000);
0922         }
0923 /*@egen*/
0924         {
0925           return jjtn000.text = s;
0926         }/*@bgen(jjtree)*/
0927   } catch (Throwable jjte000) {
0928     if (jjtc000) {
0929       jjtree.clearNodeScope(jjtn000);
0930       jjtc000 = false;
0931     } else {
0932       jjtree.popNode();
0933     }
0934     if (jjte000 instanceof RuntimeException) {
0935       throw (RuntimeException)jjte000;
0936     }
0937     if (jjte000 instanceof ParseException) {
0938       throw (ParseException)jjte000;
0939     }
0940     throw (Error)jjte000;
0941   } finally {
0942     if (jjtc000) {
0943       jjtree.closeNodeScope(jjtn000, true);
0944       jjtreeCloseNodeScope(jjtn000);
0945     }
0946   }
0947 /*@egen*/
0948 }
0949 
0950 void ImportDeclaration() :
0951 {
0952     String s = "";
0953 }
0954 {
0955   "import" [ "static" ] s = ImportName() ";"
0956 }
0957 
0958 String ImportName()            :
0959 /*
0960  * A lookahead of 2 is required below since "Name" can be followed
0961  * by a ".*" when used in the context of an "ImportDeclaration".
0962  */
0963 {/*@bgen(jjtree) ImportName */
0964   ASTImportName jjtn000 = new ASTImportName(this, JJTIMPORTNAME);
0965   boolean jjtc000 = true;
0966   jjtree.openNodeScope(jjtn000);
0967   jjtreeOpenNodeScope(jjtn000);
0968 /*@egen*/
0969   Token t1=null,t2=null;
0970   String s, ss;
0971 }
0972 {/*@bgen(jjtree) ImportName */
0973   try {
0974 /*@egen*/
0975   s=JavaIdentifier()
0976   ( LOOKAHEAD(2) "." ss=JavaIdentifier() { s += "." + ss; } )*
0977   [ t1="." t2="*" ]/*@bgen(jjtree)*/
0978         {
0979           jjtree.closeNodeScope(jjtn000, true);
0980           jjtc000 = false;
0981           jjtreeCloseNodeScope(jjtn000);
0982         }
0983 /*@egen*/
0984         {
0985           if (t1!= null) s += t1.image + t2.image;
0986           return jjtn000.text = s;
0987         }/*@bgen(jjtree)*/
0988   } catch (Throwable jjte000) {
0989     if (jjtc000) {
0990       jjtree.clearNodeScope(jjtn000);
0991       jjtc000 = false;
0992     } else {
0993       jjtree.popNode();
0994     }
0995     if (jjte000 instanceof RuntimeException) {
0996       throw (RuntimeException)jjte000;
0997     }
0998     if (jjte000 instanceof ParseException) {
0999       throw (ParseException)jjte000;
1000     }
1001     throw (Error)jjte000;
1002   } finally {
1003     if (jjtc000) {
1004       jjtree.closeNodeScope(jjtn000, true);
1005       jjtreeCloseNodeScope(jjtn000);
1006     }
1007   }
1008 /*@egen*/
1009 }
1010 
1011 /*
1012  * Modifiers. We match all modifiers in a single rule to reduce the chances of
1013  * syntax errors for simple modifier mistakes. It will also enable us to give
1014  * better error messages.
1015  */
1016 
1017 void Modifiers():
1018 {}
1019 {
1020  (
1021   LOOKAHEAD(2)
1022   (
1023    "public"
1024   |
1025    "static"
1026   |
1027    "protected"
1028   |
1029    "private"
1030   |
1031    "final"
1032   |
1033    "abstract"
1034   |
1035    "synchronized"
1036   |
1037    "native"
1038   |
1039    "transient"
1040   |
1041    "volatile"
1042   |
1043    "strictfp"
1044   |
1045    Annotation()
1046   )
1047  )*
1048 }
1049 
1050 /*
1051  * Declaration syntax follows.
1052  */
1053 void TypeDeclaration():
1054 {
1055    ;
1056 }
1057 {
1058   ";"
1059 |
1060   Modifiers()
1061   (
1062      ClassOrInterfaceDeclaration()
1063    |
1064      EnumDeclaration()
1065    |
1066      AnnotationTypeDeclaration()
1067   )
1068 }
1069 
1070 
1071 String NewName()          :
1072 /*
1073  * A lookahead of 2 is required below since "Name" can be followed
1074  * by a ".*" when used in the context of an "ImportDeclaration".
1075  */
1076 {/*@bgen(jjtree) NewName */
1077   ASTNewName jjtn000 = new ASTNewName(this, JJTNEWNAME);
1078   boolean jjtc000 = true;
1079   jjtree.openNodeScope(jjtn000);
1080   jjtreeOpenNodeScope(jjtn000);
1081 /*@egen*/
1082   String s, ss;
1083 }
1084 {/*@bgen(jjtree) NewName */
1085   try {
1086 /*@egen*/
1087   s=JavaIdentifier()
1088   ( LOOKAHEAD(2) "." ss=JavaIdentifier() { s += "." + ss; } )*/*@bgen(jjtree)*/
1089         {
1090           jjtree.closeNodeScope(jjtn000, true);
1091           jjtc000 = false;
1092           jjtreeCloseNodeScope(jjtn000);
1093         }
1094 /*@egen*/
1095         {
1096           return jjtn000.text = s;
1097         }/*@bgen(jjtree)*/
1098   } catch (Throwable jjte000) {
1099     if (jjtc000) {
1100       jjtree.clearNodeScope(jjtn000);
1101       jjtc000 = false;
1102     } else {
1103       jjtree.popNode();
1104     }
1105     if (jjte000 instanceof RuntimeException) {
1106       throw (RuntimeException)jjte000;
1107     }
1108     if (jjte000 instanceof ParseException) {
1109       throw (ParseException)jjte000;
1110     }
1111     throw (Error)jjte000;
1112   } finally {
1113     if (jjtc000) {
1114       jjtree.closeNodeScope(jjtn000, true);
1115       jjtreeCloseNodeScope(jjtn000);
1116     }
1117   }
1118 /*@egen*/
1119 }
1120 
1121 void ClassOrInterfaceDeclaration()         :
1122 {/*@bgen(jjtree) NewType */
1123   ASTNewType jjtn000 = new ASTNewType(this, JJTNEWTYPE);
1124   boolean jjtc000 = true;
1125   jjtree.openNodeScope(jjtn000);
1126   jjtreeOpenNodeScope(jjtn000);
1127 /*@egen*/
1128   boolean isInterface = false;
1129   String name;
1130 }
1131 {/*@bgen(jjtree) NewType */
1132   try {
1133 /*@egen*/
1134   ( "class" | "interface" { isInterface = true; } )
1135   name = NewName() { jjtn000.name = name; }
1136   [ TypeParameters() ]
1137   [ ExtendsList(isInterface) ]
1138   [ ImplementsList(isInterface) ]
1139   ClassOrInterfaceBody(isInterface)/*@bgen(jjtree)*/
1140   } catch (Throwable jjte000) {
1141     if (jjtc000) {
1142       jjtree.clearNodeScope(jjtn000);
1143       jjtc000 = false;
1144     } else {
1145       jjtree.popNode();
1146     }
1147     if (jjte000 instanceof RuntimeException) {
1148       throw (RuntimeException)jjte000;
1149     }
1150     if (jjte000 instanceof ParseException) {
1151       throw (ParseException)jjte000;
1152     }
1153     throw (Error)jjte000;
1154   } finally {
1155     if (jjtc000) {
1156       jjtree.closeNodeScope(jjtn000, true);
1157       jjtreeCloseNodeScope(jjtn000);
1158     }
1159   }
1160 /*@egen*/
1161 }
1162 
1163 void ExtendsList(boolean isInterface)           :
1164 {/*@bgen(jjtree) SuperList */
1165    ASTSuperList jjtn000 = new ASTSuperList(this, JJTSUPERLIST);
1166    boolean jjtc000 = true;
1167    jjtree.openNodeScope(jjtn000);
1168    jjtreeOpenNodeScope(jjtn000);
1169 /*@egen*/
1170    boolean extendsMoreThanOne = false;
1171    String s;
1172 }
1173 {/*@bgen(jjtree) SuperList */
1174    try {
1175 /*@egen*/
1176    "extends" s = ClassOrInterfaceType() { jjtn000.list.add(s);}
1177    ( "," s = ClassOrInterfaceType() { extendsMoreThanOne = true; jjtn000.list.add(s); } )*/*@bgen(jjtree)*/
1178    {
1179      jjtree.closeNodeScope(jjtn000, true);
1180      jjtc000 = false;
1181      jjtreeCloseNodeScope(jjtn000);
1182    }
1183 /*@egen*/
1184    {
1185       if (extendsMoreThanOne && !isInterface)
1186          throw new ParseException("A class cannot extend more than one other class");
1187    }/*@bgen(jjtree)*/
1188    } catch (Throwable jjte000) {
1189      if (jjtc000) {
1190        jjtree.clearNodeScope(jjtn000);
1191        jjtc000 = false;
1192      } else {
1193        jjtree.popNode();
1194      }
1195      if (jjte000 instanceof RuntimeException) {
1196        throw (RuntimeException)jjte000;
1197      }
1198      if (jjte000 instanceof ParseException) {
1199        throw (ParseException)jjte000;
1200      }
1201      throw (Error)jjte000;
1202    } finally {
1203      if (jjtc000) {
1204        jjtree.closeNodeScope(jjtn000, true);
1205        jjtreeCloseNodeScope(jjtn000);
1206      }
1207    }
1208 /*@egen*/
1209 }
1210 
1211 void ImplementsList(boolean isInterface)           :
1212 {/*@bgen(jjtree) SuperList */
1213    ASTSuperList jjtn000 = new ASTSuperList(this, JJTSUPERLIST);
1214    boolean jjtc000 = true;
1215    jjtree.openNodeScope(jjtn000);
1216    jjtreeOpenNodeScope(jjtn000);
1217 /*@egen*/
1218    String s;
1219 }
1220 {/*@bgen(jjtree) SuperList */
1221    try {
1222 /*@egen*/
1223    "implements" s = ClassOrInterfaceType() { jjtn000.list.add(s);}
1224    ( "," s = ClassOrInterfaceType() { jjtn000.list.add(s);} )*/*@bgen(jjtree)*/
1225    {
1226      jjtree.closeNodeScope(jjtn000, true);
1227      jjtc000 = false;
1228      jjtreeCloseNodeScope(jjtn000);
1229    }
1230 /*@egen*/
1231    {
1232       if (isInterface)
1233          throw new ParseException("An interface cannot implement other interfaces");
1234    }/*@bgen(jjtree)*/
1235    } catch (Throwable jjte000) {
1236      if (jjtc000) {
1237        jjtree.clearNodeScope(jjtn000);
1238        jjtc000 = false;
1239      } else {
1240        jjtree.popNode();
1241      }
1242      if (jjte000 instanceof RuntimeException) {
1243        throw (RuntimeException)jjte000;
1244      }
1245      if (jjte000 instanceof ParseException) {
1246        throw (ParseException)jjte000;
1247      }
1248      throw (Error)jjte000;
1249    } finally {
1250      if (jjtc000) {
1251        jjtree.closeNodeScope(jjtn000, true);
1252        jjtreeCloseNodeScope(jjtn000);
1253      }
1254    }
1255 /*@egen*/
1256 }
1257 
1258 void EnumDeclaration()          :
1259 {/*@bgen(jjtree) NewType */
1260   ASTNewType jjtn000 = new ASTNewType(this, JJTNEWTYPE);
1261   boolean jjtc000 = true;
1262   jjtree.openNodeScope(jjtn000);
1263   jjtreeOpenNodeScope(jjtn000);
1264 /*@egen*/ String name; }
1265 {/*@bgen(jjtree) NewType */
1266   try {
1267 /*@egen*/
1268   "enum" name = NewName() { jjtn000.name = name; }
1269   [ ImplementsList(false) ]
1270   EnumBody()/*@bgen(jjtree)*/
1271   } catch (Throwable jjte000) {
1272     if (jjtc000) {
1273       jjtree.clearNodeScope(jjtn000);
1274       jjtc000 = false;
1275     } else {
1276       jjtree.popNode();
1277     }
1278     if (jjte000 instanceof RuntimeException) {
1279       throw (RuntimeException)jjte000;
1280     }
1281     if (jjte000 instanceof ParseException) {
1282       throw (ParseException)jjte000;
1283     }
1284     throw (Error)jjte000;
1285   } finally {
1286     if (jjtc000) {
1287       jjtree.closeNodeScope(jjtn000, true);
1288       jjtreeCloseNodeScope(jjtn000);
1289     }
1290   }
1291 /*@egen*/
1292 }
1293 
1294 void EnumBody():
1295 {}
1296 {
1297    "{"
1298    [ EnumConstant() ( LOOKAHEAD(2) "," EnumConstant() )* ]
1299    [ "," ]
1300    [ ";" ( ClassOrInterfaceBodyDeclaration(false) )* ]
1301    "}"
1302 }
1303 
1304 void EnumConstant():
1305 {}
1306 {
1307   Modifiers() JavaIdentifier() [ Arguments() ] [ ClassOrInterfaceBody(false) ]
1308 }
1309 
1310 void TypeParameters():
1311 {}
1312 {
1313    "<" TypeParameter() ( "," TypeParameter() )* ">"
1314 }
1315 
1316 void TypeParameter():
1317 {}
1318 {
1319    JavaIdentifier() [ TypeBound() ]
1320 }
1321 
1322 void TypeBound():
1323 {}
1324 {
1325    "extends" ClassOrInterfaceType() ( "&" ClassOrInterfaceType() )*
1326 }
1327 
1328 void ClassOrInterfaceBody(boolean isInterface):
1329 /*
1330  * Parsing this fills "tokens" with all tokens of the block
1331  * excluding the braces at each end.
1332  */
1333 {}
1334 {
1335   "{"
1336   ( ClassOrInterfaceBodyDeclaration(isInterface) )*
1337   "}"
1338 }
1339 
1340 void ClassOrInterfaceBodyDeclaration(boolean isInterface):
1341 {
1342    boolean isNestedInterface = false;
1343    int modifiers;
1344 }
1345 {
1346   LOOKAHEAD(2)
1347   Initializer()
1348   {
1349      if (isInterface)
1350         throw new ParseException("An interface cannot have initializers");
1351   }
1352 |
1353   Modifiers() // Just get all the modifiers out of the way. If you want to do
1354               // more checks, pass the modifiers down to the member
1355   (
1356       ClassOrInterfaceDeclaration()
1357     |
1358       EnumDeclaration()
1359     |
1360       LOOKAHEAD( [ TypeParameters() ] JavaIdentifier() "(" )
1361       ConstructorDeclaration()
1362     |
1363       LOOKAHEAD( Type() JavaIdentifier() ( "[" "]" )* ( "," | "=" | ";" ) )
1364       FieldDeclaration()
1365     |
1366       MethodDeclaration()
1367   )
1368 |
1369   ";"
1370 }
1371 
1372 void FieldDeclaration():
1373 {}
1374 {
1375   // Modifiers are already matched in the caller
1376   Type() VariableDeclarator() ( "," VariableDeclarator() )* ";"
1377 }
1378 
1379 void FieldVariableDeclarator():
1380 {}
1381 {
1382   FieldVariableDeclaratorId() [ "=" VariableInitializer() ]
1383 }
1384 
1385 void FieldVariableDeclaratorId():
1386 {}
1387 {
1388   NewName() ( "[" "]" )*
1389 }
1390 
1391 void VariableDeclarator():
1392 {}
1393 {
1394   VariableDeclaratorId() [ "=" VariableInitializer() ]
1395 }
1396 
1397 void VariableDeclaratorId():
1398 {}
1399 {
1400   JavaIdentifier() ( "[" "]" )*
1401 }
1402 
1403 void VariableInitializer():
1404 {}
1405 {
1406   ArrayInitializer()
1407 |
1408   Expression()
1409 }
1410 
1411 void ArrayInitializer():
1412 {}
1413 {
1414   "{" [ VariableInitializer() ( LOOKAHEAD(2) "," VariableInitializer() )* ] [ "," ] "}"
1415 }
1416 
1417 void MethodDeclaration():
1418 {}
1419 {
1420   // Modifiers already matched in the caller!
1421   [ TypeParameters() ]
1422   ResultType()
1423   MethodDeclarator() [ "throws" NameList() ]
1424   ( Block() | ";" )
1425 }
1426 
1427 void MethodDeclarator():
1428 {}
1429 {
1430   NewName() FormalParameters() ( "[" "]" )*
1431 }
1432 
1433 void FormalParameters() :
1434 /*
1435  * Parsing this fills "tokens" with all tokens of the formal
1436  * parameters excluding the parentheses at each end.
1437  */
1438 {}
1439 {
1440   "("
1441   [ FormalParameter() ( "," FormalParameter() )* ]
1442   ")"
1443 }
1444 
1445 void FormalParameter():
1446 {}
1447 {
1448   Modifiers() Type() [ "..." ] VariableDeclaratorId()
1449 }
1450 
1451 void ConstructorDeclaration():
1452 {}
1453 {
1454   [ TypeParameters() ]
1455   // Modifiers matched in the caller
1456   JavaIdentifier() FormalParameters() [ "throws" NameList() ]
1457   "{"
1458     [ LOOKAHEAD(ExplicitConstructorInvocation()) ExplicitConstructorInvocation() ]
1459     ( BlockStatement() )*
1460   "}"
1461 }
1462 
1463 void ExplicitConstructorInvocation():
1464 {}
1465 {
1466   LOOKAHEAD("this" Arguments() ";")
1467   "this" Arguments() ";"
1468 |
1469   [ LOOKAHEAD(2) PrimaryExpression() "." ] "super" Arguments() ";"
1470 }
1471 
1472 void Initializer():
1473 {}
1474 {
1475   [ "static" ] Block()
1476 }
1477 
1478 
1479 /*
1480  * Type, name and expression syntax follows.
1481  */
1482 
1483 void Type():
1484 {}
1485 {
1486    LOOKAHEAD(2) ReferenceType()
1487  |
1488    PrimitiveType()
1489 }
1490 
1491 void ReferenceType():
1492 {}
1493 {
1494    PrimitiveType() ( LOOKAHEAD(2) "[" "]" )+
1495   |
1496    ( ClassOrInterfaceType() ) ( LOOKAHEAD(2) "[" "]" )*
1497 }
1498 
1499 String ClassOrInterfaceType():
1500 {
1501   String s, s1;
1502   StringBuilder sb = new StringBuilder();
1503 }
1504 {
1505   s = Name() [ LOOKAHEAD(2) TypeArguments() ]
1506   ( LOOKAHEAD(2) "." s1 = Name() { sb.append("."); sb.append(s1);}
1507   [ LOOKAHEAD(2) TypeArguments() ] )*
1508   {
1509     return s + sb.toString();
1510   }
1511 }
1512 
1513 void TypeArguments():
1514 {}
1515 {
1516    "<" TypeArgument() ( "," TypeArgument() )* ">"
1517 }
1518 
1519 void TypeArgument():
1520 {}
1521 {
1522    ReferenceType()
1523  |
1524    "?" [ WildcardBounds() ]
1525 }
1526 
1527 void WildcardBounds():
1528 {}
1529 {
1530    "extends" ReferenceType()
1531  |
1532    "super" ReferenceType()
1533 }
1534 
1535 
1536 void PrimitiveType():
1537 {}
1538 {
1539   "boolean"
1540 |
1541   "char"
1542 |
1543   "byte"
1544 |
1545   "short"
1546 |
1547   "int"
1548 |
1549   "long"
1550 |
1551   "float"
1552 |
1553   "double"
1554 }
1555 
1556 
1557 void ResultType() :
1558 {}
1559 {
1560 (
1561   "void"
1562 |
1563   Type()
1564 )
1565 }
1566 
1567 String Name()       :
1568 /*
1569  * A lookahead of 2 is required below since "Name" can be followed
1570  * by a ".*" when used in the context of an "ImportDeclaration".
1571  */
1572 {/*@bgen(jjtree) Name */
1573   ASTName jjtn000 = new ASTName(this, JJTNAME);
1574   boolean jjtc000 = true;
1575   jjtree.openNodeScope(jjtn000);
1576   jjtreeOpenNodeScope(jjtn000);
1577 /*@egen*/
1578   String s, ss;
1579 }
1580 {/*@bgen(jjtree) Name */
1581   try {
1582 /*@egen*/
1583   s=JavaIdentifier()
1584   ( LOOKAHEAD(2) "." ss=JavaIdentifier() { s += "." + ss; } )*/*@bgen(jjtree)*/
1585         {
1586           jjtree.closeNodeScope(jjtn000, true);
1587           jjtc000 = false;
1588           jjtreeCloseNodeScope(jjtn000);
1589         }
1590 /*@egen*/
1591         {
1592           return jjtn000.text = s;
1593         }/*@bgen(jjtree)*/
1594   } catch (Throwable jjte000) {
1595     if (jjtc000) {
1596       jjtree.clearNodeScope(jjtn000);
1597       jjtc000 = false;
1598     } else {
1599       jjtree.popNode();
1600     }
1601     if (jjte000 instanceof RuntimeException) {
1602       throw (RuntimeException)jjte000;
1603     }
1604     if (jjte000 instanceof ParseException) {
1605       throw (ParseException)jjte000;
1606     }
1607     throw (Error)jjte000;
1608   } finally {
1609     if (jjtc000) {
1610       jjtree.closeNodeScope(jjtn000, true);
1611       jjtreeCloseNodeScope(jjtn000);
1612     }
1613   }
1614 /*@egen*/
1615 }
1616 
1617 void NameList():
1618 {}
1619 {
1620   Name() ( "," Name() )*
1621 }
1622 
1623 
1624 /*
1625  * Expression syntax follows.
1626  */
1627 
1628 void Expression() :
1629 /*
1630  * This expansion has been written this way instead of:
1631  *   Assignment() | ConditionalExpression()
1632  * for performance reasons.
1633  * However, it is a weakening of the grammar for it allows the LHS of
1634  * assignments to be any conditional expression whereas it can only be
1635  * a primary expression.  Consider adding a semantic predicate to work
1636  * around this.
1637  */
1638 {}
1639 {
1640   ConditionalExpression()
1641   [
1642     LOOKAHEAD(2)
1643     AssignmentOperator() Expression()
1644   ]
1645 }
1646 
1647 
1648 void AssignmentOperator():
1649 {}
1650 {
1651   "=" | "*=" | "/=" | "%=" | "+=" | "-=" | "<<=" | ">>=" | ">>>=" | "&=" | "^=" | "|="
1652 }
1653 
1654 void ConditionalExpression():
1655 {}
1656 {
1657   ConditionalOrExpression() [ "?" Expression() ":" Expression() ]
1658 }
1659 
1660 void ConditionalOrExpression():
1661 {}
1662 {
1663   ConditionalAndExpression() ( "||" ConditionalAndExpression() )*
1664 }
1665 
1666 void ConditionalAndExpression():
1667 {}
1668 {
1669   InclusiveOrExpression() ( "&&" InclusiveOrExpression() )*
1670 }
1671 
1672 void InclusiveOrExpression():
1673 {}
1674 {
1675   ExclusiveOrExpression() ( "|" ExclusiveOrExpression() )*
1676 }
1677 
1678 void ExclusiveOrExpression():
1679 {}
1680 {
1681   AndExpression() ( "^" AndExpression() )*
1682 }
1683 
1684 void AndExpression():
1685 {}
1686 {
1687   EqualityExpression() ( "&" EqualityExpression() )*
1688 }
1689 
1690 void EqualityExpression():
1691 {}
1692 {
1693   InstanceOfExpression() ( ( "==" | "!=" ) InstanceOfExpression() )*
1694 }
1695 
1696 void InstanceOfExpression():
1697 {}
1698 {
1699   RelationalExpression() [ "instanceof" Type() ]
1700 }
1701 
1702 void RelationalExpression():
1703 {}
1704 {
1705   ShiftExpression() ( ( "<" | ">" | "<=" | ">=" ) ShiftExpression() )*
1706 }
1707 
1708 void ShiftExpression():
1709 {}
1710 {
1711   AdditiveExpression() ( ( "<<" | RSIGNEDSHIFT() | RUNSIGNEDSHIFT() ) AdditiveExpression() )*
1712 }
1713 
1714 void AdditiveExpression():
1715 {}
1716 {
1717   MultiplicativeExpression() ( ( "+" | "-" ) MultiplicativeExpression() )*
1718 }
1719 
1720 void MultiplicativeExpression():
1721 {}
1722 {
1723   UnaryExpression() ( ( "*" | "/" | "%" ) UnaryExpression() )*
1724 }
1725 
1726 void UnaryExpression():
1727 {}
1728 {
1729   ( "+" | "-" ) UnaryExpression()
1730 |
1731   PreIncrementExpression()
1732 |
1733   PreDecrementExpression()
1734 |
1735   UnaryExpressionNotPlusMinus()
1736 }
1737 
1738 void PreIncrementExpression():
1739 {}
1740 {
1741   "++" PrimaryExpression()
1742 }
1743 
1744 void PreDecrementExpression():
1745 {}
1746 {
1747   "--" PrimaryExpression()
1748 }
1749 
1750 void UnaryExpressionNotPlusMinus():
1751 {}
1752 {
1753   ( "~" | "!" ) UnaryExpression()
1754 |
1755   LOOKAHEAD( CastLookahead() )
1756   CastExpression()
1757 |
1758   PostfixExpression()
1759 }
1760 
1761 // This production is to determine lookahead only.  The LOOKAHEAD specifications
1762 // below are not used, but they are there just to indicate that we know about
1763 // this.
1764 void CastLookahead():
1765 {}
1766 {
1767   LOOKAHEAD(2)
1768   "(" PrimitiveType()
1769 |
1770   LOOKAHEAD("(" Type() "[")
1771   "(" Type() "[" "]"
1772 |
1773   "(" Type() ")" ( "~" | "!" | "(" | JavaIdentifier() | "this" | "super" | "new" | Literal() )
1774 }
1775 
1776 void PostfixExpression():
1777 {}
1778 {
1779   PrimaryExpression() [ "++" | "--" ]
1780 }
1781 
1782 void CastExpression():
1783 {}
1784 {
1785   LOOKAHEAD("(" PrimitiveType())
1786   "(" Type() ")" UnaryExpression()
1787 |
1788   "(" Type() ")" UnaryExpressionNotPlusMinus()
1789 }
1790 
1791 void PrimaryExpression() :
1792 {}
1793 {
1794   PrimaryPrefix() ( LOOKAHEAD(2) PrimarySuffix() )*
1795 }
1796 
1797 void MemberSelector():
1798 {}
1799 {
1800   "." TypeArguments() JavaIdentifier()
1801 }
1802 
1803 void PrimaryPrefix():
1804 {}
1805 {
1806   Literal()
1807 |
1808   "this"
1809 |
1810   "super" "." JavaIdentifier()
1811 |
1812   "(" Expression() ")"
1813 |
1814   AllocationExpression()
1815 |
1816   LOOKAHEAD( ResultType() "." "class" )
1817   ResultType() "." "class"
1818 |
1819   Name()
1820 }
1821 
1822 void PrimarySuffix():
1823 {}
1824 {
1825   LOOKAHEAD(2)
1826   "." "this"
1827 |
1828   LOOKAHEAD(2)
1829   "." AllocationExpression()
1830 |
1831   LOOKAHEAD(3)
1832   MemberSelector()
1833 |
1834   "[" Expression() "]"
1835 |
1836   "." JavaIdentifier()
1837 |
1838   Arguments()
1839 }
1840 
1841 void Literal():
1842 {}
1843 {
1844   <INTEGER_LITERAL>
1845 |
1846   <FLOATING_POINT_LITERAL>
1847 |
1848   <CHARACTER_LITERAL>
1849 |
1850   <STRING_LITERAL>
1851 |
1852   BooleanLiteral()
1853 |
1854   NullLiteral()
1855 }
1856 
1857 Token IntegerLiteral() :
1858 {
1859   Token t;
1860 }
1861 {
1862   t=<INTEGER_LITERAL>
1863                 {
1864           return t;
1865         }
1866 }
1867 
1868 Token BooleanLiteral() :
1869 {
1870   Token t;
1871 }
1872 {
1873   t="true"
1874                 {
1875           return t;
1876         }
1877 |
1878   t="false"
1879                 {
1880           return t;
1881         }
1882 }
1883 
1884 Token StringLiteral() :
1885 {
1886   Token t;
1887 }
1888 {
1889   t=<STRING_LITERAL>
1890                 {
1891           return t;
1892         }
1893 }
1894 
1895 void NullLiteral() :
1896 {}
1897 {
1898   "null"
1899 }
1900 
1901 void Arguments() :
1902 /*
1903  * Parsing this fills "tokens" with all tokens of the arguments
1904  * excluding the parentheses at each end.
1905 */
1906 {}
1907 {
1908   "("
1909   [ ArgumentList() ]
1910   ")"
1911 }
1912 
1913 void ArgumentList():
1914 {}
1915 {
1916   Expression() ( "," Expression() )*
1917 }
1918 
1919 void AllocationExpression():
1920 {}
1921 {
1922   LOOKAHEAD(2)
1923   "new" PrimitiveType() ArrayDimsAndInits()
1924 |
1925   "new" ClassOrInterfaceType() [ TypeArguments() ]
1926     (
1927       ArrayDimsAndInits()
1928     |
1929       Arguments() [ ClassOrInterfaceBody(false) ]
1930     )
1931 }
1932 
1933 /*
1934  * The third LOOKAHEAD specification below is to parse to PrimarySuffix
1935  * if there is an expression between the "[...]".
1936  */
1937 void ArrayDimsAndInits():
1938 {}
1939 {
1940   LOOKAHEAD(2)
1941   ( LOOKAHEAD(2) "[" Expression() "]" )+ ( LOOKAHEAD(2) "[" "]" )*
1942 |
1943   ( "[" "]" )+ ArrayInitializer()
1944 }
1945 
1946 
1947 /*
1948  * Statement syntax follows.
1949  */
1950 
1951 void Statement():
1952 {}
1953 {
1954   LOOKAHEAD(2)
1955   LabeledStatement()
1956 |
1957   AssertStatement()
1958 |
1959   Block()
1960 |
1961   EmptyStatement()
1962 |
1963   StatementExpression() ";"
1964 |
1965   SwitchStatement()
1966 |
1967   IfStatement()
1968 |
1969   WhileStatement()
1970 |
1971   DoStatement()
1972 |
1973   ForStatement()
1974 |
1975   BreakStatement()
1976 |
1977   ContinueStatement()
1978 |
1979   ReturnStatement()
1980 |
1981   ThrowStatement()
1982 |
1983   SynchronizedStatement()
1984 |
1985   TryStatement()
1986 }
1987 
1988 void AssertStatement():
1989 {}
1990 {
1991   "assert" Expression() [ ":" Expression() ] ";"
1992 }
1993 
1994 void LabeledStatement():
1995 {}
1996 {
1997   JavaIdentifier() ":" Statement()
1998 }
1999 
2000 void Block() :
2001 /*
2002  * Parsing this fills "tokens" with all tokens of the block
2003  * excluding the braces at each end.
2004  */
2005 {}
2006 {
2007   "{"
2008   ( BlockStatement() )*
2009   "}"
2010 }
2011 
2012 void BlockStatement():
2013 {}
2014 {
2015   LOOKAHEAD( Modifiers() Type() JavaIdentifier() )
2016   LocalVariableDeclaration() ";"
2017 |
2018   Statement()
2019 |
2020   ClassOrInterfaceDeclaration( )
2021 }
2022 
2023 void LocalVariableDeclaration():
2024 {}
2025 {
2026   Modifiers() Type() VariableDeclarator() ( "," VariableDeclarator() )*
2027 }
2028 
2029 void EmptyStatement():
2030 {}
2031 {
2032   ";"
2033 }
2034 
2035 void StatementExpression():
2036 /*
2037  * The last expansion of this production accepts more than the legal
2038  * Java expansions for StatementExpression.  This expansion does not
2039  * use PostfixExpression for performance reasons.
2040  */
2041 {}
2042 {
2043   PreIncrementExpression()
2044 |
2045   PreDecrementExpression()
2046 |
2047   PrimaryExpression()
2048   [
2049     "++"
2050   |
2051     "--"
2052   |
2053     AssignmentOperator() Expression()
2054   ]
2055 }
2056 
2057 void SwitchStatement():
2058 {}
2059 {
2060   "switch" "(" Expression() ")" "{"
2061     ( SwitchLabel() ( BlockStatement() )* )*
2062   "}"
2063 }
2064 
2065 void SwitchLabel():
2066 {}
2067 {
2068   "case" Expression() ":"
2069 |
2070   "default" ":"
2071 }
2072 
2073 void IfStatement():
2074 /*
2075  * The disambiguating algorithm of JavaCC automatically binds dangling
2076  * else's to the innermost if statement.  The LOOKAHEAD specification
2077  * is to tell JavaCC that we know what we are doing.
2078  */
2079 {}
2080 {
2081   "if" "(" Expression() ")" Statement() [ LOOKAHEAD(1) "else" Statement() ]
2082 }
2083 
2084 void WhileStatement():
2085 {}
2086 {
2087   "while" "(" Expression() ")" Statement()
2088 }
2089 
2090 void DoStatement():
2091 {}
2092 {
2093   "do" Statement() "while" "(" Expression() ")" ";"
2094 }
2095 
2096 void ForStatement():
2097 {}
2098 {
2099   "for" "("
2100 
2101   (
2102       LOOKAHEAD(Modifiers() Type() JavaIdentifier() ":")
2103       Modifiers() Type() JavaIdentifier() ":" Expression()
2104     |
2105      [ ForInit() ] ";" [ Expression() ] ";" [ ForUpdate() ]
2106   )
2107 
2108   ")" Statement()
2109 }
2110 
2111 void ForInit():
2112 {}
2113 {
2114   LOOKAHEAD( Modifiers() Type() JavaIdentifier() )
2115   LocalVariableDeclaration()
2116 |
2117   StatementExpressionList()
2118 }
2119 
2120 void StatementExpressionList():
2121 {}
2122 {
2123   StatementExpression() ( "," StatementExpression() )*
2124 }
2125 
2126 void ForUpdate():
2127 {}
2128 {
2129   StatementExpressionList()
2130 }
2131 
2132 void BreakStatement():
2133 {}
2134 {
2135   "break" [ JavaIdentifier() ] ";"
2136 }
2137 
2138 void ContinueStatement():
2139 {}
2140 {
2141   "continue" [ JavaIdentifier() ] ";"
2142 }
2143 
2144 void ReturnStatement() :
2145 {}
2146 {
2147   "return" [ Expression() ] ";"
2148 }
2149 
2150 void ThrowStatement() :
2151 {}
2152 {
2153   "throw" Expression() ";"
2154 }
2155 
2156 void SynchronizedStatement():
2157 {}
2158 {
2159   "synchronized" "(" Expression() ")" Block()
2160 }
2161 
2162 void TryStatement():
2163 /*
2164  * Semantic check required here to make sure that at least one
2165  * finally/catch is present.
2166  */
2167 {}
2168 {
2169   "try" Block()
2170   ( "catch" "(" FormalParameter() ")" Block() )*
2171   [ "finally" Block() ]
2172 }
2173 
2174 /* We use productions to match >>>, >> and > so that we can keep the
2175  * type declaration syntax with generics clean
2176  */
2177 
2178 void RUNSIGNEDSHIFT():
2179 {}
2180 {
2181   ( LOOKAHEAD({ getToken(1).kind == GT &&
2182                 getToken(1).realKind == RUNSIGNEDSHIFT} )
2183    ">" ">" ">"
2184   )
2185 }
2186 
2187 void RSIGNEDSHIFT():
2188 {}
2189 {
2190   ( LOOKAHEAD({ getToken(1).kind == GT &&
2191                 getToken(1).realKind == RSIGNEDSHIFT} )
2192   ">" ">"
2193   )
2194 }
2195 
2196 /* Annotation syntax follows. */
2197 
2198 void Annotation():
2199 {}
2200 {
2201    LOOKAHEAD( "@" Name() "(" ( JavaIdentifier() "=" | ")" ))
2202    NormalAnnotation()
2203  |
2204    LOOKAHEAD( "@" Name() "(" )
2205    SingleMemberAnnotation()
2206  |
2207    MarkerAnnotation()
2208 }
2209 
2210 void NormalAnnotation():
2211 {}
2212 {
2213    "@" Name() "(" [ MemberValuePairs() ] ")"
2214 }
2215 
2216 void MarkerAnnotation():
2217 {}
2218 {
2219   "@" Name()
2220 }
2221 
2222 void SingleMemberAnnotation():
2223 {}
2224 {
2225   "@" Name() "(" MemberValue() ")"
2226 }
2227 
2228 void MemberValuePairs():
2229 {}
2230 {
2231    MemberValuePair() ( "," MemberValuePair() )*
2232 }
2233 
2234 void MemberValuePair():
2235 {}
2236 {
2237     JavaIdentifier() "=" MemberValue()
2238 }
2239 
2240 void MemberValue():
2241 {}
2242 {
2243    Annotation()
2244  |
2245    MemberValueArrayInitializer()
2246  |
2247    ConditionalExpression()
2248 }
2249 
2250 void  MemberValueArrayInitializer():
2251 {}
2252 {
2253   "{" MemberValue() ( LOOKAHEAD(2) "," MemberValue() )* [ "," ] "}"
2254 }
2255 
2256 
2257 /* Annotation Types. */
2258 
2259 void AnnotationTypeDeclaration():
2260 {}
2261 {
2262   "@" "interface" JavaIdentifier() AnnotationTypeBody()
2263 }
2264 
2265 void AnnotationTypeBody():
2266 {}
2267 {
2268   "{" ( AnnotationTypeMemberDeclaration() )* "}"
2269 }
2270 
2271 void AnnotationTypeMemberDeclaration():
2272 {}
2273 {
2274  Modifiers()
2275  (
2276    LOOKAHEAD(Type() JavaIdentifier() "(")
2277    Type() JavaIdentifier() "(" ")" [ DefaultValue() ] ";"
2278   |
2279    ClassOrInterfaceDeclaration()
2280   |
2281    EnumDeclaration()
2282   |
2283    AnnotationTypeDeclaration()
2284   |
2285    FieldDeclaration()
2286  )
2287  |
2288    ( ";" )
2289 }
2290 
2291 void DefaultValue():
2292 {}
2293 {
2294   "default" MemberValue()
2295 }
2296 
2297 /* IDENTIFIERS */
2298 
2299 TOKEN :
2300 {
2301   < IDENTIFIER: <LETTER> (<PART_LETTER>)* >
2302 |
2303   < #LETTER:
2304       [  // all chars for which Character.isIdentifierStart is true
2305          "$",
2306          "A"-"Z",
2307          "_",
2308          "a"-"z",
2309          "\u00a2"-"\u00a5",
2310          "\u00aa",
2311          "\u00b5",
2312          "\u00ba",
2313          "\u00c0"-"\u00d6",
2314          "\u00d8"-"\u00f6",
2315          "\u00f8"-"\u021f",
2316          "\u0222"-"\u0233",
2317          "\u0250"-"\u02ad",
2318          "\u02b0"-"\u02b8",
2319          "\u02bb"-"\u02c1",
2320          "\u02d0"-"\u02d1",
2321          "\u02e0"-"\u02e4",
2322          "\u02ee",
2323          "\u037a",
2324          "\u0386",
2325          "\u0388"-"\u038a",
2326          "\u038c",
2327          "\u038e"-"\u03a1",
2328          "\u03a3"-"\u03ce",
2329          "\u03d0"-"\u03d7",
2330          "\u03da"-"\u03f3",
2331          "\u0400"-"\u0481",
2332          "\u048c"-"\u04c4",
2333          "\u04c7"-"\u04c8",
2334          "\u04cb"-"\u04cc",
2335          "\u04d0"-"\u04f5",
2336          "\u04f8"-"\u04f9",
2337          "\u0531"-"\u0556",
2338          "\u0559",
2339          "\u0561"-"\u0587",
2340          "\u05d0"-"\u05ea",
2341          "\u05f0"-"\u05f2",
2342          "\u0621"-"\u063a",
2343          "\u0640"-"\u064a",
2344          "\u0671"-"\u06d3",
2345          "\u06d5",
2346          "\u06e5"-"\u06e6",
2347          "\u06fa"-"\u06fc",
2348          "\u0710",
2349          "\u0712"-"\u072c",
2350          "\u0780"-"\u07a5",
2351          "\u0905"-"\u0939",
2352          "\u093d",
2353          "\u0950",
2354          "\u0958"-"\u0961",
2355          "\u0985"-"\u098c",
2356          "\u098f"-"\u0990",
2357          "\u0993"-"\u09a8",
2358          "\u09aa"-"\u09b0",
2359          "\u09b2",
2360          "\u09b6"-"\u09b9",
2361          "\u09dc"-"\u09dd",
2362          "\u09df"-"\u09e1",
2363          "\u09f0"-"\u09f3",
2364          "\u0a05"-"\u0a0a",
2365          "\u0a0f"-"\u0a10",
2366          "\u0a13"-"\u0a28",
2367          "\u0a2a"-"\u0a30",
2368          "\u0a32"-"\u0a33",
2369          "\u0a35"-"\u0a36",
2370          "\u0a38"-"\u0a39",
2371          "\u0a59"-"\u0a5c",
2372          "\u0a5e",
2373          "\u0a72"-"\u0a74",
2374          "\u0a85"-"\u0a8b",
2375          "\u0a8d",
2376          "\u0a8f"-"\u0a91",
2377          "\u0a93"-"\u0aa8",
2378          "\u0aaa"-"\u0ab0",
2379          "\u0ab2"-"\u0ab3",
2380          "\u0ab5"-"\u0ab9",
2381          "\u0abd",
2382          "\u0ad0",
2383          "\u0ae0",
2384          "\u0b05"-"\u0b0c",
2385          "\u0b0f"-"\u0b10",
2386          "\u0b13"-"\u0b28",
2387          "\u0b2a"-"\u0b30",
2388          "\u0b32"-"\u0b33",
2389          "\u0b36"-"\u0b39",
2390          "\u0b3d",
2391          "\u0b5c"-"\u0b5d",
2392          "\u0b5f"-"\u0b61",
2393          "\u0b85"-"\u0b8a",
2394          "\u0b8e"-"\u0b90",
2395          "\u0b92"-"\u0b95",
2396          "\u0b99"-"\u0b9a",
2397          "\u0b9c",
2398          "\u0b9e"-"\u0b9f",
2399          "\u0ba3"-"\u0ba4",
2400          "\u0ba8"-"\u0baa",
2401          "\u0bae"-"\u0bb5",
2402          "\u0bb7"-"\u0bb9",
2403          "\u0c05"-"\u0c0c",
2404          "\u0c0e"-"\u0c10",
2405          "\u0c12"-"\u0c28",
2406          "\u0c2a"-"\u0c33",
2407          "\u0c35"-"\u0c39",
2408          "\u0c60"-"\u0c61",
2409          "\u0c85"-"\u0c8c",
2410          "\u0c8e"-"\u0c90",
2411          "\u0c92"-"\u0ca8",
2412          "\u0caa"-"\u0cb3",
2413          "\u0cb5"-"\u0cb9",
2414          "\u0cde",
2415          "\u0ce0"-"\u0ce1",
2416          "\u0d05"-"\u0d0c",
2417          "\u0d0e"-"\u0d10",
2418          "\u0d12"-"\u0d28",
2419          "\u0d2a"-"\u0d39",
2420          "\u0d60"-"\u0d61",
2421          "\u0d85"-"\u0d96",
2422          "\u0d9a"-"\u0db1",
2423          "\u0db3"-"\u0dbb",
2424          "\u0dbd",
2425          "\u0dc0"-"\u0dc6",
2426          "\u0e01"-"\u0e30",
2427          "\u0e32"-"\u0e33",
2428          "\u0e3f"-"\u0e46",
2429          "\u0e81"-"\u0e82",
2430          "\u0e84",
2431          "\u0e87"-"\u0e88",
2432          "\u0e8a",
2433          "\u0e8d",
2434          "\u0e94"-"\u0e97",
2435          "\u0e99"-"\u0e9f",
2436          "\u0ea1"-"\u0ea3",
2437          "\u0ea5",
2438          "\u0ea7",
2439          "\u0eaa"-"\u0eab",
2440          "\u0ead"-"\u0eb0",
2441          "\u0eb2"-"\u0eb3",
2442          "\u0ebd",
2443          "\u0ec0"-"\u0ec4",
2444          "\u0ec6",
2445          "\u0edc"-"\u0edd",
2446          "\u0f00",
2447          "\u0f40"-"\u0f47",
2448          "\u0f49"-"\u0f6a",
2449          "\u0f88"-"\u0f8b",
2450          "\u1000"-"\u1021",
2451          "\u1023"-"\u1027",
2452          "\u1029"-"\u102a",
2453          "\u1050"-"\u1055",
2454          "\u10a0"-"\u10c5",
2455          "\u10d0"-"\u10f6",
2456          "\u1100"-"\u1159",
2457          "\u115f"-"\u11a2",
2458          "\u11a8"-"\u11f9",
2459          "\u1200"-"\u1206",
2460          "\u1208"-"\u1246",
2461          "\u1248",
2462          "\u124a"-"\u124d",
2463          "\u1250"-"\u1256",
2464          "\u1258",
2465          "\u125a"-"\u125d",
2466          "\u1260"-"\u1286",
2467          "\u1288",
2468          "\u128a"-"\u128d",
2469          "\u1290"-"\u12ae",
2470          "\u12b0",
2471          "\u12b2"-"\u12b5",
2472          "\u12b8"-"\u12be",
2473          "\u12c0",
2474          "\u12c2"-"\u12c5",
2475          "\u12c8"-"\u12ce",
2476          "\u12d0"-"\u12d6",
2477          "\u12d8"-"\u12ee",
2478          "\u12f0"-"\u130e",
2479          "\u1310",
2480          "\u1312"-"\u1315",
2481          "\u1318"-"\u131e",
2482          "\u1320"-"\u1346",
2483          "\u1348"-"\u135a",
2484          "\u13a0"-"\u13f4",
2485          "\u1401"-"\u166c",
2486          "\u166f"-"\u1676",
2487          "\u1681"-"\u169a",
2488          "\u16a0"-"\u16ea",
2489          "\u1780"-"\u17b3",
2490          "\u17db",
2491          "\u1820"-"\u1877",
2492          "\u1880"-"\u18a8",
2493          "\u1e00"-"\u1e9b",
2494          "\u1ea0"-"\u1ef9",
2495          "\u1f00"-"\u1f15",
2496          "\u1f18"-"\u1f1d",
2497          "\u1f20"-"\u1f45",
2498          "\u1f48"-"\u1f4d",
2499          "\u1f50"-"\u1f57",
2500          "\u1f59",
2501          "\u1f5b",
2502          "\u1f5d",
2503          "\u1f5f"-"\u1f7d",
2504          "\u1f80"-"\u1fb4",
2505          "\u1fb6"-"\u1fbc",
2506          "\u1fbe",
2507          "\u1fc2"-"\u1fc4",
2508          "\u1fc6"-"\u1fcc",
2509          "\u1fd0"-"\u1fd3",
2510          "\u1fd6"-"\u1fdb",
2511          "\u1fe0"-"\u1fec",
2512          "\u1ff2"-"\u1ff4",
2513          "\u1ff6"-"\u1ffc",
2514          "\u203f"-"\u2040",
2515          "\u207f",
2516          "\u20a0"-"\u20af",
2517          "\u2102",
2518          "\u2107",
2519          "\u210a"-"\u2113",
2520          "\u2115",
2521          "\u2119"-"\u211d",
2522          "\u2124",
2523          "\u2126",
2524          "\u2128",
2525          "\u212a"-"\u212d",
2526          "\u212f"-"\u2131",
2527          "\u2133"-"\u2139",
2528          "\u2160"-"\u2183",
2529          "\u3005"-"\u3007",
2530          "\u3021"-"\u3029",
2531          "\u3031"-"\u3035",
2532          "\u3038"-"\u303a",
2533          "\u3041"-"\u3094",
2534          "\u309d"-"\u309e",
2535          "\u30a1"-"\u30fe",
2536          "\u3105"-"\u312c",
2537          "\u3131"-"\u318e",
2538          "\u31a0"-"\u31b7",
2539          "\u3400"-"\u4db5",
2540          "\u4e00"-"\u9fa5",
2541          "\ua000"-"\ua48c",
2542          "\uac00"-"\ud7a3",
2543          "\uf900"-"\ufa2d",
2544          "\ufb00"-"\ufb06",
2545          "\ufb13"-"\ufb17",
2546          "\ufb1d",
2547          "\ufb1f"-"\ufb28",
2548          "\ufb2a"-"\ufb36",
2549          "\ufb38"-"\ufb3c",
2550          "\ufb3e",
2551          "\ufb40"-"\ufb41",
2552          "\ufb43"-"\ufb44",
2553          "\ufb46"-"\ufbb1",
2554          "\ufbd3"-"\ufd3d",
2555          "\ufd50"-"\ufd8f",
2556          "\ufd92"-"\ufdc7",
2557          "\ufdf0"-"\ufdfb",
2558          "\ufe33"-"\ufe34",
2559          "\ufe4d"-"\ufe4f",
2560          "\ufe69",
2561          "\ufe70"-"\ufe72",
2562          "\ufe74",
2563          "\ufe76"-"\ufefc",
2564          "\uff04",
2565          "\uff21"-"\uff3a",
2566          "\uff3f",
2567          "\uff41"-"\uff5a",
2568          "\uff65"-"\uffbe",
2569          "\uffc2"-"\uffc7",
2570          "\uffca"-"\uffcf",
2571          "\uffd2"-"\uffd7",
2572          "\uffda"-"\uffdc",
2573          "\uffe0"-"\uffe1",
2574          "\uffe5"-"\uffe6"
2575       ]
2576   >
2577 |
2578   < #PART_LETTER:
2579       [  // all chars for which Character.isIdentifierPart is true
2580          "\u0000"-"\u0008",
2581          "\u000e"-"\u001b",
2582          "$",
2583          "0"-"9",
2584          "A"-"Z",
2585          "_",
2586          "a"-"z",
2587          "\u007f"-"\u009f",
2588          "\u00a2"-"\u00a5",
2589          "\u00aa",
2590          "\u00b5",
2591          "\u00ba",
2592          "\u00c0"-"\u00d6",
2593          "\u00d8"-"\u00f6",
2594          "\u00f8"-"\u021f",
2595          "\u0222"-"\u0233",
2596          "\u0250"-"\u02ad",
2597          "\u02b0"-"\u02b8",
2598          "\u02bb"-"\u02c1",
2599          "\u02d0"-"\u02d1",
2600          "\u02e0"-"\u02e4",
2601          "\u02ee",
2602          "\u0300"-"\u034e",
2603          "\u0360"-"\u0362",
2604          "\u037a",
2605          "\u0386",
2606          "\u0388"-"\u038a",
2607          "\u038c",
2608          "\u038e"-"\u03a1",
2609          "\u03a3"-"\u03ce",
2610          "\u03d0"-"\u03d7",
2611          "\u03da"-"\u03f3",
2612          "\u0400"-"\u0481",
2613          "\u0483"-"\u0486",
2614          "\u048c"-"\u04c4",
2615          "\u04c7"-"\u04c8",
2616          "\u04cb"-"\u04cc",
2617          "\u04d0"-"\u04f5",
2618          "\u04f8"-"\u04f9",
2619          "\u0531"-"\u0556",
2620          "\u0559",
2621          "\u0561"-"\u0587",
2622          "\u0591"-"\u05a1",
2623          "\u05a3"-"\u05b9",
2624          "\u05bb"-"\u05bd",
2625          "\u05bf",
2626          "\u05c1"-"\u05c2",
2627          "\u05c4",
2628          "\u05d0"-"\u05ea",
2629          "\u05f0"-"\u05f2",
2630          "\u0621"-"\u063a",
2631          "\u0640"-"\u0655",
2632          "\u0660"-"\u0669",
2633          "\u0670"-"\u06d3",
2634          "\u06d5"-"\u06dc",
2635          "\u06df"-"\u06e8",
2636          "\u06ea"-"\u06ed",
2637          "\u06f0"-"\u06fc",
2638          "\u070f"-"\u072c",
2639          "\u0730"-"\u074a",
2640          "\u0780"-"\u07b0",
2641          "\u0901"-"\u0903",
2642          "\u0905"-"\u0939",
2643          "\u093c"-"\u094d",
2644          "\u0950"-"\u0954",
2645          "\u0958"-"\u0963",
2646          "\u0966"-"\u096f",
2647          "\u0981"-"\u0983",
2648          "\u0985"-"\u098c",
2649          "\u098f"-"\u0990",
2650          "\u0993"-"\u09a8",
2651          "\u09aa"-"\u09b0",
2652          "\u09b2",
2653          "\u09b6"-"\u09b9",
2654          "\u09bc",
2655          "\u09be"-"\u09c4",
2656          "\u09c7"-"\u09c8",
2657          "\u09cb"-"\u09cd",
2658          "\u09d7",
2659          "\u09dc"-"\u09dd",
2660          "\u09df"-"\u09e3",
2661          "\u09e6"-"\u09f3",
2662          "\u0a02",
2663          "\u0a05"-"\u0a0a",
2664          "\u0a0f"-"\u0a10",
2665          "\u0a13"-"\u0a28",
2666          "\u0a2a"-"\u0a30",
2667          "\u0a32"-"\u0a33",
2668          "\u0a35"-"\u0a36",
2669          "\u0a38"-"\u0a39",
2670          "\u0a3c",
2671          "\u0a3e"-"\u0a42",
2672          "\u0a47"-"\u0a48",
2673          "\u0a4b"-"\u0a4d",
2674          "\u0a59"-"\u0a5c",
2675          "\u0a5e",
2676          "\u0a66"-"\u0a74",
2677          "\u0a81"-"\u0a83",
2678          "\u0a85"-"\u0a8b",
2679          "\u0a8d",
2680          "\u0a8f"-"\u0a91",
2681          "\u0a93"-"\u0aa8",
2682          "\u0aaa"-"\u0ab0",
2683          "\u0ab2"-"\u0ab3",
2684          "\u0ab5"-"\u0ab9",
2685          "\u0abc"-"\u0ac5",
2686          "\u0ac7"-"\u0ac9",
2687          "\u0acb"-"\u0acd",
2688          "\u0ad0",
2689          "\u0ae0",
2690          "\u0ae6"-"\u0aef",
2691          "\u0b01"-"\u0b03",
2692          "\u0b05"-"\u0b0c",
2693          "\u0b0f"-"\u0b10",
2694          "\u0b13"-"\u0b28",
2695          "\u0b2a"-"\u0b30",
2696          "\u0b32"-"\u0b33",
2697          "\u0b36"-"\u0b39",
2698          "\u0b3c"-"\u0b43",
2699          "\u0b47"-"\u0b48",
2700          "\u0b4b"-"\u0b4d",
2701          "\u0b56"-"\u0b57",
2702          "\u0b5c"-"\u0b5d",
2703          "\u0b5f"-"\u0b61",
2704          "\u0b66"-"\u0b6f",
2705          "\u0b82"-"\u0b83",
2706          "\u0b85"-"\u0b8a",
2707          "\u0b8e"-"\u0b90",
2708          "\u0b92"-"\u0b95",
2709          "\u0b99"-"\u0b9a",
2710          "\u0b9c",
2711          "\u0b9e"-"\u0b9f",
2712          "\u0ba3"-"\u0ba4",
2713          "\u0ba8"-"\u0baa",
2714          "\u0bae"-"\u0bb5",
2715          "\u0bb7"-"\u0bb9",
2716          "\u0bbe"-"\u0bc2",
2717          "\u0bc6"-"\u0bc8",
2718          "\u0bca"-"\u0bcd",
2719          "\u0bd7",
2720          "\u0be7"-"\u0bef",
2721          "\u0c01"-"\u0c03",
2722          "\u0c05"-"\u0c0c",
2723          "\u0c0e"-"\u0c10",
2724          "\u0c12"-"\u0c28",
2725          "\u0c2a"-"\u0c33",
2726          "\u0c35"-"\u0c39",
2727          "\u0c3e"-"\u0c44",
2728          "\u0c46"-"\u0c48",
2729          "\u0c4a"-"\u0c4d",
2730          "\u0c55"-"\u0c56",
2731          "\u0c60"-"\u0c61",
2732          "\u0c66"-"\u0c6f",
2733          "\u0c82"-"\u0c83",
2734          "\u0c85"-"\u0c8c",
2735          "\u0c8e"-"\u0c90",
2736          "\u0c92"-"\u0ca8",
2737          "\u0caa"-"\u0cb3",
2738          "\u0cb5"-"\u0cb9",
2739          "\u0cbe"-"\u0cc4",
2740          "\u0cc6"-"\u0cc8",
2741          "\u0cca"-"\u0ccd",
2742          "\u0cd5"-"\u0cd6",
2743          "\u0cde",
2744          "\u0ce0"-"\u0ce1",
2745          "\u0ce6"-"\u0cef",
2746          "\u0d02"-"\u0d03",
2747          "\u0d05"-"\u0d0c",
2748          "\u0d0e"-"\u0d10",
2749          "\u0d12"-"\u0d28",
2750          "\u0d2a"-"\u0d39",
2751          "\u0d3e"-"\u0d43",
2752          "\u0d46"-"\u0d48",
2753          "\u0d4a"-"\u0d4d",
2754          "\u0d57",
2755          "\u0d60"-"\u0d61",
2756          "\u0d66"-"\u0d6f",
2757          "\u0d82"-"\u0d83",
2758          "\u0d85"-"\u0d96",
2759          "\u0d9a"-"\u0db1",
2760          "\u0db3"-"\u0dbb",
2761          "\u0dbd",
2762          "\u0dc0"-"\u0dc6",
2763          "\u0dca",
2764          "\u0dcf"-"\u0dd4",
2765          "\u0dd6",
2766          "\u0dd8"-"\u0ddf",
2767          "\u0df2"-"\u0df3",
2768          "\u0e01"-"\u0e3a",
2769          "\u0e3f"-"\u0e4e",
2770          "\u0e50"-"\u0e59",
2771          "\u0e81"-"\u0e82",
2772          "\u0e84",
2773          "\u0e87"-"\u0e88",
2774          "\u0e8a",
2775          "\u0e8d",
2776          "\u0e94"-"\u0e97",
2777          "\u0e99"-"\u0e9f",
2778          "\u0ea1"-"\u0ea3",
2779          "\u0ea5",
2780          "\u0ea7",
2781          "\u0eaa"-"\u0eab",
2782          "\u0ead"-"\u0eb9",
2783          "\u0ebb"-"\u0ebd",
2784          "\u0ec0"-"\u0ec4",
2785          "\u0ec6",
2786          "\u0ec8"-"\u0ecd",
2787          "\u0ed0"-"\u0ed9",
2788          "\u0edc"-"\u0edd",
2789          "\u0f00",
2790          "\u0f18"-"\u0f19",
2791          "\u0f20"-"\u0f29",
2792          "\u0f35",
2793          "\u0f37",
2794          "\u0f39",
2795          "\u0f3e"-"\u0f47",
2796          "\u0f49"-"\u0f6a",
2797          "\u0f71"-"\u0f84",
2798          "\u0f86"-"\u0f8b",
2799          "\u0f90"-"\u0f97",
2800          "\u0f99"-"\u0fbc",
2801          "\u0fc6",
2802          "\u1000"-"\u1021",
2803          "\u1023"-"\u1027",
2804          "\u1029"-"\u102a",
2805          "\u102c"-"\u1032",
2806          "\u1036"-"\u1039",
2807          "\u1040"-"\u1049",
2808          "\u1050"-"\u1059",
2809          "\u10a0"-"\u10c5",
2810          "\u10d0"-"\u10f6",
2811          "\u1100"-"\u1159",
2812          "\u115f"-"\u11a2",
2813          "\u11a8"-"\u11f9",
2814          "\u1200"-"\u1206",
2815          "\u1208"-"\u1246",
2816          "\u1248",
2817          "\u124a"-"\u124d",
2818          "\u1250"-"\u1256",
2819          "\u1258",
2820          "\u125a"-"\u125d",
2821          "\u1260"-"\u1286",
2822          "\u1288",
2823          "\u128a"-"\u128d",
2824          "\u1290"-"\u12ae",
2825          "\u12b0",
2826          "\u12b2"-"\u12b5",
2827          "\u12b8"-"\u12be",
2828          "\u12c0",
2829          "\u12c2"-"\u12c5",
2830          "\u12c8"-"\u12ce",
2831          "\u12d0"-"\u12d6",
2832          "\u12d8"-"\u12ee",
2833          "\u12f0"-"\u130e",
2834          "\u1310",
2835          "\u1312"-"\u1315",
2836          "\u1318"-"\u131e",
2837          "\u1320"-"\u1346",
2838          "\u1348"-"\u135a",
2839          "\u1369"-"\u1371",
2840          "\u13a0"-"\u13f4",
2841          "\u1401"-"\u166c",
2842          "\u166f"-"\u1676",
2843          "\u1681"-"\u169a",
2844          "\u16a0"-"\u16ea",
2845          "\u1780"-"\u17d3",
2846          "\u17db",
2847          "\u17e0"-"\u17e9",
2848          "\u180b"-"\u180e",
2849          "\u1810"-"\u1819",
2850          "\u1820"-"\u1877",
2851          "\u1880"-"\u18a9",
2852          "\u1e00"-"\u1e9b",
2853          "\u1ea0"-"\u1ef9",
2854          "\u1f00"-"\u1f15",
2855          "\u1f18"-"\u1f1d",
2856          "\u1f20"-"\u1f45",
2857          "\u1f48"-"\u1f4d",
2858          "\u1f50"-"\u1f57",
2859          "\u1f59",
2860          "\u1f5b",
2861          "\u1f5d",
2862          "\u1f5f"-"\u1f7d",
2863          "\u1f80"-"\u1fb4",
2864          "\u1fb6"-"\u1fbc",
2865          "\u1fbe",
2866          "\u1fc2"-"\u1fc4",
2867          "\u1fc6"-"\u1fcc",
2868          "\u1fd0"-"\u1fd3",
2869          "\u1fd6"-"\u1fdb",
2870          "\u1fe0"-"\u1fec",
2871          "\u1ff2"-"\u1ff4",
2872          "\u1ff6"-"\u1ffc",
2873          "\u200c"-"\u200f",
2874          "\u202a"-"\u202e",
2875          "\u203f"-"\u2040",
2876          "\u206a"-"\u206f",
2877          "\u207f",
2878          "\u20a0"-"\u20af",
2879          "\u20d0"-"\u20dc",
2880          "\u20e1",
2881          "\u2102",
2882          "\u2107",
2883          "\u210a"-"\u2113",
2884          "\u2115",
2885          "\u2119"-"\u211d",
2886          "\u2124",
2887          "\u2126",
2888          "\u2128",
2889          "\u212a"-"\u212d",
2890          "\u212f"-"\u2131",
2891          "\u2133"-"\u2139",
2892          "\u2160"-"\u2183",
2893          "\u3005"-"\u3007",
2894          "\u3021"-"\u302f",
2895          "\u3031"-"\u3035",
2896          "\u3038"-"\u303a",
2897          "\u3041"-"\u3094",
2898          "\u3099"-"\u309a",
2899          "\u309d"-"\u309e",
2900          "\u30a1"-"\u30fe",
2901          "\u3105"-"\u312c",
2902          "\u3131"-"\u318e",
2903          "\u31a0"-"\u31b7",
2904          "\u3400"-"\u4db5",
2905          "\u4e00"-"\u9fa5",
2906          "\ua000"-"\ua48c",
2907          "\uac00"-"\ud7a3",
2908          "\uf900"-"\ufa2d",
2909          "\ufb00"-"\ufb06",
2910          "\ufb13"-"\ufb17",
2911          "\ufb1d"-"\ufb28",
2912          "\ufb2a"-"\ufb36",
2913          "\ufb38"-"\ufb3c",
2914          "\ufb3e",
2915          "\ufb40"-"\ufb41",
2916          "\ufb43"-"\ufb44",
2917          "\ufb46"-"\ufbb1",
2918          "\ufbd3"-"\ufd3d",
2919          "\ufd50"-"\ufd8f",
2920          "\ufd92"-"\ufdc7",
2921          "\ufdf0"-"\ufdfb",
2922          "\ufe20"-"\ufe23",
2923          "\ufe33"-"\ufe34",
2924          "\ufe4d"-"\ufe4f",
2925          "\ufe69",
2926          "\ufe70"-"\ufe72",
2927          "\ufe74",
2928          "\ufe76"-"\ufefc",
2929          "\ufeff",
2930          "\uff04",
2931          "\uff10"-"\uff19",
2932          "\uff21"-"\uff3a",
2933          "\uff3f",
2934          "\uff41"-"\uff5a",
2935          "\uff65"-"\uffbe",
2936          "\uffc2"-"\uffc7",
2937          "\uffca"-"\uffcf",
2938          "\uffd2"-"\uffd7",
2939          "\uffda"-"\uffdc",
2940          "\uffe0"-"\uffe1",
2941          "\uffe5"-"\uffe6",
2942          "\ufff9"-"\ufffb"
2943       ]
2944   >
2945 }
2946