001/* Generated By:JavaCC: Do not edit this line. XPathParser.java */
002    package org.apache.commons.jxpath.ri.parser;
003
004    import org.apache.commons.jxpath.ri.Compiler;
005    import java.util.ArrayList;
006
007    public class XPathParser implements XPathParserConstants {
008        private Compiler compiler;
009
010        public void setCompiler(Compiler compiler){
011            this.compiler = compiler;
012        }
013
014        private String unescape(String string){
015            int index = string.indexOf("'");
016            while (index != -1){
017                string = string.substring(0, index) + "\'" + string.substring(index + 6);
018                index = string.indexOf("'");
019            }
020            index = string.indexOf(""");
021            while (index != -1){
022                string = string.substring(0, index) + "\"" + string.substring(index + 6);
023                index = string.indexOf(""");
024            }
025            return string;
026        }
027
028// Note: XPath does not have reserved words, so we have to include all these terminals
029  final public String NCName() throws ParseException {
030    switch (jj_nt.kind) {
031    case OR:
032    case AND:
033    case MOD:
034    case DIV:
035    case NCName:
036      NCName_Without_CoreFunctions();
037      break;
038    case NODE:
039      jj_consume_token(NODE);
040      break;
041    case TEXT:
042      jj_consume_token(TEXT);
043      break;
044    case COMMENT:
045      jj_consume_token(COMMENT);
046      break;
047    case PI:
048      jj_consume_token(PI);
049      break;
050    case FUNCTION_LAST:
051      jj_consume_token(FUNCTION_LAST);
052      break;
053    case FUNCTION_POSITION:
054      jj_consume_token(FUNCTION_POSITION);
055      break;
056    case FUNCTION_COUNT:
057      jj_consume_token(FUNCTION_COUNT);
058      break;
059    case FUNCTION_ID:
060      jj_consume_token(FUNCTION_ID);
061      break;
062    case FUNCTION_LOCAL_NAME:
063      jj_consume_token(FUNCTION_LOCAL_NAME);
064      break;
065    case FUNCTION_NAMESPACE_URI:
066      jj_consume_token(FUNCTION_NAMESPACE_URI);
067      break;
068    case FUNCTION_NAME:
069      jj_consume_token(FUNCTION_NAME);
070      break;
071    case FUNCTION_STRING:
072      jj_consume_token(FUNCTION_STRING);
073      break;
074    case FUNCTION_CONCAT:
075      jj_consume_token(FUNCTION_CONCAT);
076      break;
077    case FUNCTION_STARTS_WITH:
078      jj_consume_token(FUNCTION_STARTS_WITH);
079      break;
080    case FUNCTION_ENDS_WITH:
081      jj_consume_token(FUNCTION_ENDS_WITH);
082      break;
083    case FUNCTION_CONTAINS:
084      jj_consume_token(FUNCTION_CONTAINS);
085      break;
086    case FUNCTION_SUBSTRING_BEFORE:
087      jj_consume_token(FUNCTION_SUBSTRING_BEFORE);
088      break;
089    case FUNCTION_SUBSTRING_AFTER:
090      jj_consume_token(FUNCTION_SUBSTRING_AFTER);
091      break;
092    case FUNCTION_SUBSTRING:
093      jj_consume_token(FUNCTION_SUBSTRING);
094      break;
095    case FUNCTION_STRING_LENGTH:
096      jj_consume_token(FUNCTION_STRING_LENGTH);
097      break;
098    case FUNCTION_NORMALIZE_SPACE:
099      jj_consume_token(FUNCTION_NORMALIZE_SPACE);
100      break;
101    case FUNCTION_TRANSLATE:
102      jj_consume_token(FUNCTION_TRANSLATE);
103      break;
104    case FUNCTION_BOOLEAN:
105      jj_consume_token(FUNCTION_BOOLEAN);
106      break;
107    case FUNCTION_NOT:
108      jj_consume_token(FUNCTION_NOT);
109      break;
110    case FUNCTION_TRUE:
111      jj_consume_token(FUNCTION_TRUE);
112      break;
113    case FUNCTION_FALSE:
114      jj_consume_token(FUNCTION_FALSE);
115      break;
116    case FUNCTION_NULL:
117      jj_consume_token(FUNCTION_NULL);
118      break;
119    case FUNCTION_LANG:
120      jj_consume_token(FUNCTION_LANG);
121      break;
122    case FUNCTION_NUMBER:
123      jj_consume_token(FUNCTION_NUMBER);
124      break;
125    case FUNCTION_SUM:
126      jj_consume_token(FUNCTION_SUM);
127      break;
128    case FUNCTION_FLOOR:
129      jj_consume_token(FUNCTION_FLOOR);
130      break;
131    case FUNCTION_CEILING:
132      jj_consume_token(FUNCTION_CEILING);
133      break;
134    case FUNCTION_ROUND:
135      jj_consume_token(FUNCTION_ROUND);
136      break;
137    case FUNCTION_KEY:
138      jj_consume_token(FUNCTION_KEY);
139      break;
140    case FUNCTION_FORMAT_NUMBER:
141      jj_consume_token(FUNCTION_FORMAT_NUMBER);
142      break;
143    default:
144      jj_la1[0] = jj_gen;
145      jj_consume_token(-1);
146      throw new ParseException();
147    }
148        {if (true) return token.image;}
149    throw new Error("Missing return statement in function");
150  }
151
152  final public String NCName_Without_CoreFunctions() throws ParseException {
153    switch (jj_nt.kind) {
154    case NCName:
155      jj_consume_token(NCName);
156      break;
157    case OR:
158      jj_consume_token(OR);
159      break;
160    case AND:
161      jj_consume_token(AND);
162      break;
163    case MOD:
164      jj_consume_token(MOD);
165      break;
166    case DIV:
167      jj_consume_token(DIV);
168      break;
169    default:
170      jj_la1[1] = jj_gen;
171      jj_consume_token(-1);
172      throw new ParseException();
173    }
174        {if (true) return token.image;}
175    throw new Error("Missing return statement in function");
176  }
177
178  final public int CoreFunctionName() throws ParseException {
179    int code;
180    switch (jj_nt.kind) {
181    case FUNCTION_LAST:
182      jj_consume_token(FUNCTION_LAST);
183                                      code = Compiler.FUNCTION_LAST;
184      break;
185    case FUNCTION_POSITION:
186      jj_consume_token(FUNCTION_POSITION);
187                                      code = Compiler.FUNCTION_POSITION;
188      break;
189    case FUNCTION_COUNT:
190      jj_consume_token(FUNCTION_COUNT);
191                                      code = Compiler.FUNCTION_COUNT;
192      break;
193    case FUNCTION_ID:
194      jj_consume_token(FUNCTION_ID);
195                                      code = Compiler.FUNCTION_ID;
196      break;
197    case FUNCTION_LOCAL_NAME:
198      jj_consume_token(FUNCTION_LOCAL_NAME);
199                                      code = Compiler.FUNCTION_LOCAL_NAME;
200      break;
201    case FUNCTION_NAMESPACE_URI:
202      jj_consume_token(FUNCTION_NAMESPACE_URI);
203                                      code = Compiler.FUNCTION_NAMESPACE_URI;
204      break;
205    case FUNCTION_NAME:
206      jj_consume_token(FUNCTION_NAME);
207                                      code = Compiler.FUNCTION_NAME;
208      break;
209    case FUNCTION_STRING:
210      jj_consume_token(FUNCTION_STRING);
211                                      code = Compiler.FUNCTION_STRING;
212      break;
213    case FUNCTION_CONCAT:
214      jj_consume_token(FUNCTION_CONCAT);
215                                      code = Compiler.FUNCTION_CONCAT;
216      break;
217    case FUNCTION_STARTS_WITH:
218      jj_consume_token(FUNCTION_STARTS_WITH);
219                                      code = Compiler.FUNCTION_STARTS_WITH;
220      break;
221    case FUNCTION_ENDS_WITH:
222      jj_consume_token(FUNCTION_ENDS_WITH);
223                                      code = Compiler.FUNCTION_ENDS_WITH;
224      break;
225    case FUNCTION_CONTAINS:
226      jj_consume_token(FUNCTION_CONTAINS);
227                                      code = Compiler.FUNCTION_CONTAINS;
228      break;
229    case FUNCTION_SUBSTRING_BEFORE:
230      jj_consume_token(FUNCTION_SUBSTRING_BEFORE);
231                                      code = Compiler.FUNCTION_SUBSTRING_BEFORE;
232      break;
233    case FUNCTION_SUBSTRING_AFTER:
234      jj_consume_token(FUNCTION_SUBSTRING_AFTER);
235                                      code = Compiler.FUNCTION_SUBSTRING_AFTER;
236      break;
237    case FUNCTION_SUBSTRING:
238      jj_consume_token(FUNCTION_SUBSTRING);
239                                      code = Compiler.FUNCTION_SUBSTRING;
240      break;
241    case FUNCTION_STRING_LENGTH:
242      jj_consume_token(FUNCTION_STRING_LENGTH);
243                                      code = Compiler.FUNCTION_STRING_LENGTH;
244      break;
245    case FUNCTION_NORMALIZE_SPACE:
246      jj_consume_token(FUNCTION_NORMALIZE_SPACE);
247                                      code = Compiler.FUNCTION_NORMALIZE_SPACE;
248      break;
249    case FUNCTION_TRANSLATE:
250      jj_consume_token(FUNCTION_TRANSLATE);
251                                      code = Compiler.FUNCTION_TRANSLATE;
252      break;
253    case FUNCTION_BOOLEAN:
254      jj_consume_token(FUNCTION_BOOLEAN);
255                                      code = Compiler.FUNCTION_BOOLEAN;
256      break;
257    case FUNCTION_NOT:
258      jj_consume_token(FUNCTION_NOT);
259                                      code = Compiler.FUNCTION_NOT;
260      break;
261    case FUNCTION_TRUE:
262      jj_consume_token(FUNCTION_TRUE);
263                                      code = Compiler.FUNCTION_TRUE;
264      break;
265    case FUNCTION_FALSE:
266      jj_consume_token(FUNCTION_FALSE);
267                                      code = Compiler.FUNCTION_FALSE;
268      break;
269    case FUNCTION_NULL:
270      jj_consume_token(FUNCTION_NULL);
271                                      code = Compiler.FUNCTION_NULL;
272      break;
273    case FUNCTION_LANG:
274      jj_consume_token(FUNCTION_LANG);
275                                      code = Compiler.FUNCTION_LANG;
276      break;
277    case FUNCTION_NUMBER:
278      jj_consume_token(FUNCTION_NUMBER);
279                                      code = Compiler.FUNCTION_NUMBER;
280      break;
281    case FUNCTION_SUM:
282      jj_consume_token(FUNCTION_SUM);
283                                      code = Compiler.FUNCTION_SUM;
284      break;
285    case FUNCTION_FLOOR:
286      jj_consume_token(FUNCTION_FLOOR);
287                                      code = Compiler.FUNCTION_FLOOR;
288      break;
289    case FUNCTION_CEILING:
290      jj_consume_token(FUNCTION_CEILING);
291                                      code = Compiler.FUNCTION_CEILING;
292      break;
293    case FUNCTION_ROUND:
294      jj_consume_token(FUNCTION_ROUND);
295                                      code = Compiler.FUNCTION_ROUND;
296      break;
297    case FUNCTION_KEY:
298      jj_consume_token(FUNCTION_KEY);
299                                      code = Compiler.FUNCTION_KEY;
300      break;
301    case FUNCTION_FORMAT_NUMBER:
302      jj_consume_token(FUNCTION_FORMAT_NUMBER);
303                                      code = Compiler.FUNCTION_FORMAT_NUMBER;
304      break;
305    default:
306      jj_la1[2] = jj_gen;
307      jj_consume_token(-1);
308      throw new ParseException();
309    }
310        {if (true) return code;}
311    throw new Error("Missing return statement in function");
312  }
313
314  final public Object QName() throws ParseException {
315 String nc1, nc2 = null;
316    nc1 = NCName();
317    switch (jj_nt.kind) {
318    case 80:
319      jj_consume_token(80);
320      nc2 = NCName();
321      break;
322    default:
323      jj_la1[3] = jj_gen;
324      ;
325    }
326        if (nc2 == null){
327            {if (true) return compiler.qname(null, nc1);}
328        }
329        else {
330            {if (true) return compiler.qname(nc1, nc2);}
331        }
332    throw new Error("Missing return statement in function");
333  }
334
335  final public Object QName_Without_CoreFunctions() throws ParseException {
336    String nc1, nc2 = null;
337    if (jj_2_1(2147483647)) {
338      nc1 = NCName();
339      jj_consume_token(80);
340      nc2 = NCName();
341    } else {
342      switch (jj_nt.kind) {
343      case OR:
344      case AND:
345      case MOD:
346      case DIV:
347      case NCName:
348        nc1 = NCName_Without_CoreFunctions();
349        break;
350      default:
351        jj_la1[4] = jj_gen;
352        jj_consume_token(-1);
353        throw new ParseException();
354      }
355    }
356        if (nc2 == null){
357            {if (true) return compiler.qname(null, nc1);}
358        }
359        else {
360            {if (true) return compiler.qname(nc1, nc2);}
361        }
362    throw new Error("Missing return statement in function");
363  }
364
365  final public Object parseExpression() throws ParseException {
366    Object ex;
367    ex = Expression();
368    jj_consume_token(0);
369        {if (true) return ex;}
370    throw new Error("Missing return statement in function");
371  }
372
373/* ################################################################################### */
374/* XSLT Patterns (http://www.w3.org/1999/08/WD-xslt-19990813)                          */
375/* ################################################################################### */
376
377/* [XSLT1] Pattern ::= LocationPathPattern | Pattern '|' LocationPathPattern  */
378
379//void Pattern() :
380//{}
381//{
382//        LocationPathPattern() ( <UNION> LocationPathPattern() )* <EOF>
383//}
384//
385//
386///* [XSLT2] LocationPathPattern ::=
387//   '/' RelativePathPattern? | IdKeyPattern (('/' | '//' RelativePathPattern)? | '//'? RelativePathPattern
388//*/
389//
390//void LocationPathPattern() :
391//{}
392//{
393//        <SLASH> ( RelativePathPattern() )?
394//    |    (
395//        LOOKAHEAD(IdKeyPattern())
396//            IdKeyPattern() ( ( <SLASH> | <SLASHSLASH>) RelativePathPattern() )?
397//        |    ( <SLASHSLASH> )? RelativePathPattern()
398//        )
399//}
400//
401//
402//
403///* [XSLT3] IdKeyPattern    ::=    'id' '(' Literal ')' | 'key' '(' Literal ',' Literal ')'  */
404//
405//void IdKeyPattern() :
406//{}
407//{
408//        <ID> "(" <Literal> ")"
409//    |    <KEY>  "(" <Literal> "," <Literal> ")"
410//}
411//
412//
413///* [XSLT4] RelativePathPattern    ::=    StepPattern | RelativePathPattern '/' StepPattern
414//                           | RelativePathPattern '//' StepPattern
415//*/
416//void RelativePathPattern() :
417//{}
418//{
419//        StepPattern() ( ( <SLASH>| <SLASHSLASH> ) StepPattern()    )*
420//}
421//
422//
423///* [XSLT5]    StepPattern    ::=    AbbreviatedAxisSpecifier NodeTest Predicate*   */
424//void StepPattern() :
425//{}
426//{
427//        AbbreviatedAxisSpecifier() NodeTest() (Predicate())*
428//}
429
430
431
432// See XPath Syntax (http://www.w3.org/TR/xpath )
433
434
435//void XPath() :
436//{}
437//{
438//    LocationPath()
439//    <EOF>
440//}
441
442
443/* [1] LocationPath ::= RelativeLocationPath | AbsoluteLocationPath  */
444  final public Object LocationPath() throws ParseException {
445 Object ex = null;
446    switch (jj_nt.kind) {
447    case OR:
448    case AND:
449    case MOD:
450    case DIV:
451    case NODE:
452    case TEXT:
453    case COMMENT:
454    case PI:
455    case AXIS_SELF:
456    case AXIS_CHILD:
457    case AXIS_PARENT:
458    case AXIS_ANCESTOR:
459    case AXIS_ATTRIBUTE:
460    case AXIS_NAMESPACE:
461    case AXIS_PRECEDING:
462    case AXIS_FOLLOWING:
463    case AXIS_DESCENDANT:
464    case AXIS_ANCESTOR_OR_SELF:
465    case AXIS_FOLLOWING_SIBLING:
466    case AXIS_PRECEDING_SIBLING:
467    case AXIS_DESCENDANT_OR_SELF:
468    case FUNCTION_LAST:
469    case FUNCTION_POSITION:
470    case FUNCTION_COUNT:
471    case FUNCTION_ID:
472    case FUNCTION_KEY:
473    case FUNCTION_LOCAL_NAME:
474    case FUNCTION_NAMESPACE_URI:
475    case FUNCTION_NAME:
476    case FUNCTION_STRING:
477    case FUNCTION_CONCAT:
478    case FUNCTION_STARTS_WITH:
479    case FUNCTION_ENDS_WITH:
480    case FUNCTION_CONTAINS:
481    case FUNCTION_SUBSTRING_BEFORE:
482    case FUNCTION_SUBSTRING_AFTER:
483    case FUNCTION_SUBSTRING:
484    case FUNCTION_STRING_LENGTH:
485    case FUNCTION_NORMALIZE_SPACE:
486    case FUNCTION_TRANSLATE:
487    case FUNCTION_BOOLEAN:
488    case FUNCTION_NOT:
489    case FUNCTION_TRUE:
490    case FUNCTION_FALSE:
491    case FUNCTION_NULL:
492    case FUNCTION_LANG:
493    case FUNCTION_NUMBER:
494    case FUNCTION_SUM:
495    case FUNCTION_FLOOR:
496    case FUNCTION_CEILING:
497    case FUNCTION_ROUND:
498    case FUNCTION_FORMAT_NUMBER:
499    case NCName:
500    case 83:
501    case 84:
502    case 87:
503    case 89:
504      ex = RelativeLocationPath();
505      break;
506    case SLASH:
507    case SLASHSLASH:
508      ex = AbsoluteLocationPath();
509      break;
510    default:
511      jj_la1[5] = jj_gen;
512      jj_consume_token(-1);
513      throw new ParseException();
514    }
515        {if (true) return ex;}
516    throw new Error("Missing return statement in function");
517  }
518
519/* [2] AbsoluteLocationPath ::= '/' RelativeLocationPath? | AbbreviatedAbsoluteLocationPath  */
520/* [10]    AbbreviatedAbsoluteLocationPath    ::=    '//' RelativeLocationPath  */
521  final public Object AbsoluteLocationPath() throws ParseException {
522    ArrayList steps = new ArrayList();
523    if (jj_2_2(2147483647)) {
524      LocationStep(steps);
525      label_1:
526      while (true) {
527        switch (jj_nt.kind) {
528        case SLASH:
529        case SLASHSLASH:
530          ;
531          break;
532        default:
533          jj_la1[6] = jj_gen;
534          break label_1;
535        }
536        LocationStep(steps);
537      }
538    } else {
539      switch (jj_nt.kind) {
540      case SLASH:
541        jj_consume_token(SLASH);
542        break;
543      default:
544        jj_la1[7] = jj_gen;
545        jj_consume_token(-1);
546        throw new ParseException();
547      }
548    }
549        {if (true) return compiler.locationPath(true, steps.toArray());}
550    throw new Error("Missing return statement in function");
551  }
552
553/* [3] RelativeLocationPath ::= Step | RelativeLocationPath '/' Step | AbbreviatedRelativeLocationPath */
554  final public Object RelativeLocationPath() throws ParseException {
555    ArrayList steps = new ArrayList();
556    NodeTest(steps);
557    label_2:
558    while (true) {
559      switch (jj_nt.kind) {
560      case SLASH:
561      case SLASHSLASH:
562        ;
563        break;
564      default:
565        jj_la1[8] = jj_gen;
566        break label_2;
567      }
568      LocationStep(steps);
569    }
570        {if (true) return compiler.locationPath(false, steps.toArray());}
571    throw new Error("Missing return statement in function");
572  }
573
574/* [3] RelativeLocationPath ::= Step | RelativeLocationPath '/' Step | AbbreviatedRelativeLocationPath */
575/* [11]    AbbreviatedRelativeLocationPath    ::=    RelativeLocationPath '//' Step  */
576
577
578/*--------------------*/
579/* 2.1 Location Steps */
580/*--------------------*/
581
582/* [4] Step ::= AxisSpecifier NodeTest Predicate*   | AbbreviatedStep  */
583  final public void LocationStep(ArrayList steps) throws ParseException {
584    Object t;
585    Object s;
586    switch (jj_nt.kind) {
587    case SLASH:
588      jj_consume_token(SLASH);
589      break;
590    case SLASHSLASH:
591      jj_consume_token(SLASHSLASH);
592            // Abbreviated step: descendant-or-self::node()
593            t = compiler.nodeTypeTest(Compiler.NODE_TYPE_NODE);
594            steps.add(compiler.step(Compiler.AXIS_DESCENDANT_OR_SELF, t, null));
595      break;
596    default:
597      jj_la1[9] = jj_gen;
598      jj_consume_token(-1);
599      throw new ParseException();
600    }
601    NodeTest(steps);
602  }
603
604/* [7] NodeTest ::= WildcardName | NodeType '(' ')' | 'processing-instruction' '(' Literal ')' */
605  final public void NodeTest(ArrayList steps) throws ParseException {
606    int axis;
607    int type = -1;
608    String instruction = null;
609    Object name = null;
610    Object s;
611    Object p;
612    ArrayList ps = new ArrayList();
613    switch (jj_nt.kind) {
614    case OR:
615    case AND:
616    case MOD:
617    case DIV:
618    case NODE:
619    case TEXT:
620    case COMMENT:
621    case PI:
622    case AXIS_SELF:
623    case AXIS_CHILD:
624    case AXIS_PARENT:
625    case AXIS_ANCESTOR:
626    case AXIS_ATTRIBUTE:
627    case AXIS_NAMESPACE:
628    case AXIS_PRECEDING:
629    case AXIS_FOLLOWING:
630    case AXIS_DESCENDANT:
631    case AXIS_ANCESTOR_OR_SELF:
632    case AXIS_FOLLOWING_SIBLING:
633    case AXIS_PRECEDING_SIBLING:
634    case AXIS_DESCENDANT_OR_SELF:
635    case FUNCTION_LAST:
636    case FUNCTION_POSITION:
637    case FUNCTION_COUNT:
638    case FUNCTION_ID:
639    case FUNCTION_KEY:
640    case FUNCTION_LOCAL_NAME:
641    case FUNCTION_NAMESPACE_URI:
642    case FUNCTION_NAME:
643    case FUNCTION_STRING:
644    case FUNCTION_CONCAT:
645    case FUNCTION_STARTS_WITH:
646    case FUNCTION_ENDS_WITH:
647    case FUNCTION_CONTAINS:
648    case FUNCTION_SUBSTRING_BEFORE:
649    case FUNCTION_SUBSTRING_AFTER:
650    case FUNCTION_SUBSTRING:
651    case FUNCTION_STRING_LENGTH:
652    case FUNCTION_NORMALIZE_SPACE:
653    case FUNCTION_TRANSLATE:
654    case FUNCTION_BOOLEAN:
655    case FUNCTION_NOT:
656    case FUNCTION_TRUE:
657    case FUNCTION_FALSE:
658    case FUNCTION_NULL:
659    case FUNCTION_LANG:
660    case FUNCTION_NUMBER:
661    case FUNCTION_SUM:
662    case FUNCTION_FLOOR:
663    case FUNCTION_CEILING:
664    case FUNCTION_ROUND:
665    case FUNCTION_FORMAT_NUMBER:
666    case NCName:
667    case 87:
668    case 89:
669      axis = AxisSpecifier();
670      if (jj_2_3(2147483647)) {
671        type = NodeType();
672        jj_consume_token(81);
673        jj_consume_token(82);
674      } else if (jj_2_4(2147483647)) {
675        jj_consume_token(PI);
676        jj_consume_token(81);
677        jj_consume_token(Literal);
678                    instruction = unescape(token.image.substring(1, token.image.length() - 1));
679        jj_consume_token(82);
680      } else {
681        switch (jj_nt.kind) {
682        case OR:
683        case AND:
684        case MOD:
685        case DIV:
686        case NODE:
687        case TEXT:
688        case COMMENT:
689        case PI:
690        case FUNCTION_LAST:
691        case FUNCTION_POSITION:
692        case FUNCTION_COUNT:
693        case FUNCTION_ID:
694        case FUNCTION_KEY:
695        case FUNCTION_LOCAL_NAME:
696        case FUNCTION_NAMESPACE_URI:
697        case FUNCTION_NAME:
698        case FUNCTION_STRING:
699        case FUNCTION_CONCAT:
700        case FUNCTION_STARTS_WITH:
701        case FUNCTION_ENDS_WITH:
702        case FUNCTION_CONTAINS:
703        case FUNCTION_SUBSTRING_BEFORE:
704        case FUNCTION_SUBSTRING_AFTER:
705        case FUNCTION_SUBSTRING:
706        case FUNCTION_STRING_LENGTH:
707        case FUNCTION_NORMALIZE_SPACE:
708        case FUNCTION_TRANSLATE:
709        case FUNCTION_BOOLEAN:
710        case FUNCTION_NOT:
711        case FUNCTION_TRUE:
712        case FUNCTION_FALSE:
713        case FUNCTION_NULL:
714        case FUNCTION_LANG:
715        case FUNCTION_NUMBER:
716        case FUNCTION_SUM:
717        case FUNCTION_FLOOR:
718        case FUNCTION_CEILING:
719        case FUNCTION_ROUND:
720        case FUNCTION_FORMAT_NUMBER:
721        case NCName:
722        case 89:
723          name = WildcardName();
724          break;
725        default:
726          jj_la1[10] = jj_gen;
727          jj_consume_token(-1);
728          throw new ParseException();
729        }
730      }
731      break;
732    case 83:
733      jj_consume_token(83);
734                    axis = Compiler.AXIS_SELF;
735                    type = Compiler.NODE_TYPE_NODE;
736      break;
737    case 84:
738      jj_consume_token(84);
739                    axis = Compiler.AXIS_PARENT;
740                    type = Compiler.NODE_TYPE_NODE;
741      break;
742    default:
743      jj_la1[11] = jj_gen;
744      jj_consume_token(-1);
745      throw new ParseException();
746    }
747    label_3:
748    while (true) {
749      switch (jj_nt.kind) {
750      case 85:
751        ;
752        break;
753      default:
754        jj_la1[12] = jj_gen;
755        break label_3;
756      }
757      p = Predicate();
758                ps.add(p);
759    }
760        if (name != null){
761            s = compiler.nodeNameTest(name);
762        }
763        else if (instruction != null){
764            s = compiler.processingInstructionTest(instruction);
765        }
766        else {
767            s = compiler.nodeTypeTest(type);
768        }
769        steps.add(compiler.step(axis, s, ps.toArray()));
770  }
771
772/* [5] AxisSpecifier ::=    AxisName '::' | AbbreviatedAxisSpecifier  */
773  final public int AxisSpecifier() throws ParseException {
774    int axis;
775    switch (jj_nt.kind) {
776    case AXIS_SELF:
777    case AXIS_CHILD:
778    case AXIS_PARENT:
779    case AXIS_ANCESTOR:
780    case AXIS_ATTRIBUTE:
781    case AXIS_NAMESPACE:
782    case AXIS_PRECEDING:
783    case AXIS_FOLLOWING:
784    case AXIS_DESCENDANT:
785    case AXIS_ANCESTOR_OR_SELF:
786    case AXIS_FOLLOWING_SIBLING:
787    case AXIS_PRECEDING_SIBLING:
788    case AXIS_DESCENDANT_OR_SELF:
789      axis = AxisName();
790      break;
791    default:
792      jj_la1[13] = jj_gen;
793      axis = AbbreviatedAxisSpecifier();
794    }
795        {if (true) return axis;}
796    throw new Error("Missing return statement in function");
797  }
798
799/*----------*/
800/* 2.2 Axes */
801/*----------*/
802
803/* [6] AxisName ::= 'ancestor' | 'ancestor-or-self' | 'attribute'  | 'child' | 'descendant'
804                    | 'descendant-or-self' | 'following' | 'following-sibling' | 'namespace'
805                       | 'parent' | 'preceding' | 'preceding-sibling' | 'self'
806*/
807  final public int AxisName() throws ParseException {
808    int axis = 0;
809    switch (jj_nt.kind) {
810    case AXIS_SELF:
811      jj_consume_token(AXIS_SELF);
812                                          axis = Compiler.AXIS_SELF;
813      break;
814    case AXIS_CHILD:
815      jj_consume_token(AXIS_CHILD);
816                                          axis = Compiler.AXIS_CHILD;
817      break;
818    case AXIS_PARENT:
819      jj_consume_token(AXIS_PARENT);
820                                          axis = Compiler.AXIS_PARENT;
821      break;
822    case AXIS_ANCESTOR:
823      jj_consume_token(AXIS_ANCESTOR);
824                                          axis = Compiler.AXIS_ANCESTOR;
825      break;
826    case AXIS_ATTRIBUTE:
827      jj_consume_token(AXIS_ATTRIBUTE);
828                                          axis = Compiler.AXIS_ATTRIBUTE;
829      break;
830    case AXIS_NAMESPACE:
831      jj_consume_token(AXIS_NAMESPACE);
832                                          axis = Compiler.AXIS_NAMESPACE;
833      break;
834    case AXIS_PRECEDING:
835      jj_consume_token(AXIS_PRECEDING);
836                                          axis = Compiler.AXIS_PRECEDING;
837      break;
838    case AXIS_FOLLOWING:
839      jj_consume_token(AXIS_FOLLOWING);
840                                          axis = Compiler.AXIS_FOLLOWING;
841      break;
842    case AXIS_DESCENDANT:
843      jj_consume_token(AXIS_DESCENDANT);
844                                          axis = Compiler.AXIS_DESCENDANT;
845      break;
846    case AXIS_ANCESTOR_OR_SELF:
847      jj_consume_token(AXIS_ANCESTOR_OR_SELF);
848                                          axis = Compiler.AXIS_ANCESTOR_OR_SELF;
849      break;
850    case AXIS_FOLLOWING_SIBLING:
851      jj_consume_token(AXIS_FOLLOWING_SIBLING);
852                                          axis = Compiler.AXIS_FOLLOWING_SIBLING;
853      break;
854    case AXIS_PRECEDING_SIBLING:
855      jj_consume_token(AXIS_PRECEDING_SIBLING);
856                                          axis = Compiler.AXIS_PRECEDING_SIBLING;
857      break;
858    case AXIS_DESCENDANT_OR_SELF:
859      jj_consume_token(AXIS_DESCENDANT_OR_SELF);
860                                          axis = Compiler.AXIS_DESCENDANT_OR_SELF;
861      break;
862    default:
863      jj_la1[14] = jj_gen;
864      jj_consume_token(-1);
865      throw new ParseException();
866    }
867        {if (true) return axis;}
868    throw new Error("Missing return statement in function");
869  }
870
871/*----------------*/
872/* 2.3 Node Tests */
873/*----------------*/
874
875/*----------------*/
876/* 2.4 Predicates */
877/*----------------*/
878
879/* [8] Predicate ::= '[' PredicateExpr ']'  */
880/* [9] PredicateExpr ::=  Expr  */
881  final public Object Predicate() throws ParseException {
882    Object ex;
883    jj_consume_token(85);
884    ex = Expression();
885    jj_consume_token(86);
886        {if (true) return ex;}
887    throw new Error("Missing return statement in function");
888  }
889
890/* [12]    AbbreviatedStep    ::=    '.'  | '..'  */
891
892/* [13]    AbbreviatedAxisSpecifier    ::=    '@'? */
893  final public int AbbreviatedAxisSpecifier() throws ParseException {
894    int axis = Compiler.AXIS_CHILD;
895    switch (jj_nt.kind) {
896    case 87:
897      jj_consume_token(87);
898           axis = Compiler.AXIS_ATTRIBUTE;
899      break;
900    default:
901      jj_la1[15] = jj_gen;
902      ;
903    }
904        {if (true) return axis;}
905    throw new Error("Missing return statement in function");
906  }
907
908/*---------------*/
909/* 3 Expressions */
910/*---------------*/
911
912/*------------*/
913/* 3.1 Basics */
914/*------------*/
915
916/*
917The effect of the grammar is that the order of precedence is (lowest precedence first):
918    or
919    and
920    =, !=
921    <=, <, >=, >
922and all operators are left associative.
923For example, 3 > 2 > 1 is equivalent to (3 > 2) > 1, which evaluates to false.
924*/
925
926/* [14] Expr ::= OrExpr */
927  final public Object Expression() throws ParseException {
928 Object ex;
929    ex = OrExpr();
930        {if (true) return ex;}
931    throw new Error("Missing return statement in function");
932  }
933
934/* [15] PrimaryExpr ::= VariableReference | '(' Expr ')' | Literal | Number | FunctionCall */
935  final public Object PrimaryExpr() throws ParseException {
936    Object ex = null;
937    switch (jj_nt.kind) {
938    case VARIABLE:
939      ex = VariableReference();
940      break;
941    case 81:
942      jj_consume_token(81);
943      ex = Expression();
944      jj_consume_token(82);
945      break;
946    case Literal:
947      jj_consume_token(Literal);
948                      ex = compiler.literal(unescape(token.image.substring(1, token.image.length() - 1)));
949      break;
950    case Number:
951      jj_consume_token(Number);
952                      ex = compiler.number(token.image);
953      break;
954    default:
955      jj_la1[16] = jj_gen;
956      if (jj_2_5(2147483647)) {
957        ex = CoreFunctionCall();
958      } else {
959        switch (jj_nt.kind) {
960        case OR:
961        case AND:
962        case MOD:
963        case DIV:
964        case NODE:
965        case TEXT:
966        case COMMENT:
967        case PI:
968        case FUNCTION_LAST:
969        case FUNCTION_POSITION:
970        case FUNCTION_COUNT:
971        case FUNCTION_ID:
972        case FUNCTION_KEY:
973        case FUNCTION_LOCAL_NAME:
974        case FUNCTION_NAMESPACE_URI:
975        case FUNCTION_NAME:
976        case FUNCTION_STRING:
977        case FUNCTION_CONCAT:
978        case FUNCTION_STARTS_WITH:
979        case FUNCTION_ENDS_WITH:
980        case FUNCTION_CONTAINS:
981        case FUNCTION_SUBSTRING_BEFORE:
982        case FUNCTION_SUBSTRING_AFTER:
983        case FUNCTION_SUBSTRING:
984        case FUNCTION_STRING_LENGTH:
985        case FUNCTION_NORMALIZE_SPACE:
986        case FUNCTION_TRANSLATE:
987        case FUNCTION_BOOLEAN:
988        case FUNCTION_NOT:
989        case FUNCTION_TRUE:
990        case FUNCTION_FALSE:
991        case FUNCTION_NULL:
992        case FUNCTION_LANG:
993        case FUNCTION_NUMBER:
994        case FUNCTION_SUM:
995        case FUNCTION_FLOOR:
996        case FUNCTION_CEILING:
997        case FUNCTION_ROUND:
998        case FUNCTION_FORMAT_NUMBER:
999        case NCName:
1000          ex = FunctionCall();
1001          break;
1002        default:
1003          jj_la1[17] = jj_gen;
1004          jj_consume_token(-1);
1005          throw new ParseException();
1006        }
1007      }
1008    }
1009        {if (true) return ex;}
1010    throw new Error("Missing return statement in function");
1011  }
1012
1013/*--------------------*/
1014/* 3.2 Function Calls */
1015/*--------------------*/
1016
1017/* [16]    FunctionCall    ::=    FunctionName '(' ( Argument ( ',' Argument)*)? ')'  */
1018  final public Object FunctionCall() throws ParseException {
1019    Object name;
1020    ArrayList args;
1021    name = FunctionName();
1022    args = ArgumentList();
1023        if (args == null){
1024            {if (true) return compiler.function(name, null);}
1025        }
1026        else {
1027            {if (true) return compiler.function(name, args.toArray());}
1028        }
1029    throw new Error("Missing return statement in function");
1030  }
1031
1032  final public Object CoreFunctionCall() throws ParseException {
1033    int code = 0;
1034    ArrayList args;
1035    code = CoreFunctionName();
1036    args = ArgumentList();
1037        if (args == null){
1038            {if (true) return compiler.function(code, null);}
1039        }
1040        else {
1041            {if (true) return compiler.function(code, args.toArray());}
1042        }
1043    throw new Error("Missing return statement in function");
1044  }
1045
1046  final public ArrayList ArgumentList() throws ParseException {
1047    ArrayList args = null;
1048    Object arg;
1049    jj_consume_token(81);
1050    switch (jj_nt.kind) {
1051    case SLASH:
1052    case SLASHSLASH:
1053    case MINUS:
1054    case VARIABLE:
1055    case Literal:
1056    case Number:
1057    case OR:
1058    case AND:
1059    case MOD:
1060    case DIV:
1061    case NODE:
1062    case TEXT:
1063    case COMMENT:
1064    case PI:
1065    case AXIS_SELF:
1066    case AXIS_CHILD:
1067    case AXIS_PARENT:
1068    case AXIS_ANCESTOR:
1069    case AXIS_ATTRIBUTE:
1070    case AXIS_NAMESPACE:
1071    case AXIS_PRECEDING:
1072    case AXIS_FOLLOWING:
1073    case AXIS_DESCENDANT:
1074    case AXIS_ANCESTOR_OR_SELF:
1075    case AXIS_FOLLOWING_SIBLING:
1076    case AXIS_PRECEDING_SIBLING:
1077    case AXIS_DESCENDANT_OR_SELF:
1078    case FUNCTION_LAST:
1079    case FUNCTION_POSITION:
1080    case FUNCTION_COUNT:
1081    case FUNCTION_ID:
1082    case FUNCTION_KEY:
1083    case FUNCTION_LOCAL_NAME:
1084    case FUNCTION_NAMESPACE_URI:
1085    case FUNCTION_NAME:
1086    case FUNCTION_STRING:
1087    case FUNCTION_CONCAT:
1088    case FUNCTION_STARTS_WITH:
1089    case FUNCTION_ENDS_WITH:
1090    case FUNCTION_CONTAINS:
1091    case FUNCTION_SUBSTRING_BEFORE:
1092    case FUNCTION_SUBSTRING_AFTER:
1093    case FUNCTION_SUBSTRING:
1094    case FUNCTION_STRING_LENGTH:
1095    case FUNCTION_NORMALIZE_SPACE:
1096    case FUNCTION_TRANSLATE:
1097    case FUNCTION_BOOLEAN:
1098    case FUNCTION_NOT:
1099    case FUNCTION_TRUE:
1100    case FUNCTION_FALSE:
1101    case FUNCTION_NULL:
1102    case FUNCTION_LANG:
1103    case FUNCTION_NUMBER:
1104    case FUNCTION_SUM:
1105    case FUNCTION_FLOOR:
1106    case FUNCTION_CEILING:
1107    case FUNCTION_ROUND:
1108    case FUNCTION_FORMAT_NUMBER:
1109    case NCName:
1110    case 81:
1111    case 83:
1112    case 84:
1113    case 87:
1114    case 89:
1115      arg = Argument();
1116                                args = new ArrayList(); args.add(arg);
1117      label_4:
1118      while (true) {
1119        switch (jj_nt.kind) {
1120        case 88:
1121          ;
1122          break;
1123        default:
1124          jj_la1[18] = jj_gen;
1125          break label_4;
1126        }
1127        jj_consume_token(88);
1128        arg = Argument();
1129                                       args.add(arg);
1130      }
1131      break;
1132    default:
1133      jj_la1[19] = jj_gen;
1134      ;
1135    }
1136    jj_consume_token(82);
1137        {if (true) return args;}
1138    throw new Error("Missing return statement in function");
1139  }
1140
1141/* [17]    Argument    ::=    Expr */
1142  final public Object Argument() throws ParseException {
1143    Object ex;
1144    ex = Expression();
1145        {if (true) return ex;}
1146    throw new Error("Missing return statement in function");
1147  }
1148
1149/*---------------*/
1150/* 3.3 Node-sets */
1151/*---------------*/
1152
1153/* [18] UnionExpr    ::=    PathExpr | UnionExpr '|' PathExpr */
1154  final public Object UnionExpr() throws ParseException {
1155    Object ex, r;
1156    ArrayList list = null;
1157    ex = PathExpr();
1158    label_5:
1159    while (true) {
1160      switch (jj_nt.kind) {
1161      case UNION:
1162        ;
1163        break;
1164      default:
1165        jj_la1[20] = jj_gen;
1166        break label_5;
1167      }
1168      jj_consume_token(UNION);
1169      r = PathExpr();
1170                if (list == null){
1171                    list = new ArrayList();
1172                    list.add(ex);
1173                }
1174                list.add(r);
1175    }
1176        if (list != null){
1177            ex = compiler.union(list.toArray());
1178        }
1179        {if (true) return ex;}
1180    throw new Error("Missing return statement in function");
1181  }
1182
1183/* [19] PathExpr ::= LocationPath | FilterExpr | FilterExpr '/' RelativeLocationPath | FilterExpr '//' RelativeLocationPath  */
1184  final public Object PathExpr() throws ParseException {
1185    Object ex = null;
1186    Object[] steps;
1187    if (jj_2_6(2147483647)) {
1188      ex = FilterExpr();
1189    } else {
1190      switch (jj_nt.kind) {
1191      case SLASH:
1192      case SLASHSLASH:
1193      case OR:
1194      case AND:
1195      case MOD:
1196      case DIV:
1197      case NODE:
1198      case TEXT:
1199      case COMMENT:
1200      case PI:
1201      case AXIS_SELF:
1202      case AXIS_CHILD:
1203      case AXIS_PARENT:
1204      case AXIS_ANCESTOR:
1205      case AXIS_ATTRIBUTE:
1206      case AXIS_NAMESPACE:
1207      case AXIS_PRECEDING:
1208      case AXIS_FOLLOWING:
1209      case AXIS_DESCENDANT:
1210      case AXIS_ANCESTOR_OR_SELF:
1211      case AXIS_FOLLOWING_SIBLING:
1212      case AXIS_PRECEDING_SIBLING:
1213      case AXIS_DESCENDANT_OR_SELF:
1214      case FUNCTION_LAST:
1215      case FUNCTION_POSITION:
1216      case FUNCTION_COUNT:
1217      case FUNCTION_ID:
1218      case FUNCTION_KEY:
1219      case FUNCTION_LOCAL_NAME:
1220      case FUNCTION_NAMESPACE_URI:
1221      case FUNCTION_NAME:
1222      case FUNCTION_STRING:
1223      case FUNCTION_CONCAT:
1224      case FUNCTION_STARTS_WITH:
1225      case FUNCTION_ENDS_WITH:
1226      case FUNCTION_CONTAINS:
1227      case FUNCTION_SUBSTRING_BEFORE:
1228      case FUNCTION_SUBSTRING_AFTER:
1229      case FUNCTION_SUBSTRING:
1230      case FUNCTION_STRING_LENGTH:
1231      case FUNCTION_NORMALIZE_SPACE:
1232      case FUNCTION_TRANSLATE:
1233      case FUNCTION_BOOLEAN:
1234      case FUNCTION_NOT:
1235      case FUNCTION_TRUE:
1236      case FUNCTION_FALSE:
1237      case FUNCTION_NULL:
1238      case FUNCTION_LANG:
1239      case FUNCTION_NUMBER:
1240      case FUNCTION_SUM:
1241      case FUNCTION_FLOOR:
1242      case FUNCTION_CEILING:
1243      case FUNCTION_ROUND:
1244      case FUNCTION_FORMAT_NUMBER:
1245      case NCName:
1246      case 83:
1247      case 84:
1248      case 87:
1249      case 89:
1250        ex = LocationPath();
1251        break;
1252      default:
1253        jj_la1[21] = jj_gen;
1254        jj_consume_token(-1);
1255        throw new ParseException();
1256      }
1257    }
1258        {if (true) return ex;}
1259    throw new Error("Missing return statement in function");
1260  }
1261
1262/* [20]    FilterExpr    ::=    PrimaryExpr    | FilterExpr Predicate */
1263  final public Object FilterExpr() throws ParseException {
1264    Object ex, p;
1265    ArrayList ps = new ArrayList();
1266    boolean path = false;
1267    ArrayList steps = new ArrayList();
1268    ex = PrimaryExpr();
1269    label_6:
1270    while (true) {
1271      switch (jj_nt.kind) {
1272      case 85:
1273        ;
1274        break;
1275      default:
1276        jj_la1[22] = jj_gen;
1277        break label_6;
1278      }
1279      p = Predicate();
1280                path = true;
1281                ps.add(p);
1282    }
1283    label_7:
1284    while (true) {
1285      switch (jj_nt.kind) {
1286      case SLASH:
1287      case SLASHSLASH:
1288        ;
1289        break;
1290      default:
1291        jj_la1[23] = jj_gen;
1292        break label_7;
1293      }
1294      LocationStep(steps);
1295                path = true;
1296    }
1297        if (path){
1298            {if (true) return compiler.expressionPath(ex, ps.toArray(), steps.toArray());}
1299        }
1300        else {
1301            {if (true) return ex;}
1302        }
1303    throw new Error("Missing return statement in function");
1304  }
1305
1306/*--------------*/
1307/* 3.4 Booleans */
1308/*--------------*/
1309
1310/* [21] OrExpr    ::=    AndExpr | OrExpr 'or' AndExpr */
1311  final public Object OrExpr() throws ParseException {
1312    Object ex, r;
1313    ArrayList list = null;
1314    ex = AndExpr();
1315    label_8:
1316    while (true) {
1317      switch (jj_nt.kind) {
1318      case OR:
1319        ;
1320        break;
1321      default:
1322        jj_la1[24] = jj_gen;
1323        break label_8;
1324      }
1325      jj_consume_token(OR);
1326      r = AndExpr();
1327                if (list == null){
1328                    list = new ArrayList();
1329                    list.add(ex);
1330                }
1331                list.add(r);
1332    }
1333        if (list != null){
1334            ex = compiler.or(list.toArray());
1335        }
1336        {if (true) return ex;}
1337    throw new Error("Missing return statement in function");
1338  }
1339
1340/* [22] AndExpr    ::=    EqualityExpr  | AndExpr 'and' EqualityExpr  */
1341  final public Object AndExpr() throws ParseException {
1342    Object ex, r;
1343    ArrayList list = null;
1344    ex = EqualityExpr();
1345    label_9:
1346    while (true) {
1347      switch (jj_nt.kind) {
1348      case AND:
1349        ;
1350        break;
1351      default:
1352        jj_la1[25] = jj_gen;
1353        break label_9;
1354      }
1355      jj_consume_token(AND);
1356      r = EqualityExpr();
1357                if (list == null){
1358                    list = new ArrayList();
1359                    list.add(ex);
1360                }
1361                list.add(r);
1362    }
1363        if (list != null){
1364            ex = compiler.and(list.toArray());
1365        }
1366        {if (true) return ex;}
1367    throw new Error("Missing return statement in function");
1368  }
1369
1370/* [23] EqualityExpr    ::=    RelationalExpr | EqualityExpr '=' RelationalExpr | EqualityExpr '!=' RelationalExpr */
1371  final public Object EqualityExpr() throws ParseException {
1372 Object ex, r;
1373    ex = RelationalExpr();
1374    label_10:
1375    while (true) {
1376      switch (jj_nt.kind) {
1377      case EQ:
1378      case NEQ:
1379        ;
1380        break;
1381      default:
1382        jj_la1[26] = jj_gen;
1383        break label_10;
1384      }
1385      switch (jj_nt.kind) {
1386      case EQ:
1387        jj_consume_token(EQ);
1388        r = RelationalExpr();
1389                                          ex = compiler.equal(ex, r);
1390        break;
1391      case NEQ:
1392        jj_consume_token(NEQ);
1393        r = RelationalExpr();
1394                                          ex = compiler.notEqual(ex, r);
1395        break;
1396      default:
1397        jj_la1[27] = jj_gen;
1398        jj_consume_token(-1);
1399        throw new ParseException();
1400      }
1401    }
1402        {if (true) return ex;}
1403    throw new Error("Missing return statement in function");
1404  }
1405
1406/* [24] RelationalExpr    ::=    AdditiveExpr | RelationalExpr '<' AdditiveExpr | RelationalExpr '>' AdditiveExpr
1407                       | RelationalExpr '<=' AdditiveExpr  | RelationalExpr '>=' AdditiveExpr */
1408  final public Object RelationalExpr() throws ParseException {
1409 Object ex, r;
1410    ex = AdditiveExpr();
1411    label_11:
1412    while (true) {
1413      switch (jj_nt.kind) {
1414      case LT:
1415      case LTE:
1416      case GT:
1417      case GTE:
1418        ;
1419        break;
1420      default:
1421        jj_la1[28] = jj_gen;
1422        break label_11;
1423      }
1424      switch (jj_nt.kind) {
1425      case LT:
1426        jj_consume_token(LT);
1427        r = AdditiveExpr();
1428                                        ex = compiler.lessThan(ex, r);
1429        break;
1430      case GT:
1431        jj_consume_token(GT);
1432        r = AdditiveExpr();
1433                                        ex = compiler.greaterThan(ex, r);
1434        break;
1435      case LTE:
1436        jj_consume_token(LTE);
1437        r = AdditiveExpr();
1438                                        ex = compiler.lessThanOrEqual(ex, r);
1439        break;
1440      case GTE:
1441        jj_consume_token(GTE);
1442        r = AdditiveExpr();
1443                                        ex = compiler.greaterThanOrEqual(ex, r);
1444        break;
1445      default:
1446        jj_la1[29] = jj_gen;
1447        jj_consume_token(-1);
1448        throw new ParseException();
1449      }
1450    }
1451        {if (true) return ex;}
1452    throw new Error("Missing return statement in function");
1453  }
1454
1455/*-------------*/
1456/* 3.5 Numbers */
1457/*-------------*/
1458
1459/* [25] AdditiveExpr ::= MultiplicativeExpr  | AdditiveExpr '+' MultiplicativeExpr  | AdditiveExpr '-' MultiplicativeExpr  */
1460  final public Object AdditiveExpr() throws ParseException {
1461    Object ex, r;
1462    ArrayList list = null;
1463    ex = SubtractiveExpr();
1464    label_12:
1465    while (true) {
1466      switch (jj_nt.kind) {
1467      case PLUS:
1468        ;
1469        break;
1470      default:
1471        jj_la1[30] = jj_gen;
1472        break label_12;
1473      }
1474      jj_consume_token(PLUS);
1475      r = SubtractiveExpr();
1476                if (list == null){
1477                    list = new ArrayList();
1478                    list.add(ex);
1479                }
1480                list.add(r);
1481    }
1482        if (list != null){
1483            ex = compiler.sum(list.toArray());
1484        }
1485        {if (true) return ex;}
1486    throw new Error("Missing return statement in function");
1487  }
1488
1489  final public Object SubtractiveExpr() throws ParseException {
1490    Object ex, r = null;
1491    ex = MultiplicativeExpr();
1492    label_13:
1493    while (true) {
1494      switch (jj_nt.kind) {
1495      case MINUS:
1496        ;
1497        break;
1498      default:
1499        jj_la1[31] = jj_gen;
1500        break label_13;
1501      }
1502      jj_consume_token(MINUS);
1503      r = MultiplicativeExpr();
1504                                               ex = compiler.minus(ex, r);
1505    }
1506        {if (true) return ex;}
1507    throw new Error("Missing return statement in function");
1508  }
1509
1510/* [26] MultiplicativeExpr ::= UnaryExpr | MultiplicativeExpr MultiplyOperator UnaryExpr
1511            | MultiplicativeExpr 'div' UnaryExpr | MultiplicativeExpr 'mod' UnaryExpr  */
1512  final public Object MultiplicativeExpr() throws ParseException {
1513    Object ex, r;
1514    ex = UnaryExpr();
1515    label_14:
1516    while (true) {
1517      switch (jj_nt.kind) {
1518      case MOD:
1519      case DIV:
1520      case 89:
1521        ;
1522        break;
1523      default:
1524        jj_la1[32] = jj_gen;
1525        break label_14;
1526      }
1527      switch (jj_nt.kind) {
1528      case 89:
1529        jj_consume_token(89);
1530        r = UnaryExpr();
1531                                    ex = compiler.multiply(ex, r);
1532        break;
1533      case DIV:
1534        jj_consume_token(DIV);
1535        r = UnaryExpr();
1536                                    ex = compiler.divide(ex, r);
1537        break;
1538      case MOD:
1539        jj_consume_token(MOD);
1540        r = UnaryExpr();
1541                                    ex = compiler.mod(ex, r);
1542        break;
1543      default:
1544        jj_la1[33] = jj_gen;
1545        jj_consume_token(-1);
1546        throw new ParseException();
1547      }
1548    }
1549        {if (true) return ex;}
1550    throw new Error("Missing return statement in function");
1551  }
1552
1553/* [27]    UnaryExpr    ::=    UnionExpr  | '-' UnaryExpr  */
1554  final public Object UnaryExpr() throws ParseException {
1555    Object ex;
1556    switch (jj_nt.kind) {
1557    case SLASH:
1558    case SLASHSLASH:
1559    case VARIABLE:
1560    case Literal:
1561    case Number:
1562    case OR:
1563    case AND:
1564    case MOD:
1565    case DIV:
1566    case NODE:
1567    case TEXT:
1568    case COMMENT:
1569    case PI:
1570    case AXIS_SELF:
1571    case AXIS_CHILD:
1572    case AXIS_PARENT:
1573    case AXIS_ANCESTOR:
1574    case AXIS_ATTRIBUTE:
1575    case AXIS_NAMESPACE:
1576    case AXIS_PRECEDING:
1577    case AXIS_FOLLOWING:
1578    case AXIS_DESCENDANT:
1579    case AXIS_ANCESTOR_OR_SELF:
1580    case AXIS_FOLLOWING_SIBLING:
1581    case AXIS_PRECEDING_SIBLING:
1582    case AXIS_DESCENDANT_OR_SELF:
1583    case FUNCTION_LAST:
1584    case FUNCTION_POSITION:
1585    case FUNCTION_COUNT:
1586    case FUNCTION_ID:
1587    case FUNCTION_KEY:
1588    case FUNCTION_LOCAL_NAME:
1589    case FUNCTION_NAMESPACE_URI:
1590    case FUNCTION_NAME:
1591    case FUNCTION_STRING:
1592    case FUNCTION_CONCAT:
1593    case FUNCTION_STARTS_WITH:
1594    case FUNCTION_ENDS_WITH:
1595    case FUNCTION_CONTAINS:
1596    case FUNCTION_SUBSTRING_BEFORE:
1597    case FUNCTION_SUBSTRING_AFTER:
1598    case FUNCTION_SUBSTRING:
1599    case FUNCTION_STRING_LENGTH:
1600    case FUNCTION_NORMALIZE_SPACE:
1601    case FUNCTION_TRANSLATE:
1602    case FUNCTION_BOOLEAN:
1603    case FUNCTION_NOT:
1604    case FUNCTION_TRUE:
1605    case FUNCTION_FALSE:
1606    case FUNCTION_NULL:
1607    case FUNCTION_LANG:
1608    case FUNCTION_NUMBER:
1609    case FUNCTION_SUM:
1610    case FUNCTION_FLOOR:
1611    case FUNCTION_CEILING:
1612    case FUNCTION_ROUND:
1613    case FUNCTION_FORMAT_NUMBER:
1614    case NCName:
1615    case 81:
1616    case 83:
1617    case 84:
1618    case 87:
1619    case 89:
1620      ex = UnionExpr();
1621      break;
1622    case MINUS:
1623      jj_consume_token(MINUS);
1624      ex = UnaryExpr();
1625                                    ex = compiler.minus(ex);
1626      break;
1627    default:
1628      jj_la1[34] = jj_gen;
1629      jj_consume_token(-1);
1630      throw new ParseException();
1631    }
1632        {if (true) return ex;}
1633    throw new Error("Missing return statement in function");
1634  }
1635
1636/*-------------*/
1637/* 3.6 Strings */
1638/*-------------*/
1639
1640/*----------------------------------*/
1641/* 3.7 Expression Lexical Structure */
1642/*----------------------------------*/
1643/*
1644The following special tokenization rules must be applied in the order
1645specified to disambiguate the grammar:
1646
16471. If there is a preceding token and the preceding token is not one of
1648   @, ::, (, [, , or an Operator,
1649   then a * must be recognized as a MultiplyOperator and an NCName must
1650   be recognized as an OperatorName.
1651
16522. If the character following an NCName (possibly after intervening ExprWhitespace)
1653   is (, then the token must be recognized as a NodeType or a FunctionName.
1654
16553. If the two characters following an NCName (possibly after intervening ExprWhitespace)
1656   are ::, then the token must be recognized as an AxisName.
1657
16584. Otherwise, the token must not be recognized as a MultiplyOperator, an OperatorName,
1659   a NodeType, a FunctionName, or an AxisName.
1660*/
1661
1662/*
1663[28]    ExprToken    ::=    '(' | ')' | '[' | ']' | '.' | '..' | '@' | ',' | '::'
1664   | WildcardName  | NodeType  | Operator  | FunctionName  | AxisName  | Literal
1665   | Number  | VariableReference
1666*/
1667/* [34]    MultiplyOperator    ::=    '*'  */
1668
1669/* [35]    FunctionName    ::=    QName - NodeType   */
1670  final public Object FunctionName() throws ParseException {
1671    Object qname;
1672    qname = QName_Without_CoreFunctions();
1673        {if (true) return qname;}
1674    throw new Error("Missing return statement in function");
1675  }
1676
1677/* [36]    VariableReference    ::=    '$' QName  */
1678  final public Object VariableReference() throws ParseException {
1679    Object ex;
1680    jj_consume_token(VARIABLE);
1681    ex = QName();
1682        {if (true) return compiler.variableReference(ex);}
1683    throw new Error("Missing return statement in function");
1684  }
1685
1686/* [37]    WildcardName    ::=    '*'     | NCName ':' '*'     | QName  */
1687  final public Object WildcardName() throws ParseException {
1688    Object qn;
1689    String nc1, nc2 = null;
1690    switch (jj_nt.kind) {
1691    case 89:
1692      jj_consume_token(89);
1693      break;
1694    case OR:
1695    case AND:
1696    case MOD:
1697    case DIV:
1698    case NODE:
1699    case TEXT:
1700    case COMMENT:
1701    case PI:
1702    case FUNCTION_LAST:
1703    case FUNCTION_POSITION:
1704    case FUNCTION_COUNT:
1705    case FUNCTION_ID:
1706    case FUNCTION_KEY:
1707    case FUNCTION_LOCAL_NAME:
1708    case FUNCTION_NAMESPACE_URI:
1709    case FUNCTION_NAME:
1710    case FUNCTION_STRING:
1711    case FUNCTION_CONCAT:
1712    case FUNCTION_STARTS_WITH:
1713    case FUNCTION_ENDS_WITH:
1714    case FUNCTION_CONTAINS:
1715    case FUNCTION_SUBSTRING_BEFORE:
1716    case FUNCTION_SUBSTRING_AFTER:
1717    case FUNCTION_SUBSTRING:
1718    case FUNCTION_STRING_LENGTH:
1719    case FUNCTION_NORMALIZE_SPACE:
1720    case FUNCTION_TRANSLATE:
1721    case FUNCTION_BOOLEAN:
1722    case FUNCTION_NOT:
1723    case FUNCTION_TRUE:
1724    case FUNCTION_FALSE:
1725    case FUNCTION_NULL:
1726    case FUNCTION_LANG:
1727    case FUNCTION_NUMBER:
1728    case FUNCTION_SUM:
1729    case FUNCTION_FLOOR:
1730    case FUNCTION_CEILING:
1731    case FUNCTION_ROUND:
1732    case FUNCTION_FORMAT_NUMBER:
1733    case NCName:
1734      NCName();
1735      break;
1736    default:
1737      jj_la1[35] = jj_gen;
1738      jj_consume_token(-1);
1739      throw new ParseException();
1740    }
1741                           nc1 = token.image;
1742    switch (jj_nt.kind) {
1743    case 80:
1744      jj_consume_token(80);
1745      switch (jj_nt.kind) {
1746      case 89:
1747        jj_consume_token(89);
1748        break;
1749      case OR:
1750      case AND:
1751      case MOD:
1752      case DIV:
1753      case NODE:
1754      case TEXT:
1755      case COMMENT:
1756      case PI:
1757      case FUNCTION_LAST:
1758      case FUNCTION_POSITION:
1759      case FUNCTION_COUNT:
1760      case FUNCTION_ID:
1761      case FUNCTION_KEY:
1762      case FUNCTION_LOCAL_NAME:
1763      case FUNCTION_NAMESPACE_URI:
1764      case FUNCTION_NAME:
1765      case FUNCTION_STRING:
1766      case FUNCTION_CONCAT:
1767      case FUNCTION_STARTS_WITH:
1768      case FUNCTION_ENDS_WITH:
1769      case FUNCTION_CONTAINS:
1770      case FUNCTION_SUBSTRING_BEFORE:
1771      case FUNCTION_SUBSTRING_AFTER:
1772      case FUNCTION_SUBSTRING:
1773      case FUNCTION_STRING_LENGTH:
1774      case FUNCTION_NORMALIZE_SPACE:
1775      case FUNCTION_TRANSLATE:
1776      case FUNCTION_BOOLEAN:
1777      case FUNCTION_NOT:
1778      case FUNCTION_TRUE:
1779      case FUNCTION_FALSE:
1780      case FUNCTION_NULL:
1781      case FUNCTION_LANG:
1782      case FUNCTION_NUMBER:
1783      case FUNCTION_SUM:
1784      case FUNCTION_FLOOR:
1785      case FUNCTION_CEILING:
1786      case FUNCTION_ROUND:
1787      case FUNCTION_FORMAT_NUMBER:
1788      case NCName:
1789        NCName();
1790        break;
1791      default:
1792        jj_la1[36] = jj_gen;
1793        jj_consume_token(-1);
1794        throw new ParseException();
1795      }
1796                               nc2 = token.image;
1797      break;
1798    default:
1799      jj_la1[37] = jj_gen;
1800      ;
1801    }
1802        if (nc2 != null){
1803            qn = compiler.qname(nc1, nc2);
1804        }
1805        else {
1806            qn = compiler.qname(null, nc1);
1807        }
1808        {if (true) return qn;}
1809    throw new Error("Missing return statement in function");
1810  }
1811
1812/* [38]    NodeType    ::=    'comment' | 'text'  | 'processing-instruction'  | 'node'  */
1813  final public int NodeType() throws ParseException {
1814    int type;
1815    switch (jj_nt.kind) {
1816    case TEXT:
1817      jj_consume_token(TEXT);
1818                      type = Compiler.NODE_TYPE_TEXT;
1819      break;
1820    case NODE:
1821      jj_consume_token(NODE);
1822                      type = Compiler.NODE_TYPE_NODE;
1823      break;
1824    case COMMENT:
1825      jj_consume_token(COMMENT);
1826                      type = Compiler.NODE_TYPE_COMMENT;
1827      break;
1828    case PI:
1829      jj_consume_token(PI);
1830                      type = Compiler.NODE_TYPE_PI;
1831      break;
1832    default:
1833      jj_la1[38] = jj_gen;
1834      jj_consume_token(-1);
1835      throw new ParseException();
1836    }
1837        {if (true) return type;}
1838    throw new Error("Missing return statement in function");
1839  }
1840
1841  final private boolean jj_2_1(int xla) {
1842    jj_la = xla; jj_lastpos = jj_scanpos = token;
1843    try { return !jj_3_1(); }
1844    catch(LookaheadSuccess ls) { return true; }
1845    finally { jj_save(0, xla); }
1846  }
1847
1848  final private boolean jj_2_2(int xla) {
1849    jj_la = xla; jj_lastpos = jj_scanpos = token;
1850    try { return !jj_3_2(); }
1851    catch(LookaheadSuccess ls) { return true; }
1852    finally { jj_save(1, xla); }
1853  }
1854
1855  final private boolean jj_2_3(int xla) {
1856    jj_la = xla; jj_lastpos = jj_scanpos = token;
1857    try { return !jj_3_3(); }
1858    catch(LookaheadSuccess ls) { return true; }
1859    finally { jj_save(2, xla); }
1860  }
1861
1862  final private boolean jj_2_4(int xla) {
1863    jj_la = xla; jj_lastpos = jj_scanpos = token;
1864    try { return !jj_3_4(); }
1865    catch(LookaheadSuccess ls) { return true; }
1866    finally { jj_save(3, xla); }
1867  }
1868
1869  final private boolean jj_2_5(int xla) {
1870    jj_la = xla; jj_lastpos = jj_scanpos = token;
1871    try { return !jj_3_5(); }
1872    catch(LookaheadSuccess ls) { return true; }
1873    finally { jj_save(4, xla); }
1874  }
1875
1876  final private boolean jj_2_6(int xla) {
1877    jj_la = xla; jj_lastpos = jj_scanpos = token;
1878    try { return !jj_3_6(); }
1879    catch(LookaheadSuccess ls) { return true; }
1880    finally { jj_save(5, xla); }
1881  }
1882
1883  final private boolean jj_3_2() {
1884    if (jj_3R_16()) return true;
1885    return false;
1886  }
1887
1888  final private boolean jj_3R_144() {
1889    if (jj_3R_16()) return true;
1890    return false;
1891  }
1892
1893  final private boolean jj_3R_143() {
1894    if (jj_3R_77()) return true;
1895    return false;
1896  }
1897
1898  final private boolean jj_3R_150() {
1899    if (jj_3R_16()) return true;
1900    Token xsp;
1901    while (true) {
1902      xsp = jj_scanpos;
1903      if (jj_3R_151()) { jj_scanpos = xsp; break; }
1904    }
1905    return false;
1906  }
1907
1908  final private boolean jj_3R_132() {
1909    if (jj_scan_token(MINUS)) return true;
1910    if (jj_3R_129()) return true;
1911    return false;
1912  }
1913
1914  final private boolean jj_3R_130() {
1915    Token xsp;
1916    xsp = jj_scanpos;
1917    if (jj_3R_133()) {
1918    jj_scanpos = xsp;
1919    if (jj_3R_134()) {
1920    jj_scanpos = xsp;
1921    if (jj_3R_135()) return true;
1922    }
1923    }
1924    return false;
1925  }
1926
1927  final private boolean jj_3R_148() {
1928    Token xsp;
1929    xsp = jj_scanpos;
1930    if (jj_3R_150()) {
1931    jj_scanpos = xsp;
1932    if (jj_scan_token(6)) return true;
1933    }
1934    return false;
1935  }
1936
1937  final private boolean jj_3R_131() {
1938    if (jj_3R_136()) return true;
1939    return false;
1940  }
1941
1942  final private boolean jj_3R_64() {
1943    Token xsp;
1944    xsp = jj_scanpos;
1945    if (jj_scan_token(79)) {
1946    jj_scanpos = xsp;
1947    if (jj_scan_token(27)) {
1948    jj_scanpos = xsp;
1949    if (jj_scan_token(28)) {
1950    jj_scanpos = xsp;
1951    if (jj_scan_token(29)) {
1952    jj_scanpos = xsp;
1953    if (jj_scan_token(30)) return true;
1954    }
1955    }
1956    }
1957    }
1958    return false;
1959  }
1960
1961  final private boolean jj_3R_113() {
1962    if (jj_scan_token(87)) return true;
1963    return false;
1964  }
1965
1966  final private boolean jj_3R_91() {
1967    Token xsp;
1968    xsp = jj_scanpos;
1969    if (jj_3R_113()) jj_scanpos = xsp;
1970    return false;
1971  }
1972
1973  final private boolean jj_3R_141() {
1974    if (jj_3R_19()) return true;
1975    Token xsp;
1976    while (true) {
1977      xsp = jj_scanpos;
1978      if (jj_3R_143()) { jj_scanpos = xsp; break; }
1979    }
1980    while (true) {
1981      xsp = jj_scanpos;
1982      if (jj_3R_144()) { jj_scanpos = xsp; break; }
1983    }
1984    return false;
1985  }
1986
1987  final private boolean jj_3R_129() {
1988    Token xsp;
1989    xsp = jj_scanpos;
1990    if (jj_3R_131()) {
1991    jj_scanpos = xsp;
1992    if (jj_3R_132()) return true;
1993    }
1994    return false;
1995  }
1996
1997  final private boolean jj_3_6() {
1998    if (jj_3R_19()) return true;
1999    return false;
2000  }
2001
2002  final private boolean jj_3R_146() {
2003    if (jj_3R_148()) return true;
2004    return false;
2005  }
2006
2007  final private boolean jj_3R_135() {
2008    if (jj_scan_token(MOD)) return true;
2009    if (jj_3R_129()) return true;
2010    return false;
2011  }
2012
2013  final private boolean jj_3R_145() {
2014    if (jj_3R_147()) return true;
2015    return false;
2016  }
2017
2018  final private boolean jj_3R_134() {
2019    if (jj_scan_token(DIV)) return true;
2020    if (jj_3R_129()) return true;
2021    return false;
2022  }
2023
2024  final private boolean jj_3R_133() {
2025    if (jj_scan_token(89)) return true;
2026    if (jj_3R_129()) return true;
2027    return false;
2028  }
2029
2030  final private boolean jj_3R_142() {
2031    Token xsp;
2032    xsp = jj_scanpos;
2033    if (jj_3R_145()) {
2034    jj_scanpos = xsp;
2035    if (jj_3R_146()) return true;
2036    }
2037    return false;
2038  }
2039
2040  final private boolean jj_3R_140() {
2041    if (jj_3R_142()) return true;
2042    return false;
2043  }
2044
2045  final private boolean jj_3R_139() {
2046    if (jj_3R_141()) return true;
2047    return false;
2048  }
2049
2050  final private boolean jj_3R_77() {
2051    if (jj_scan_token(85)) return true;
2052    if (jj_3R_70()) return true;
2053    if (jj_scan_token(86)) return true;
2054    return false;
2055  }
2056
2057  final private boolean jj_3R_127() {
2058    if (jj_3R_129()) return true;
2059    Token xsp;
2060    while (true) {
2061      xsp = jj_scanpos;
2062      if (jj_3R_130()) { jj_scanpos = xsp; break; }
2063    }
2064    return false;
2065  }
2066
2067  final private boolean jj_3R_137() {
2068    Token xsp;
2069    xsp = jj_scanpos;
2070    if (jj_3R_139()) {
2071    jj_scanpos = xsp;
2072    if (jj_3R_140()) return true;
2073    }
2074    return false;
2075  }
2076
2077  final private boolean jj_3R_128() {
2078    if (jj_scan_token(MINUS)) return true;
2079    if (jj_3R_127()) return true;
2080    return false;
2081  }
2082
2083  final private boolean jj_3R_112() {
2084    if (jj_scan_token(AXIS_DESCENDANT_OR_SELF)) return true;
2085    return false;
2086  }
2087
2088  final private boolean jj_3R_111() {
2089    if (jj_scan_token(AXIS_PRECEDING_SIBLING)) return true;
2090    return false;
2091  }
2092
2093  final private boolean jj_3R_110() {
2094    if (jj_scan_token(AXIS_FOLLOWING_SIBLING)) return true;
2095    return false;
2096  }
2097
2098  final private boolean jj_3R_122() {
2099    if (jj_scan_token(PLUS)) return true;
2100    if (jj_3R_121()) return true;
2101    return false;
2102  }
2103
2104  final private boolean jj_3R_109() {
2105    if (jj_scan_token(AXIS_ANCESTOR_OR_SELF)) return true;
2106    return false;
2107  }
2108
2109  final private boolean jj_3R_108() {
2110    if (jj_scan_token(AXIS_DESCENDANT)) return true;
2111    return false;
2112  }
2113
2114  final private boolean jj_3R_107() {
2115    if (jj_scan_token(AXIS_FOLLOWING)) return true;
2116    return false;
2117  }
2118
2119  final private boolean jj_3R_106() {
2120    if (jj_scan_token(AXIS_PRECEDING)) return true;
2121    return false;
2122  }
2123
2124  final private boolean jj_3R_121() {
2125    if (jj_3R_127()) return true;
2126    Token xsp;
2127    while (true) {
2128      xsp = jj_scanpos;
2129      if (jj_3R_128()) { jj_scanpos = xsp; break; }
2130    }
2131    return false;
2132  }
2133
2134  final private boolean jj_3R_105() {
2135    if (jj_scan_token(AXIS_NAMESPACE)) return true;
2136    return false;
2137  }
2138
2139  final private boolean jj_3R_104() {
2140    if (jj_scan_token(AXIS_ATTRIBUTE)) return true;
2141    return false;
2142  }
2143
2144  final private boolean jj_3R_103() {
2145    if (jj_scan_token(AXIS_ANCESTOR)) return true;
2146    return false;
2147  }
2148
2149  final private boolean jj_3R_20() {
2150    if (jj_3R_64()) return true;
2151    return false;
2152  }
2153
2154  final private boolean jj_3R_102() {
2155    if (jj_scan_token(AXIS_PARENT)) return true;
2156    return false;
2157  }
2158
2159  final private boolean jj_3R_101() {
2160    if (jj_scan_token(AXIS_CHILD)) return true;
2161    return false;
2162  }
2163
2164  final private boolean jj_3R_100() {
2165    if (jj_scan_token(AXIS_SELF)) return true;
2166    return false;
2167  }
2168
2169  final private boolean jj_3R_138() {
2170    if (jj_scan_token(UNION)) return true;
2171    if (jj_3R_137()) return true;
2172    return false;
2173  }
2174
2175  final private boolean jj_3R_15() {
2176    Token xsp;
2177    xsp = jj_scanpos;
2178    if (jj_3R_20()) {
2179    jj_scanpos = xsp;
2180    if (jj_scan_token(31)) {
2181    jj_scanpos = xsp;
2182    if (jj_scan_token(32)) {
2183    jj_scanpos = xsp;
2184    if (jj_scan_token(33)) {
2185    jj_scanpos = xsp;
2186    if (jj_scan_token(34)) {
2187    jj_scanpos = xsp;
2188    if (jj_scan_token(48)) {
2189    jj_scanpos = xsp;
2190    if (jj_scan_token(49)) {
2191    jj_scanpos = xsp;
2192    if (jj_scan_token(50)) {
2193    jj_scanpos = xsp;
2194    if (jj_scan_token(51)) {
2195    jj_scanpos = xsp;
2196    if (jj_scan_token(53)) {
2197    jj_scanpos = xsp;
2198    if (jj_scan_token(54)) {
2199    jj_scanpos = xsp;
2200    if (jj_scan_token(55)) {
2201    jj_scanpos = xsp;
2202    if (jj_scan_token(56)) {
2203    jj_scanpos = xsp;
2204    if (jj_scan_token(57)) {
2205    jj_scanpos = xsp;
2206    if (jj_scan_token(58)) {
2207    jj_scanpos = xsp;
2208    if (jj_scan_token(59)) {
2209    jj_scanpos = xsp;
2210    if (jj_scan_token(60)) {
2211    jj_scanpos = xsp;
2212    if (jj_scan_token(61)) {
2213    jj_scanpos = xsp;
2214    if (jj_scan_token(62)) {
2215    jj_scanpos = xsp;
2216    if (jj_scan_token(63)) {
2217    jj_scanpos = xsp;
2218    if (jj_scan_token(64)) {
2219    jj_scanpos = xsp;
2220    if (jj_scan_token(65)) {
2221    jj_scanpos = xsp;
2222    if (jj_scan_token(66)) {
2223    jj_scanpos = xsp;
2224    if (jj_scan_token(67)) {
2225    jj_scanpos = xsp;
2226    if (jj_scan_token(68)) {
2227    jj_scanpos = xsp;
2228    if (jj_scan_token(69)) {
2229    jj_scanpos = xsp;
2230    if (jj_scan_token(70)) {
2231    jj_scanpos = xsp;
2232    if (jj_scan_token(71)) {
2233    jj_scanpos = xsp;
2234    if (jj_scan_token(72)) {
2235    jj_scanpos = xsp;
2236    if (jj_scan_token(73)) {
2237    jj_scanpos = xsp;
2238    if (jj_scan_token(74)) {
2239    jj_scanpos = xsp;
2240    if (jj_scan_token(75)) {
2241    jj_scanpos = xsp;
2242    if (jj_scan_token(76)) {
2243    jj_scanpos = xsp;
2244    if (jj_scan_token(77)) {
2245    jj_scanpos = xsp;
2246    if (jj_scan_token(52)) {
2247    jj_scanpos = xsp;
2248    if (jj_scan_token(78)) return true;
2249    }
2250    }
2251    }
2252    }
2253    }
2254    }
2255    }
2256    }
2257    }
2258    }
2259    }
2260    }
2261    }
2262    }
2263    }
2264    }
2265    }
2266    }
2267    }
2268    }
2269    }
2270    }
2271    }
2272    }
2273    }
2274    }
2275    }
2276    }
2277    }
2278    }
2279    }
2280    }
2281    }
2282    }
2283    }
2284    return false;
2285  }
2286
2287  final private boolean jj_3R_90() {
2288    Token xsp;
2289    xsp = jj_scanpos;
2290    if (jj_3R_100()) {
2291    jj_scanpos = xsp;
2292    if (jj_3R_101()) {
2293    jj_scanpos = xsp;
2294    if (jj_3R_102()) {
2295    jj_scanpos = xsp;
2296    if (jj_3R_103()) {
2297    jj_scanpos = xsp;
2298    if (jj_3R_104()) {
2299    jj_scanpos = xsp;
2300    if (jj_3R_105()) {
2301    jj_scanpos = xsp;
2302    if (jj_3R_106()) {
2303    jj_scanpos = xsp;
2304    if (jj_3R_107()) {
2305    jj_scanpos = xsp;
2306    if (jj_3R_108()) {
2307    jj_scanpos = xsp;
2308    if (jj_3R_109()) {
2309    jj_scanpos = xsp;
2310    if (jj_3R_110()) {
2311    jj_scanpos = xsp;
2312    if (jj_3R_111()) {
2313    jj_scanpos = xsp;
2314    if (jj_3R_112()) return true;
2315    }
2316    }
2317    }
2318    }
2319    }
2320    }
2321    }
2322    }
2323    }
2324    }
2325    }
2326    }
2327    return false;
2328  }
2329
2330  final private boolean jj_3R_136() {
2331    if (jj_3R_137()) return true;
2332    Token xsp;
2333    while (true) {
2334      xsp = jj_scanpos;
2335      if (jj_3R_138()) { jj_scanpos = xsp; break; }
2336    }
2337    return false;
2338  }
2339
2340  final private boolean jj_3R_118() {
2341    Token xsp;
2342    xsp = jj_scanpos;
2343    if (jj_3R_123()) {
2344    jj_scanpos = xsp;
2345    if (jj_3R_124()) {
2346    jj_scanpos = xsp;
2347    if (jj_3R_125()) {
2348    jj_scanpos = xsp;
2349    if (jj_3R_126()) return true;
2350    }
2351    }
2352    }
2353    return false;
2354  }
2355
2356  final private boolean jj_3R_117() {
2357    if (jj_3R_121()) return true;
2358    Token xsp;
2359    while (true) {
2360      xsp = jj_scanpos;
2361      if (jj_3R_122()) { jj_scanpos = xsp; break; }
2362    }
2363    return false;
2364  }
2365
2366  final private boolean jj_3R_83() {
2367    if (jj_3R_91()) return true;
2368    return false;
2369  }
2370
2371  final private boolean jj_3R_82() {
2372    if (jj_3R_90()) return true;
2373    return false;
2374  }
2375
2376  final private boolean jj_3R_96() {
2377    if (jj_3R_70()) return true;
2378    return false;
2379  }
2380
2381  final private boolean jj_3R_126() {
2382    if (jj_scan_token(GTE)) return true;
2383    if (jj_3R_117()) return true;
2384    return false;
2385  }
2386
2387  final private boolean jj_3R_97() {
2388    if (jj_scan_token(88)) return true;
2389    if (jj_3R_96()) return true;
2390    return false;
2391  }
2392
2393  final private boolean jj_3R_125() {
2394    if (jj_scan_token(LTE)) return true;
2395    if (jj_3R_117()) return true;
2396    return false;
2397  }
2398
2399  final private boolean jj_3R_73() {
2400    Token xsp;
2401    xsp = jj_scanpos;
2402    if (jj_3R_82()) {
2403    jj_scanpos = xsp;
2404    if (jj_3R_83()) return true;
2405    }
2406    return false;
2407  }
2408
2409  final private boolean jj_3R_124() {
2410    if (jj_scan_token(GT)) return true;
2411    if (jj_3R_117()) return true;
2412    return false;
2413  }
2414
2415  final private boolean jj_3R_116() {
2416    Token xsp;
2417    xsp = jj_scanpos;
2418    if (jj_3R_119()) {
2419    jj_scanpos = xsp;
2420    if (jj_3R_120()) return true;
2421    }
2422    return false;
2423  }
2424
2425  final private boolean jj_3R_123() {
2426    if (jj_scan_token(LT)) return true;
2427    if (jj_3R_117()) return true;
2428    return false;
2429  }
2430
2431  final private boolean jj_3R_88() {
2432    if (jj_3R_96()) return true;
2433    Token xsp;
2434    while (true) {
2435      xsp = jj_scanpos;
2436      if (jj_3R_97()) { jj_scanpos = xsp; break; }
2437    }
2438    return false;
2439  }
2440
2441  final private boolean jj_3R_115() {
2442    if (jj_3R_117()) return true;
2443    Token xsp;
2444    while (true) {
2445      xsp = jj_scanpos;
2446      if (jj_3R_118()) { jj_scanpos = xsp; break; }
2447    }
2448    return false;
2449  }
2450
2451  final private boolean jj_3R_26() {
2452    if (jj_scan_token(PI)) return true;
2453    return false;
2454  }
2455
2456  final private boolean jj_3R_80() {
2457    if (jj_scan_token(81)) return true;
2458    Token xsp;
2459    xsp = jj_scanpos;
2460    if (jj_3R_88()) jj_scanpos = xsp;
2461    if (jj_scan_token(82)) return true;
2462    return false;
2463  }
2464
2465  final private boolean jj_3R_25() {
2466    if (jj_scan_token(COMMENT)) return true;
2467    return false;
2468  }
2469
2470  final private boolean jj_3R_24() {
2471    if (jj_scan_token(NODE)) return true;
2472    return false;
2473  }
2474
2475  final private boolean jj_3R_120() {
2476    if (jj_scan_token(NEQ)) return true;
2477    if (jj_3R_115()) return true;
2478    return false;
2479  }
2480
2481  final private boolean jj_3R_23() {
2482    if (jj_scan_token(TEXT)) return true;
2483    return false;
2484  }
2485
2486  final private boolean jj_3R_119() {
2487    if (jj_scan_token(EQ)) return true;
2488    if (jj_3R_115()) return true;
2489    return false;
2490  }
2491
2492  final private boolean jj_3R_68() {
2493    if (jj_3R_77()) return true;
2494    return false;
2495  }
2496
2497  final private boolean jj_3_1() {
2498    if (jj_3R_15()) return true;
2499    if (jj_scan_token(80)) return true;
2500    return false;
2501  }
2502
2503  final private boolean jj_3_4() {
2504    if (jj_scan_token(PI)) return true;
2505    return false;
2506  }
2507
2508  final private boolean jj_3_3() {
2509    if (jj_3R_17()) return true;
2510    if (jj_scan_token(81)) return true;
2511    if (jj_scan_token(82)) return true;
2512    return false;
2513  }
2514
2515  final private boolean jj_3R_17() {
2516    Token xsp;
2517    xsp = jj_scanpos;
2518    if (jj_3R_23()) {
2519    jj_scanpos = xsp;
2520    if (jj_3R_24()) {
2521    jj_scanpos = xsp;
2522    if (jj_3R_25()) {
2523    jj_scanpos = xsp;
2524    if (jj_3R_26()) return true;
2525    }
2526    }
2527    }
2528    return false;
2529  }
2530
2531  final private boolean jj_3R_67() {
2532    if (jj_scan_token(84)) return true;
2533    return false;
2534  }
2535
2536  final private boolean jj_3R_114() {
2537    if (jj_3R_15()) return true;
2538    return false;
2539  }
2540
2541  final private boolean jj_3R_66() {
2542    if (jj_scan_token(83)) return true;
2543    return false;
2544  }
2545
2546  final private boolean jj_3R_94() {
2547    if (jj_3R_115()) return true;
2548    Token xsp;
2549    while (true) {
2550      xsp = jj_scanpos;
2551      if (jj_3R_116()) { jj_scanpos = xsp; break; }
2552    }
2553    return false;
2554  }
2555
2556  final private boolean jj_3R_76() {
2557    if (jj_3R_84()) return true;
2558    return false;
2559  }
2560
2561  final private boolean jj_3R_99() {
2562    if (jj_3R_64()) return true;
2563    return false;
2564  }
2565
2566  final private boolean jj_3R_98() {
2567    if (jj_3R_15()) return true;
2568    if (jj_scan_token(80)) return true;
2569    if (jj_3R_15()) return true;
2570    return false;
2571  }
2572
2573  final private boolean jj_3R_75() {
2574    if (jj_scan_token(PI)) return true;
2575    if (jj_scan_token(81)) return true;
2576    if (jj_scan_token(Literal)) return true;
2577    if (jj_scan_token(82)) return true;
2578    return false;
2579  }
2580
2581  final private boolean jj_3R_92() {
2582    if (jj_3R_15()) return true;
2583    return false;
2584  }
2585
2586  final private boolean jj_3R_74() {
2587    if (jj_3R_17()) return true;
2588    if (jj_scan_token(81)) return true;
2589    if (jj_scan_token(82)) return true;
2590    return false;
2591  }
2592
2593  final private boolean jj_3R_71() {
2594    if (jj_3R_18()) return true;
2595    if (jj_3R_80()) return true;
2596    return false;
2597  }
2598
2599  final private boolean jj_3R_93() {
2600    if (jj_scan_token(80)) return true;
2601    Token xsp;
2602    xsp = jj_scanpos;
2603    if (jj_scan_token(89)) {
2604    jj_scanpos = xsp;
2605    if (jj_3R_114()) return true;
2606    }
2607    return false;
2608  }
2609
2610  final private boolean jj_3R_65() {
2611    if (jj_3R_73()) return true;
2612    Token xsp;
2613    xsp = jj_scanpos;
2614    if (jj_3R_74()) {
2615    jj_scanpos = xsp;
2616    if (jj_3R_75()) {
2617    jj_scanpos = xsp;
2618    if (jj_3R_76()) return true;
2619    }
2620    }
2621    return false;
2622  }
2623
2624  final private boolean jj_3R_85() {
2625    if (jj_scan_token(80)) return true;
2626    if (jj_3R_15()) return true;
2627    return false;
2628  }
2629
2630  final private boolean jj_3R_89() {
2631    Token xsp;
2632    xsp = jj_scanpos;
2633    if (jj_3R_98()) {
2634    jj_scanpos = xsp;
2635    if (jj_3R_99()) return true;
2636    }
2637    return false;
2638  }
2639
2640  final private boolean jj_3R_95() {
2641    if (jj_scan_token(AND)) return true;
2642    if (jj_3R_94()) return true;
2643    return false;
2644  }
2645
2646  final private boolean jj_3R_84() {
2647    Token xsp;
2648    xsp = jj_scanpos;
2649    if (jj_scan_token(89)) {
2650    jj_scanpos = xsp;
2651    if (jj_3R_92()) return true;
2652    }
2653    xsp = jj_scanpos;
2654    if (jj_3R_93()) jj_scanpos = xsp;
2655    return false;
2656  }
2657
2658  final private boolean jj_3R_22() {
2659    Token xsp;
2660    xsp = jj_scanpos;
2661    if (jj_3R_65()) {
2662    jj_scanpos = xsp;
2663    if (jj_3R_66()) {
2664    jj_scanpos = xsp;
2665    if (jj_3R_67()) return true;
2666    }
2667    }
2668    while (true) {
2669      xsp = jj_scanpos;
2670      if (jj_3R_68()) { jj_scanpos = xsp; break; }
2671    }
2672    return false;
2673  }
2674
2675  final private boolean jj_3R_72() {
2676    if (jj_3R_81()) return true;
2677    if (jj_3R_80()) return true;
2678    return false;
2679  }
2680
2681  final private boolean jj_3R_86() {
2682    if (jj_3R_94()) return true;
2683    Token xsp;
2684    while (true) {
2685      xsp = jj_scanpos;
2686      if (jj_3R_95()) { jj_scanpos = xsp; break; }
2687    }
2688    return false;
2689  }
2690
2691  final private boolean jj_3R_151() {
2692    if (jj_3R_16()) return true;
2693    return false;
2694  }
2695
2696  final private boolean jj_3_5() {
2697    if (jj_3R_18()) return true;
2698    if (jj_scan_token(81)) return true;
2699    return false;
2700  }
2701
2702  final private boolean jj_3R_78() {
2703    if (jj_3R_15()) return true;
2704    Token xsp;
2705    xsp = jj_scanpos;
2706    if (jj_3R_85()) jj_scanpos = xsp;
2707    return false;
2708  }
2709
2710  final private boolean jj_3R_69() {
2711    if (jj_scan_token(VARIABLE)) return true;
2712    if (jj_3R_78()) return true;
2713    return false;
2714  }
2715
2716  final private boolean jj_3R_57() {
2717    if (jj_scan_token(FUNCTION_FORMAT_NUMBER)) return true;
2718    return false;
2719  }
2720
2721  final private boolean jj_3R_56() {
2722    if (jj_scan_token(FUNCTION_KEY)) return true;
2723    return false;
2724  }
2725
2726  final private boolean jj_3R_55() {
2727    if (jj_scan_token(FUNCTION_ROUND)) return true;
2728    return false;
2729  }
2730
2731  final private boolean jj_3R_63() {
2732    if (jj_3R_72()) return true;
2733    return false;
2734  }
2735
2736  final private boolean jj_3R_54() {
2737    if (jj_scan_token(FUNCTION_CEILING)) return true;
2738    return false;
2739  }
2740
2741  final private boolean jj_3R_62() {
2742    if (jj_3R_71()) return true;
2743    return false;
2744  }
2745
2746  final private boolean jj_3R_53() {
2747    if (jj_scan_token(FUNCTION_FLOOR)) return true;
2748    return false;
2749  }
2750
2751  final private boolean jj_3R_61() {
2752    if (jj_scan_token(Number)) return true;
2753    return false;
2754  }
2755
2756  final private boolean jj_3R_52() {
2757    if (jj_scan_token(FUNCTION_SUM)) return true;
2758    return false;
2759  }
2760
2761  final private boolean jj_3R_21() {
2762    if (jj_scan_token(SLASHSLASH)) return true;
2763    return false;
2764  }
2765
2766  final private boolean jj_3R_60() {
2767    if (jj_scan_token(Literal)) return true;
2768    return false;
2769  }
2770
2771  final private boolean jj_3R_51() {
2772    if (jj_scan_token(FUNCTION_NUMBER)) return true;
2773    return false;
2774  }
2775
2776  final private boolean jj_3R_59() {
2777    if (jj_scan_token(81)) return true;
2778    if (jj_3R_70()) return true;
2779    if (jj_scan_token(82)) return true;
2780    return false;
2781  }
2782
2783  final private boolean jj_3R_87() {
2784    if (jj_scan_token(OR)) return true;
2785    if (jj_3R_86()) return true;
2786    return false;
2787  }
2788
2789  final private boolean jj_3R_50() {
2790    if (jj_scan_token(FUNCTION_LANG)) return true;
2791    return false;
2792  }
2793
2794  final private boolean jj_3R_58() {
2795    if (jj_3R_69()) return true;
2796    return false;
2797  }
2798
2799  final private boolean jj_3R_81() {
2800    if (jj_3R_89()) return true;
2801    return false;
2802  }
2803
2804  final private boolean jj_3R_49() {
2805    if (jj_scan_token(FUNCTION_NULL)) return true;
2806    return false;
2807  }
2808
2809  final private boolean jj_3R_48() {
2810    if (jj_scan_token(FUNCTION_FALSE)) return true;
2811    return false;
2812  }
2813
2814  final private boolean jj_3R_47() {
2815    if (jj_scan_token(FUNCTION_TRUE)) return true;
2816    return false;
2817  }
2818
2819  final private boolean jj_3R_46() {
2820    if (jj_scan_token(FUNCTION_NOT)) return true;
2821    return false;
2822  }
2823
2824  final private boolean jj_3R_16() {
2825    Token xsp;
2826    xsp = jj_scanpos;
2827    if (jj_scan_token(6)) {
2828    jj_scanpos = xsp;
2829    if (jj_3R_21()) return true;
2830    }
2831    if (jj_3R_22()) return true;
2832    return false;
2833  }
2834
2835  final private boolean jj_3R_149() {
2836    if (jj_3R_16()) return true;
2837    return false;
2838  }
2839
2840  final private boolean jj_3R_45() {
2841    if (jj_scan_token(FUNCTION_BOOLEAN)) return true;
2842    return false;
2843  }
2844
2845  final private boolean jj_3R_44() {
2846    if (jj_scan_token(FUNCTION_TRANSLATE)) return true;
2847    return false;
2848  }
2849
2850  final private boolean jj_3R_19() {
2851    Token xsp;
2852    xsp = jj_scanpos;
2853    if (jj_3R_58()) {
2854    jj_scanpos = xsp;
2855    if (jj_3R_59()) {
2856    jj_scanpos = xsp;
2857    if (jj_3R_60()) {
2858    jj_scanpos = xsp;
2859    if (jj_3R_61()) {
2860    jj_scanpos = xsp;
2861    if (jj_3R_62()) {
2862    jj_scanpos = xsp;
2863    if (jj_3R_63()) return true;
2864    }
2865    }
2866    }
2867    }
2868    }
2869    return false;
2870  }
2871
2872  final private boolean jj_3R_43() {
2873    if (jj_scan_token(FUNCTION_NORMALIZE_SPACE)) return true;
2874    return false;
2875  }
2876
2877  final private boolean jj_3R_42() {
2878    if (jj_scan_token(FUNCTION_STRING_LENGTH)) return true;
2879    return false;
2880  }
2881
2882  final private boolean jj_3R_41() {
2883    if (jj_scan_token(FUNCTION_SUBSTRING)) return true;
2884    return false;
2885  }
2886
2887  final private boolean jj_3R_40() {
2888    if (jj_scan_token(FUNCTION_SUBSTRING_AFTER)) return true;
2889    return false;
2890  }
2891
2892  final private boolean jj_3R_79() {
2893    if (jj_3R_86()) return true;
2894    Token xsp;
2895    while (true) {
2896      xsp = jj_scanpos;
2897      if (jj_3R_87()) { jj_scanpos = xsp; break; }
2898    }
2899    return false;
2900  }
2901
2902  final private boolean jj_3R_39() {
2903    if (jj_scan_token(FUNCTION_SUBSTRING_BEFORE)) return true;
2904    return false;
2905  }
2906
2907  final private boolean jj_3R_38() {
2908    if (jj_scan_token(FUNCTION_CONTAINS)) return true;
2909    return false;
2910  }
2911
2912  final private boolean jj_3R_37() {
2913    if (jj_scan_token(FUNCTION_ENDS_WITH)) return true;
2914    return false;
2915  }
2916
2917  final private boolean jj_3R_36() {
2918    if (jj_scan_token(FUNCTION_STARTS_WITH)) return true;
2919    return false;
2920  }
2921
2922  final private boolean jj_3R_35() {
2923    if (jj_scan_token(FUNCTION_CONCAT)) return true;
2924    return false;
2925  }
2926
2927  final private boolean jj_3R_34() {
2928    if (jj_scan_token(FUNCTION_STRING)) return true;
2929    return false;
2930  }
2931
2932  final private boolean jj_3R_33() {
2933    if (jj_scan_token(FUNCTION_NAME)) return true;
2934    return false;
2935  }
2936
2937  final private boolean jj_3R_32() {
2938    if (jj_scan_token(FUNCTION_NAMESPACE_URI)) return true;
2939    return false;
2940  }
2941
2942  final private boolean jj_3R_31() {
2943    if (jj_scan_token(FUNCTION_LOCAL_NAME)) return true;
2944    return false;
2945  }
2946
2947  final private boolean jj_3R_70() {
2948    if (jj_3R_79()) return true;
2949    return false;
2950  }
2951
2952  final private boolean jj_3R_30() {
2953    if (jj_scan_token(FUNCTION_ID)) return true;
2954    return false;
2955  }
2956
2957  final private boolean jj_3R_29() {
2958    if (jj_scan_token(FUNCTION_COUNT)) return true;
2959    return false;
2960  }
2961
2962  final private boolean jj_3R_28() {
2963    if (jj_scan_token(FUNCTION_POSITION)) return true;
2964    return false;
2965  }
2966
2967  final private boolean jj_3R_27() {
2968    if (jj_scan_token(FUNCTION_LAST)) return true;
2969    return false;
2970  }
2971
2972  final private boolean jj_3R_147() {
2973    if (jj_3R_22()) return true;
2974    Token xsp;
2975    while (true) {
2976      xsp = jj_scanpos;
2977      if (jj_3R_149()) { jj_scanpos = xsp; break; }
2978    }
2979    return false;
2980  }
2981
2982  final private boolean jj_3R_18() {
2983    Token xsp;
2984    xsp = jj_scanpos;
2985    if (jj_3R_27()) {
2986    jj_scanpos = xsp;
2987    if (jj_3R_28()) {
2988    jj_scanpos = xsp;
2989    if (jj_3R_29()) {
2990    jj_scanpos = xsp;
2991    if (jj_3R_30()) {
2992    jj_scanpos = xsp;
2993    if (jj_3R_31()) {
2994    jj_scanpos = xsp;
2995    if (jj_3R_32()) {
2996    jj_scanpos = xsp;
2997    if (jj_3R_33()) {
2998    jj_scanpos = xsp;
2999    if (jj_3R_34()) {
3000    jj_scanpos = xsp;
3001    if (jj_3R_35()) {
3002    jj_scanpos = xsp;
3003    if (jj_3R_36()) {
3004    jj_scanpos = xsp;
3005    if (jj_3R_37()) {
3006    jj_scanpos = xsp;
3007    if (jj_3R_38()) {
3008    jj_scanpos = xsp;
3009    if (jj_3R_39()) {
3010    jj_scanpos = xsp;
3011    if (jj_3R_40()) {
3012    jj_scanpos = xsp;
3013    if (jj_3R_41()) {
3014    jj_scanpos = xsp;
3015    if (jj_3R_42()) {
3016    jj_scanpos = xsp;
3017    if (jj_3R_43()) {
3018    jj_scanpos = xsp;
3019    if (jj_3R_44()) {
3020    jj_scanpos = xsp;
3021    if (jj_3R_45()) {
3022    jj_scanpos = xsp;
3023    if (jj_3R_46()) {
3024    jj_scanpos = xsp;
3025    if (jj_3R_47()) {
3026    jj_scanpos = xsp;
3027    if (jj_3R_48()) {
3028    jj_scanpos = xsp;
3029    if (jj_3R_49()) {
3030    jj_scanpos = xsp;
3031    if (jj_3R_50()) {
3032    jj_scanpos = xsp;
3033    if (jj_3R_51()) {
3034    jj_scanpos = xsp;
3035    if (jj_3R_52()) {
3036    jj_scanpos = xsp;
3037    if (jj_3R_53()) {
3038    jj_scanpos = xsp;
3039    if (jj_3R_54()) {
3040    jj_scanpos = xsp;
3041    if (jj_3R_55()) {
3042    jj_scanpos = xsp;
3043    if (jj_3R_56()) {
3044    jj_scanpos = xsp;
3045    if (jj_3R_57()) return true;
3046    }
3047    }
3048    }
3049    }
3050    }
3051    }
3052    }
3053    }
3054    }
3055    }
3056    }
3057    }
3058    }
3059    }
3060    }
3061    }
3062    }
3063    }
3064    }
3065    }
3066    }
3067    }
3068    }
3069    }
3070    }
3071    }
3072    }
3073    }
3074    }
3075    }
3076    return false;
3077  }
3078
3079  public XPathParserTokenManager token_source;
3080  SimpleCharStream jj_input_stream;
3081  public Token token, jj_nt;
3082  private Token jj_scanpos, jj_lastpos;
3083  private int jj_la;
3084  public boolean lookingAhead = false;
3085  private boolean jj_semLA;
3086  private int jj_gen;
3087  final private int[] jj_la1 = new int[39];
3088  static private int[] jj_la1_0;
3089  static private int[] jj_la1_1;
3090  static private int[] jj_la1_2;
3091  static {
3092      jj_la1_0();
3093      jj_la1_1();
3094      jj_la1_2();
3095   }
3096   private static void jj_la1_0() {
3097      jj_la1_0 = new int[] {0xf8000000,0x78000000,0x0,0x0,0x78000000,0xf80000c0,0xc0,0x40,0xc0,0xc0,0xf8000000,0xf8000000,0x0,0x0,0x0,0x0,0x160000,0xf8000000,0x0,0xf81604c0,0x100,0xf80000c0,0x0,0xc0,0x8000000,0x10000000,0x1800,0x1800,0x1e000,0x1e000,0x200,0x400,0x60000000,0x60000000,0xf81604c0,0xf8000000,0xf8000000,0x0,0x80000000,};
3098   }
3099   private static void jj_la1_1() {
3100      jj_la1_1 = new int[] {0xffff0007,0x0,0xffff0000,0x0,0x0,0xffffffff,0x0,0x0,0x0,0x0,0xffff0007,0xffffffff,0x0,0xfff8,0xfff8,0x0,0x0,0xffff0007,0x0,0xffffffff,0x0,0xffffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xffffffff,0xffff0007,0xffff0007,0x0,0x7,};
3101   }
3102   private static void jj_la1_2() {
3103      jj_la1_2 = new int[] {0xffff,0x8000,0x7fff,0x10000,0x8000,0x298ffff,0x0,0x0,0x0,0x0,0x200ffff,0x298ffff,0x200000,0x0,0x0,0x800000,0x20000,0xffff,0x1000000,0x29affff,0x0,0x298ffff,0x200000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2000000,0x2000000,0x29affff,0x200ffff,0x200ffff,0x10000,0x0,};
3104   }
3105  final private JJCalls[] jj_2_rtns = new JJCalls[6];
3106  private boolean jj_rescan = false;
3107  private int jj_gc = 0;
3108
3109  public XPathParser(java.io.InputStream stream) {
3110    jj_input_stream = new SimpleCharStream(stream, 1, 1);
3111    token_source = new XPathParserTokenManager(jj_input_stream);
3112    token = new Token();
3113    token.next = jj_nt = token_source.getNextToken();
3114    jj_gen = 0;
3115    for (int i = 0; i < 39; i++) jj_la1[i] = -1;
3116    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
3117  }
3118
3119  public void ReInit(java.io.InputStream stream) {
3120    jj_input_stream.ReInit(stream, 1, 1);
3121    token_source.ReInit(jj_input_stream);
3122    token = new Token();
3123    token.next = jj_nt = token_source.getNextToken();
3124    jj_gen = 0;
3125    for (int i = 0; i < 39; i++) jj_la1[i] = -1;
3126    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
3127  }
3128
3129  public XPathParser(java.io.Reader stream) {
3130    jj_input_stream = new SimpleCharStream(stream, 1, 1);
3131    token_source = new XPathParserTokenManager(jj_input_stream);
3132    token = new Token();
3133    token.next = jj_nt = token_source.getNextToken();
3134    jj_gen = 0;
3135    for (int i = 0; i < 39; i++) jj_la1[i] = -1;
3136    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
3137  }
3138
3139  public void ReInit(java.io.Reader stream) {
3140    jj_input_stream.ReInit(stream, 1, 1);
3141    token_source.ReInit(jj_input_stream);
3142    token = new Token();
3143    token.next = jj_nt = token_source.getNextToken();
3144    jj_gen = 0;
3145    for (int i = 0; i < 39; i++) jj_la1[i] = -1;
3146    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
3147  }
3148
3149  public XPathParser(XPathParserTokenManager tm) {
3150    token_source = tm;
3151    token = new Token();
3152    token.next = jj_nt = token_source.getNextToken();
3153    jj_gen = 0;
3154    for (int i = 0; i < 39; i++) jj_la1[i] = -1;
3155    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
3156  }
3157
3158  public void ReInit(XPathParserTokenManager tm) {
3159    token_source = tm;
3160    token = new Token();
3161    token.next = jj_nt = token_source.getNextToken();
3162    jj_gen = 0;
3163    for (int i = 0; i < 39; i++) jj_la1[i] = -1;
3164    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
3165  }
3166
3167  final private Token jj_consume_token(int kind) throws ParseException {
3168    Token oldToken = token;
3169    if ((token = jj_nt).next != null) jj_nt = jj_nt.next;
3170    else jj_nt = jj_nt.next = token_source.getNextToken();
3171    if (token.kind == kind) {
3172      jj_gen++;
3173      if (++jj_gc > 100) {
3174        jj_gc = 0;
3175        for (int i = 0; i < jj_2_rtns.length; i++) {
3176          JJCalls c = jj_2_rtns[i];
3177          while (c != null) {
3178            if (c.gen < jj_gen) c.first = null;
3179            c = c.next;
3180          }
3181        }
3182      }
3183      return token;
3184    }
3185    jj_nt = token;
3186    token = oldToken;
3187    jj_kind = kind;
3188    throw generateParseException();
3189  }
3190
3191  static private final class LookaheadSuccess extends java.lang.Error { }
3192  final private LookaheadSuccess jj_ls = new LookaheadSuccess();
3193  final private boolean jj_scan_token(int kind) {
3194    if (jj_scanpos == jj_lastpos) {
3195      jj_la--;
3196      if (jj_scanpos.next == null) {
3197        jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
3198      } else {
3199        jj_lastpos = jj_scanpos = jj_scanpos.next;
3200      }
3201    } else {
3202      jj_scanpos = jj_scanpos.next;
3203    }
3204    if (jj_rescan) {
3205      int i = 0; Token tok = token;
3206      while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }
3207      if (tok != null) jj_add_error_token(kind, i);
3208    }
3209    if (jj_scanpos.kind != kind) return true;
3210    if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;
3211    return false;
3212  }
3213
3214  final public Token getNextToken() {
3215    if ((token = jj_nt).next != null) jj_nt = jj_nt.next;
3216    else jj_nt = jj_nt.next = token_source.getNextToken();
3217    jj_gen++;
3218    return token;
3219  }
3220
3221  final public Token getToken(int index) {
3222    Token t = lookingAhead ? jj_scanpos : token;
3223    for (int i = 0; i < index; i++) {
3224      if (t.next != null) t = t.next;
3225      else t = t.next = token_source.getNextToken();
3226    }
3227    return t;
3228  }
3229
3230  private java.util.Vector jj_expentries = new java.util.Vector();
3231  private int[] jj_expentry;
3232  private int jj_kind = -1;
3233  private int[] jj_lasttokens = new int[100];
3234  private int jj_endpos;
3235
3236  private void jj_add_error_token(int kind, int pos) {
3237    if (pos >= 100) return;
3238    if (pos == jj_endpos + 1) {
3239      jj_lasttokens[jj_endpos++] = kind;
3240    } else if (jj_endpos != 0) {
3241      jj_expentry = new int[jj_endpos];
3242      for (int i = 0; i < jj_endpos; i++) {
3243        jj_expentry[i] = jj_lasttokens[i];
3244      }
3245      boolean exists = false;
3246      for (java.util.Enumeration e = jj_expentries.elements(); e.hasMoreElements();) {
3247        int[] oldentry = (int[])(e.nextElement());
3248        if (oldentry.length == jj_expentry.length) {
3249          exists = true;
3250          for (int i = 0; i < jj_expentry.length; i++) {
3251            if (oldentry[i] != jj_expentry[i]) {
3252              exists = false;
3253              break;
3254            }
3255          }
3256          if (exists) break;
3257        }
3258      }
3259      if (!exists) jj_expentries.addElement(jj_expentry);
3260      if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;
3261    }
3262  }
3263
3264  public ParseException generateParseException() {
3265    jj_expentries.removeAllElements();
3266    boolean[] la1tokens = new boolean[90];
3267    for (int i = 0; i < 90; i++) {
3268      la1tokens[i] = false;
3269    }
3270    if (jj_kind >= 0) {
3271      la1tokens[jj_kind] = true;
3272      jj_kind = -1;
3273    }
3274    for (int i = 0; i < 39; i++) {
3275      if (jj_la1[i] == jj_gen) {
3276        for (int j = 0; j < 32; j++) {
3277          if ((jj_la1_0[i] & (1<<j)) != 0) {
3278            la1tokens[j] = true;
3279          }
3280          if ((jj_la1_1[i] & (1<<j)) != 0) {
3281            la1tokens[32+j] = true;
3282          }
3283          if ((jj_la1_2[i] & (1<<j)) != 0) {
3284            la1tokens[64+j] = true;
3285          }
3286        }
3287      }
3288    }
3289    for (int i = 0; i < 90; i++) {
3290      if (la1tokens[i]) {
3291        jj_expentry = new int[1];
3292        jj_expentry[0] = i;
3293        jj_expentries.addElement(jj_expentry);
3294      }
3295    }
3296    jj_endpos = 0;
3297    jj_rescan_token();
3298    jj_add_error_token(0, 0);
3299    int[][] exptokseq = new int[jj_expentries.size()][];
3300    for (int i = 0; i < jj_expentries.size(); i++) {
3301      exptokseq[i] = (int[])jj_expentries.elementAt(i);
3302    }
3303    return new ParseException(token, exptokseq, tokenImage);
3304  }
3305
3306  final public void enable_tracing() {
3307  }
3308
3309  final public void disable_tracing() {
3310  }
3311
3312  final private void jj_rescan_token() {
3313    jj_rescan = true;
3314    for (int i = 0; i < 6; i++) {
3315      JJCalls p = jj_2_rtns[i];
3316      do {
3317        if (p.gen > jj_gen) {
3318          jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
3319          switch (i) {
3320            case 0: jj_3_1(); break;
3321            case 1: jj_3_2(); break;
3322            case 2: jj_3_3(); break;
3323            case 3: jj_3_4(); break;
3324            case 4: jj_3_5(); break;
3325            case 5: jj_3_6(); break;
3326          }
3327        }
3328        p = p.next;
3329      } while (p != null);
3330    }
3331    jj_rescan = false;
3332  }
3333
3334  final private void jj_save(int index, int xla) {
3335    JJCalls p = jj_2_rtns[index];
3336    while (p.gen > jj_gen) {
3337      if (p.next == null) { p = p.next = new JJCalls(); break; }
3338      p = p.next;
3339    }
3340    p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;
3341  }
3342
3343  static final class JJCalls {
3344    int gen;
3345    Token first;
3346    int arg;
3347    JJCalls next;
3348  }
3349
3350    }