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