1 // created by jay 0.8 (c) 1998 Axel.Schreiner@informatik.uni-osnabrueck.de
3 // line 2 "XPathParser.y"
4 /* XPathParser.java -- An XPath 1.0 parser.
5 Copyright (C) 2004 Free Software Foundation, Inc.
7 This file is part of GNU Classpath.
9 GNU Classpath is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
14 GNU Classpath is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with GNU Classpath; see the file COPYING. If not, write to the
21 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
24 Linking this library statically or dynamically with other modules is
25 making a combined work based on this library. Thus, the terms and
26 conditions of the GNU General Public License cover the whole
29 As a special exception, the copyright holders of this library give you
30 permission to link this library with independent modules to produce an
31 executable, regardless of the license terms of these independent
32 modules, and to copy and distribute the resulting executable under
33 terms of your choice, provided that you also meet, for each linked
34 independent module, the terms and conditions of the license of that
35 module. An independent module is a module which is not derived from
36 or based on this library. If you modify this library, you may extend
37 this exception to your version of the library, but you are not
38 obligated to do so. If you do not wish to do so, delete this
39 exception statement from your version. */
41 package gnu
.xml
.xpath
;
43 import java
.util
.ArrayList
;
44 import java
.util
.Collections
;
45 import java
.util
.List
;
46 import javax
.xml
.namespace
.NamespaceContext
;
47 import javax
.xml
.namespace
.QName
;
48 import javax
.xml
.xpath
.XPathFunctionResolver
;
49 import javax
.xml
.xpath
.XPathVariableResolver
;
50 import org
.w3c
.dom
.Node
;
53 * An XPath 1.0 parser.
55 * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
57 public class XPathParser
60 NamespaceContext namespaceContext
;
61 XPathVariableResolver variableResolver
;
62 XPathFunctionResolver functionResolver
;
64 QName
getQName(String name
)
66 QName qName
= QName
.valueOf(name
);
67 if (namespaceContext
!= null)
69 String prefix
= qName
.getPrefix();
70 String uri
= qName
.getNamespaceURI();
71 if (prefix
!= null && (uri
== null || uri
.length() == 0))
73 uri
= namespaceContext
.getNamespaceURI(prefix
);
74 String localName
= qName
.getLocalPart();
75 qName
= new QName(uri
, localName
, prefix
);
81 Expr
lookupFunction(String name
, List args
)
83 int arity
= args
.size();
84 if ("position".equals(name
) && arity
== 0)
86 return new PositionFunction();
88 else if ("last".equals(name
) && arity
== 0)
90 return new LastFunction();
92 else if ("string".equals(name
) && (arity
== 1 || arity
== 0))
94 return new StringFunction(args
);
96 else if ("number".equals(name
) && (arity
== 1 || arity
== 0))
98 return new NumberFunction(args
);
100 else if ("boolean".equals(name
) && arity
== 1)
102 return new BooleanFunction(args
);
104 else if ("count".equals(name
) && arity
== 1)
106 return new CountFunction(args
);
108 else if ("not".equals(name
) && arity
== 1)
110 return new NotFunction(args
);
112 else if ("id".equals(name
) && arity
== 1)
114 return new IdFunction(args
);
116 else if ("concat".equals(name
) && arity
> 1)
118 return new ConcatFunction(args
);
120 else if ("true".equals(name
) && arity
== 0)
122 return new TrueFunction();
124 else if ("false".equals(name
) && arity
== 0)
126 return new FalseFunction();
128 else if ("name".equals(name
) && (arity
== 1 || arity
== 0))
130 return new NameFunction(args
);
132 else if ("local-name".equals(name
) && (arity
== 1 || arity
== 0))
134 return new LocalNameFunction(args
);
136 else if ("namespace-uri".equals(name
) && (arity
== 1 || arity
== 0))
138 return new NamespaceUriFunction(args
);
140 else if ("starts-with".equals(name
) && arity
== 2)
142 return new StartsWithFunction(args
);
144 else if ("contains".equals(name
) && arity
== 2)
146 return new ContainsFunction(args
);
148 else if ("string-length".equals(name
) && (arity
== 1 || arity
== 0))
150 return new StringLengthFunction(args
);
152 else if ("translate".equals(name
) && arity
== 3)
154 return new TranslateFunction(args
);
156 else if ("normalize-space".equals(name
) && (arity
== 1 || arity
== 0))
158 return new NormalizeSpaceFunction(args
);
160 else if ("substring".equals(name
) && (arity
== 2 || arity
== 3))
162 return new SubstringFunction(args
);
164 else if ("substring-before".equals(name
) && arity
== 2)
166 return new SubstringBeforeFunction(args
);
168 else if ("substring-after".equals(name
) && arity
== 2)
170 return new SubstringAfterFunction(args
);
172 else if ("lang".equals(name
) && arity
== 1)
174 return new LangFunction(args
);
176 else if ("sum".equals(name
) && arity
== 1)
178 return new SumFunction(args
);
180 else if ("floor".equals(name
) && arity
== 1)
182 return new FloorFunction(args
);
184 else if ("ceiling".equals(name
) && arity
== 1)
186 return new CeilingFunction(args
);
188 else if ("round".equals(name
) && arity
== 1)
190 return new RoundFunction(args
);
192 else if (functionResolver
!= null)
194 QName qName
= QName
.valueOf(name
);
195 Object function
= functionResolver
.resolveFunction(qName
, arity
);
196 if (function
!= null &&
197 function
instanceof Function
&&
198 function
instanceof Expr
)
200 Function f
= (Function
) function
;
201 f
.setArguments(args
);
202 return (Expr
) function
;
205 return new FunctionCall(functionResolver
, name
, args
);
211 public static final int LITERAL
= 257;
212 public static final int DIGITS
= 258;
213 public static final int NAME
= 259;
214 public static final int LP
= 260;
215 public static final int RP
= 261;
216 public static final int LB
= 262;
217 public static final int RB
= 263;
218 public static final int COMMA
= 264;
219 public static final int PIPE
= 265;
220 public static final int SLASH
= 266;
221 public static final int DOUBLE_SLASH
= 267;
222 public static final int EQ
= 268;
223 public static final int NE
= 269;
224 public static final int GT
= 270;
225 public static final int LT
= 271;
226 public static final int GTE
= 272;
227 public static final int LTE
= 273;
228 public static final int PLUS
= 274;
229 public static final int MINUS
= 275;
230 public static final int AT
= 276;
231 public static final int STAR
= 277;
232 public static final int DOLLAR
= 278;
233 public static final int COLON
= 279;
234 public static final int DOUBLE_COLON
= 280;
235 public static final int DOT
= 281;
236 public static final int DOUBLE_DOT
= 282;
237 public static final int ANCESTOR
= 283;
238 public static final int ANCESTOR_OR_SELF
= 284;
239 public static final int ATTRIBUTE
= 285;
240 public static final int CHILD
= 286;
241 public static final int DESCENDANT
= 287;
242 public static final int DESCENDANT_OR_SELF
= 288;
243 public static final int FOLLOWING
= 289;
244 public static final int FOLLOWING_SIBLING
= 290;
245 public static final int NAMESPACE
= 291;
246 public static final int PARENT
= 292;
247 public static final int PRECEDING
= 293;
248 public static final int PRECEDING_SIBLING
= 294;
249 public static final int SELF
= 295;
250 public static final int DIV
= 296;
251 public static final int MOD
= 297;
252 public static final int OR
= 298;
253 public static final int AND
= 299;
254 public static final int COMMENT
= 300;
255 public static final int PROCESSING_INSTRUCTION
= 301;
256 public static final int TEXT
= 302;
257 public static final int NODE
= 303;
258 public static final int UNARY
= 304;
259 public static final int yyErrorCode
= 256;
261 /** thrown for irrecoverable syntax errors and stack overflow.
263 public static class yyException
extends java
.lang
.Exception
{
264 public yyException (String message
) {
269 /** must be implemented by a scanner object to supply input to the parser.
271 public interface yyInput
{
272 /** move on to next token.
273 @return false if positioned beyond tokens.
274 @throws IOException on input error.
276 boolean advance () throws java
.io
.IOException
;
277 /** classifies current token.
278 Should not be called if advance() returned false.
279 @return current %token or single character.
282 /** associated with current token.
283 Should not be called if advance() returned false.
284 @return value for token().
289 /** simplified error message.
290 @see <a href="#yyerror(java.lang.String, java.lang.String[])">yyerror</a>
292 public void yyerror (String message
) {
293 yyerror(message
, null);
296 /** (syntax) error message.
297 Can be overwritten to control message format.
298 @param message text to be displayed.
299 @param expected vector of acceptable tokens, if available.
301 public void yyerror (String message
, String
[] expected
) {
302 if (expected
!= null && expected
.length
> 0) {
303 System
.err
.print(message
+", expecting");
304 for (int n
= 0; n
< expected
.length
; ++ n
)
305 System
.err
.print(" "+expected
[n
]);
306 System
.err
.println();
308 System
.err
.println(message
);
311 /** debugging support, requires the package jay.yydebug.
312 Set to null to suppress debugging messages.
314 //t protected jay.yydebug.yyDebug yydebug;
316 protected static final int yyFinal
= 30;
318 /** index-checked interface to yyName[].
319 @param token single character or %token value.
320 @return token name or [illegal] or [unknown].
322 //t public static final String yyname (int token) {
323 //t if (token < 0 || token > YyNameClass.yyName.length) return "[illegal]";
325 //t if ((name = YyNameClass.yyName[token]) != null) return name;
326 //t return "[unknown]";
329 /** computes list of expected tokens on error by tracing the tables.
330 @param state for which to compute the list.
331 @return list of token names.
333 protected String
[] yyExpecting (int state
) {
334 int token
, n
, len
= 0;
335 boolean[] ok
= new boolean[YyNameClass
.yyName
.length
];
337 if ((n
= YySindexClass
.yySindex
[state
]) != 0)
338 for (token
= n
< 0 ?
-n
: 0;
339 token
< YyNameClass
.yyName
.length
&& n
+token
< YyTableClass
.yyTable
.length
; ++ token
)
340 if (YyCheckClass
.yyCheck
[n
+token
] == token
&& !ok
[token
] && YyNameClass
.yyName
[token
] != null) {
344 if ((n
= YyRindexClass
.yyRindex
[state
]) != 0)
345 for (token
= n
< 0 ?
-n
: 0;
346 token
< YyNameClass
.yyName
.length
&& n
+token
< YyTableClass
.yyTable
.length
; ++ token
)
347 if (YyCheckClass
.yyCheck
[n
+token
] == token
&& !ok
[token
] && YyNameClass
.yyName
[token
] != null) {
352 String result
[] = new String
[len
];
353 for (n
= token
= 0; n
< len
; ++ token
)
354 if (ok
[token
]) result
[n
++] = YyNameClass
.yyName
[token
];
358 /** the generated parser, with debugging messages.
359 Maintains a state and a value stack, currently with fixed maximum size.
360 @param yyLex scanner.
361 @param yydebug debug message writer implementing yyDebug, or null.
362 @return result of the last reduction, if any.
363 @throws yyException on irrecoverable parse error.
365 public Object
yyparse (yyInput yyLex
, Object yydebug
)
366 throws java
.io
.IOException
, yyException
{
367 //t this.yydebug = (jay.yydebug.yyDebug)yydebug;
368 return yyparse(yyLex
);
371 /** initial size and increment of the state/value stack [default 256].
372 This is not final so that it can be overwritten outside of invocations
377 /** executed at the beginning of a reduce action.
378 Used as $$ = yyDefault($1), prior to the user-specified action, if any.
379 Can be overwritten to provide deep copy, etc.
380 @param first value for $1, or null.
383 protected Object
yyDefault (Object first
) {
387 /** the generated parser.
388 Maintains a state and a value stack, currently with fixed maximum size.
389 @param yyLex scanner.
390 @return result of the last reduction, if any.
391 @throws yyException on irrecoverable parse error.
393 public Object
yyparse (yyInput yyLex
)
394 throws java
.io
.IOException
, yyException
{
395 if (yyMax
<= 0) yyMax
= 256; // initial size
396 int yyState
= 0, yyStates
[] = new int[yyMax
]; // state stack
397 Object yyVal
= null, yyVals
[] = new Object
[yyMax
]; // value stack
398 int yyToken
= -1; // current input
399 int yyErrorFlag
= 0; // #tks to shift
401 yyLoop
: for (int yyTop
= 0;; ++ yyTop
) {
402 if (yyTop
>= yyStates
.length
) { // dynamically increase
403 int[] i
= new int[yyStates
.length
+yyMax
];
404 System
.arraycopy(yyStates
, 0, i
, 0, yyStates
.length
);
406 Object
[] o
= new Object
[yyVals
.length
+yyMax
];
407 System
.arraycopy(yyVals
, 0, o
, 0, yyVals
.length
);
410 yyStates
[yyTop
] = yyState
;
411 yyVals
[yyTop
] = yyVal
;
412 //t if (yydebug != null) yydebug.push(yyState, yyVal);
414 yyDiscarded
: for (;;) { // discarding a token does not change stack
416 if ((yyN
= YyDefRedClass
.yyDefRed
[yyState
]) == 0) { // else [default] reduce (yyN)
418 yyToken
= yyLex
.advance() ? yyLex
.token() : 0;
419 //t if (yydebug != null)
420 //t yydebug.lex(yyState, yyToken, yyname(yyToken), yyLex.value());
422 if ((yyN
= YySindexClass
.yySindex
[yyState
]) != 0 && (yyN
+= yyToken
) >= 0
423 && yyN
< YyTableClass
.yyTable
.length
&& YyCheckClass
.yyCheck
[yyN
] == yyToken
) {
424 //t if (yydebug != null)
425 //t yydebug.shift(yyState, YyTableClass.yyTable[yyN], yyErrorFlag-1);
426 yyState
= YyTableClass
.yyTable
[yyN
]; // shift to yyN
427 yyVal
= yyLex
.value();
429 if (yyErrorFlag
> 0) -- yyErrorFlag
;
432 if ((yyN
= YyRindexClass
.yyRindex
[yyState
]) != 0 && (yyN
+= yyToken
) >= 0
433 && yyN
< YyTableClass
.yyTable
.length
&& YyCheckClass
.yyCheck
[yyN
] == yyToken
)
434 yyN
= YyTableClass
.yyTable
[yyN
]; // reduce (yyN)
436 switch (yyErrorFlag
) {
439 yyerror("syntax error", yyExpecting(yyState
));
440 //t if (yydebug != null) yydebug.error("syntax error");
445 if ((yyN
= YySindexClass
.yySindex
[yyStates
[yyTop
]]) != 0
446 && (yyN
+= yyErrorCode
) >= 0 && yyN
< YyTableClass
.yyTable
.length
447 && YyCheckClass
.yyCheck
[yyN
] == yyErrorCode
) {
448 //t if (yydebug != null)
449 //t yydebug.shift(yyStates[yyTop], YyTableClass.yyTable[yyN], 3);
450 yyState
= YyTableClass
.yyTable
[yyN
];
451 yyVal
= yyLex
.value();
454 //t if (yydebug != null) yydebug.pop(yyStates[yyTop]);
455 } while (-- yyTop
>= 0);
456 //t if (yydebug != null) yydebug.reject();
457 throw new yyException("irrecoverable syntax error");
461 //t if (yydebug != null) yydebug.reject();
462 throw new yyException("irrecoverable syntax error at end-of-file");
464 //t if (yydebug != null)
465 //t yydebug.discard(yyState, yyToken, yyname(yyToken),
468 continue yyDiscarded
; // leave stack alone
471 int yyV
= yyTop
+ 1-YyLenClass
.yyLen
[yyN
];
472 //t if (yydebug != null)
473 //t yydebug.reduce(yyState, yyStates[yyV-1], yyN, YyRuleClass.yyRule[yyN], YyLenClass.yyLen[yyN]);
474 yyVal
= yyDefault(yyV
> yyTop ?
null : yyVals
[yyV
]);
477 // line 276 "XPathParser.y"
483 // line 280 "XPathParser.y"
486 if (yyVals
[0+yyTop
] instanceof Steps
)
488 steps
= (Steps
) yyVals
[0+yyTop
];
493 steps
.path
.addFirst(yyVals
[0+yyTop
]);
495 steps
.path
.addFirst(new Root());
497 /*$$ = new Step(new Root(), (Path) $2);*/
501 // line 296 "XPathParser.y"
503 Test nt
= new NodeTypeTest((short) 0);
504 Selector s
= new Selector(Selector
.DESCENDANT_OR_SELF
,
505 Collections
.singletonList (nt
));
507 if (yyVals
[0+yyTop
] instanceof Steps
)
509 steps
= (Steps
) yyVals
[0+yyTop
];
514 steps
.path
.addFirst(yyVals
[0+yyTop
]);
516 steps
.path
.addFirst(s
);
517 steps
.path
.addFirst(new Root());
519 /*Step step = new Step(s, (Path) $2);*/
520 /*$$ = new Step(new Root(), step);*/
524 // line 321 "XPathParser.y"
527 if (yyVals
[-2+yyTop
] instanceof Steps
)
529 steps
= (Steps
) yyVals
[-2+yyTop
];
534 steps
.path
.addFirst(yyVals
[-2+yyTop
]);
536 steps
.path
.addLast(yyVals
[0+yyTop
]);
538 /*$$ = new Step((Expr) $1, (Path) $3);*/
542 // line 337 "XPathParser.y"
544 Test nt
= new NodeTypeTest((short) 0);
545 Selector s
= new Selector(Selector
.DESCENDANT_OR_SELF
,
546 Collections
.singletonList (nt
));
548 if (yyVals
[-2+yyTop
] instanceof Steps
)
550 steps
= (Steps
) yyVals
[-2+yyTop
];
555 steps
.path
.addFirst(yyVals
[-2+yyTop
]);
557 steps
.path
.addLast(s
);
558 steps
.path
.addLast(yyVals
[0+yyTop
]);
560 /*Step step = new Step(s, (Path) $3);*/
561 /*$$ = new Step((Expr) $1, step);*/
565 // line 361 "XPathParser.y"
567 yyVal
= new Selector (Selector
.CHILD
, (List
) yyVals
[0+yyTop
]);
571 // line 365 "XPathParser.y"
573 yyVal
= new Selector (Selector
.ATTRIBUTE
, (List
) yyVals
[0+yyTop
]);
577 // line 369 "XPathParser.y"
579 yyVal
= new Selector (((Integer
) yyVals
[-2+yyTop
]).intValue (), (List
) yyVals
[0+yyTop
]);
583 // line 373 "XPathParser.y"
585 yyVal
= new Selector (Selector
.SELF
, Collections
.EMPTY_LIST
);
589 // line 377 "XPathParser.y"
591 yyVal
= new Selector (Selector
.PARENT
, Collections
.EMPTY_LIST
);
595 // line 384 "XPathParser.y"
597 List list
= new ArrayList();
598 list
.add(yyVals
[0+yyTop
]);
603 // line 390 "XPathParser.y"
605 List list
= (List
)yyVals
[-1+yyTop
];
606 list
.add(yyVals
[0+yyTop
]);
611 // line 414 "XPathParser.y"
613 yyVal
= new Integer(Selector
.ANCESTOR
);
617 // line 418 "XPathParser.y"
619 yyVal
= new Integer(Selector
.ANCESTOR_OR_SELF
);
623 // line 422 "XPathParser.y"
625 yyVal
= new Integer(Selector
.ATTRIBUTE
);
629 // line 426 "XPathParser.y"
631 yyVal
= new Integer(Selector
.CHILD
);
635 // line 430 "XPathParser.y"
637 yyVal
= new Integer(Selector
.DESCENDANT
);
641 // line 434 "XPathParser.y"
643 yyVal
= new Integer(Selector
.DESCENDANT_OR_SELF
);
647 // line 438 "XPathParser.y"
649 yyVal
= new Integer(Selector
.FOLLOWING
);
653 // line 442 "XPathParser.y"
655 yyVal
= new Integer(Selector
.FOLLOWING_SIBLING
);
659 // line 446 "XPathParser.y"
661 yyVal
= new Integer(Selector
.NAMESPACE
);
665 // line 450 "XPathParser.y"
667 yyVal
= new Integer(Selector
.PARENT
);
671 // line 454 "XPathParser.y"
673 yyVal
= new Integer(Selector
.PRECEDING
);
677 // line 458 "XPathParser.y"
679 yyVal
= new Integer(Selector
.PRECEDING_SIBLING
);
683 // line 462 "XPathParser.y"
685 yyVal
= new Integer(Selector
.SELF
);
689 // line 471 "XPathParser.y"
691 yyVal
= new NodeTypeTest(Node
.PROCESSING_INSTRUCTION_NODE
, (String
) yyVals
[-1+yyTop
]);
695 // line 476 "XPathParser.y"
697 yyVal
= new NodeTypeTest(((Short
) yyVals
[-1+yyTop
]).shortValue());
701 // line 483 "XPathParser.y"
703 yyVal
= new Predicate((Expr
) yyVals
[-1+yyTop
]);
707 // line 491 "XPathParser.y"
709 yyVal
= new ParenthesizedExpr((Expr
) yyVals
[-1+yyTop
]);
713 // line 495 "XPathParser.y"
715 yyVal
= new Constant(yyVals
[0+yyTop
]);
719 // line 499 "XPathParser.y"
721 yyVal
= new Constant(yyVals
[0+yyTop
]);
725 // line 507 "XPathParser.y"
727 yyVal
= lookupFunction((String
) yyVals
[-2+yyTop
], Collections
.EMPTY_LIST
);
731 // line 511 "XPathParser.y"
733 yyVal
= lookupFunction((String
) yyVals
[-3+yyTop
], (List
) yyVals
[-1+yyTop
]);
737 // line 518 "XPathParser.y"
739 List list
= new ArrayList();
740 list
.add(yyVals
[0+yyTop
]);
745 // line 524 "XPathParser.y"
747 List list
= (List
) yyVals
[0+yyTop
];
748 list
.add(0, yyVals
[-2+yyTop
]);
753 // line 534 "XPathParser.y"
755 yyVal
= new UnionExpr((Expr
) yyVals
[-2+yyTop
], (Expr
) yyVals
[0+yyTop
]);
759 // line 543 "XPathParser.y"
762 if (yyVals
[0+yyTop
] instanceof Steps
)
764 steps
= (Steps
) yyVals
[0+yyTop
];
769 steps
.path
.addFirst(yyVals
[0+yyTop
]);
771 steps
.path
.addFirst(yyVals
[-2+yyTop
]);
773 /*$$ = new Step ((Expr) $1, (Path) $3);*/
777 // line 559 "XPathParser.y"
779 Test nt
= new NodeTypeTest((short) 0);
780 Selector s
= new Selector(Selector
.DESCENDANT_OR_SELF
,
781 Collections
.singletonList(nt
));
783 if (yyVals
[0+yyTop
] instanceof Steps
)
785 steps
= (Steps
) yyVals
[0+yyTop
];
790 steps
.path
.addFirst(yyVals
[0+yyTop
]);
792 steps
.path
.addFirst(s
);
793 steps
.path
.addFirst(yyVals
[-2+yyTop
]);
795 /*Step step = new Step (s, (Path) $3);*/
796 /*$$ = new Step ((Expr) $1, step);*/
800 // line 584 "XPathParser.y"
802 Predicate filter
= (Predicate
) yyVals
[0+yyTop
];
803 Selector s
= new Selector(Selector
.SELF
,
804 Collections
.singletonList(filter
));
806 if (yyVals
[-1+yyTop
] instanceof Steps
)
808 steps
= (Steps
) yyVals
[-1+yyTop
];
813 steps
.path
.addFirst(yyVals
[-1+yyTop
]);
815 steps
.path
.addLast(s
);
817 /*$$ = new Step ((Expr) $1, s);*/
821 // line 607 "XPathParser.y"
823 yyVal
= new OrExpr((Expr
) yyVals
[-2+yyTop
], (Expr
) yyVals
[0+yyTop
]);
827 // line 615 "XPathParser.y"
829 yyVal
= new AndExpr((Expr
) yyVals
[-2+yyTop
], (Expr
) yyVals
[0+yyTop
]);
833 // line 623 "XPathParser.y"
835 yyVal
= new EqualityExpr((Expr
) yyVals
[-2+yyTop
], (Expr
) yyVals
[0+yyTop
], false);
839 // line 627 "XPathParser.y"
841 yyVal
= new EqualityExpr((Expr
) yyVals
[-2+yyTop
], (Expr
) yyVals
[0+yyTop
], true);
845 // line 635 "XPathParser.y"
847 yyVal
= new RelationalExpr((Expr
) yyVals
[-2+yyTop
], (Expr
) yyVals
[0+yyTop
], true, false);
851 // line 639 "XPathParser.y"
853 yyVal
= new RelationalExpr((Expr
) yyVals
[-2+yyTop
], (Expr
) yyVals
[0+yyTop
], false, false);
857 // line 643 "XPathParser.y"
859 yyVal
= new RelationalExpr((Expr
) yyVals
[-2+yyTop
], (Expr
) yyVals
[0+yyTop
], true, true);
863 // line 647 "XPathParser.y"
865 yyVal
= new RelationalExpr((Expr
) yyVals
[-2+yyTop
], (Expr
) yyVals
[0+yyTop
], false, true);
869 // line 655 "XPathParser.y"
871 yyVal
= new ArithmeticExpr((Expr
) yyVals
[-2+yyTop
], (Expr
) yyVals
[0+yyTop
], ArithmeticExpr
.ADD
);
875 // line 659 "XPathParser.y"
877 yyVal
= new ArithmeticExpr((Expr
) yyVals
[-2+yyTop
], (Expr
) yyVals
[0+yyTop
], ArithmeticExpr
.SUBTRACT
);
881 // line 667 "XPathParser.y"
883 yyVal
= new ArithmeticExpr((Expr
) yyVals
[-2+yyTop
], (Expr
) yyVals
[0+yyTop
], ArithmeticExpr
.MULTIPLY
);
887 // line 671 "XPathParser.y"
889 yyVal
= new ArithmeticExpr((Expr
) yyVals
[-2+yyTop
], (Expr
) yyVals
[0+yyTop
], ArithmeticExpr
.DIVIDE
);
893 // line 675 "XPathParser.y"
895 yyVal
= new ArithmeticExpr((Expr
) yyVals
[-2+yyTop
], (Expr
) yyVals
[0+yyTop
], ArithmeticExpr
.MODULO
);
899 // line 683 "XPathParser.y"
901 yyVal
= new NegativeExpr((Expr
) yyVals
[0+yyTop
]);
905 // line 690 "XPathParser.y"
907 yyVal
= new Double((String
) yyVals
[0+yyTop
] + ".0");
911 // line 694 "XPathParser.y"
913 yyVal
= new Double((String
) yyVals
[-1+yyTop
] + ".0");
917 // line 698 "XPathParser.y"
919 yyVal
= new Double((String
) yyVals
[-2+yyTop
] + "." + (String
) yyVals
[0+yyTop
]);
923 // line 702 "XPathParser.y"
925 yyVal
= new Double("0." + (String
) yyVals
[0+yyTop
]);
929 // line 731 "XPathParser.y"
931 yyVal
= new VariableReference(variableResolver
, (String
) yyVals
[0+yyTop
]);
935 // line 738 "XPathParser.y"
937 yyVal
= new NameTest(null, true, true);
941 // line 742 "XPathParser.y"
943 QName qName
= getQName((String
) yyVals
[-2+yyTop
]);
944 yyVal
= new NameTest(qName
, true, false);
948 // line 747 "XPathParser.y"
950 QName qName
= getQName((String
) yyVals
[0+yyTop
]);
951 yyVal
= new NameTest(qName
, false, false);
955 // line 756 "XPathParser.y"
957 yyVal
= (String
) yyVals
[-2+yyTop
] + ':' + (String
) yyVals
[0+yyTop
];
961 // line 763 "XPathParser.y"
963 yyVal
= new Short(Node
.COMMENT_NODE
);
967 // line 767 "XPathParser.y"
969 yyVal
= new Short(Node
.TEXT_NODE
);
973 // line 771 "XPathParser.y"
975 yyVal
= new Short(Node
.PROCESSING_INSTRUCTION_NODE
);
979 // line 775 "XPathParser.y"
981 yyVal
= new Short((short) 0);
986 yyTop
-= YyLenClass
.yyLen
[yyN
];
987 yyState
= yyStates
[yyTop
];
988 int yyM
= YyLhsClass
.yyLhs
[yyN
];
989 if (yyState
== 0 && yyM
== 0) {
990 //t if (yydebug != null) yydebug.shift(0, yyFinal);
993 yyToken
= yyLex
.advance() ? yyLex
.token() : 0;
994 //t if (yydebug != null)
995 //t yydebug.lex(yyState, yyToken,yyname(yyToken), yyLex.value());
998 //t if (yydebug != null) yydebug.accept(yyVal);
1003 if ((yyN
= YyGindexClass
.yyGindex
[yyM
]) != 0 && (yyN
+= yyState
) >= 0
1004 && yyN
< YyTableClass
.yyTable
.length
&& YyCheckClass
.yyCheck
[yyN
] == yyState
)
1005 yyState
= YyTableClass
.yyTable
[yyN
];
1007 yyState
= YyDgotoClass
.yyDgoto
[yyM
];
1008 //t if (yydebug != null) yydebug.shift(yyStates[yyTop], yyState);
1014 protected static final class YyLhsClass
{
1016 public static final short yyLhs
[] = { -1,
1017 0, 2, 2, 4, 4, 4, 3, 3, 3, 5,
1018 5, 5, 5, 5, 6, 6, 7, 7, 7, 7,
1019 7, 7, 7, 7, 7, 7, 7, 7, 7, 8,
1020 8, 8, 9, 12, 12, 12, 12, 12, 15, 15,
1021 17, 17, 18, 18, 19, 19, 19, 19, 20, 20,
1022 1, 1, 21, 21, 22, 22, 22, 23, 23, 23,
1023 23, 23, 24, 24, 24, 25, 25, 25, 25, 26,
1024 26, 14, 14, 14, 14, 16, 13, 10, 10, 10,
1025 27, 27, 11, 11, 11, 11,
1027 } /* End of class YyLhsClass */
1029 protected static final class YyLenClass
{
1031 public static final short yyLen
[] = { 2,
1032 1, 1, 1, 1, 2, 2, 1, 3, 3, 1,
1033 2, 3, 1, 1, 1, 2, 1, 1, 1, 1,
1034 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1035 3, 2, 3, 1, 3, 1, 1, 1, 3, 4,
1036 1, 3, 1, 3, 1, 1, 3, 3, 1, 2,
1037 1, 3, 1, 3, 1, 3, 3, 1, 3, 3,
1038 3, 3, 1, 3, 3, 1, 3, 3, 3, 1,
1039 2, 1, 2, 3, 2, 1, 2, 1, 3, 1,
1042 } /* End class YyLenClass */
1044 protected static final class YyDefRedClass
{
1046 public static final short yyDefRed
[] = { 0,
1047 36, 0, 0, 0, 0, 0, 0, 0, 78, 0,
1048 0, 14, 17, 18, 19, 20, 21, 22, 23, 24,
1049 25, 26, 27, 28, 29, 83, 0, 84, 86, 0,
1050 0, 45, 0, 3, 7, 0, 0, 15, 30, 0,
1051 49, 34, 37, 38, 0, 0, 43, 0, 0, 0,
1052 0, 0, 0, 66, 0, 0, 0, 0, 13, 0,
1053 80, 0, 71, 0, 0, 77, 75, 0, 0, 0,
1054 0, 0, 16, 0, 32, 0, 0, 0, 0, 50,
1055 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1056 0, 0, 74, 82, 79, 35, 0, 31, 0, 8,
1057 9, 0, 0, 39, 0, 0, 44, 0, 0, 0,
1058 0, 0, 0, 0, 0, 0, 0, 0, 67, 68,
1061 } /* End of class YyDefRedClass */
1063 protected static final class YyDgotoClass
{
1065 public static final short yyDgoto
[] = { 105,
1066 31, 32, 33, 34, 35, 36, 37, 38, 73, 39,
1067 40, 41, 42, 43, 44, 45, 106, 46, 47, 48,
1068 49, 50, 51, 52, 53, 54, 55,
1070 } /* End of class YyDgotoClass */
1072 protected static final class YySindexClass
{
1074 public static final short yySindex
[] = { -97,
1075 0, -271, -267, -97, -239, -239, -97, -199, 0, -236,
1076 -222, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1077 0, 0, 0, 0, 0, 0, -218, 0, 0, 0,
1078 -257, 0, -241, 0, 0, -205, -221, 0, 0, -194,
1079 0, 0, 0, 0, -190, -185, 0, -238, -211, -234,
1080 -255, -209, -275, 0, 0, -169, -250, -168, 0, -241,
1081 0, -241, 0, -205, -187, 0, 0, -167, -97, -239,
1082 -239, -97, 0, -199, 0, -151, -43, -239, -239, 0,
1083 -97, -97, -97, -97, -97, -97, -97, -97, -97, -97,
1084 -97, -97, 0, 0, 0, 0, -164, 0, -211, 0,
1085 0, -166, -205, 0, -165, -163, 0, -241, -241, -234,
1086 -255, -255, -209, -209, -209, -209, -275, -275, 0, 0,
1089 } /* End of class YySindexClass */
1091 protected static final class YyRindexClass
{
1093 public static final short yyRindex
[] = { 0,
1094 0, 58, 1, 0, 420, 0, 0, 0, 0, 0,
1095 129, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1096 0, 0, 0, 0, 0, 0, -161, 0, 0, 0,
1097 40, 0, 237, 0, 0, 168, 0, 0, 0, 0,
1098 0, 0, 0, 0, 0, 459, 0, 277, 557, 544,
1099 656, 561, 474, 0, 19, 75, 0, 0, 0, 295,
1100 0, 334, 0, 183, 114, 0, 0, 0, 0, 0,
1101 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1102 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1103 0, 0, 0, 0, 0, 0, 0, 0, 686, 0,
1104 0, 0, 222, 0, -156, 0, 0, 351, 405, 553,
1105 665, 697, 577, 600, 617, 639, 513, 528, 0, 0,
1108 } /* End of class YyRindexClass */
1110 protected static final class YyGindexClass
{
1112 public static final short yyGindex
[] = { 7,
1113 0, 0, 8, 0, 3, -3, 0, 0, 48, 0,
1114 0, 0, 0, 0, 0, 0, -12, 0, 35, 0,
1115 44, 36, -1, -54, 2, -7, -2,
1117 } /* End of class YyGindexClass */
1119 protected static final class YyTableClass
{
1121 public static final short yyTable
[] = { 63,
1122 81, 90, 61, 61, 64, 61, 30, 66, 94, 56,
1123 58, 57, 60, 62, 84, 85, 86, 87, 80, 3,
1124 91, 92, 65, 72, 70, 71, 95, 78, 79, 113,
1125 114, 115, 116, 82, 83, 67, 8, 9, 68, 1,
1126 69, 59, 12, 13, 14, 15, 16, 17, 18, 19,
1127 20, 21, 22, 23, 24, 25, 72, 72, 74, 3,
1128 26, 27, 28, 29, 88, 89, 75, 61, 61, 76,
1129 103, 61, 100, 101, 73, 61, 61, 9, 102, 77,
1130 111, 112, 119, 120, 121, 108, 109, 81, 93, 117,
1131 118, 97, 96, 98, 94, 80, 122, 124, 123, 85,
1132 26, 27, 28, 29, 41, 1, 2, 3, 4, 104,
1133 125, 107, 99, 81, 5, 6, 110, 0, 0, 0,
1134 0, 0, 0, 7, 8, 9, 10, 0, 13, 11,
1135 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1136 22, 23, 24, 25, 0, 0, 0, 0, 26, 27,
1137 28, 29, 0, 0, 0, 0, 0, 0, 0, 1,
1138 2, 3, 4, 0, 0, 0, 0, 10, 5, 6,
1139 0, 0, 0, 0, 0, 0, 0, 7, 8, 9,
1140 10, 0, 11, 11, 12, 13, 14, 15, 16, 17,
1141 18, 19, 20, 21, 22, 23, 24, 25, 0, 0,
1142 0, 0, 26, 27, 28, 29, 0, 0, 0, 0,
1143 0, 0, 0, 1, 2, 3, 4, 0, 0, 0,
1144 0, 12, 5, 6, 0, 0, 0, 0, 0, 0,
1145 0, 0, 8, 9, 10, 0, 2, 11, 12, 13,
1146 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1147 24, 25, 0, 0, 0, 0, 26, 27, 28, 29,
1148 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
1149 81, 81, 81, 81, 81, 81, 46, 81, 76, 80,
1150 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
1151 80, 80, 80, 80, 5, 80, 81, 81, 81, 81,
1152 1, 0, 1, 1, 0, 0, 0, 0, 0, 0,
1153 0, 0, 0, 0, 80, 80, 80, 80, 72, 72,
1154 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
1155 72, 72, 72, 6, 72, 73, 73, 73, 73, 73,
1156 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
1157 47, 73, 0, 72, 72, 72, 72, 0, 0, 0,
1158 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1159 73, 73, 73, 73, 81, 81, 81, 81, 81, 81,
1160 81, 81, 81, 81, 81, 81, 81, 81, 81, 13,
1161 81, 13, 13, 13, 13, 13, 13, 13, 13, 13,
1162 13, 13, 13, 13, 48, 13, 0, 0, 0, 81,
1163 81, 81, 81, 0, 0, 0, 0, 0, 0, 4,
1164 0, 0, 0, 0, 13, 13, 13, 13, 10, 0,
1165 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
1166 10, 10, 10, 11, 10, 11, 11, 11, 11, 11,
1167 11, 11, 11, 11, 11, 11, 11, 11, 70, 11,
1168 0, 0, 0, 10, 10, 10, 10, 0, 0, 0,
1169 0, 0, 0, 63, 0, 0, 0, 0, 11, 11,
1170 11, 11, 12, 0, 12, 12, 12, 12, 12, 12,
1171 12, 12, 12, 12, 12, 12, 12, 2, 12, 2,
1172 2, 2, 0, 0, 2, 2, 2, 2, 2, 2,
1173 2, 2, 64, 2, 0, 0, 0, 12, 12, 12,
1174 12, 0, 0, 0, 0, 0, 0, 65, 0, 0,
1175 0, 0, 2, 2, 2, 2, 0, 46, 0, 46,
1176 46, 46, 0, 53, 46, 46, 46, 46, 46, 46,
1177 46, 46, 54, 46, 0, 5, 51, 5, 5, 5,
1178 58, 0, 5, 5, 5, 5, 5, 5, 5, 5,
1179 0, 5, 46, 46, 46, 46, 60, 0, 0, 0,
1180 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1181 5, 5, 5, 5, 6, 0, 6, 6, 6, 59,
1182 0, 6, 6, 6, 6, 6, 6, 6, 6, 0,
1183 6, 47, 0, 47, 47, 47, 62, 0, 47, 47,
1184 47, 47, 47, 47, 47, 47, 0, 47, 0, 6,
1185 6, 6, 6, 0, 0, 0, 0, 0, 61, 0,
1186 0, 0, 0, 0, 0, 0, 47, 47, 47, 47,
1187 0, 0, 0, 0, 0, 55, 0, 0, 0, 0,
1188 0, 0, 0, 0, 56, 48, 0, 48, 48, 48,
1189 0, 0, 48, 48, 48, 48, 48, 48, 48, 48,
1190 4, 48, 4, 4, 4, 52, 0, 4, 4, 4,
1191 4, 4, 4, 4, 4, 0, 57, 0, 0, 0,
1192 48, 48, 48, 48, 0, 0, 0, 0, 0, 0,
1193 0, 0, 0, 0, 0, 4, 4, 4, 4, 70,
1194 0, 70, 70, 0, 0, 0, 70, 70, 70, 70,
1195 70, 70, 70, 70, 63, 70, 63, 63, 0, 0,
1196 0, 63, 63, 63, 63, 63, 63, 63, 63, 0,
1197 0, 0, 0, 0, 70, 70, 70, 70, 0, 0,
1198 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1199 0, 63, 63, 64, 0, 64, 64, 0, 0, 0,
1200 64, 64, 64, 64, 64, 64, 64, 64, 65, 0,
1201 65, 65, 0, 0, 0, 65, 65, 65, 65, 65,
1202 65, 65, 65, 0, 53, 0, 53, 53, 0, 0,
1203 64, 64, 0, 54, 0, 54, 54, 51, 0, 51,
1204 51, 58, 0, 58, 58, 65, 65, 0, 58, 58,
1205 58, 58, 58, 58, 0, 0, 0, 60, 0, 60,
1206 60, 53, 53, 0, 60, 60, 60, 60, 60, 60,
1207 54, 54, 0, 0, 51, 0, 0, 0, 58, 58,
1208 59, 0, 59, 59, 0, 0, 0, 59, 59, 59,
1209 59, 59, 59, 0, 60, 60, 0, 62, 0, 62,
1210 62, 0, 0, 0, 62, 62, 62, 62, 62, 62,
1211 0, 0, 0, 0, 0, 0, 0, 59, 59, 61,
1212 0, 61, 61, 0, 0, 0, 61, 61, 61, 61,
1213 61, 61, 0, 0, 62, 62, 55, 0, 55, 55,
1214 0, 0, 0, 55, 55, 56, 0, 56, 56, 0,
1215 0, 0, 56, 56, 0, 0, 61, 61, 0, 0,
1216 0, 0, 0, 0, 0, 0, 52, 0, 52, 52,
1217 0, 0, 0, 55, 55, 0, 0, 57, 0, 57,
1218 57, 0, 56, 56, 57, 57, 0, 0, 0, 0,
1219 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1220 0, 0, 0, 52, 0, 0, 0, 0, 0, 0,
1223 } /* End of class YyTableClass */
1225 protected static final class YyCheckClass
{
1227 public static final short yyCheck
[] = { 7,
1228 0, 277, 5, 6, 8, 8, 0, 10, 259, 281,
1229 4, 279, 5, 6, 270, 271, 272, 273, 0, 259,
1230 296, 297, 259, 262, 266, 267, 277, 266, 267, 84,
1231 85, 86, 87, 268, 269, 258, 276, 277, 257, 0,
1232 298, 281, 282, 283, 284, 285, 286, 287, 288, 289,
1233 290, 291, 292, 293, 294, 295, 262, 0, 280, 259,
1234 300, 301, 302, 303, 274, 275, 261, 70, 71, 260,
1235 74, 74, 70, 71, 0, 78, 79, 277, 72, 265,
1236 82, 83, 90, 91, 92, 78, 79, 299, 258, 88,
1237 89, 279, 261, 261, 259, 48, 263, 261, 264, 261,
1238 300, 301, 302, 303, 261, 257, 258, 259, 260, 261,
1239 123, 77, 69, 0, 266, 267, 81, -1, -1, -1,
1240 -1, -1, -1, 275, 276, 277, 278, -1, 0, 281,
1241 282, 283, 284, 285, 286, 287, 288, 289, 290, 291,
1242 292, 293, 294, 295, -1, -1, -1, -1, 300, 301,
1243 302, 303, -1, -1, -1, -1, -1, -1, -1, 257,
1244 258, 259, 260, -1, -1, -1, -1, 0, 266, 267,
1245 -1, -1, -1, -1, -1, -1, -1, 275, 276, 277,
1246 278, -1, 0, 281, 282, 283, 284, 285, 286, 287,
1247 288, 289, 290, 291, 292, 293, 294, 295, -1, -1,
1248 -1, -1, 300, 301, 302, 303, -1, -1, -1, -1,
1249 -1, -1, -1, 257, 258, 259, 260, -1, -1, -1,
1250 -1, 0, 266, 267, -1, -1, -1, -1, -1, -1,
1251 -1, -1, 276, 277, 278, -1, 0, 281, 282, 283,
1252 284, 285, 286, 287, 288, 289, 290, 291, 292, 293,
1253 294, 295, -1, -1, -1, -1, 300, 301, 302, 303,
1254 260, 261, 262, 263, 264, 265, 266, 267, 268, 269,
1255 270, 271, 272, 273, 274, 275, 0, 277, 260, 261,
1256 262, 263, 264, 265, 266, 267, 268, 269, 270, 271,
1257 272, 273, 274, 275, 0, 277, 296, 297, 298, 299,
1258 261, -1, 263, 264, -1, -1, -1, -1, -1, -1,
1259 -1, -1, -1, -1, 296, 297, 298, 299, 261, 262,
1260 263, 264, 265, 266, 267, 268, 269, 270, 271, 272,
1261 273, 274, 275, 0, 277, 261, 262, 263, 264, 265,
1262 266, 267, 268, 269, 270, 271, 272, 273, 274, 275,
1263 0, 277, -1, 296, 297, 298, 299, -1, -1, -1,
1264 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1265 296, 297, 298, 299, 261, 262, 263, 264, 265, 266,
1266 267, 268, 269, 270, 271, 272, 273, 274, 275, 261,
1267 277, 263, 264, 265, 266, 267, 268, 269, 270, 271,
1268 272, 273, 274, 275, 0, 277, -1, -1, -1, 296,
1269 297, 298, 299, -1, -1, -1, -1, -1, -1, 0,
1270 -1, -1, -1, -1, 296, 297, 298, 299, 261, -1,
1271 263, 264, 265, 266, 267, 268, 269, 270, 271, 272,
1272 273, 274, 275, 261, 277, 263, 264, 265, 266, 267,
1273 268, 269, 270, 271, 272, 273, 274, 275, 0, 277,
1274 -1, -1, -1, 296, 297, 298, 299, -1, -1, -1,
1275 -1, -1, -1, 0, -1, -1, -1, -1, 296, 297,
1276 298, 299, 261, -1, 263, 264, 265, 266, 267, 268,
1277 269, 270, 271, 272, 273, 274, 275, 261, 277, 263,
1278 264, 265, -1, -1, 268, 269, 270, 271, 272, 273,
1279 274, 275, 0, 277, -1, -1, -1, 296, 297, 298,
1280 299, -1, -1, -1, -1, -1, -1, 0, -1, -1,
1281 -1, -1, 296, 297, 298, 299, -1, 261, -1, 263,
1282 264, 265, -1, 0, 268, 269, 270, 271, 272, 273,
1283 274, 275, 0, 277, -1, 261, 0, 263, 264, 265,
1284 0, -1, 268, 269, 270, 271, 272, 273, 274, 275,
1285 -1, 277, 296, 297, 298, 299, 0, -1, -1, -1,
1286 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1287 296, 297, 298, 299, 261, -1, 263, 264, 265, 0,
1288 -1, 268, 269, 270, 271, 272, 273, 274, 275, -1,
1289 277, 261, -1, 263, 264, 265, 0, -1, 268, 269,
1290 270, 271, 272, 273, 274, 275, -1, 277, -1, 296,
1291 297, 298, 299, -1, -1, -1, -1, -1, 0, -1,
1292 -1, -1, -1, -1, -1, -1, 296, 297, 298, 299,
1293 -1, -1, -1, -1, -1, 0, -1, -1, -1, -1,
1294 -1, -1, -1, -1, 0, 261, -1, 263, 264, 265,
1295 -1, -1, 268, 269, 270, 271, 272, 273, 274, 275,
1296 261, 277, 263, 264, 265, 0, -1, 268, 269, 270,
1297 271, 272, 273, 274, 275, -1, 0, -1, -1, -1,
1298 296, 297, 298, 299, -1, -1, -1, -1, -1, -1,
1299 -1, -1, -1, -1, -1, 296, 297, 298, 299, 261,
1300 -1, 263, 264, -1, -1, -1, 268, 269, 270, 271,
1301 272, 273, 274, 275, 261, 277, 263, 264, -1, -1,
1302 -1, 268, 269, 270, 271, 272, 273, 274, 275, -1,
1303 -1, -1, -1, -1, 296, 297, 298, 299, -1, -1,
1304 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1305 -1, 298, 299, 261, -1, 263, 264, -1, -1, -1,
1306 268, 269, 270, 271, 272, 273, 274, 275, 261, -1,
1307 263, 264, -1, -1, -1, 268, 269, 270, 271, 272,
1308 273, 274, 275, -1, 261, -1, 263, 264, -1, -1,
1309 298, 299, -1, 261, -1, 263, 264, 261, -1, 263,
1310 264, 261, -1, 263, 264, 298, 299, -1, 268, 269,
1311 270, 271, 272, 273, -1, -1, -1, 261, -1, 263,
1312 264, 298, 299, -1, 268, 269, 270, 271, 272, 273,
1313 298, 299, -1, -1, 298, -1, -1, -1, 298, 299,
1314 261, -1, 263, 264, -1, -1, -1, 268, 269, 270,
1315 271, 272, 273, -1, 298, 299, -1, 261, -1, 263,
1316 264, -1, -1, -1, 268, 269, 270, 271, 272, 273,
1317 -1, -1, -1, -1, -1, -1, -1, 298, 299, 261,
1318 -1, 263, 264, -1, -1, -1, 268, 269, 270, 271,
1319 272, 273, -1, -1, 298, 299, 261, -1, 263, 264,
1320 -1, -1, -1, 268, 269, 261, -1, 263, 264, -1,
1321 -1, -1, 268, 269, -1, -1, 298, 299, -1, -1,
1322 -1, -1, -1, -1, -1, -1, 261, -1, 263, 264,
1323 -1, -1, -1, 298, 299, -1, -1, 261, -1, 263,
1324 264, -1, 298, 299, 268, 269, -1, -1, -1, -1,
1325 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1326 -1, -1, -1, 298, -1, -1, -1, -1, -1, -1,
1327 -1, -1, -1, -1, 298, 299,
1329 } /* End of class YyCheckClass */
1332 //t protected static final class YyRuleClass {
1334 //t public static final String yyRule [] = {
1335 //t "$accept : expr",
1336 //t "expr : or_expr",
1337 //t "location_path : relative_location_path",
1338 //t "location_path : absolute_location_path",
1339 //t "absolute_location_path : SLASH",
1340 //t "absolute_location_path : SLASH relative_location_path",
1341 //t "absolute_location_path : DOUBLE_SLASH relative_location_path",
1342 //t "relative_location_path : step",
1343 //t "relative_location_path : relative_location_path SLASH step",
1344 //t "relative_location_path : relative_location_path DOUBLE_SLASH step",
1345 //t "step : step_node_test",
1346 //t "step : AT step_node_test",
1347 //t "step : axis_name DOUBLE_COLON step_node_test",
1349 //t "step : DOUBLE_DOT",
1350 //t "step_node_test : node_test",
1351 //t "step_node_test : step_node_test predicate",
1352 //t "axis_name : ANCESTOR",
1353 //t "axis_name : ANCESTOR_OR_SELF",
1354 //t "axis_name : ATTRIBUTE",
1355 //t "axis_name : CHILD",
1356 //t "axis_name : DESCENDANT",
1357 //t "axis_name : DESCENDANT_OR_SELF",
1358 //t "axis_name : FOLLOWING",
1359 //t "axis_name : FOLLOWING_SIBLING",
1360 //t "axis_name : NAMESPACE",
1361 //t "axis_name : PARENT",
1362 //t "axis_name : PRECEDING",
1363 //t "axis_name : PRECEDING_SIBLING",
1364 //t "axis_name : SELF",
1365 //t "node_test : name_test",
1366 //t "node_test : PROCESSING_INSTRUCTION LITERAL RP",
1367 //t "node_test : node_type RP",
1368 //t "predicate : LB expr RB",
1369 //t "primary_expr : variable_reference",
1370 //t "primary_expr : LP expr RP",
1371 //t "primary_expr : LITERAL",
1372 //t "primary_expr : number",
1373 //t "primary_expr : function_call",
1374 //t "function_call : function_name LP RP",
1375 //t "function_call : function_name LP argument_list RP",
1376 //t "argument_list : expr",
1377 //t "argument_list : expr COMMA argument_list",
1378 //t "union_expr : path_expr",
1379 //t "union_expr : union_expr PIPE path_expr",
1380 //t "path_expr : location_path",
1381 //t "path_expr : filter_expr",
1382 //t "path_expr : filter_expr SLASH relative_location_path",
1383 //t "path_expr : filter_expr DOUBLE_SLASH relative_location_path",
1384 //t "filter_expr : primary_expr",
1385 //t "filter_expr : filter_expr predicate",
1386 //t "or_expr : and_expr",
1387 //t "or_expr : or_expr OR and_expr",
1388 //t "and_expr : equality_expr",
1389 //t "and_expr : and_expr AND equality_expr",
1390 //t "equality_expr : relational_expr",
1391 //t "equality_expr : equality_expr EQ relational_expr",
1392 //t "equality_expr : equality_expr NE relational_expr",
1393 //t "relational_expr : additive_expr",
1394 //t "relational_expr : relational_expr LT additive_expr",
1395 //t "relational_expr : relational_expr GT additive_expr",
1396 //t "relational_expr : relational_expr LTE additive_expr",
1397 //t "relational_expr : relational_expr GTE additive_expr",
1398 //t "additive_expr : multiplicative_expr",
1399 //t "additive_expr : additive_expr PLUS multiplicative_expr",
1400 //t "additive_expr : additive_expr MINUS multiplicative_expr",
1401 //t "multiplicative_expr : unary_expr",
1402 //t "multiplicative_expr : multiplicative_expr STAR unary_expr",
1403 //t "multiplicative_expr : multiplicative_expr DIV unary_expr",
1404 //t "multiplicative_expr : multiplicative_expr MOD unary_expr",
1405 //t "unary_expr : union_expr",
1406 //t "unary_expr : MINUS unary_expr",
1407 //t "number : DIGITS",
1408 //t "number : DIGITS DOT",
1409 //t "number : DIGITS DOT DIGITS",
1410 //t "number : DOT DIGITS",
1411 //t "function_name : qname",
1412 //t "variable_reference : DOLLAR qname",
1413 //t "name_test : STAR",
1414 //t "name_test : NAME COLON STAR",
1415 //t "name_test : qname",
1417 //t "qname : NAME COLON NAME",
1418 //t "node_type : COMMENT",
1419 //t "node_type : TEXT",
1420 //t "node_type : PROCESSING_INSTRUCTION",
1421 //t "node_type : NODE",
1423 //t } /* End of class YyRuleClass */
1425 protected static final class YyNameClass
{
1427 public static final String yyName
[] = {
1428 "end-of-file",null,null,null,null,null,null,null,null,null,null,null,
1429 null,null,null,null,null,null,null,null,null,null,null,null,null,null,
1430 null,null,null,null,null,null,null,null,null,null,null,null,null,null,
1431 null,null,null,null,null,null,null,null,null,null,null,null,null,null,
1432 null,null,null,null,null,null,null,null,null,null,null,null,null,null,
1433 null,null,null,null,null,null,null,null,null,null,null,null,null,null,
1434 null,null,null,null,null,null,null,null,null,null,null,null,null,null,
1435 null,null,null,null,null,null,null,null,null,null,null,null,null,null,
1436 null,null,null,null,null,null,null,null,null,null,null,null,null,null,
1437 null,null,null,null,null,null,null,null,null,null,null,null,null,null,
1438 null,null,null,null,null,null,null,null,null,null,null,null,null,null,
1439 null,null,null,null,null,null,null,null,null,null,null,null,null,null,
1440 null,null,null,null,null,null,null,null,null,null,null,null,null,null,
1441 null,null,null,null,null,null,null,null,null,null,null,null,null,null,
1442 null,null,null,null,null,null,null,null,null,null,null,null,null,null,
1443 null,null,null,null,null,null,null,null,null,null,null,null,null,null,
1444 null,null,null,null,null,null,null,null,null,null,null,null,null,null,
1445 null,null,null,null,null,null,null,null,null,null,null,null,null,null,
1446 null,null,null,null,null,null,null,"LITERAL","DIGITS","NAME","LP",
1447 "RP","LB","RB","COMMA","PIPE","SLASH","DOUBLE_SLASH","EQ","NE","GT",
1448 "LT","GTE","LTE","PLUS","MINUS","AT","STAR","DOLLAR","COLON",
1449 "DOUBLE_COLON","DOT","DOUBLE_DOT","ANCESTOR","ANCESTOR_OR_SELF",
1450 "ATTRIBUTE","CHILD","DESCENDANT","DESCENDANT_OR_SELF","FOLLOWING",
1451 "FOLLOWING_SIBLING","NAMESPACE","PARENT","PRECEDING",
1452 "PRECEDING_SIBLING","SELF","DIV","MOD","OR","AND","COMMENT",
1453 "PROCESSING_INSTRUCTION","TEXT","NODE","UNARY",
1455 } /* End of class YyNameClass */
1458 // line 781 "XPathParser.y"