Parser.cs 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135
  1. // created by jay 0.7 (c) 1998 [email protected]
  2. #line 2 "Parser.jay"
  3. // XPath parser
  4. //
  5. // Author - Piers Haken <[email protected]>
  6. //
  7. // TODO: FUNCTION_CALL should be a QName, not just a NCName
  8. // TODO: PROCESSING_INSTRUCTION's optional parameter
  9. // TODO: flatten argument/predicate lists in place
  10. using System;
  11. using System.Xml.XPath;
  12. namespace Mono.Xml.XPath
  13. {
  14. public class XPathParser
  15. {
  16. internal object yyparseSafe (Tokenizer tok)
  17. {
  18. return yyparseSafe (tok, null);
  19. }
  20. internal object yyparseSafe (Tokenizer tok, object yyDebug)
  21. {
  22. try
  23. {
  24. return yyparse (tok, yyDebug);
  25. }
  26. catch (XPathException e)
  27. {
  28. throw e;
  29. }
  30. catch (Exception e)
  31. {
  32. throw new XPathException ("Error during parse", e);
  33. }
  34. }
  35. internal object yyparseDebug (Tokenizer tok)
  36. {
  37. return yyparseSafe (tok, new yydebug.yyDebugSimple ());
  38. }
  39. #line 48 "-"
  40. /** simplified error message.
  41. @see <a href="#yyerror(java.lang.String, java.lang.String[])">yyerror</a>
  42. */
  43. public void yyerror (string message) {
  44. yyerror(message, null);
  45. }
  46. /** (syntax) error message.
  47. Can be overwritten to control message format.
  48. @param message text to be displayed.
  49. @param expected vector of acceptable tokens, if available.
  50. */
  51. public void yyerror (string message, string[] expected) {
  52. if ((expected != null) && (expected.Length > 0)) {
  53. System.Console.Write (message+", expecting");
  54. for (int n = 0; n < expected.Length; ++ n)
  55. System.Console.Write (" "+expected[n]);
  56. System.Console.WriteLine ();
  57. } else
  58. System.Console.WriteLine (message);
  59. }
  60. /** debugging support, requires the package jay.yydebug.
  61. Set to null to suppress debugging messages.
  62. */
  63. protected yydebug.yyDebug debug;
  64. protected static int yyFinal = 25;
  65. public static string [] yyRule = {
  66. "$accept : Expr",
  67. "Expr : OrExpr",
  68. "OrExpr : AndExpr",
  69. "OrExpr : OrExpr OR AndExpr",
  70. "AndExpr : EqualityExpr",
  71. "AndExpr : AndExpr \"and\" EqualityExpr",
  72. "EqualityExpr : RelationalExpr",
  73. "EqualityExpr : EqualityExpr EQ RelationalExpr",
  74. "EqualityExpr : EqualityExpr NE RelationalExpr",
  75. "RelationalExpr : AdditiveExpr",
  76. "RelationalExpr : RelationalExpr LT AdditiveExpr",
  77. "RelationalExpr : RelationalExpr GT AdditiveExpr",
  78. "RelationalExpr : RelationalExpr LE AdditiveExpr",
  79. "RelationalExpr : RelationalExpr GE AdditiveExpr",
  80. "AdditiveExpr : MultiplicativeExpr",
  81. "AdditiveExpr : AdditiveExpr PLUS MultiplicativeExpr",
  82. "AdditiveExpr : AdditiveExpr MINUS MultiplicativeExpr",
  83. "MultiplicativeExpr : UnaryExpr",
  84. "MultiplicativeExpr : MultiplicativeExpr ASTERISK UnaryExpr",
  85. "MultiplicativeExpr : MultiplicativeExpr DIV UnaryExpr",
  86. "MultiplicativeExpr : MultiplicativeExpr MOD UnaryExpr",
  87. "UnaryExpr : UnionExpr",
  88. "UnaryExpr : MINUS UnaryExpr",
  89. "UnionExpr : PathExpr",
  90. "UnionExpr : UnionExpr BAR PathExpr",
  91. "PathExpr : RelativeLocationPath",
  92. "PathExpr : SLASH",
  93. "PathExpr : SLASH RelativeLocationPath",
  94. "PathExpr : SLASH2 RelativeLocationPath",
  95. "PathExpr : FilterExpr",
  96. "PathExpr : FilterExpr SLASH RelativeLocationPath",
  97. "PathExpr : FilterExpr SLASH2 RelativeLocationPath",
  98. "RelativeLocationPath : Step",
  99. "RelativeLocationPath : RelativeLocationPath SLASH Step",
  100. "RelativeLocationPath : RelativeLocationPath SLASH2 Step",
  101. "Step : AxisSpecifier QName ZeroOrMorePredicates",
  102. "Step : AxisSpecifier ASTERISK ZeroOrMorePredicates",
  103. "Step : AxisSpecifier NodeType PAREN_OPEN OptionalLiteral PAREN_CLOSE ZeroOrMorePredicates",
  104. "Step : DOT",
  105. "Step : DOT2",
  106. "AxisSpecifier :",
  107. "AxisSpecifier : AT",
  108. "AxisSpecifier : AxisName COLON2",
  109. "NodeType : COMMENT",
  110. "NodeType : TEXT",
  111. "NodeType : PROCESSING_INSTRUCTION",
  112. "NodeType : NODE",
  113. "FilterExpr : PrimaryExpr",
  114. "FilterExpr : FilterExpr Predicate",
  115. "PrimaryExpr : DOLLAR QName",
  116. "PrimaryExpr : PAREN_OPEN Expr PAREN_CLOSE",
  117. "PrimaryExpr : LITERAL",
  118. "PrimaryExpr : NUMBER",
  119. "PrimaryExpr : FunctionCall",
  120. "FunctionCall : FUNCTION_NAME PAREN_OPEN OptionalArgumentList PAREN_CLOSE",
  121. "OptionalArgumentList :",
  122. "OptionalArgumentList : Expr OptionalArgumentListTail",
  123. "OptionalArgumentListTail :",
  124. "OptionalArgumentListTail : COMMA Expr OptionalArgumentListTail",
  125. "ZeroOrMorePredicates :",
  126. "ZeroOrMorePredicates : Predicate ZeroOrMorePredicates",
  127. "Predicate : BRACKET_OPEN Expr BRACKET_CLOSE",
  128. "AxisName : ANCESTOR",
  129. "AxisName : ANCESTOR_OR_SELF",
  130. "AxisName : ATTRIBUTE",
  131. "AxisName : CHILD",
  132. "AxisName : DESCENDANT",
  133. "AxisName : DESCENDANT_OR_SELF",
  134. "AxisName : FOLLOWING",
  135. "AxisName : FOLLOWING_SIBLING",
  136. "AxisName : NAMESPACE",
  137. "AxisName : PARENT",
  138. "AxisName : PRECEDING",
  139. "AxisName : PRECEDING_SIBLING",
  140. "AxisName : SELF",
  141. "OptionalLiteral :",
  142. "OptionalLiteral : LITERAL",
  143. "QName : NCName",
  144. "QName : NCName COLON ASTERISK",
  145. "QName : NCName COLON NCName",
  146. };
  147. protected static string [] yyName = {
  148. "end-of-file",null,null,null,null,null,null,null,null,null,null,null,
  149. null,null,null,null,null,null,null,null,null,null,null,null,null,null,
  150. null,null,null,null,null,null,null,null,null,null,"'$'",null,null,
  151. null,"'('","')'","'*'","'+'","','","'-'","'.'","'/'",null,null,null,
  152. null,null,null,null,null,null,null,"':'",null,"'<'","'='","'>'",null,
  153. "'@'",null,null,null,null,null,null,null,null,null,null,null,null,
  154. null,null,null,null,null,null,null,null,null,null,null,null,null,null,
  155. "'['",null,"']'",null,null,null,null,null,null,null,null,null,null,
  156. null,null,null,null,null,null,null,null,null,null,null,null,null,null,
  157. null,null,null,null,null,null,"'|'",null,null,null,null,null,null,
  158. null,null,null,null,null,null,null,null,null,null,null,null,null,null,
  159. null,null,null,null,null,null,null,null,null,null,null,null,null,null,
  160. null,null,null,null,null,null,null,null,null,null,null,null,null,null,
  161. null,null,null,null,null,null,null,null,null,null,null,null,null,null,
  162. null,null,null,null,null,null,null,null,null,null,null,null,null,null,
  163. null,null,null,null,null,null,null,null,null,null,null,null,null,null,
  164. null,null,null,null,null,null,null,null,null,null,null,null,null,null,
  165. null,null,null,null,null,null,null,null,null,null,null,null,null,null,
  166. null,null,null,null,null,null,null,null,null,null,null,null,null,null,
  167. "ERROR","EOF","SLASH","SLASH2","\"//\"","DOT","DOT2","\"..\"","COLON",
  168. "COLON2","\"::\"","COMMA","AT","FUNCTION_NAME","BRACKET_OPEN",
  169. "BRACKET_CLOSE","PAREN_OPEN","PAREN_CLOSE","AND","\"and\"","OR",
  170. "\"or\"","DIV","\"div\"","MOD","\"mod\"","PLUS","MINUS","ASTERISK",
  171. "DOLLAR","BAR","EQ","NE","\"!=\"","LE","\"<=\"","GE","\">=\"","LT",
  172. "GT","ANCESTOR","\"ancestor\"","ANCESTOR_OR_SELF",
  173. "\"ancstor-or-self\"","ATTRIBUTE","\"attribute\"","CHILD","\"child\"",
  174. "DESCENDANT","\"descendant\"","DESCENDANT_OR_SELF",
  175. "\"descendant-or-self\"","FOLLOWING","\"following\"",
  176. "FOLLOWING_SIBLING","\"sibling\"","NAMESPACE","\"NameSpace\"",
  177. "PARENT","\"parent\"","PRECEDING","\"preceding\"","PRECEDING_SIBLING",
  178. "\"preceding-sibling\"","SELF","\"self\"","COMMENT","\"comment\"",
  179. "TEXT","\"text\"","PROCESSING_INSTRUCTION",
  180. "\"processing-instruction\"","NODE","\"node\"","NUMBER","LITERAL",
  181. "NCName",
  182. };
  183. /** index-checked interface to yyName[].
  184. @param token single character or %token value.
  185. @return token name or [illegal] or [unknown].
  186. */
  187. public static string yyname (int token) {
  188. if ((token < 0) || (token > yyName.Length)) return "[illegal]";
  189. string name;
  190. if ((name = yyName[token]) != null) return name;
  191. return "[unknown]";
  192. }
  193. /** computes list of expected tokens on error by tracing the tables.
  194. @param state for which to compute the list.
  195. @return list of token names.
  196. */
  197. protected string[] yyExpecting (int state) {
  198. int token, n, len = 0;
  199. bool[] ok = new bool[yyName.Length];
  200. if ((n = yySindex[state]) != 0)
  201. for (token = n < 0 ? -n : 0;
  202. (token < yyName.Length) && (n+token < yyTable.Length); ++ token)
  203. if (yyCheck[n+token] == token && !ok[token] && yyName[token] != null) {
  204. ++ len;
  205. ok[token] = true;
  206. }
  207. if ((n = yyRindex[state]) != 0)
  208. for (token = n < 0 ? -n : 0;
  209. (token < yyName.Length) && (n+token < yyTable.Length); ++ token)
  210. if (yyCheck[n+token] == token && !ok[token] && yyName[token] != null) {
  211. ++ len;
  212. ok[token] = true;
  213. }
  214. string [] result = new string[len];
  215. for (n = token = 0; n < len; ++ token)
  216. if (ok[token]) result[n++] = yyName[token];
  217. return result;
  218. }
  219. /** the generated parser, with debugging messages.
  220. Maintains a state and a value stack, currently with fixed maximum size.
  221. @param yyLex scanner.
  222. @param yydebug debug message writer implementing yyDebug, or null.
  223. @return result of the last reduction, if any.
  224. @throws yyException on irrecoverable parse error.
  225. */
  226. public Object yyparse (yyParser.yyInput yyLex, Object yyd)
  227. {
  228. this.debug = (yydebug.yyDebug)yyd;
  229. return yyparse(yyLex);
  230. }
  231. /** initial size and increment of the state/value stack [default 256].
  232. This is not final so that it can be overwritten outside of invocations
  233. of yyparse().
  234. */
  235. protected int yyMax;
  236. /** executed at the beginning of a reduce action.
  237. Used as $$ = yyDefault($1), prior to the user-specified action, if any.
  238. Can be overwritten to provide deep copy, etc.
  239. @param first value for $1, or null.
  240. @return first.
  241. */
  242. protected Object yyDefault (Object first) {
  243. return first;
  244. }
  245. /** the generated parser.
  246. Maintains a state and a value stack, currently with fixed maximum size.
  247. @param yyLex scanner.
  248. @return result of the last reduction, if any.
  249. @throws yyException on irrecoverable parse error.
  250. */
  251. public Object yyparse (yyParser.yyInput yyLex)
  252. {
  253. if (yyMax <= 0) yyMax = 256; // initial size
  254. int yyState = 0; // state stack ptr
  255. int [] yyStates = new int[yyMax]; // state stack
  256. Object yyVal = null; // value stack ptr
  257. Object [] yyVals = new Object[yyMax]; // value stack
  258. int yyToken = -1; // current input
  259. int yyErrorFlag = 0; // #tks to shift
  260. int yyTop = 0;
  261. goto skip;
  262. yyLoop:
  263. yyTop++;
  264. skip:
  265. for (;; ++ yyTop) {
  266. if (yyTop >= yyStates.Length) { // dynamically increase
  267. int[] i = new int[yyStates.Length+yyMax];
  268. yyStates.CopyTo (i, 0);
  269. yyStates = i;
  270. Object[] o = new Object[yyVals.Length+yyMax];
  271. yyVals.CopyTo (o, 0);
  272. yyVals = o;
  273. }
  274. yyStates[yyTop] = yyState;
  275. yyVals[yyTop] = yyVal;
  276. if (debug != null) debug.push(yyState, yyVal);
  277. yyDiscarded: for (;;) { // discarding a token does not change stack
  278. int yyN;
  279. if ((yyN = yyDefRed[yyState]) == 0) { // else [default] reduce (yyN)
  280. if (yyToken < 0) {
  281. yyToken = yyLex.advance() ? yyLex.token() : 0;
  282. if (debug != null)
  283. debug.lex(yyState, yyToken, yyname(yyToken), yyLex.value());
  284. }
  285. if ((yyN = yySindex[yyState]) != 0 && ((yyN += yyToken) >= 0)
  286. && (yyN < yyTable.Length) && (yyCheck[yyN] == yyToken)) {
  287. if (debug != null)
  288. debug.shift(yyState, yyTable[yyN], yyErrorFlag-1);
  289. yyState = yyTable[yyN]; // shift to yyN
  290. yyVal = yyLex.value();
  291. yyToken = -1;
  292. if (yyErrorFlag > 0) -- yyErrorFlag;
  293. goto yyLoop;
  294. }
  295. if ((yyN = yyRindex[yyState]) != 0 && (yyN += yyToken) >= 0
  296. && yyN < yyTable.Length && yyCheck[yyN] == yyToken)
  297. yyN = yyTable[yyN]; // reduce (yyN)
  298. else
  299. switch (yyErrorFlag) {
  300. case 0:
  301. yyerror("syntax error", yyExpecting(yyState));
  302. if (debug != null) debug.error("syntax error");
  303. goto case 1;
  304. case 1: case 2:
  305. yyErrorFlag = 3;
  306. do {
  307. if ((yyN = yySindex[yyStates[yyTop]]) != 0
  308. && (yyN += Token.yyErrorCode) >= 0 && yyN < yyTable.Length
  309. && yyCheck[yyN] == Token.yyErrorCode) {
  310. if (debug != null)
  311. debug.shift(yyStates[yyTop], yyTable[yyN], 3);
  312. yyState = yyTable[yyN];
  313. yyVal = yyLex.value();
  314. goto yyLoop;
  315. }
  316. if (debug != null) debug.pop(yyStates[yyTop]);
  317. } while (-- yyTop >= 0);
  318. if (debug != null) debug.reject();
  319. throw new yyParser.yyException("irrecoverable syntax error");
  320. case 3:
  321. if (yyToken == 0) {
  322. if (debug != null) debug.reject();
  323. throw new yyParser.yyException("irrecoverable syntax error at end-of-file");
  324. }
  325. if (debug != null)
  326. debug.discard(yyState, yyToken, yyname(yyToken),
  327. yyLex.value());
  328. yyToken = -1;
  329. goto yyDiscarded; // leave stack alone
  330. }
  331. }
  332. int yyV = yyTop + 1-yyLen[yyN];
  333. if (debug != null)
  334. debug.reduce(yyState, yyStates[yyV-1], yyN, yyRule[yyN], yyLen[yyN]);
  335. yyVal = yyDefault(yyV > yyTop ? null : yyVals[yyV]);
  336. switch (yyN) {
  337. case 3:
  338. #line 133 "Parser.jay"
  339. {
  340. yyVal = new ExprOR ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
  341. }
  342. break;
  343. case 5:
  344. #line 141 "Parser.jay"
  345. {
  346. yyVal = new ExprAND ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
  347. }
  348. break;
  349. case 7:
  350. #line 149 "Parser.jay"
  351. {
  352. yyVal = new ExprEQ ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
  353. }
  354. break;
  355. case 8:
  356. #line 153 "Parser.jay"
  357. {
  358. yyVal = new ExprNE ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
  359. }
  360. break;
  361. case 10:
  362. #line 161 "Parser.jay"
  363. {
  364. yyVal = new ExprLT ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
  365. }
  366. break;
  367. case 11:
  368. #line 165 "Parser.jay"
  369. {
  370. yyVal = new ExprGT ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
  371. }
  372. break;
  373. case 12:
  374. #line 169 "Parser.jay"
  375. {
  376. yyVal = new ExprLE ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
  377. }
  378. break;
  379. case 13:
  380. #line 173 "Parser.jay"
  381. {
  382. yyVal = new ExprGE ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
  383. }
  384. break;
  385. case 15:
  386. #line 181 "Parser.jay"
  387. {
  388. yyVal = new ExprPLUS ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
  389. }
  390. break;
  391. case 16:
  392. #line 185 "Parser.jay"
  393. {
  394. yyVal = new ExprMINUS ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
  395. }
  396. break;
  397. case 18:
  398. #line 193 "Parser.jay"
  399. {
  400. yyVal = new ExprMULT ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
  401. }
  402. break;
  403. case 19:
  404. #line 197 "Parser.jay"
  405. {
  406. yyVal = new ExprDIV ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
  407. }
  408. break;
  409. case 20:
  410. #line 201 "Parser.jay"
  411. {
  412. yyVal = new ExprMOD ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
  413. }
  414. break;
  415. case 22:
  416. #line 209 "Parser.jay"
  417. {
  418. yyVal = new ExprNEG ((Expression) yyVals[0+yyTop]);
  419. }
  420. break;
  421. case 24:
  422. #line 217 "Parser.jay"
  423. {
  424. yyVal = new ExprUNION ((NodeSet) yyVals[-2+yyTop], (NodeSet) yyVals[0+yyTop]);
  425. }
  426. break;
  427. case 26:
  428. #line 225 "Parser.jay"
  429. {
  430. yyVal = new ExprRoot ();
  431. }
  432. break;
  433. case 27:
  434. #line 229 "Parser.jay"
  435. {
  436. yyVal = new ExprSLASH (new ExprRoot (), (NodeSet) yyVals[0+yyTop]);
  437. }
  438. break;
  439. case 28:
  440. #line 233 "Parser.jay"
  441. {
  442. ExprStep exprStep = new ExprStep (new NodeTypeTest (Axes.DescendantOrSelf, XPathNodeType.All));
  443. yyVal = new ExprSLASH (new ExprSLASH (new ExprRoot (), exprStep), (NodeSet) yyVals[0+yyTop]);
  444. }
  445. break;
  446. case 30:
  447. #line 239 "Parser.jay"
  448. {
  449. yyVal = new ExprSLASH ((Expression) yyVals[-2+yyTop], (NodeSet) yyVals[0+yyTop]);
  450. }
  451. break;
  452. case 31:
  453. #line 243 "Parser.jay"
  454. {
  455. ExprStep exprStep = new ExprStep (new NodeTypeTest (Axes.DescendantOrSelf, XPathNodeType.All));
  456. yyVal = new ExprSLASH (new ExprSLASH ((Expression) yyVals[-2+yyTop], exprStep), (NodeSet) yyVals[0+yyTop]);
  457. }
  458. break;
  459. case 33:
  460. #line 252 "Parser.jay"
  461. {
  462. yyVal = new ExprSLASH ((Expression) yyVals[-2+yyTop], (NodeSet) yyVals[0+yyTop]);
  463. }
  464. break;
  465. case 34:
  466. #line 256 "Parser.jay"
  467. {
  468. ExprStep exprStep = new ExprStep (new NodeTypeTest (Axes.DescendantOrSelf, XPathNodeType.All));
  469. yyVal = new ExprSLASH (new ExprSLASH ((Expression) yyVals[-2+yyTop], exprStep), (NodeSet) yyVals[0+yyTop]);
  470. }
  471. break;
  472. case 35:
  473. #line 264 "Parser.jay"
  474. {
  475. yyVal = new ExprStep (new NodeNameTest ((Axes) yyVals[-2+yyTop], (QName) yyVals[-1+yyTop]), (ExprPredicates) yyVals[0+yyTop]);
  476. }
  477. break;
  478. case 36:
  479. #line 268 "Parser.jay"
  480. {
  481. yyVal = new ExprStep (new NodeTypeTest ((Axes) yyVals[-2+yyTop]), (ExprPredicates) yyVals[0+yyTop]);
  482. }
  483. break;
  484. case 37:
  485. #line 272 "Parser.jay"
  486. {
  487. yyVal = new ExprStep (new NodeTypeTest ((Axes) yyVals[-5+yyTop], (XPathNodeType) yyVals[-4+yyTop], (String) yyVals[-2+yyTop]), (ExprPredicates) yyVals[0+yyTop]);
  488. }
  489. break;
  490. case 38:
  491. #line 276 "Parser.jay"
  492. {
  493. yyVal = new ExprStep (new NodeTypeTest (Axes.Self, XPathNodeType.All));
  494. }
  495. break;
  496. case 39:
  497. #line 280 "Parser.jay"
  498. {
  499. yyVal = new ExprStep (new NodeTypeTest (Axes.Parent, XPathNodeType.All));
  500. }
  501. break;
  502. case 40:
  503. #line 287 "Parser.jay"
  504. {
  505. yyVal = Axes.Child;
  506. }
  507. break;
  508. case 41:
  509. #line 291 "Parser.jay"
  510. {
  511. yyVal = Axes.Attribute;
  512. }
  513. break;
  514. case 42:
  515. #line 295 "Parser.jay"
  516. {
  517. yyVal = yyVals[-1+yyTop];
  518. }
  519. break;
  520. case 43:
  521. #line 301 "Parser.jay"
  522. { yyVal = XPathNodeType.Comment; }
  523. break;
  524. case 44:
  525. #line 302 "Parser.jay"
  526. { yyVal = XPathNodeType.Text; }
  527. break;
  528. case 45:
  529. #line 303 "Parser.jay"
  530. { yyVal = XPathNodeType.ProcessingInstruction; }
  531. break;
  532. case 46:
  533. #line 304 "Parser.jay"
  534. { yyVal = XPathNodeType.All; }
  535. break;
  536. case 48:
  537. #line 311 "Parser.jay"
  538. {
  539. yyVal = new ExprFilter ((Expression) yyVals[-1+yyTop], (Expression) yyVals[0+yyTop]);
  540. }
  541. break;
  542. case 49:
  543. #line 318 "Parser.jay"
  544. {
  545. yyVal = new ExprVariable ((QName) yyVals[0+yyTop]);
  546. }
  547. break;
  548. case 50:
  549. #line 322 "Parser.jay"
  550. {
  551. yyVal = yyVals[-1+yyTop];
  552. }
  553. break;
  554. case 51:
  555. #line 326 "Parser.jay"
  556. {
  557. yyVal = new ExprLiteral ((String) yyVals[0+yyTop]);
  558. }
  559. break;
  560. case 52:
  561. #line 330 "Parser.jay"
  562. {
  563. yyVal = new ExprNumber ((double) yyVals[0+yyTop]);
  564. }
  565. break;
  566. case 54:
  567. #line 338 "Parser.jay"
  568. {
  569. yyVal = new ExprFunctionCall ((String) yyVals[-3+yyTop], (FunctionArguments) yyVals[-1+yyTop]);
  570. }
  571. break;
  572. case 56:
  573. #line 346 "Parser.jay"
  574. {
  575. yyVal = new FunctionArguments ((Expression) yyVals[-1+yyTop], (FunctionArguments) yyVals[0+yyTop]);
  576. }
  577. break;
  578. case 58:
  579. #line 354 "Parser.jay"
  580. {
  581. yyVal = new FunctionArguments ((Expression) yyVals[-1+yyTop], (FunctionArguments) yyVals[0+yyTop]);
  582. }
  583. break;
  584. case 60:
  585. #line 363 "Parser.jay"
  586. {
  587. yyVal = new ExprPredicates ((Expression) yyVals[-1+yyTop], (ExprPredicates) yyVals[0+yyTop]);
  588. }
  589. break;
  590. case 61:
  591. #line 370 "Parser.jay"
  592. {
  593. yyVal = yyVals[-1+yyTop];
  594. }
  595. break;
  596. case 62:
  597. #line 376 "Parser.jay"
  598. { yyVal = Axes.Ancestor; }
  599. break;
  600. case 63:
  601. #line 377 "Parser.jay"
  602. { yyVal = Axes.AncestorOrSelf; }
  603. break;
  604. case 64:
  605. #line 378 "Parser.jay"
  606. { yyVal = Axes.Attribute; }
  607. break;
  608. case 65:
  609. #line 379 "Parser.jay"
  610. { yyVal = Axes.Child; }
  611. break;
  612. case 66:
  613. #line 380 "Parser.jay"
  614. { yyVal = Axes.Descendant; }
  615. break;
  616. case 67:
  617. #line 381 "Parser.jay"
  618. { yyVal = Axes.DescendantOrSelf; }
  619. break;
  620. case 68:
  621. #line 382 "Parser.jay"
  622. { yyVal = Axes.Following; }
  623. break;
  624. case 69:
  625. #line 383 "Parser.jay"
  626. { yyVal = Axes.FollowingSibling; }
  627. break;
  628. case 70:
  629. #line 384 "Parser.jay"
  630. { yyVal = Axes.Namespace; }
  631. break;
  632. case 71:
  633. #line 385 "Parser.jay"
  634. { yyVal = Axes.Parent; }
  635. break;
  636. case 72:
  637. #line 386 "Parser.jay"
  638. { yyVal = Axes.Preceding; }
  639. break;
  640. case 73:
  641. #line 387 "Parser.jay"
  642. { yyVal = Axes.PrecedingSibling; }
  643. break;
  644. case 74:
  645. #line 388 "Parser.jay"
  646. { yyVal = Axes.Self; }
  647. break;
  648. case 77:
  649. #line 398 "Parser.jay"
  650. {
  651. yyVal = new NCName ((String) yyVals[0+yyTop]);
  652. }
  653. break;
  654. case 78:
  655. #line 402 "Parser.jay"
  656. {
  657. yyVal = new QName ((String) yyVals[-2+yyTop], null);
  658. }
  659. break;
  660. case 79:
  661. #line 406 "Parser.jay"
  662. {
  663. yyVal = new QName ((String) yyVals[-2+yyTop], (String) yyVals[0+yyTop]);
  664. }
  665. break;
  666. #line 691 "-"
  667. }
  668. yyTop -= yyLen[yyN];
  669. yyState = yyStates[yyTop];
  670. int yyM = yyLhs[yyN];
  671. if (yyState == 0 && yyM == 0) {
  672. if (debug != null) debug.shift(0, yyFinal);
  673. yyState = yyFinal;
  674. if (yyToken < 0) {
  675. yyToken = yyLex.advance() ? yyLex.token() : 0;
  676. if (debug != null)
  677. debug.lex(yyState, yyToken,yyname(yyToken), yyLex.value());
  678. }
  679. if (yyToken == 0) {
  680. if (debug != null) debug.accept(yyVal);
  681. return yyVal;
  682. }
  683. goto yyLoop;
  684. }
  685. if (((yyN = yyGindex[yyM]) != 0) && ((yyN += yyState) >= 0)
  686. && (yyN < yyTable.Length) && (yyCheck[yyN] == yyState))
  687. yyState = yyTable[yyN];
  688. else
  689. yyState = yyDgoto[yyM];
  690. if (debug != null) debug.shift(yyStates[yyTop], yyState);
  691. goto yyLoop;
  692. }
  693. }
  694. }
  695. static short [] yyLhs = { -1,
  696. 0, 1, 1, 2, 2, 3, 3, 3, 4, 4,
  697. 4, 4, 4, 5, 5, 5, 6, 6, 6, 6,
  698. 7, 7, 8, 8, 9, 9, 9, 9, 9, 9,
  699. 9, 10, 10, 10, 12, 12, 12, 12, 12, 13,
  700. 13, 13, 16, 16, 16, 16, 11, 11, 19, 19,
  701. 19, 19, 19, 21, 22, 22, 23, 23, 15, 15,
  702. 20, 18, 18, 18, 18, 18, 18, 18, 18, 18,
  703. 18, 18, 18, 18, 17, 17, 14, 14, 14,
  704. };
  705. static short [] yyLen = { 2,
  706. 1, 1, 3, 1, 3, 1, 3, 3, 1, 3,
  707. 3, 3, 3, 1, 3, 3, 1, 3, 3, 3,
  708. 1, 2, 1, 3, 1, 1, 2, 2, 1, 3,
  709. 3, 1, 3, 3, 3, 3, 6, 1, 1, 0,
  710. 1, 2, 1, 1, 1, 1, 1, 2, 2, 3,
  711. 1, 1, 1, 4, 0, 2, 0, 3, 0, 2,
  712. 3, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  713. 1, 1, 1, 1, 0, 1, 1, 3, 3,
  714. };
  715. static short [] yyDefRed = { 0,
  716. 0, 0, 38, 39, 41, 0, 0, 0, 0, 62,
  717. 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
  718. 73, 74, 52, 51, 0, 0, 0, 0, 0, 0,
  719. 0, 17, 0, 23, 0, 0, 32, 0, 0, 47,
  720. 53, 0, 0, 0, 0, 22, 0, 49, 0, 0,
  721. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  722. 0, 0, 0, 0, 0, 0, 0, 48, 0, 43,
  723. 44, 45, 46, 0, 0, 42, 0, 0, 50, 0,
  724. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  725. 19, 20, 18, 24, 33, 34, 0, 0, 0, 36,
  726. 0, 35, 0, 0, 56, 54, 78, 79, 61, 60,
  727. 76, 0, 0, 0, 58, 37,
  728. };
  729. protected static short [] yyDgoto = { 25,
  730. 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
  731. 36, 37, 38, 48, 100, 75, 112, 39, 40, 101,
  732. 41, 78, 105,
  733. };
  734. protected static short [] yySindex = { -231,
  735. -97, -97, 0, 0, 0, -263, -231, -231, -318, 0,
  736. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  737. 0, 0, 0, 0, 0, -256, -250, -282, -273, -259,
  738. -268, 0, -257, 0, -219, -255, 0, -252, -230, 0,
  739. 0, -219, -219, -231, -223, 0, -206, 0, -231, -231,
  740. -231, -231, -231, -231, -231, -231, -231, -231, -231, -231,
  741. -231, -157, -97, -97, -97, -97, -231, 0, -204, 0,
  742. 0, 0, 0, -204, -194, 0, -199, -183, 0, -276,
  743. -250, -282, -273, -273, -259, -259, -259, -259, -268, -268,
  744. 0, 0, 0, 0, 0, 0, -219, -219, -176, 0,
  745. -204, 0, -234, -231, 0, 0, 0, 0, 0, 0,
  746. 0, -170, -199, -204, 0, 0,
  747. };
  748. protected static short [] yyRindex = { -240,
  749. 1, -240, 0, 0, 0, 0, -240, -240, 0, 0,
  750. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  751. 0, 0, 0, 0, 0, 19, 2, 92, 27, 391,
  752. 307, 0, 281, 0, 125, 151, 0, 0, 0, 0,
  753. 0, 177, 203, -271, 0, 0, 61, 0, -240, -240,
  754. -240, -240, -240, -240, -240, -240, -240, -240, -240, -240,
  755. -240, -240, -240, -240, -240, -240, -240, 0, 99, 0,
  756. 0, 0, 0, 99, 0, 0, -165, 0, 0, 0,
  757. 424, 398, 34, 521, 417, 443, 469, 495, 336, 362,
  758. 0, 0, 0, 0, 0, 0, 229, 255, 0, 0,
  759. 99, 0, -164, -240, 0, 0, 0, 0, 0, 0,
  760. 0, 0, -165, 99, 0, 0,
  761. };
  762. protected static short [] yyGindex = { -7,
  763. 0, 62, 65, -5, 64, -8, 4, 0, 52, 42,
  764. 0, 31, 0, 83, -66, 0, 0, 0, 0, 86,
  765. 0, 0, 10,
  766. };
  767. protected static short [] yyTable = { 45,
  768. 26, 2, 55, 65, 66, 51, 52, 102, 107, 44,
  769. 59, 46, 60, 40, 47, 67, 61, 53, 1, 54,
  770. 49, 55, 56, 57, 58, 50, 6, 1, 2, 62,
  771. 3, 4, 69, 7, 110, 76, 77, 5, 6, 63,
  772. 64, 7, 42, 43, 40, 83, 84, 116, 89, 90,
  773. 79, 40, 8, 40, 9, 40, 108, 40, 80, 99,
  774. 77, 40, 91, 92, 93, 10, 67, 11, 104, 12,
  775. 70, 13, 71, 14, 72, 15, 73, 16, 103, 17,
  776. 47, 18, 40, 19, 40, 20, 40, 21, 40, 22,
  777. 106, 4, 40, 95, 96, 109, 113, 111, 59, 23,
  778. 24, 1, 2, 114, 3, 4, 97, 98, 57, 75,
  779. 81, 5, 6, 94, 82, 7, 85, 86, 87, 88,
  780. 74, 68, 115, 0, 25, 0, 0, 0, 9, 0,
  781. 0, 0, 0, 0, 0, 0, 0, 0, 0, 10,
  782. 0, 11, 0, 12, 0, 13, 0, 14, 0, 15,
  783. 29, 16, 0, 17, 0, 18, 0, 19, 0, 20,
  784. 0, 21, 0, 22, 3, 4, 0, 0, 0, 0,
  785. 0, 5, 0, 23, 24, 0, 27, 0, 0, 0,
  786. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  787. 0, 0, 0, 0, 0, 0, 0, 0, 0, 10,
  788. 0, 11, 28, 12, 0, 13, 0, 14, 0, 15,
  789. 0, 16, 0, 17, 0, 18, 0, 19, 0, 20,
  790. 0, 21, 0, 22, 0, 0, 0, 0, 30, 0,
  791. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  792. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  793. 0, 0, 0, 0, 31, 0, 0, 0, 0, 0,
  794. 0, 0, 0, 0, 0, 0, 0, 0, 26, 2,
  795. 0, 0, 26, 2, 26, 2, 26, 26, 2, 26,
  796. 21, 26, 0, 26, 26, 26, 1, 26, 26, 26,
  797. 1, 26, 1, 26, 6, 26, 26, 0, 6, 0,
  798. 6, 7, 6, 6, 0, 7, 14, 7, 0, 7,
  799. 7, 0, 0, 0, 6, 6, 0, 0, 0, 77,
  800. 77, 7, 7, 40, 0, 40, 0, 40, 77, 40,
  801. 0, 77, 77, 40, 77, 15, 77, 77, 0, 77,
  802. 0, 77, 0, 77, 77, 77, 0, 77, 77, 77,
  803. 0, 77, 0, 77, 0, 77, 77, 59, 59, 4,
  804. 0, 16, 0, 4, 0, 4, 59, 4, 4, 0,
  805. 59, 0, 59, 0, 59, 59, 0, 59, 0, 59,
  806. 0, 59, 59, 59, 0, 59, 59, 59, 0, 59,
  807. 9, 59, 25, 59, 59, 0, 25, 5, 25, 0,
  808. 25, 25, 0, 25, 0, 25, 0, 25, 25, 25,
  809. 0, 25, 25, 25, 0, 25, 12, 25, 29, 25,
  810. 25, 0, 29, 3, 29, 0, 29, 29, 0, 29,
  811. 0, 29, 0, 29, 29, 29, 0, 29, 29, 29,
  812. 0, 29, 13, 29, 27, 29, 29, 0, 27, 0,
  813. 27, 0, 27, 27, 0, 27, 0, 27, 0, 27,
  814. 27, 27, 0, 27, 27, 27, 0, 27, 10, 27,
  815. 28, 27, 27, 0, 28, 0, 28, 0, 28, 28,
  816. 0, 28, 0, 28, 0, 28, 28, 28, 0, 28,
  817. 28, 28, 0, 28, 11, 28, 30, 28, 28, 0,
  818. 30, 0, 30, 0, 30, 30, 0, 30, 0, 30,
  819. 0, 30, 30, 30, 0, 30, 30, 30, 0, 30,
  820. 8, 30, 31, 30, 30, 0, 31, 0, 31, 0,
  821. 31, 31, 0, 31, 0, 31, 0, 31, 31, 31,
  822. 0, 31, 31, 31, 0, 31, 0, 31, 21, 31,
  823. 31, 0, 21, 0, 21, 0, 21, 21, 0, 21,
  824. 0, 21, 0, 21, 21, 21, 0, 0, 21, 21,
  825. 0, 21, 0, 21, 14, 21, 21, 0, 14, 0,
  826. 14, 0, 14, 14, 0, 0, 0, 0, 0, 14,
  827. 14, 0, 0, 0, 14, 14, 0, 14, 0, 14,
  828. 0, 14, 14, 15, 0, 0, 0, 15, 0, 15,
  829. 0, 15, 15, 0, 0, 0, 0, 0, 15, 15,
  830. 0, 0, 0, 15, 15, 0, 15, 0, 15, 16,
  831. 15, 15, 0, 16, 0, 16, 0, 16, 16, 0,
  832. 0, 0, 0, 0, 16, 16, 0, 0, 0, 16,
  833. 16, 0, 16, 0, 16, 0, 16, 16, 9, 0,
  834. 0, 0, 9, 0, 9, 5, 9, 9, 0, 5,
  835. 0, 5, 0, 5, 5, 0, 0, 0, 9, 9,
  836. 0, 9, 0, 9, 12, 9, 9, 0, 12, 0,
  837. 12, 3, 12, 12, 0, 3, 0, 3, 0, 0,
  838. 3, 0, 0, 0, 12, 12, 0, 12, 0, 12,
  839. 13, 12, 12, 0, 13, 0, 13, 0, 13, 13,
  840. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  841. 13, 13, 0, 13, 0, 13, 10, 13, 13, 0,
  842. 10, 0, 10, 0, 10, 10, 0, 0, 0, 0,
  843. 0, 0, 0, 0, 0, 0, 10, 10, 0, 10,
  844. 0, 10, 11, 10, 10, 0, 11, 0, 11, 0,
  845. 11, 11, 0, 0, 0, 0, 0, 0, 0, 0,
  846. 0, 0, 11, 11, 0, 11, 0, 11, 8, 11,
  847. 11, 0, 8, 0, 8, 0, 8, 8, 0, 0,
  848. 0, 0, 0, 0, 0, 0, 0, 0, 8, 8,
  849. };
  850. protected static short [] yyCheck = { 7,
  851. 0, 0, 274, 259, 260, 288, 289, 74, 285, 273,
  852. 279, 8, 281, 285, 333, 271, 285, 291, 0, 293,
  853. 277, 295, 296, 283, 284, 276, 0, 259, 260, 287,
  854. 262, 263, 285, 0, 101, 266, 44, 269, 270, 259,
  855. 260, 273, 1, 2, 285, 51, 52, 114, 57, 58,
  856. 274, 323, 284, 325, 286, 327, 333, 329, 265, 67,
  857. 0, 333, 59, 60, 61, 297, 271, 299, 268, 301,
  858. 323, 303, 325, 305, 327, 307, 329, 309, 273, 311,
  859. 333, 313, 323, 315, 325, 317, 327, 319, 329, 321,
  860. 274, 0, 333, 63, 64, 272, 104, 332, 0, 331,
  861. 332, 259, 260, 274, 262, 263, 65, 66, 274, 274,
  862. 49, 269, 270, 62, 50, 273, 53, 54, 55, 56,
  863. 38, 36, 113, -1, 0, -1, -1, -1, 286, -1,
  864. -1, -1, -1, -1, -1, -1, -1, -1, -1, 297,
  865. -1, 299, -1, 301, -1, 303, -1, 305, -1, 307,
  866. 0, 309, -1, 311, -1, 313, -1, 315, -1, 317,
  867. -1, 319, -1, 321, 262, 263, -1, -1, -1, -1,
  868. -1, 269, -1, 331, 332, -1, 0, -1, -1, -1,
  869. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  870. -1, -1, -1, -1, -1, -1, -1, -1, -1, 297,
  871. -1, 299, 0, 301, -1, 303, -1, 305, -1, 307,
  872. -1, 309, -1, 311, -1, 313, -1, 315, -1, 317,
  873. -1, 319, -1, 321, -1, -1, -1, -1, 0, -1,
  874. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  875. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  876. -1, -1, -1, -1, 0, -1, -1, -1, -1, -1,
  877. -1, -1, -1, -1, -1, -1, -1, -1, 268, 268,
  878. -1, -1, 272, 272, 274, 274, 276, 277, 277, 279,
  879. 0, 281, -1, 283, 284, 285, 268, 287, 288, 289,
  880. 272, 291, 274, 293, 268, 295, 296, -1, 272, -1,
  881. 274, 268, 276, 277, -1, 272, 0, 274, -1, 276,
  882. 277, -1, -1, -1, 288, 289, -1, -1, -1, 259,
  883. 260, 288, 289, 323, -1, 325, -1, 327, 268, 329,
  884. -1, 271, 272, 333, 274, 0, 276, 277, -1, 279,
  885. -1, 281, -1, 283, 284, 285, -1, 287, 288, 289,
  886. -1, 291, -1, 293, -1, 295, 296, 259, 260, 268,
  887. -1, 0, -1, 272, -1, 274, 268, 276, 277, -1,
  888. 272, -1, 274, -1, 276, 277, -1, 279, -1, 281,
  889. -1, 283, 284, 285, -1, 287, 288, 289, -1, 291,
  890. 0, 293, 268, 295, 296, -1, 272, 0, 274, -1,
  891. 276, 277, -1, 279, -1, 281, -1, 283, 284, 285,
  892. -1, 287, 288, 289, -1, 291, 0, 293, 268, 295,
  893. 296, -1, 272, 0, 274, -1, 276, 277, -1, 279,
  894. -1, 281, -1, 283, 284, 285, -1, 287, 288, 289,
  895. -1, 291, 0, 293, 268, 295, 296, -1, 272, -1,
  896. 274, -1, 276, 277, -1, 279, -1, 281, -1, 283,
  897. 284, 285, -1, 287, 288, 289, -1, 291, 0, 293,
  898. 268, 295, 296, -1, 272, -1, 274, -1, 276, 277,
  899. -1, 279, -1, 281, -1, 283, 284, 285, -1, 287,
  900. 288, 289, -1, 291, 0, 293, 268, 295, 296, -1,
  901. 272, -1, 274, -1, 276, 277, -1, 279, -1, 281,
  902. -1, 283, 284, 285, -1, 287, 288, 289, -1, 291,
  903. 0, 293, 268, 295, 296, -1, 272, -1, 274, -1,
  904. 276, 277, -1, 279, -1, 281, -1, 283, 284, 285,
  905. -1, 287, 288, 289, -1, 291, -1, 293, 268, 295,
  906. 296, -1, 272, -1, 274, -1, 276, 277, -1, 279,
  907. -1, 281, -1, 283, 284, 285, -1, -1, 288, 289,
  908. -1, 291, -1, 293, 268, 295, 296, -1, 272, -1,
  909. 274, -1, 276, 277, -1, -1, -1, -1, -1, 283,
  910. 284, -1, -1, -1, 288, 289, -1, 291, -1, 293,
  911. -1, 295, 296, 268, -1, -1, -1, 272, -1, 274,
  912. -1, 276, 277, -1, -1, -1, -1, -1, 283, 284,
  913. -1, -1, -1, 288, 289, -1, 291, -1, 293, 268,
  914. 295, 296, -1, 272, -1, 274, -1, 276, 277, -1,
  915. -1, -1, -1, -1, 283, 284, -1, -1, -1, 288,
  916. 289, -1, 291, -1, 293, -1, 295, 296, 268, -1,
  917. -1, -1, 272, -1, 274, 268, 276, 277, -1, 272,
  918. -1, 274, -1, 276, 277, -1, -1, -1, 288, 289,
  919. -1, 291, -1, 293, 268, 295, 296, -1, 272, -1,
  920. 274, 268, 276, 277, -1, 272, -1, 274, -1, -1,
  921. 277, -1, -1, -1, 288, 289, -1, 291, -1, 293,
  922. 268, 295, 296, -1, 272, -1, 274, -1, 276, 277,
  923. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  924. 288, 289, -1, 291, -1, 293, 268, 295, 296, -1,
  925. 272, -1, 274, -1, 276, 277, -1, -1, -1, -1,
  926. -1, -1, -1, -1, -1, -1, 288, 289, -1, 291,
  927. -1, 293, 268, 295, 296, -1, 272, -1, 274, -1,
  928. 276, 277, -1, -1, -1, -1, -1, -1, -1, -1,
  929. -1, -1, 288, 289, -1, 291, -1, 293, 268, 295,
  930. 296, -1, 272, -1, 274, -1, 276, 277, -1, -1,
  931. -1, -1, -1, -1, -1, -1, -1, -1, 288, 289,
  932. };
  933. #line 412 "Parser.jay"
  934. }
  935. #line 962 "-"
  936. namespace yydebug {
  937. using System;
  938. public interface yyDebug {
  939. void push (int state, Object value);
  940. void lex (int state, int token, string name, Object value);
  941. void shift (int from, int to, int errorFlag);
  942. void pop (int state);
  943. void discard (int state, int token, string name, Object value);
  944. void reduce (int from, int to, int rule, string text, int len);
  945. void shift (int from, int to);
  946. void accept (Object value);
  947. void error (string message);
  948. void reject ();
  949. }
  950. class yyDebugSimple : yyDebug {
  951. void println (string s){
  952. Console.WriteLine (s);
  953. }
  954. public void push (int state, Object value) {
  955. println ("push\tstate "+state+"\tvalue "+value);
  956. }
  957. public void lex (int state, int token, string name, Object value) {
  958. println("lex\tstate "+state+"\treading "+name+"\tvalue "+value);
  959. }
  960. public void shift (int from, int to, int errorFlag) {
  961. switch (errorFlag) {
  962. default: // normally
  963. println("shift\tfrom state "+from+" to "+to);
  964. break;
  965. case 0: case 1: case 2: // in error recovery
  966. println("shift\tfrom state "+from+" to "+to
  967. +"\t"+errorFlag+" left to recover");
  968. break;
  969. case 3: // normally
  970. println("shift\tfrom state "+from+" to "+to+"\ton error");
  971. break;
  972. }
  973. }
  974. public void pop (int state) {
  975. println("pop\tstate "+state+"\ton error");
  976. }
  977. public void discard (int state, int token, string name, Object value) {
  978. println("discard\tstate "+state+"\ttoken "+name+"\tvalue "+value);
  979. }
  980. public void reduce (int from, int to, int rule, string text, int len) {
  981. println("reduce\tstate "+from+"\tuncover "+to
  982. +"\trule ("+rule+") "+text);
  983. }
  984. public void shift (int from, int to) {
  985. println("goto\tfrom state "+from+" to "+to);
  986. }
  987. public void accept (Object value) {
  988. println("accept\tvalue "+value);
  989. }
  990. public void error (string message) {
  991. println("error\t"+message);
  992. }
  993. public void reject () {
  994. println("reject");
  995. }
  996. }
  997. }
  998. // %token constants
  999. class Token {
  1000. public const int ERROR = 257;
  1001. public const int EOF = 258;
  1002. public const int SLASH = 259;
  1003. public const int SLASH2 = 260;
  1004. public const int DOT = 262;
  1005. public const int DOT2 = 263;
  1006. public const int COLON = 265;
  1007. public const int COLON2 = 266;
  1008. public const int COMMA = 268;
  1009. public const int AT = 269;
  1010. public const int FUNCTION_NAME = 270;
  1011. public const int BRACKET_OPEN = 271;
  1012. public const int BRACKET_CLOSE = 272;
  1013. public const int PAREN_OPEN = 273;
  1014. public const int PAREN_CLOSE = 274;
  1015. public const int AND = 275;
  1016. public const int and = 276;
  1017. public const int OR = 277;
  1018. public const int or = 278;
  1019. public const int DIV = 279;
  1020. public const int div = 280;
  1021. public const int MOD = 281;
  1022. public const int mod = 282;
  1023. public const int PLUS = 283;
  1024. public const int MINUS = 284;
  1025. public const int ASTERISK = 285;
  1026. public const int DOLLAR = 286;
  1027. public const int BAR = 287;
  1028. public const int EQ = 288;
  1029. public const int NE = 289;
  1030. public const int LE = 291;
  1031. public const int GE = 293;
  1032. public const int LT = 295;
  1033. public const int GT = 296;
  1034. public const int ANCESTOR = 297;
  1035. public const int ancestor = 298;
  1036. public const int ANCESTOR_OR_SELF = 299;
  1037. public const int ATTRIBUTE = 301;
  1038. public const int attribute = 302;
  1039. public const int CHILD = 303;
  1040. public const int child = 304;
  1041. public const int DESCENDANT = 305;
  1042. public const int descendant = 306;
  1043. public const int DESCENDANT_OR_SELF = 307;
  1044. public const int FOLLOWING = 309;
  1045. public const int following = 310;
  1046. public const int FOLLOWING_SIBLING = 311;
  1047. public const int sibling = 312;
  1048. public const int NAMESPACE = 313;
  1049. public const int NameSpace = 314;
  1050. public const int PARENT = 315;
  1051. public const int parent = 316;
  1052. public const int PRECEDING = 317;
  1053. public const int preceding = 318;
  1054. public const int PRECEDING_SIBLING = 319;
  1055. public const int SELF = 321;
  1056. public const int self = 322;
  1057. public const int COMMENT = 323;
  1058. public const int comment = 324;
  1059. public const int TEXT = 325;
  1060. public const int text = 326;
  1061. public const int PROCESSING_INSTRUCTION = 327;
  1062. public const int NODE = 329;
  1063. public const int node = 330;
  1064. public const int NUMBER = 331;
  1065. public const int LITERAL = 332;
  1066. public const int NCName = 333;
  1067. public const int yyErrorCode = 256;
  1068. }
  1069. namespace yyParser {
  1070. using System;
  1071. /** thrown for irrecoverable syntax errors and stack overflow.
  1072. */
  1073. public class yyException : System.Exception {
  1074. public yyException (string message) : base (message) {
  1075. }
  1076. }
  1077. /** must be implemented by a scanner object to supply input to the parser.
  1078. */
  1079. public interface yyInput {
  1080. /** move on to next token.
  1081. @return false if positioned beyond tokens.
  1082. @throws IOException on input error.
  1083. */
  1084. bool advance (); // throws java.io.IOException;
  1085. /** classifies current token.
  1086. Should not be called if advance() returned false.
  1087. @return current %token or single character.
  1088. */
  1089. int token ();
  1090. /** associated with current token.
  1091. Should not be called if advance() returned false.
  1092. @return value for token().
  1093. */
  1094. Object value ();
  1095. }
  1096. }
  1097. } // close outermost namespace, that MUST HAVE BEEN opened in the prolog