View Javadoc

    1   /* Generated By:JJTree&JavaCC: Do not edit this line. JspParser.java */
    2   package net.sourceforge.pmd.lang.jsp.ast;
    3
    4   import net.sourceforge.pmd.lang.ast.CharStream;
    5   import net.sourceforge.pmd.lang.ast.TokenMgrError;
    6
    7   /**
    8    * JSP Parser for PMD.
    9    * @author Pieter, Application Engineers NV/SA, http://www.ae.be
    10   */
    11  public class JspParser/*@bgen(jjtree)*/implements JspParserTreeConstants, JspParserConstants {/*@bgen(jjtree)*/
    12    protected JJTJspParserState jjtree = new JJTJspParserState();
    13
    14          /**
    15  	* Counter used to keep track of unclosed tags
    16  	*/
    17          private OpenTagRegister tagRegister = new OpenTagRegister();
    18
    19          /**
    20  	 * Return the contents of a quote.
    21  	 * @param quote String - starting and ending with " or '
    22  	 * @return String a substring of quote: quote without the first and list
    23  	 * character.
    24  	 */
    25          private static String quoteContent(String quote) {
    26                  return quote.substring(1, quote.length()-1);
    27          }
    28
    29          /**
    30  	 * Return the contents of a EL expression or a Value Binding expression.
    31  	 * @param expression String - starting with ${ or #{ and ending with }
    32  	 * @return String a substring of expression: expression without the first two and list
    33  	 * characters.
    34  	 */
    35          private static String expressionContent(String expression) {
    36                  return expression.substring(2, expression.length()-1).trim();
    37          }
    38
    39  /** ******************************************************************** */
    40  /** *************************  JSP GRAMMAR  **************************** */
    41  /** ******************************************************************** */
    42
    43  /**
    44   * The root of the AST of a JSP.
    45   */
    46    final public ASTCompilationUnit CompilationUnit() throws ParseException {
    47   /*@bgen(jjtree) CompilationUnit */
    48    ASTCompilationUnit jjtn000 = new ASTCompilationUnit(this, JJTCOMPILATIONUNIT);
    49    boolean jjtc000 = true;
    50    jjtree.openNodeScope(jjtn000);
    51      try {
    52        Prolog();
    53        Content();
    54        jj_consume_token(0);
    55      jjtree.closeNodeScope(jjtn000, true);
    56      jjtc000 = false;
    57      {if (true) return jjtn000;}
    58      } catch (Throwable jjte000) {
    59      if (jjtc000) {
    60        jjtree.clearNodeScope(jjtn000);
    61        jjtc000 = false;
    62      } else {
    63        jjtree.popNode();
    64      }
    65      if (jjte000 instanceof RuntimeException) {
    66        {if (true) throw (RuntimeException)jjte000;}
    67      }
    68      if (jjte000 instanceof ParseException) {
    69        {if (true) throw (ParseException)jjte000;}
    70      }
    71      {if (true) throw (Error)jjte000;}
    72      } finally {
    73      if (jjtc000) {
    74        jjtree.closeNodeScope(jjtn000, true);
    75      }
    76      }
    77      throw new RuntimeException("Missing return statement in function");
    78    }
    79
    80  /**
    81   * The optional prolog of a JSP, including (xml) declarations and DTD.
    82   */
    83    final public void Prolog() throws ParseException {
    84      if (jj_2_1(2147483647)) {
    85        label_1:
    86        while (true) {
    87          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    88          case COMMENT_START:
    89          case JSP_COMMENT_START:
    90            ;
    91            break;
    92          default:
    93            jj_la1[0] = jj_gen;
    94            break label_1;
    95          }
    96          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    97          case COMMENT_START:
    98            CommentTag();
    99            break;
    100         case JSP_COMMENT_START:
    101           JspComment();
    102           break;
    103         default:
    104           jj_la1[1] = jj_gen;
    105           jj_consume_token(-1);
    106           throw new ParseException();
    107         }
    108       }
    109       Declaration();
    110     } else {
    111       ;
    112     }
    113     if (jj_2_2(2147483647)) {
    114       label_2:
    115       while (true) {
    116         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    117         case COMMENT_START:
    118         case JSP_COMMENT_START:
    119           ;
    120           break;
    121         default:
    122           jj_la1[2] = jj_gen;
    123           break label_2;
    124         }
    125         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    126         case COMMENT_START:
    127           CommentTag();
    128           break;
    129         case JSP_COMMENT_START:
    130           JspComment();
    131           break;
    132         default:
    133           jj_la1[3] = jj_gen;
    134           jj_consume_token(-1);
    135           throw new ParseException();
    136         }
    137       }
    138       DoctypeDeclaration();
    139     } else {
    140       ;
    141     }
    142   }
    143
    144 /**
    145  * Everything between a start-tag and the corresponding end-tag of an element (if an end tag exists).
    146  */
    147   final public void Content() throws ParseException {
    148  /*@bgen(jjtree) Content */
    149   ASTContent jjtn000 = new ASTContent(this, JJTCONTENT);
    150   boolean jjtc000 = true;
    151   jjtree.openNodeScope(jjtn000);
    152     try {
    153       label_3:
    154       while (true) {
    155         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    156         case TAG_START:
    157         case COMMENT_START:
    158         case CDATA_START:
    159         case JSP_COMMENT_START:
    160         case JSP_DECLARATION_START:
    161         case JSP_EXPRESSION_START:
    162         case JSP_SCRIPTLET_START:
    163         case JSP_DIRECTIVE_START:
    164         case HTML_SCRIPT_START:
    165         case EL_EXPRESSION:
    166         case UNPARSED_TEXT:
    167           ;
    168           break;
    169         default:
    170           jj_la1[4] = jj_gen;
    171           break label_3;
    172         }
    173         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    174         case EL_EXPRESSION:
    175         case UNPARSED_TEXT:
    176           Text();
    177           break;
    178         case TAG_START:
    179         case COMMENT_START:
    180         case CDATA_START:
    181         case JSP_COMMENT_START:
    182         case JSP_DECLARATION_START:
    183         case JSP_EXPRESSION_START:
    184         case JSP_SCRIPTLET_START:
    185         case JSP_DIRECTIVE_START:
    186         case HTML_SCRIPT_START:
    187           ContentElement();
    188           break;
    189         default:
    190           jj_la1[5] = jj_gen;
    191           jj_consume_token(-1);
    192           throw new ParseException();
    193         }
    194       }
    195     } catch (Throwable jjte000) {
    196           if (jjtc000) {
    197             jjtree.clearNodeScope(jjtn000);
    198             jjtc000 = false;
    199           } else {
    200             jjtree.popNode();
    201           }
    202           if (jjte000 instanceof RuntimeException) {
    203             {if (true) throw (RuntimeException)jjte000;}
    204           }
    205           if (jjte000 instanceof ParseException) {
    206             {if (true) throw (ParseException)jjte000;}
    207           }
    208           {if (true) throw (Error)jjte000;}
    209     } finally {
    210           if (jjtc000) {
    211             jjtree.closeNodeScope(jjtn000, true);
    212           }
    213     }
    214   }
    215
    216 /**
    217  * A single (non-text) element that can occur between a start-tag and end-tag of an element.
    218  *
    219  */
    220   final public void ContentElement() throws ParseException {
    221     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    222     case COMMENT_START:
    223       CommentTag();
    224       break;
    225     case TAG_START:
    226       Element();
    227       break;
    228     case CDATA_START:
    229       CData();
    230       break;
    231     case JSP_COMMENT_START:
    232       JspComment();
    233       break;
    234     case JSP_DECLARATION_START:
    235       JspDeclaration();
    236       break;
    237     case JSP_EXPRESSION_START:
    238       JspExpression();
    239       break;
    240     case JSP_SCRIPTLET_START:
    241       JspScriptlet();
    242       break;
    243     case JSP_DIRECTIVE_START:
    244       JspDirective();
    245       break;
    246     case HTML_SCRIPT_START:
    247       HtmlScript();
    248       break;
    249     default:
    250       jj_la1[6] = jj_gen;
    251       jj_consume_token(-1);
    252       throw new ParseException();
    253     }
    254   }
    255
    256   final public void JspDirective() throws ParseException {
    257  /*@bgen(jjtree) JspDirective */
    258         ASTJspDirective jjtn000 = new ASTJspDirective(this, JJTJSPDIRECTIVE);
    259         boolean jjtc000 = true;
    260         jjtree.openNodeScope(jjtn000);Token t;
    261     try {
    262       jj_consume_token(JSP_DIRECTIVE_START);
    263       t = jj_consume_token(JSP_DIRECTIVE_NAME);
    264                                    jjtn000.setName(t.image);
    265       label_4:
    266       while (true) {
    267         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    268         case JSP_DIRECTIVE_ATTRIBUTE_NAME:
    269           ;
    270           break;
    271         default:
    272           jj_la1[7] = jj_gen;
    273           break label_4;
    274         }
    275         JspDirectiveAttribute();
    276       }
    277       jj_consume_token(JSP_DIRECTIVE_END);
    278     } catch (Throwable jjte000) {
    279           if (jjtc000) {
    280             jjtree.clearNodeScope(jjtn000);
    281             jjtc000 = false;
    282           } else {
    283             jjtree.popNode();
    284           }
    285           if (jjte000 instanceof RuntimeException) {
    286             {if (true) throw (RuntimeException)jjte000;}
    287           }
    288           if (jjte000 instanceof ParseException) {
    289             {if (true) throw (ParseException)jjte000;}
    290           }
    291           {if (true) throw (Error)jjte000;}
    292     } finally {
    293           if (jjtc000) {
    294             jjtree.closeNodeScope(jjtn000, true);
    295           }
    296     }
    297   }
    298
    299   final public void JspDirectiveAttribute() throws ParseException {
    300  /*@bgen(jjtree) JspDirectiveAttribute */
    301         ASTJspDirectiveAttribute jjtn000 = new ASTJspDirectiveAttribute(this, JJTJSPDIRECTIVEATTRIBUTE);
    302         boolean jjtc000 = true;
    303         jjtree.openNodeScope(jjtn000);Token t;
    304     try {
    305       t = jj_consume_token(JSP_DIRECTIVE_ATTRIBUTE_NAME);
    306                                              jjtn000.setName(t.image);
    307       jj_consume_token(JSP_DIRECTIVE_ATTRIBUTE_EQUALS);
    308       t = jj_consume_token(JSP_DIRECTIVE_ATTRIBUTE_VALUE);
    309                                               jjtree.closeNodeScope(jjtn000, true);
    310                                               jjtc000 = false;
    311                                               jjtn000.setValue(quoteContent(t.image));
    312     } finally {
    313           if (jjtc000) {
    314             jjtree.closeNodeScope(jjtn000, true);
    315           }
    316     }
    317   }
    318
    319   final public void JspScriptlet() throws ParseException {
    320  /*@bgen(jjtree) JspScriptlet */
    321         ASTJspScriptlet jjtn000 = new ASTJspScriptlet(this, JJTJSPSCRIPTLET);
    322         boolean jjtc000 = true;
    323         jjtree.openNodeScope(jjtn000);Token t;
    324     try {
    325       jj_consume_token(JSP_SCRIPTLET_START);
    326       t = jj_consume_token(JSP_SCRIPTLET);
    327                               jjtn000.setImage(t.image.trim());
    328       jj_consume_token(JSP_SCRIPTLET_END);
    329     } finally {
    330           if (jjtc000) {
    331             jjtree.closeNodeScope(jjtn000, true);
    332           }
    333     }
    334   }
    335
    336   final public void JspExpression() throws ParseException {
    337  /*@bgen(jjtree) JspExpression */
    338         ASTJspExpression jjtn000 = new ASTJspExpression(this, JJTJSPEXPRESSION);
    339         boolean jjtc000 = true;
    340         jjtree.openNodeScope(jjtn000);Token t;
    341     try {
    342       jj_consume_token(JSP_EXPRESSION_START);
    343       t = jj_consume_token(JSP_EXPRESSION);
    344                                jjtn000.setImage(t.image.trim());
    345       jj_consume_token(JSP_EXPRESSION_END);
    346     } finally {
    347           if (jjtc000) {
    348             jjtree.closeNodeScope(jjtn000, true);
    349           }
    350     }
    351   }
    352
    353   final public void JspDeclaration() throws ParseException {
    354  /*@bgen(jjtree) JspDeclaration */
    355         ASTJspDeclaration jjtn000 = new ASTJspDeclaration(this, JJTJSPDECLARATION);
    356         boolean jjtc000 = true;
    357         jjtree.openNodeScope(jjtn000);Token t;
    358     try {
    359       jj_consume_token(JSP_DECLARATION_START);
    360       t = jj_consume_token(JSP_DECLARATION);
    361                                 jjtn000.setImage(t.image.trim());
    362       jj_consume_token(JSP_DECLARATION_END);
    363     } finally {
    364           if (jjtc000) {
    365             jjtree.closeNodeScope(jjtn000, true);
    366           }
    367     }
    368   }
    369
    370   final public void JspComment() throws ParseException {
    371  /*@bgen(jjtree) JspComment */
    372         ASTJspComment jjtn000 = new ASTJspComment(this, JJTJSPCOMMENT);
    373         boolean jjtc000 = true;
    374         jjtree.openNodeScope(jjtn000);Token t;
    375     try {
    376       jj_consume_token(JSP_COMMENT_START);
    377       t = jj_consume_token(JSP_COMMENT_CONTENT);
    378                                     jjtn000.setImage(t.image.trim());
    379       jj_consume_token(JSP_COMMENT_END);
    380     } finally {
    381           if (jjtc000) {
    382             jjtree.closeNodeScope(jjtn000, true);
    383           }
    384     }
    385   }
    386
    387 /**
    388  * This production groups all characters between two tags, where
    389  * tag is an xml-tag "<...>" or a jsp-page-tag "<%...%>" or CDATA "<![CDATA[...]]>".
    390  * Text consists of unparsed text and/or Expression Language expressions.
    391  */
    392   final public void Text() throws ParseException {
    393  /*@bgen(jjtree) Text */
    394         ASTText jjtn000 = new ASTText(this, JJTTEXT);
    395         boolean jjtc000 = true;
    396         jjtree.openNodeScope(jjtn000);StringBuffer content = new StringBuffer();
    397         String tmp;
    398     try {
    399       label_5:
    400       while (true) {
    401         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    402         case UNPARSED_TEXT:
    403           tmp = UnparsedText();
    404                                        content.append(tmp);
    405           break;
    406         case EL_EXPRESSION:
    407           tmp = ElExpression();
    408                                    content.append(tmp);
    409           break;
    410         default:
    411           jj_la1[8] = jj_gen;
    412           jj_consume_token(-1);
    413           throw new ParseException();
    414         }
    415         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    416         case EL_EXPRESSION:
    417         case UNPARSED_TEXT:
    418           ;
    419           break;
    420         default:
    421           jj_la1[9] = jj_gen;
    422           break label_5;
    423         }
    424       }
    425                   jjtree.closeNodeScope(jjtn000, true);
    426                   jjtc000 = false;
    427                  jjtn000.setImage(content.toString());
    428     } catch (Throwable jjte000) {
    429             if (jjtc000) {
    430               jjtree.clearNodeScope(jjtn000);
    431               jjtc000 = false;
    432             } else {
    433               jjtree.popNode();
    434             }
    435             if (jjte000 instanceof RuntimeException) {
    436               {if (true) throw (RuntimeException)jjte000;}
    437             }
    438             if (jjte000 instanceof ParseException) {
    439               {if (true) throw (ParseException)jjte000;}
    440             }
    441             {if (true) throw (Error)jjte000;}
    442     } finally {
    443             if (jjtc000) {
    444               jjtree.closeNodeScope(jjtn000, true);
    445             }
    446     }
    447   }
    448
    449   final public String UnparsedText() throws ParseException {
    450  /*@bgen(jjtree) UnparsedText */
    451   ASTUnparsedText jjtn000 = new ASTUnparsedText(this, JJTUNPARSEDTEXT);
    452   boolean jjtc000 = true;
    453   jjtree.openNodeScope(jjtn000);Token t;
    454     try {
    455       t = jj_consume_token(UNPARSED_TEXT);
    456           jjtree.closeNodeScope(jjtn000, true);
    457           jjtc000 = false;
    458                 jjtn000.setImage(t.image);
    459                 {if (true) return t.image;}
    460     } finally {
    461           if (jjtc000) {
    462             jjtree.closeNodeScope(jjtn000, true);
    463           }
    464     }
    465     throw new RuntimeException("Missing return statement in function");
    466   }
    467
    468   final public String UnparsedTextNoWhitespace() throws ParseException {
    469  /*@bgen(jjtree) UnparsedText */
    470   ASTUnparsedText jjtn000 = new ASTUnparsedText(this, JJTUNPARSEDTEXT);
    471   boolean jjtc000 = true;
    472   jjtree.openNodeScope(jjtn000);Token t;
    473     try {
    474       t = jj_consume_token(UNPARSED_TEXT_NO_WHITESPACE);
    475     jjtree.closeNodeScope(jjtn000, true);
    476     jjtc000 = false;
    477                 jjtn000.setImage(t.image);
    478                 {if (true) return t.image;}
    479     } finally {
    480     if (jjtc000) {
    481       jjtree.closeNodeScope(jjtn000, true);
    482     }
    483     }
    484     throw new RuntimeException("Missing return statement in function");
    485   }
    486
    487 /**
    488  * Text that contains no single quotes, and that does not contain the start
    489  * of a EL expression or value binding.
    490  */
    491   final public String UnparsedTextNoSingleQuotes() throws ParseException {
    492  /*@bgen(jjtree) UnparsedText */
    493   ASTUnparsedText jjtn000 = new ASTUnparsedText(this, JJTUNPARSEDTEXT);
    494   boolean jjtc000 = true;
    495   jjtree.openNodeScope(jjtn000);Token t;
    496     try {
    497       t = jj_consume_token(UNPARSED_TEXT_NO_SINGLE_QUOTES);
    498           jjtree.closeNodeScope(jjtn000, true);
    499           jjtc000 = false;
    500                 jjtn000.setImage(t.image);
    501                 {if (true) return t.image;}
    502     } finally {
    503           if (jjtc000) {
    504             jjtree.closeNodeScope(jjtn000, true);
    505           }
    506     }
    507     throw new RuntimeException("Missing return statement in function");
    508   }
    509
    510 /**
    511  * Text that contains no double quotes, and that does not contain the start
    512  * of a EL expression or value binding.
    513  */
    514   final public String UnparsedTextNoDoubleQuotes() throws ParseException {
    515  /*@bgen(jjtree) UnparsedText */
    516   ASTUnparsedText jjtn000 = new ASTUnparsedText(this, JJTUNPARSEDTEXT);
    517   boolean jjtc000 = true;
    518   jjtree.openNodeScope(jjtn000);Token t;
    519     try {
    520       t = jj_consume_token(UNPARSED_TEXT_NO_DOUBLE_QUOTES);
    521           jjtree.closeNodeScope(jjtn000, true);
    522           jjtc000 = false;
    523                 jjtn000.setImage(t.image);
    524                 {if (true) return t.image;}
    525     } finally {
    526           if (jjtc000) {
    527             jjtree.closeNodeScope(jjtn000, true);
    528           }
    529     }
    530     throw new RuntimeException("Missing return statement in function");
    531   }
    532
    533 /**
    534  * An EL expression, not within an attribute value.
    535  */
    536   final public String ElExpression() throws ParseException {
    537  /*@bgen(jjtree) ElExpression */
    538         ASTElExpression jjtn000 = new ASTElExpression(this, JJTELEXPRESSION);
    539         boolean jjtc000 = true;
    540         jjtree.openNodeScope(jjtn000);Token t;
    541     try {
    542       t = jj_consume_token(EL_EXPRESSION);
    543           jjtree.closeNodeScope(jjtn000, true);
    544           jjtc000 = false;
    545                 jjtn000.setImage(expressionContent(t.image));
    546                 {if (true) return t.image;}
    547     } finally {
    548           if (jjtc000) {
    549             jjtree.closeNodeScope(jjtn000, true);
    550           }
    551     }
    552     throw new RuntimeException("Missing return statement in function");
    553   }
    554
    555   final public String ValueBindingInAttribute() throws ParseException {
    556  /*@bgen(jjtree) ValueBinding */
    557         ASTValueBinding jjtn000 = new ASTValueBinding(this, JJTVALUEBINDING);
    558         boolean jjtc000 = true;
    559         jjtree.openNodeScope(jjtn000);Token t;
    560     try {
    561       t = jj_consume_token(VALUE_BINDING_IN_ATTRIBUTE);
    562           jjtree.closeNodeScope(jjtn000, true);
    563           jjtc000 = false;
    564                 jjtn000.setImage(expressionContent(t.image));
    565                 {if (true) return t.image;}
    566     } finally {
    567           if (jjtc000) {
    568             jjtree.closeNodeScope(jjtn000, true);
    569           }
    570     }
    571     throw new RuntimeException("Missing return statement in function");
    572   }
    573
    574   final public String ElExpressionInAttribute() throws ParseException {
    575  /*@bgen(jjtree) ElExpression */
    576         ASTElExpression jjtn000 = new ASTElExpression(this, JJTELEXPRESSION);
    577         boolean jjtc000 = true;
    578         jjtree.openNodeScope(jjtn000);Token t;
    579     try {
    580       t = jj_consume_token(EL_EXPRESSION_IN_ATTRIBUTE);
    581           jjtree.closeNodeScope(jjtn000, true);
    582           jjtc000 = false;
    583                 jjtn000.setImage(expressionContent(t.image));
    584                 {if (true) return t.image;}
    585     } finally {
    586           if (jjtc000) {
    587             jjtree.closeNodeScope(jjtn000, true);
    588           }
    589     }
    590     throw new RuntimeException("Missing return statement in function");
    591   }
    592
    593   final public void CData() throws ParseException {
    594  /*@bgen(jjtree) CData */
    595         ASTCData jjtn000 = new ASTCData(this, JJTCDATA);
    596         boolean jjtc000 = true;
    597         jjtree.openNodeScope(jjtn000);StringBuffer content = new StringBuffer();
    598         Token t;
    599     try {
    600       jj_consume_token(CDATA_START);
    601       label_6:
    602       while (true) {
    603         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    604         case UNPARSED:
    605           ;
    606           break;
    607         default:
    608           jj_la1[10] = jj_gen;
    609           break label_6;
    610         }
    611         t = jj_consume_token(UNPARSED);
    612                                           content.append(t.image);
    613       }
    614       jj_consume_token(CDATA_END);
    615           jjtree.closeNodeScope(jjtn000, true);
    616           jjtc000 = false;
    617                 jjtn000.setImage(content.toString());
    618     } finally {
    619           if (jjtc000) {
    620             jjtree.closeNodeScope(jjtn000, true);
    621           }
    622     }
    623   }
    624
    625 /**
    626  * A XML element, either with a single empty tag, or with a starting and closing tag
    627  * with optional contained content.
    628  */
    629   final public void Element() throws ParseException {
    630  /*@bgen(jjtree) Element */
    631         ASTElement jjtn000 = new ASTElement(this, JJTELEMENT);
    632         boolean jjtc000 = true;
    633         jjtree.openNodeScope(jjtn000);Token startTag;
    634         Token endTag;
    635         String tagName;
    636     try {
    637       jj_consume_token(TAG_START);
    638       startTag = jj_consume_token(TAG_NAME);
    639                                         tagName = startTag.image;
    640                                                                 jjtn000.setName(tagName);
    641                                                                 tagRegister.openTag(jjtn000);
    642       label_7:
    643       while (true) {
    644         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    645         case ATTR_NAME:
    646           ;
    647           break;
    648         default:
    649           jj_la1[11] = jj_gen;
    650           break label_7;
    651         }
    652         Attribute();
    653       }
    654       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    655       case TAG_END:
    656         jj_consume_token(TAG_END);
    657                              jjtn000.setEmpty(false);
    658         Content();
    659         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    660         case ENDTAG_START:
    661           jj_consume_token(ENDTAG_START);
    662           endTag = jj_consume_token(TAG_NAME);
    663                                                tagRegister.closeTag(endTag.image);
    664           jj_consume_token(TAG_END);
    665           break;
    666         default:
    667           jj_la1[12] = jj_gen;
    668           ;
    669         }
    670         break;
    671       case TAG_SLASHEND:
    672         jj_consume_token(TAG_SLASHEND);
    673                                   jjtree.closeNodeScope(jjtn000, true);
    674                                   jjtc000 = false;
    675                                   jjtn000.setEmpty(true);
    676                                                   jjtn000.setUnclosed(false);
    677         break;
    678       default:
    679         jj_la1[13] = jj_gen;
    680         jj_consume_token(-1);
    681         throw new ParseException();
    682       }
    683     } catch (Throwable jjte000) {
    684       if (jjtc000) {
    685         jjtree.clearNodeScope(jjtn000);
    686         jjtc000 = false;
    687       } else {
    688         jjtree.popNode();
    689       }
    690       if (jjte000 instanceof RuntimeException) {
    691         {if (true) throw (RuntimeException)jjte000;}
    692       }
    693       if (jjte000 instanceof ParseException) {
    694         {if (true) throw (ParseException)jjte000;}
    695       }
    696       {if (true) throw (Error)jjte000;}
    697     } finally {
    698       if (jjtc000) {
    699         jjtree.closeNodeScope(jjtn000, true);
    700       }
    701     }
    702   }
    703
    704   final public void Attribute() throws ParseException {
    705  /*@bgen(jjtree) Attribute */
    706         ASTAttribute jjtn000 = new ASTAttribute(this, JJTATTRIBUTE);
    707         boolean jjtc000 = true;
    708         jjtree.openNodeScope(jjtn000);Token t;
    709     try {
    710       t = jj_consume_token(ATTR_NAME);
    711                     jjtn000.setName(t.image);
    712       jj_consume_token(ATTR_EQ);
    713       AttributeValue();
    714     } catch (Throwable jjte000) {
    715     if (jjtc000) {
    716       jjtree.clearNodeScope(jjtn000);
    717       jjtc000 = false;
    718     } else {
    719       jjtree.popNode();
    720     }
    721     if (jjte000 instanceof RuntimeException) {
    722       {if (true) throw (RuntimeException)jjte000;}
    723     }
    724     if (jjte000 instanceof ParseException) {
    725       {if (true) throw (ParseException)jjte000;}
    726     }
    727     {if (true) throw (Error)jjte000;}
    728     } finally {
    729     if (jjtc000) {
    730       jjtree.closeNodeScope(jjtn000, true);
    731     }
    732     }
    733   }
    734
    735 /**
    736  * The value of an attribute of an element.
    737  * EL expressions, JSF value bindings, and JSP expressions
    738  * are parsed as sub-nodes of the AttributeValue node.
    739  */
    740   final public void AttributeValue() throws ParseException {
    741  /*@bgen(jjtree) AttributeValue */
    742         ASTAttributeValue jjtn000 = new ASTAttributeValue(this, JJTATTRIBUTEVALUE);
    743         boolean jjtc000 = true;
    744         jjtree.openNodeScope(jjtn000);StringBuffer content = new StringBuffer();
    745         String tmp;
    746         Token t = null ;
    747     try {
    748       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    749       case DOUBLE_QUOTE:
    750         jj_consume_token(DOUBLE_QUOTE);
    751         label_8:
    752         while (true) {
    753           switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    754           case EL_EXPRESSION_IN_ATTRIBUTE:
    755           case VALUE_BINDING_IN_ATTRIBUTE:
    756           case JSP_EXPRESSION_IN_ATTRIBUTE:
    757           case UNPARSED_TEXT_NO_DOUBLE_QUOTES:
    758             ;
    759             break;
    760           default:
    761             jj_la1[14] = jj_gen;
    762             break label_8;
    763           }
    764           switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    765           case UNPARSED_TEXT_NO_DOUBLE_QUOTES:
    766             tmp = UnparsedTextNoDoubleQuotes();
    767             break;
    768           case EL_EXPRESSION_IN_ATTRIBUTE:
    769           case VALUE_BINDING_IN_ATTRIBUTE:
    770           case JSP_EXPRESSION_IN_ATTRIBUTE:
    771             tmp = QuoteIndependentAttributeValueContent();
    772             break;
    773           default:
    774             jj_la1[15] = jj_gen;
    775             jj_consume_token(-1);
    776             throw new ParseException();
    777           }
    778                             content.append(tmp);
    779         }
    780         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    781         case ENDING_DOUBLE_QUOTE:
    782           jj_consume_token(ENDING_DOUBLE_QUOTE);
    783           break;
    784         case DOLLAR_OR_HASH_DOUBLE_QUOTE:
    785           t = jj_consume_token(DOLLAR_OR_HASH_DOUBLE_QUOTE);
    786                                                                     content.append(t.image.substring(0, 1));
    787           break;
    788         default:
    789           jj_la1[16] = jj_gen;
    790           jj_consume_token(-1);
    791           throw new ParseException();
    792         }
    793         break;
    794       case SINGLE_QUOTE:
    795         jj_consume_token(SINGLE_QUOTE);
    796         label_9:
    797         while (true) {
    798           switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    799           case EL_EXPRESSION_IN_ATTRIBUTE:
    800           case VALUE_BINDING_IN_ATTRIBUTE:
    801           case JSP_EXPRESSION_IN_ATTRIBUTE:
    802           case UNPARSED_TEXT_NO_SINGLE_QUOTES:
    803             ;
    804             break;
    805           default:
    806             jj_la1[17] = jj_gen;
    807             break label_9;
    808           }
    809           switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    810           case UNPARSED_TEXT_NO_SINGLE_QUOTES:
    811             tmp = UnparsedTextNoSingleQuotes();
    812             break;
    813           case EL_EXPRESSION_IN_ATTRIBUTE:
    814           case VALUE_BINDING_IN_ATTRIBUTE:
    815           case JSP_EXPRESSION_IN_ATTRIBUTE:
    816             tmp = QuoteIndependentAttributeValueContent();
    817             break;
    818           default:
    819             jj_la1[18] = jj_gen;
    820             jj_consume_token(-1);
    821             throw new ParseException();
    822           }
    823                           content.append(tmp);
    824         }
    825         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    826         case ENDING_SINGLE_QUOTE:
    827           jj_consume_token(ENDING_SINGLE_QUOTE);
    828           break;
    829         case DOLLAR_OR_HASH_SINGLE_QUOTE:
    830           t = jj_consume_token(DOLLAR_OR_HASH_SINGLE_QUOTE);
    831                                                                  content.append(t.image.substring(0, 1));
    832           break;
    833         default:
    834           jj_la1[19] = jj_gen;
    835           jj_consume_token(-1);
    836           throw new ParseException();
    837         }
    838         break;
    839       case NO_QUOTE_NO_WHITESPACE:
    840         jj_consume_token(NO_QUOTE_NO_WHITESPACE);
    841         label_10:
    842         while (true) {
    843           switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    844           case EL_EXPRESSION_IN_ATTRIBUTE:
    845           case VALUE_BINDING_IN_ATTRIBUTE:
    846           case JSP_EXPRESSION_IN_ATTRIBUTE:
    847           case UNPARSED_TEXT_NO_WHITESPACE:
    848             ;
    849             break;
    850           default:
    851             jj_la1[20] = jj_gen;
    852             break label_10;
    853           }
    854           switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    855           case UNPARSED_TEXT_NO_WHITESPACE:
    856             tmp = UnparsedTextNoWhitespace();
    857             break;
    858           case EL_EXPRESSION_IN_ATTRIBUTE:
    859           case VALUE_BINDING_IN_ATTRIBUTE:
    860           case JSP_EXPRESSION_IN_ATTRIBUTE:
    861             tmp = QuoteIndependentAttributeValueContent();
    862             break;
    863           default:
    864             jj_la1[21] = jj_gen;
    865             jj_consume_token(-1);
    866             throw new ParseException();
    867           }
    868                                   content.append(tmp);
    869         }
    870         jj_consume_token(ENDING_WHITESPACE);
    871         break;
    872       case IN_ATTR_WHITESPACE:
    873         jj_consume_token(IN_ATTR_WHITESPACE);
    874         break;
    875       default:
    876         jj_la1[22] = jj_gen;
    877         jj_consume_token(-1);
    878         throw new ParseException();
    879       }
    880           jjtree.closeNodeScope(jjtn000, true);
    881           jjtc000 = false;
    882           jjtn000.setImage( content.toString() );
    883     } catch (Throwable jjte000) {
    884           if (jjtc000) {
    885             jjtree.clearNodeScope(jjtn000);
    886             jjtc000 = false;
    887           } else {
    888             jjtree.popNode();
    889           }
    890           if (jjte000 instanceof RuntimeException) {
    891             {if (true) throw (RuntimeException)jjte000;}
    892           }
    893           if (jjte000 instanceof ParseException) {
    894             {if (true) throw (ParseException)jjte000;}
    895           }
    896           {if (true) throw (Error)jjte000;}
    897     } finally {
    898           if (jjtc000) {
    899             jjtree.closeNodeScope(jjtn000, true);
    900           }
    901     }
    902   }
    903
    904 /**
    905  * Partial content of an attribute value that can contain all quotes.
    906  * This groups EL expressions, value bindings, and JSP expressions.
    907  */
    908   final public String QuoteIndependentAttributeValueContent() throws ParseException {
    909         String tmp;
    910     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    911     case EL_EXPRESSION_IN_ATTRIBUTE:
    912       tmp = ElExpressionInAttribute();
    913       break;
    914     case VALUE_BINDING_IN_ATTRIBUTE:
    915       tmp = ValueBindingInAttribute();
    916       break;
    917     case JSP_EXPRESSION_IN_ATTRIBUTE:
    918       tmp = JspExpressionInAttribute();
    919       break;
    920     default:
    921       jj_la1[23] = jj_gen;
    922       jj_consume_token(-1);
    923       throw new ParseException();
    924     }
    925           {if (true) return tmp;}
    926     throw new RuntimeException("Missing return statement in function");
    927   }
    928
    929   final public String JspExpressionInAttribute() throws ParseException {
    930  /*@bgen(jjtree) JspExpressionInAttribute */
    931         ASTJspExpressionInAttribute jjtn000 = new ASTJspExpressionInAttribute(this, JJTJSPEXPRESSIONINATTRIBUTE);
    932         boolean jjtc000 = true;
    933         jjtree.openNodeScope(jjtn000);Token t;
    934     try {
    935       t = jj_consume_token(JSP_EXPRESSION_IN_ATTRIBUTE);
    936           jjtree.closeNodeScope(jjtn000, true);
    937           jjtc000 = false;
    938                 jjtn000.setImage(t.image.substring(3, t.image.length()-2).trim()); // without <% and %>
    939                 {if (true) return t.image;}
    940     } finally {
    941           if (jjtc000) {
    942             jjtree.closeNodeScope(jjtn000, true);
    943           }
    944     }
    945     throw new RuntimeException("Missing return statement in function");
    946   }
    947
    948   final public void CommentTag() throws ParseException {
    949  /*@bgen(jjtree) CommentTag */
    950         ASTCommentTag jjtn000 = new ASTCommentTag(this, JJTCOMMENTTAG);
    951         boolean jjtc000 = true;
    952         jjtree.openNodeScope(jjtn000);StringBuffer content = new StringBuffer();
    953         Token t;
    954     try {
    955       jj_consume_token(COMMENT_START);
    956       label_11:
    957       while (true) {
    958         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    959         case COMMENT_TEXT:
    960           ;
    961           break;
    962         default:
    963           jj_la1[24] = jj_gen;
    964           break label_11;
    965         }
    966         t = jj_consume_token(COMMENT_TEXT);
    967                          content.append(t.image);
    968       }
    969       jj_consume_token(COMMENT_END);
    970           jjtree.closeNodeScope(jjtn000, true);
    971           jjtc000 = false;
    972                 jjtn000.setImage(content.toString().trim());
    973     } finally {
    974     if (jjtc000) {
    975       jjtree.closeNodeScope(jjtn000, true);
    976     }
    977     }
    978   }
    979
    980   final public void Declaration() throws ParseException {
    981  /*@bgen(jjtree) Declaration */
    982         ASTDeclaration jjtn000 = new ASTDeclaration(this, JJTDECLARATION);
    983         boolean jjtc000 = true;
    984         jjtree.openNodeScope(jjtn000);Token t;
    985     try {
    986       jj_consume_token(DECL_START);
    987       t = jj_consume_token(TAG_NAME);
    988                    jjtn000.setName(t.image);
    989       label_12:
    990       while (true) {
    991         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    992         case ATTR_NAME:
    993           ;
    994           break;
    995         default:
    996           jj_la1[25] = jj_gen;
    997           break label_12;
    998         }
    999         Attribute();
    1000       }
    1001       jj_consume_token(DECL_END);
    1002     } catch (Throwable jjte000) {
    1003     if (jjtc000) {
    1004       jjtree.clearNodeScope(jjtn000);
    1005       jjtc000 = false;
    1006     } else {
    1007       jjtree.popNode();
    1008     }
    1009     if (jjte000 instanceof RuntimeException) {
    1010       {if (true) throw (RuntimeException)jjte000;}
    1011     }
    1012     if (jjte000 instanceof ParseException) {
    1013       {if (true) throw (ParseException)jjte000;}
    1014     }
    1015     {if (true) throw (Error)jjte000;}
    1016     } finally {
    1017     if (jjtc000) {
    1018       jjtree.closeNodeScope(jjtn000, true);
    1019     }
    1020     }
    1021   }
    1022
    1023   final public void DoctypeDeclaration() throws ParseException {
    1024  /*@bgen(jjtree) DoctypeDeclaration */
    1025         ASTDoctypeDeclaration jjtn000 = new ASTDoctypeDeclaration(this, JJTDOCTYPEDECLARATION);
    1026         boolean jjtc000 = true;
    1027         jjtree.openNodeScope(jjtn000);Token t;
    1028     try {
    1029       jj_consume_token(DOCTYPE_DECL_START);
    1030       jj_consume_token(WHITESPACES);
    1031       t = jj_consume_token(NAME);
    1032                       jjtn000.setName(t.image);
    1033       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    1034       case WHITESPACES:
    1035         jj_consume_token(WHITESPACES);
    1036         break;
    1037       default:
    1038         jj_la1[26] = jj_gen;
    1039         ;
    1040       }
    1041       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    1042       case PUBLIC:
    1043       case SYSTEM:
    1044         DoctypeExternalId();
    1045         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    1046         case WHITESPACES:
    1047           jj_consume_token(WHITESPACES);
    1048           break;
    1049         default:
    1050           jj_la1[27] = jj_gen;
    1051           ;
    1052         }
    1053         break;
    1054       default:
    1055         jj_la1[28] = jj_gen;
    1056         ;
    1057       }
    1058       jj_consume_token(DOCTYPE_DECL_END);
    1059     } catch (Throwable jjte000) {
    1060           if (jjtc000) {
    1061             jjtree.clearNodeScope(jjtn000);
    1062             jjtc000 = false;
    1063           } else {
    1064             jjtree.popNode();
    1065           }
    1066           if (jjte000 instanceof RuntimeException) {
    1067             {if (true) throw (RuntimeException)jjte000;}
    1068           }
    1069           if (jjte000 instanceof ParseException) {
    1070             {if (true) throw (ParseException)jjte000;}
    1071           }
    1072           {if (true) throw (Error)jjte000;}
    1073     } finally {
    1074           if (jjtc000) {
    1075             jjtree.closeNodeScope(jjtn000, true);
    1076           }
    1077     }
    1078   }
    1079
    1080   final public void DoctypeExternalId() throws ParseException {
    1081  /*@bgen(jjtree) DoctypeExternalId */
    1082         ASTDoctypeExternalId jjtn000 = new ASTDoctypeExternalId(this, JJTDOCTYPEEXTERNALID);
    1083         boolean jjtc000 = true;
    1084         jjtree.openNodeScope(jjtn000);Token systemLiteral;
    1085         Token pubIdLiteral;
    1086     try {
    1087       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    1088       case SYSTEM:
    1089         jj_consume_token(SYSTEM);
    1090         jj_consume_token(WHITESPACES);
    1091         systemLiteral = jj_consume_token(QUOTED_LITERAL);
    1092                                   jjtree.closeNodeScope(jjtn000, true);
    1093                                   jjtc000 = false;
    1094                                   jjtn000.setUri(quoteContent(systemLiteral.image));
    1095         break;
    1096       case PUBLIC:
    1097         jj_consume_token(PUBLIC);
    1098         jj_consume_token(WHITESPACES);
    1099         pubIdLiteral = jj_consume_token(QUOTED_LITERAL);
    1100                                   jjtn000.setPublicId(quoteContent(pubIdLiteral.image));
    1101         jj_consume_token(WHITESPACES);
    1102         systemLiteral = jj_consume_token(QUOTED_LITERAL);
    1103                                   jjtree.closeNodeScope(jjtn000, true);
    1104                                   jjtc000 = false;
    1105                                   jjtn000.setUri(quoteContent(systemLiteral.image));
    1106         break;
    1107       default:
    1108         jj_la1[29] = jj_gen;
    1109         jj_consume_token(-1);
    1110         throw new ParseException();
    1111       }
    1112     } finally {
    1113                   if (jjtc000) {
    1114                     jjtree.closeNodeScope(jjtn000, true);
    1115                   }
    1116     }
    1117   }
    1118
    1119   final public void HtmlScript() throws ParseException {
    1120  /*@bgen(jjtree) HtmlScript */
    1121         ASTHtmlScript jjtn000 = new ASTHtmlScript(this, JJTHTMLSCRIPT);
    1122         boolean jjtc000 = true;
    1123         jjtree.openNodeScope(jjtn000);StringBuffer content = new StringBuffer();
    1124         String tagName;
    1125         Token t;
    1126     try {
    1127       jj_consume_token(HTML_SCRIPT_START);
    1128
    1129       label_13:
    1130       while (true) {
    1131         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    1132         case ATTR_NAME:
    1133           ;
    1134           break;
    1135         default:
    1136           jj_la1[30] = jj_gen;
    1137           break label_13;
    1138         }
    1139         Attribute();
    1140       }
    1141
    1142       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    1143       case TAG_END:
    1144         jj_consume_token(TAG_END);
    1145                                                      token_source.SwitchTo(HtmlScriptContentState);
    1146         label_14:
    1147         while (true) {
    1148           switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    1149           case HTML_SCRIPT_CONTENT:
    1150             ;
    1151             break;
    1152           default:
    1153             jj_la1[31] = jj_gen;
    1154             break label_14;
    1155           }
    1156           t = jj_consume_token(HTML_SCRIPT_CONTENT);
    1157                                          content.append(t.image);
    1158         }
    1159         jj_consume_token(HTML_SCRIPT_END_TAG);
    1160                                                   jjtree.closeNodeScope(jjtn000, true);
    1161                                                   jjtc000 = false;
    1162                                           jjtn000.setImage(content.toString().trim());
    1163         break;
    1164       case TAG_SLASHEND:
    1165         jj_consume_token(TAG_SLASHEND);
    1166         break;
    1167       default:
    1168         jj_la1[32] = jj_gen;
    1169         jj_consume_token(-1);
    1170         throw new ParseException();
    1171       }
    1172     } catch (Throwable jjte000) {
    1173           if (jjtc000) {
    1174             jjtree.clearNodeScope(jjtn000);
    1175             jjtc000 = false;
    1176           } else {
    1177             jjtree.popNode();
    1178           }
    1179           if (jjte000 instanceof RuntimeException) {
    1180             {if (true) throw (RuntimeException)jjte000;}
    1181           }
    1182           if (jjte000 instanceof ParseException) {
    1183             {if (true) throw (ParseException)jjte000;}
    1184           }
    1185           {if (true) throw (Error)jjte000;}
    1186     } finally {
    1187           if (jjtc000) {
    1188             jjtree.closeNodeScope(jjtn000, true);
    1189           }
    1190     }
    1191   }
    1192
    1193   private boolean jj_2_1(int xla) {
    1194     jj_la = xla; jj_lastpos = jj_scanpos = token;
    1195     try { return !jj_3_1(); }
    1196     catch(LookaheadSuccess ls) { return true; }
    1197     finally { jj_save(0, xla); }
    1198   }
    1199
    1200   private boolean jj_2_2(int xla) {
    1201     jj_la = xla; jj_lastpos = jj_scanpos = token;
    1202     try { return !jj_3_2(); }
    1203     catch(LookaheadSuccess ls) { return true; }
    1204     finally { jj_save(1, xla); }
    1205   }
    1206
    1207   private boolean jj_3R_49() {
    1208     if (jj_scan_token(UNPARSED_TEXT_NO_SINGLE_QUOTES)) return true;
    1209     return false;
    1210   }
    1211
    1212   private boolean jj_3R_29() {
    1213     if (jj_scan_token(COMMENT_TEXT)) return true;
    1214     return false;
    1215   }
    1216
    1217   private boolean jj_3R_25() {
    1218     if (jj_scan_token(COMMENT_START)) return true;
    1219     Token xsp;
    1220     while (true) {
    1221       xsp = jj_scanpos;
    1222       if (jj_3R_29()) { jj_scanpos = xsp; break; }
    1223     }
    1224     if (jj_scan_token(COMMENT_END)) return true;
    1225     return false;
    1226   }
    1227
    1228   private boolean jj_3R_23() {
    1229     if (jj_3R_26()) return true;
    1230     return false;
    1231   }
    1232
    1233   private boolean jj_3R_56() {
    1234     if (jj_scan_token(JSP_EXPRESSION_IN_ATTRIBUTE)) return true;
    1235     return false;
    1236   }
    1237
    1238   private boolean jj_3R_53() {
    1239     if (jj_3R_56()) return true;
    1240     return false;
    1241   }
    1242
    1243   private boolean jj_3R_52() {
    1244     if (jj_3R_55()) return true;
    1245     return false;
    1246   }
    1247
    1248   private boolean jj_3R_51() {
    1249     if (jj_3R_54()) return true;
    1250     return false;
    1251   }
    1252
    1253   private boolean jj_3R_20() {
    1254     if (jj_3R_26()) return true;
    1255     return false;
    1256   }
    1257
    1258   private boolean jj_3R_50() {
    1259     if (jj_scan_token(UNPARSED_TEXT_NO_WHITESPACE)) return true;
    1260     return false;
    1261   }
    1262
    1263   private boolean jj_3R_45() {
    1264     if (jj_3R_50()) return true;
    1265     return false;
    1266   }
    1267
    1268   private boolean jj_3R_48() {
    1269     Token xsp;
    1270     xsp = jj_scanpos;
    1271     if (jj_3R_51()) {
    1272     jj_scanpos = xsp;
    1273     if (jj_3R_52()) {
    1274     jj_scanpos = xsp;
    1275     if (jj_3R_53()) return true;
    1276     }
    1277     }
    1278     return false;
    1279   }
    1280
    1281   private boolean jj_3R_40() {
    1282     Token xsp;
    1283     xsp = jj_scanpos;
    1284     if (jj_3R_45()) {
    1285     jj_scanpos = xsp;
    1286     if (jj_3R_46()) return true;
    1287     }
    1288     return false;
    1289   }
    1290
    1291   private boolean jj_3R_22() {
    1292     if (jj_3R_25()) return true;
    1293     return false;
    1294   }
    1295
    1296   private boolean jj_3R_17() {
    1297     Token xsp;
    1298     xsp = jj_scanpos;
    1299     if (jj_3R_22()) {
    1300     jj_scanpos = xsp;
    1301     if (jj_3R_23()) return true;
    1302     }
    1303     return false;
    1304   }
    1305
    1306   private boolean jj_3R_39() {
    1307     if (jj_scan_token(DOLLAR_OR_HASH_SINGLE_QUOTE)) return true;
    1308     return false;
    1309   }
    1310
    1311   private boolean jj_3_2() {
    1312     Token xsp;
    1313     while (true) {
    1314       xsp = jj_scanpos;
    1315       if (jj_3R_17()) { jj_scanpos = xsp; break; }
    1316     }
    1317     if (jj_3R_18()) return true;
    1318     return false;
    1319   }
    1320
    1321   private boolean jj_3R_43() {
    1322     if (jj_3R_49()) return true;
    1323     return false;
    1324   }
    1325
    1326   private boolean jj_3R_37() {
    1327     if (jj_scan_token(DOLLAR_OR_HASH_DOUBLE_QUOTE)) return true;
    1328     return false;
    1329   }
    1330
    1331   private boolean jj_3R_38() {
    1332     Token xsp;
    1333     xsp = jj_scanpos;
    1334     if (jj_3R_43()) {
    1335     jj_scanpos = xsp;
    1336     if (jj_3R_44()) return true;
    1337     }
    1338     return false;
    1339   }
    1340
    1341   private boolean jj_3R_15() {
    1342     Token xsp;
    1343     xsp = jj_scanpos;
    1344     if (jj_3R_19()) {
    1345     jj_scanpos = xsp;
    1346     if (jj_3R_20()) return true;
    1347     }
    1348     return false;
    1349   }
    1350
    1351   private boolean jj_3R_19() {
    1352     if (jj_3R_25()) return true;
    1353     return false;
    1354   }
    1355
    1356   private boolean jj_3R_42() {
    1357     if (jj_3R_48()) return true;
    1358     return false;
    1359   }
    1360
    1361   private boolean jj_3_1() {
    1362     Token xsp;
    1363     while (true) {
    1364       xsp = jj_scanpos;
    1365       if (jj_3R_15()) { jj_scanpos = xsp; break; }
    1366     }
    1367     if (jj_3R_16()) return true;
    1368     return false;
    1369   }
    1370
    1371   private boolean jj_3R_35() {
    1372     if (jj_scan_token(NO_QUOTE_NO_WHITESPACE)) return true;
    1373     Token xsp;
    1374     while (true) {
    1375       xsp = jj_scanpos;
    1376       if (jj_3R_40()) { jj_scanpos = xsp; break; }
    1377     }
    1378     if (jj_scan_token(ENDING_WHITESPACE)) return true;
    1379     return false;
    1380   }
    1381
    1382   private boolean jj_3R_41() {
    1383     if (jj_3R_47()) return true;
    1384     return false;
    1385   }
    1386
    1387   private boolean jj_3R_36() {
    1388     Token xsp;
    1389     xsp = jj_scanpos;
    1390     if (jj_3R_41()) {
    1391     jj_scanpos = xsp;
    1392     if (jj_3R_42()) return true;
    1393     }
    1394     return false;
    1395   }
    1396
    1397   private boolean jj_3R_34() {
    1398     if (jj_scan_token(SINGLE_QUOTE)) return true;
    1399     Token xsp;
    1400     while (true) {
    1401       xsp = jj_scanpos;
    1402       if (jj_3R_38()) { jj_scanpos = xsp; break; }
    1403     }
    1404     xsp = jj_scanpos;
    1405     if (jj_scan_token(75)) {
    1406     jj_scanpos = xsp;
    1407     if (jj_3R_39()) return true;
    1408     }
    1409     return false;
    1410   }
    1411
    1412   private boolean jj_3R_54() {
    1413     if (jj_scan_token(EL_EXPRESSION_IN_ATTRIBUTE)) return true;
    1414     return false;
    1415   }
    1416
    1417   private boolean jj_3R_32() {
    1418     if (jj_scan_token(PUBLIC)) return true;
    1419     if (jj_scan_token(WHITESPACES)) return true;
    1420     if (jj_scan_token(QUOTED_LITERAL)) return true;
    1421     if (jj_scan_token(WHITESPACES)) return true;
    1422     if (jj_scan_token(QUOTED_LITERAL)) return true;
    1423     return false;
    1424   }
    1425
    1426   private boolean jj_3R_33() {
    1427     if (jj_scan_token(DOUBLE_QUOTE)) return true;
    1428     Token xsp;
    1429     while (true) {
    1430       xsp = jj_scanpos;
    1431       if (jj_3R_36()) { jj_scanpos = xsp; break; }
    1432     }
    1433     xsp = jj_scanpos;
    1434     if (jj_scan_token(78)) {
    1435     jj_scanpos = xsp;
    1436     if (jj_3R_37()) return true;
    1437     }
    1438     return false;
    1439   }
    1440
    1441   private boolean jj_3R_26() {
    1442     if (jj_scan_token(JSP_COMMENT_START)) return true;
    1443     if (jj_scan_token(JSP_COMMENT_CONTENT)) return true;
    1444     if (jj_scan_token(JSP_COMMENT_END)) return true;
    1445     return false;
    1446   }
    1447
    1448   private boolean jj_3R_28() {
    1449     Token xsp;
    1450     xsp = jj_scanpos;
    1451     if (jj_3R_31()) {
    1452     jj_scanpos = xsp;
    1453     if (jj_3R_32()) return true;
    1454     }
    1455     return false;
    1456   }
    1457
    1458   private boolean jj_3R_31() {
    1459     if (jj_scan_token(SYSTEM)) return true;
    1460     if (jj_scan_token(WHITESPACES)) return true;
    1461     if (jj_scan_token(QUOTED_LITERAL)) return true;
    1462     return false;
    1463   }
    1464
    1465   private boolean jj_3R_55() {
    1466     if (jj_scan_token(VALUE_BINDING_IN_ATTRIBUTE)) return true;
    1467     return false;
    1468   }
    1469
    1470   private boolean jj_3R_30() {
    1471     Token xsp;
    1472     xsp = jj_scanpos;
    1473     if (jj_3R_33()) {
    1474     jj_scanpos = xsp;
    1475     if (jj_3R_34()) {
    1476     jj_scanpos = xsp;
    1477     if (jj_3R_35()) {
    1478     jj_scanpos = xsp;
    1479     if (jj_scan_token(69)) return true;
    1480     }
    1481     }
    1482     }
    1483     return false;
    1484   }
    1485
    1486   private boolean jj_3R_24() {
    1487     if (jj_3R_28()) return true;
    1488     Token xsp;
    1489     xsp = jj_scanpos;
    1490     if (jj_scan_token(50)) jj_scanpos = xsp;
    1491     return false;
    1492   }
    1493
    1494   private boolean jj_3R_18() {
    1495     if (jj_scan_token(DOCTYPE_DECL_START)) return true;
    1496     if (jj_scan_token(WHITESPACES)) return true;
    1497     if (jj_scan_token(NAME)) return true;
    1498     Token xsp;
    1499     xsp = jj_scanpos;
    1500     if (jj_scan_token(50)) jj_scanpos = xsp;
    1501     xsp = jj_scanpos;
    1502     if (jj_3R_24()) jj_scanpos = xsp;
    1503     if (jj_scan_token(DOCTYPE_DECL_END)) return true;
    1504     return false;
    1505   }
    1506
    1507   private boolean jj_3R_47() {
    1508     if (jj_scan_token(UNPARSED_TEXT_NO_DOUBLE_QUOTES)) return true;
    1509     return false;
    1510   }
    1511
    1512   private boolean jj_3R_46() {
    1513     if (jj_3R_48()) return true;
    1514     return false;
    1515   }
    1516
    1517   private boolean jj_3R_27() {
    1518     if (jj_scan_token(ATTR_NAME)) return true;
    1519     if (jj_scan_token(ATTR_EQ)) return true;
    1520     if (jj_3R_30()) return true;
    1521     return false;
    1522   }
    1523
    1524   private boolean jj_3R_21() {
    1525     if (jj_3R_27()) return true;
    1526     return false;
    1527   }
    1528
    1529   private boolean jj_3R_44() {
    1530     if (jj_3R_48()) return true;
    1531     return false;
    1532   }
    1533
    1534   private boolean jj_3R_16() {
    1535     if (jj_scan_token(DECL_START)) return true;
    1536     if (jj_scan_token(TAG_NAME)) return true;
    1537     Token xsp;
    1538     while (true) {
    1539       xsp = jj_scanpos;
    1540       if (jj_3R_21()) { jj_scanpos = xsp; break; }
    1541     }
    1542     if (jj_scan_token(DECL_END)) return true;
    1543     return false;
    1544   }
    1545
    1546   /** Generated Token Manager. */
    1547   public JspParserTokenManager token_source;
    1548   /** Current token. */
    1549   public Token token;
    1550   /** Next token. */
    1551   public Token jj_nt;
    1552   private int jj_ntk;
    1553   private Token jj_scanpos, jj_lastpos;
    1554   private int jj_la;
    1555   private int jj_gen;
    1556   final private int[] jj_la1 = new int[33];
    1557   static private int[] jj_la1_0;
    1558   static private int[] jj_la1_1;
    1559   static private int[] jj_la1_2;
    1560   static {
    1561       jj_la1_init_0();
    1562       jj_la1_init_1();
    1563       jj_la1_init_2();
    1564    }
    1565    private static void jj_la1_init_0() {
    1566       jj_la1_0 = new int[] {0x22000000,0x22000000,0x22000000,0x22000000,0xf2800000,0xf2800000,0xf2800000,0x0,0x0,0x0,0x0,0x0,0x1000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,};
    1567    }
    1568    private static void jj_la1_init_1() {
    1569       jj_la1_1 = new int[] {0x0,0x0,0x0,0x0,0x1f,0x1f,0x7,0x40,0x18,0x18,0x1000000,0x10000000,0x0,0xa0000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x10000000,0x40000,0x40000,0x300000,0x300000,0x10000000,0x0,0xa0000000,};
    1570    }
    1571    private static void jj_la1_init_2() {
    1572       jj_la1_2 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x81c0,0x81c0,0x14000,0x11c0,0x11c0,0x2800,0x5c0,0x5c0,0x3c,0x1c0,0x40000,0x0,0x0,0x0,0x0,0x0,0x0,0x80000,0x0,};
    1573    }
    1574   final private JJCalls[] jj_2_rtns = new JJCalls[2];
    1575   private boolean jj_rescan = false;
    1576   private int jj_gc = 0;
    1577
    1578   /** Constructor with user supplied CharStream. */
    1579   public JspParser(CharStream stream) {
    1580     token_source = new JspParserTokenManager(stream);
    1581     token = new Token();
    1582     jj_ntk = -1;
    1583     jj_gen = 0;
    1584     for (int i = 0; i < 33; i++) jj_la1[i] = -1;
    1585     for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
    1586   }
    1587
    1588   /** Reinitialise. */
    1589   public void ReInit(CharStream stream) {
    1590     token_source.ReInit(stream);
    1591     token = new Token();
    1592     jj_ntk = -1;
    1593     jjtree.reset();
    1594     jj_gen = 0;
    1595     for (int i = 0; i < 33; i++) jj_la1[i] = -1;
    1596     for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
    1597   }
    1598
    1599   /** Constructor with generated Token Manager. */
    1600   public JspParser(JspParserTokenManager tm) {
    1601     token_source = tm;
    1602     token = new Token();
    1603     jj_ntk = -1;
    1604     jj_gen = 0;
    1605     for (int i = 0; i < 33; i++) jj_la1[i] = -1;
    1606     for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
    1607   }
    1608
    1609   /** Reinitialise. */
    1610   public void ReInit(JspParserTokenManager tm) {
    1611     token_source = tm;
    1612     token = new Token();
    1613     jj_ntk = -1;
    1614     jjtree.reset();
    1615     jj_gen = 0;
    1616     for (int i = 0; i < 33; i++) jj_la1[i] = -1;
    1617     for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
    1618   }
    1619
    1620   private Token jj_consume_token(int kind) throws ParseException {
    1621     Token oldToken;
    1622     if ((oldToken = token).next != null) token = token.next;
    1623     else token = token.next = token_source.getNextToken();
    1624     jj_ntk = -1;
    1625     if (token.kind == kind) {
    1626       jj_gen++;
    1627       if (++jj_gc > 100) {
    1628         jj_gc = 0;
    1629         for (int i = 0; i < jj_2_rtns.length; i++) {
    1630           JJCalls c = jj_2_rtns[i];
    1631           while (c != null) {
    1632             if (c.gen < jj_gen) c.first = null;
    1633             c = c.next;
    1634           }
    1635         }
    1636       }
    1637       return token;
    1638     }
    1639     token = oldToken;
    1640     jj_kind = kind;
    1641     throw generateParseException();
    1642   }
    1643
    1644   static private final class LookaheadSuccess extends java.lang.Error { }
    1645   final private LookaheadSuccess jj_ls = new LookaheadSuccess();
    1646   private boolean jj_scan_token(int kind) {
    1647     if (jj_scanpos == jj_lastpos) {
    1648       jj_la--;
    1649       if (jj_scanpos.next == null) {
    1650         jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
    1651       } else {
    1652         jj_lastpos = jj_scanpos = jj_scanpos.next;
    1653       }
    1654     } else {
    1655       jj_scanpos = jj_scanpos.next;
    1656     }
    1657     if (jj_rescan) {
    1658       int i = 0; Token tok = token;
    1659       while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }
    1660       if (tok != null) jj_add_error_token(kind, i);
    1661     }
    1662     if (jj_scanpos.kind != kind) return true;
    1663     if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;
    1664     return false;
    1665   }
    1666
    1667
    1668 /** Get the next Token. */
    1669   final public Token getNextToken() {
    1670     if (token.next != null) token = token.next;
    1671     else token = token.next = token_source.getNextToken();
    1672     jj_ntk = -1;
    1673     jj_gen++;
    1674     return token;
    1675   }
    1676
    1677 /** Get the specific Token. */
    1678   final public Token getToken(int index) {
    1679     Token t = token;
    1680     for (int i = 0; i < index; i++) {
    1681       if (t.next != null) t = t.next;
    1682       else t = t.next = token_source.getNextToken();
    1683     }
    1684     return t;
    1685   }
    1686
    1687   private int jj_ntk() {
    1688     if ((jj_nt=token.next) == null)
    1689       return (jj_ntk = (token.next=token_source.getNextToken()).kind);
    1690     else
    1691       return (jj_ntk = jj_nt.kind);
    1692   }
    1693
    1694   private java.util.List jj_expentries = new java.util.ArrayList();
    1695   private int[] jj_expentry;
    1696   private int jj_kind = -1;
    1697   private int[] jj_lasttokens = new int[100];
    1698   private int jj_endpos;
    1699
    1700   private void jj_add_error_token(int kind, int pos) {
    1701     if (pos >= 100) return;
    1702     if (pos == jj_endpos + 1) {
    1703       jj_lasttokens[jj_endpos++] = kind;
    1704     } else if (jj_endpos != 0) {
    1705       jj_expentry = new int[jj_endpos];
    1706       for (int i = 0; i < jj_endpos; i++) {
    1707         jj_expentry[i] = jj_lasttokens[i];
    1708       }
    1709       jj_entries_loop: for (java.util.Iterator it = jj_expentries.iterator(); it.hasNext();) {
    1710         int[] oldentry = (int[])(it.next());
    1711         if (oldentry.length == jj_expentry.length) {
    1712           for (int i = 0; i < jj_expentry.length; i++) {
    1713             if (oldentry[i] != jj_expentry[i]) {
    1714               continue jj_entries_loop;
    1715             }
    1716           }
    1717           jj_expentries.add(jj_expentry);
    1718           break jj_entries_loop;
    1719         }
    1720       }
    1721       if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;
    1722     }
    1723   }
    1724
    1725   /** Generate ParseException. */
    1726   public ParseException generateParseException() {
    1727     jj_expentries.clear();
    1728     boolean[] la1tokens = new boolean[85];
    1729     if (jj_kind >= 0) {
    1730       la1tokens[jj_kind] = true;
    1731       jj_kind = -1;
    1732     }
    1733     for (int i = 0; i < 33; i++) {
    1734       if (jj_la1[i] == jj_gen) {
    1735         for (int j = 0; j < 32; j++) {
    1736           if ((jj_la1_0[i] & (1<<j)) != 0) {
    1737             la1tokens[j] = true;
    1738           }
    1739           if ((jj_la1_1[i] & (1<<j)) != 0) {
    1740             la1tokens[32+j] = true;
    1741           }
    1742           if ((jj_la1_2[i] & (1<<j)) != 0) {
    1743             la1tokens[64+j] = true;
    1744           }
    1745         }
    1746       }
    1747     }
    1748     for (int i = 0; i < 85; i++) {
    1749       if (la1tokens[i]) {
    1750         jj_expentry = new int[1];
    1751         jj_expentry[0] = i;
    1752         jj_expentries.add(jj_expentry);
    1753       }
    1754     }
    1755     jj_endpos = 0;
    1756     jj_rescan_token();
    1757     jj_add_error_token(0, 0);
    1758     int[][] exptokseq = new int[jj_expentries.size()][];
    1759     for (int i = 0; i < jj_expentries.size(); i++) {
    1760       exptokseq[i] = (int[])jj_expentries.get(i);
    1761     }
    1762     return new ParseException(token, exptokseq, tokenImage);
    1763   }
    1764
    1765   /** Enable tracing. */
    1766   final public void enable_tracing() {
    1767   }
    1768
    1769   /** Disable tracing. */
    1770   final public void disable_tracing() {
    1771   }
    1772
    1773   private void jj_rescan_token() {
    1774     jj_rescan = true;
    1775     for (int i = 0; i < 2; i++) {
    1776     try {
    1777       JJCalls p = jj_2_rtns[i];
    1778       do {
    1779         if (p.gen > jj_gen) {
    1780           jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
    1781           switch (i) {
    1782             case 0: jj_3_1(); break;
    1783             case 1: jj_3_2(); break;
    1784           }
    1785         }
    1786         p = p.next;
    1787       } while (p != null);
    1788       } catch(LookaheadSuccess ls) { }
    1789     }
    1790     jj_rescan = false;
    1791   }
    1792
    1793   private void jj_save(int index, int xla) {
    1794     JJCalls p = jj_2_rtns[index];
    1795     while (p.gen > jj_gen) {
    1796       if (p.next == null) { p = p.next = new JJCalls(); break; }
    1797       p = p.next;
    1798     }
    1799     p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;
    1800   }
    1801
    1802   static final class JJCalls {
    1803     int gen;
    1804     Token first;
    1805     int arg;
    1806     JJCalls next;
    1807   }
    1808
    1809 }