Parser.cs 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140
  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 default
  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 MULTIPLY 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\"","MULTIPLY","NUMBER",
  181. "LITERAL","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 134 "Parser.jay"
  339. {
  340. yyVal = new ExprOR ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
  341. }
  342. break;
  343. case 5:
  344. #line 142 "Parser.jay"
  345. {
  346. yyVal = new ExprAND ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
  347. }
  348. break;
  349. case 7:
  350. #line 150 "Parser.jay"
  351. {
  352. yyVal = new ExprEQ ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
  353. }
  354. break;
  355. case 8:
  356. #line 154 "Parser.jay"
  357. {
  358. yyVal = new ExprNE ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
  359. }
  360. break;
  361. case 10:
  362. #line 162 "Parser.jay"
  363. {
  364. yyVal = new ExprLT ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
  365. }
  366. break;
  367. case 11:
  368. #line 166 "Parser.jay"
  369. {
  370. yyVal = new ExprGT ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
  371. }
  372. break;
  373. case 12:
  374. #line 170 "Parser.jay"
  375. {
  376. yyVal = new ExprLE ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
  377. }
  378. break;
  379. case 13:
  380. #line 174 "Parser.jay"
  381. {
  382. yyVal = new ExprGE ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
  383. }
  384. break;
  385. case 15:
  386. #line 182 "Parser.jay"
  387. {
  388. yyVal = new ExprPLUS ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
  389. }
  390. break;
  391. case 16:
  392. #line 186 "Parser.jay"
  393. {
  394. yyVal = new ExprMINUS ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
  395. }
  396. break;
  397. case 18:
  398. #line 194 "Parser.jay"
  399. {
  400. yyVal = new ExprMULT ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
  401. }
  402. break;
  403. case 19:
  404. #line 198 "Parser.jay"
  405. {
  406. yyVal = new ExprDIV ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
  407. }
  408. break;
  409. case 20:
  410. #line 202 "Parser.jay"
  411. {
  412. yyVal = new ExprMOD ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
  413. }
  414. break;
  415. case 22:
  416. #line 210 "Parser.jay"
  417. {
  418. yyVal = new ExprNEG ((Expression) yyVals[0+yyTop]);
  419. }
  420. break;
  421. case 24:
  422. #line 218 "Parser.jay"
  423. {
  424. yyVal = new ExprUNION ((NodeSet) yyVals[-2+yyTop], (NodeSet) yyVals[0+yyTop]);
  425. }
  426. break;
  427. case 26:
  428. #line 226 "Parser.jay"
  429. {
  430. yyVal = new ExprRoot ();
  431. }
  432. break;
  433. case 27:
  434. #line 230 "Parser.jay"
  435. {
  436. yyVal = new ExprSLASH (new ExprRoot (), (NodeSet) yyVals[0+yyTop]);
  437. }
  438. break;
  439. case 28:
  440. #line 234 "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 240 "Parser.jay"
  448. {
  449. yyVal = new ExprSLASH ((Expression) yyVals[-2+yyTop], (NodeSet) yyVals[0+yyTop]);
  450. }
  451. break;
  452. case 31:
  453. #line 244 "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 253 "Parser.jay"
  461. {
  462. yyVal = new ExprSLASH ((Expression) yyVals[-2+yyTop], (NodeSet) yyVals[0+yyTop]);
  463. }
  464. break;
  465. case 34:
  466. #line 257 "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 265 "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 269 "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 273 "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 277 "Parser.jay"
  492. {
  493. yyVal = new ExprStep (new NodeTypeTest (Axes.Self, XPathNodeType.All));
  494. }
  495. break;
  496. case 39:
  497. #line 281 "Parser.jay"
  498. {
  499. yyVal = new ExprStep (new NodeTypeTest (Axes.Parent, XPathNodeType.All));
  500. }
  501. break;
  502. case 40:
  503. #line 288 "Parser.jay"
  504. {
  505. yyVal = Axes.Child;
  506. }
  507. break;
  508. case 41:
  509. #line 292 "Parser.jay"
  510. {
  511. yyVal = Axes.Attribute;
  512. }
  513. break;
  514. case 42:
  515. #line 296 "Parser.jay"
  516. {
  517. yyVal = yyVals[-1+yyTop];
  518. }
  519. break;
  520. case 43:
  521. #line 302 "Parser.jay"
  522. { yyVal = XPathNodeType.Comment; }
  523. break;
  524. case 44:
  525. #line 303 "Parser.jay"
  526. { yyVal = XPathNodeType.Text; }
  527. break;
  528. case 45:
  529. #line 304 "Parser.jay"
  530. { yyVal = XPathNodeType.ProcessingInstruction; }
  531. break;
  532. case 46:
  533. #line 305 "Parser.jay"
  534. { yyVal = XPathNodeType.All; }
  535. break;
  536. case 48:
  537. #line 312 "Parser.jay"
  538. {
  539. yyVal = new ExprFilter ((Expression) yyVals[-1+yyTop], (Expression) yyVals[0+yyTop]);
  540. }
  541. break;
  542. case 49:
  543. #line 319 "Parser.jay"
  544. {
  545. yyVal = new ExprVariable ((QName) yyVals[0+yyTop]);
  546. }
  547. break;
  548. case 50:
  549. #line 323 "Parser.jay"
  550. {
  551. yyVal = yyVals[-1+yyTop];
  552. }
  553. break;
  554. case 51:
  555. #line 327 "Parser.jay"
  556. {
  557. yyVal = new ExprLiteral ((String) yyVals[0+yyTop]);
  558. }
  559. break;
  560. case 52:
  561. #line 331 "Parser.jay"
  562. {
  563. yyVal = new ExprNumber ((double) yyVals[0+yyTop]);
  564. }
  565. break;
  566. case 54:
  567. #line 339 "Parser.jay"
  568. {
  569. yyVal = new ExprFunctionCall ((String) yyVals[-3+yyTop], (FunctionArguments) yyVals[-1+yyTop]);
  570. }
  571. break;
  572. case 56:
  573. #line 347 "Parser.jay"
  574. {
  575. yyVal = new FunctionArguments ((Expression) yyVals[-1+yyTop], (FunctionArguments) yyVals[0+yyTop]);
  576. }
  577. break;
  578. case 58:
  579. #line 355 "Parser.jay"
  580. {
  581. yyVal = new FunctionArguments ((Expression) yyVals[-1+yyTop], (FunctionArguments) yyVals[0+yyTop]);
  582. }
  583. break;
  584. case 60:
  585. #line 364 "Parser.jay"
  586. {
  587. yyVal = new ExprPredicates ((Expression) yyVals[-1+yyTop], (ExprPredicates) yyVals[0+yyTop]);
  588. }
  589. break;
  590. case 61:
  591. #line 371 "Parser.jay"
  592. {
  593. yyVal = yyVals[-1+yyTop];
  594. }
  595. break;
  596. case 62:
  597. #line 377 "Parser.jay"
  598. { yyVal = Axes.Ancestor; }
  599. break;
  600. case 63:
  601. #line 378 "Parser.jay"
  602. { yyVal = Axes.AncestorOrSelf; }
  603. break;
  604. case 64:
  605. #line 379 "Parser.jay"
  606. { yyVal = Axes.Attribute; }
  607. break;
  608. case 65:
  609. #line 380 "Parser.jay"
  610. { yyVal = Axes.Child; }
  611. break;
  612. case 66:
  613. #line 381 "Parser.jay"
  614. { yyVal = Axes.Descendant; }
  615. break;
  616. case 67:
  617. #line 382 "Parser.jay"
  618. { yyVal = Axes.DescendantOrSelf; }
  619. break;
  620. case 68:
  621. #line 383 "Parser.jay"
  622. { yyVal = Axes.Following; }
  623. break;
  624. case 69:
  625. #line 384 "Parser.jay"
  626. { yyVal = Axes.FollowingSibling; }
  627. break;
  628. case 70:
  629. #line 385 "Parser.jay"
  630. { yyVal = Axes.Namespace; }
  631. break;
  632. case 71:
  633. #line 386 "Parser.jay"
  634. { yyVal = Axes.Parent; }
  635. break;
  636. case 72:
  637. #line 387 "Parser.jay"
  638. { yyVal = Axes.Preceding; }
  639. break;
  640. case 73:
  641. #line 388 "Parser.jay"
  642. { yyVal = Axes.PrecedingSibling; }
  643. break;
  644. case 74:
  645. #line 389 "Parser.jay"
  646. { yyVal = Axes.Self; }
  647. break;
  648. case 77:
  649. #line 399 "Parser.jay"
  650. {
  651. yyVal = new NCName ((String) yyVals[0+yyTop]);
  652. }
  653. break;
  654. case 78:
  655. #line 403 "Parser.jay"
  656. {
  657. yyVal = new QName ((String) yyVals[-2+yyTop], null);
  658. }
  659. break;
  660. case 79:
  661. #line 407 "Parser.jay"
  662. {
  663. yyVal = new QName ((String) yyVals[-2+yyTop], (String) yyVals[0+yyTop]);
  664. }
  665. break;
  666. #line default
  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 = { -252,
  735. -126, -126, 0, 0, 0, -270, -252, -252, -329, 0,
  736. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  737. 0, 0, 0, 0, 0, -265, -249, -260, -271, -241,
  738. -277, 0, -264, 0, -220, -244, 0, -221, -235, 0,
  739. 0, -220, -220, -252, -239, 0, -217, 0, -252, -252,
  740. -252, -252, -252, -252, -252, -252, -252, -252, -252, -252,
  741. -252, -187, -126, -126, -126, -126, -252, 0, -227, 0,
  742. 0, 0, 0, -227, -223, 0, -212, -216, 0, -266,
  743. -249, -260, -271, -271, -241, -241, -241, -241, -277, -277,
  744. 0, 0, 0, 0, 0, 0, -220, -220, -210, 0,
  745. -227, 0, -267, -252, 0, 0, 0, 0, 0, 0,
  746. 0, -195, -212, -227, 0, 0,
  747. };
  748. protected static short [] yyRindex = { -176,
  749. 1, -176, 0, 0, 0, 0, -176, -176, 0, 0,
  750. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  751. 0, 0, 0, 0, 0, 9, 338, 38, 30, 409,
  752. 325, 0, 299, 0, 129, 155, 0, 0, 0, 0,
  753. 0, 184, 210, -233, 0, 0, 74, 0, -176, -176,
  754. -176, -176, -176, -176, -176, -176, -176, -176, -176, -176,
  755. -176, -176, -176, -176, -176, -176, -176, 0, 100, 0,
  756. 0, 0, 0, 100, 0, 0, -183, 0, 0, 0,
  757. 547, 291, 510, 529, 419, 445, 455, 481, 354, 380,
  758. 0, 0, 0, 0, 0, 0, 239, 265, 0, 0,
  759. 100, 0, -181, -176, 0, 0, 0, 0, 0, 0,
  760. 0, 0, -183, 100, 0, 0,
  761. };
  762. protected static short [] yyGindex = { -7,
  763. 0, 46, 48, 19, 85, 27, 28, 0, 41, 12,
  764. 0, 93, 0, 67, -68, 0, 0, 0, 0, 71,
  765. 0, 0, -2,
  766. };
  767. protected static short [] yyTable = { 45,
  768. 26, 59, 44, 60, 47, 102, 1, 2, 1, 3,
  769. 4, 49, 42, 43, 65, 66, 5, 6, 107, 53,
  770. 7, 54, 62, 55, 56, 50, 67, 51, 52, 6,
  771. 76, 8, 110, 9, 79, 46, 77, 4, 63, 64,
  772. 55, 57, 58, 67, 10, 116, 11, 80, 12, 103,
  773. 13, 40, 14, 61, 15, 104, 16, 106, 17, 99,
  774. 18, 109, 19, 69, 20, 111, 21, 108, 22, 83,
  775. 84, 1, 2, 77, 3, 4, 97, 98, 114, 23,
  776. 24, 5, 6, 89, 90, 7, 91, 92, 93, 40,
  777. 57, 40, 75, 40, 81, 40, 113, 82, 9, 59,
  778. 40, 70, 94, 71, 74, 72, 68, 73, 40, 10,
  779. 115, 11, 47, 12, 0, 13, 0, 14, 0, 15,
  780. 0, 16, 0, 17, 0, 18, 0, 19, 25, 20,
  781. 0, 21, 0, 22, 0, 3, 4, 85, 86, 87,
  782. 88, 0, 5, 0, 23, 24, 40, 0, 40, 0,
  783. 40, 0, 40, 0, 29, 95, 96, 40, 0, 0,
  784. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  785. 10, 0, 11, 0, 12, 0, 13, 0, 14, 0,
  786. 15, 0, 16, 27, 17, 0, 18, 0, 19, 0,
  787. 20, 0, 21, 0, 22, 0, 0, 0, 0, 0,
  788. 0, 0, 0, 0, 0, 0, 0, 0, 0, 28,
  789. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  790. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  791. 0, 0, 0, 0, 0, 0, 0, 0, 30, 0,
  792. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  793. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  794. 0, 0, 0, 0, 31, 0, 0, 0, 26, 0,
  795. 0, 0, 26, 0, 26, 26, 1, 26, 0, 26,
  796. 1, 26, 1, 26, 26, 40, 0, 26, 26, 26,
  797. 5, 26, 0, 26, 0, 26, 26, 6, 21, 0,
  798. 0, 6, 0, 6, 6, 4, 6, 0, 0, 4,
  799. 0, 4, 4, 0, 4, 0, 0, 6, 6, 0,
  800. 0, 0, 0, 40, 14, 40, 0, 40, 0, 40,
  801. 0, 26, 77, 77, 40, 0, 0, 2, 0, 0,
  802. 0, 77, 0, 0, 77, 77, 0, 77, 77, 0,
  803. 77, 0, 77, 15, 77, 0, 77, 77, 59, 59,
  804. 77, 77, 77, 0, 77, 0, 77, 59, 77, 77,
  805. 0, 59, 0, 59, 59, 0, 59, 0, 59, 16,
  806. 59, 0, 59, 59, 0, 0, 59, 59, 59, 0,
  807. 59, 0, 59, 0, 59, 59, 25, 0, 0, 0,
  808. 25, 0, 25, 25, 77, 25, 0, 25, 9, 25,
  809. 0, 25, 25, 0, 0, 25, 25, 25, 12, 25,
  810. 0, 25, 29, 25, 25, 0, 29, 0, 29, 29,
  811. 59, 29, 0, 29, 0, 29, 0, 29, 29, 0,
  812. 0, 29, 29, 29, 13, 29, 0, 29, 0, 29,
  813. 29, 27, 0, 0, 10, 27, 0, 27, 27, 25,
  814. 27, 0, 27, 0, 27, 0, 27, 27, 0, 0,
  815. 27, 27, 27, 0, 27, 0, 27, 28, 27, 27,
  816. 11, 28, 0, 28, 28, 29, 28, 0, 28, 0,
  817. 28, 0, 28, 28, 0, 0, 28, 28, 28, 0,
  818. 28, 0, 28, 0, 28, 28, 30, 0, 0, 7,
  819. 30, 0, 30, 30, 27, 30, 0, 30, 0, 30,
  820. 0, 30, 30, 0, 0, 30, 30, 30, 8, 30,
  821. 0, 30, 31, 30, 30, 0, 31, 0, 31, 31,
  822. 28, 31, 0, 31, 0, 31, 3, 31, 31, 0,
  823. 0, 31, 31, 31, 0, 31, 0, 31, 5, 31,
  824. 31, 0, 5, 0, 5, 5, 21, 5, 0, 30,
  825. 21, 0, 21, 21, 0, 21, 0, 21, 0, 21,
  826. 0, 21, 21, 0, 0, 0, 21, 21, 0, 21,
  827. 0, 21, 14, 21, 21, 31, 14, 0, 14, 14,
  828. 0, 14, 0, 0, 0, 2, 0, 14, 14, 2,
  829. 0, 2, 14, 14, 2, 14, 0, 14, 0, 14,
  830. 14, 15, 0, 0, 0, 15, 0, 15, 15, 21,
  831. 15, 0, 0, 0, 0, 0, 15, 15, 0, 0,
  832. 0, 15, 15, 0, 15, 0, 15, 16, 15, 15,
  833. 0, 16, 0, 16, 16, 0, 16, 0, 0, 0,
  834. 0, 0, 16, 16, 0, 0, 0, 16, 16, 0,
  835. 16, 0, 16, 0, 16, 16, 9, 0, 0, 0,
  836. 9, 0, 9, 9, 0, 9, 12, 0, 0, 0,
  837. 12, 0, 12, 12, 0, 12, 9, 9, 0, 9,
  838. 0, 9, 0, 9, 9, 0, 12, 12, 0, 12,
  839. 0, 12, 13, 12, 12, 0, 13, 0, 13, 13,
  840. 0, 13, 10, 0, 0, 0, 10, 0, 10, 10,
  841. 0, 10, 13, 13, 0, 13, 0, 13, 0, 13,
  842. 13, 0, 10, 10, 0, 10, 0, 10, 11, 10,
  843. 10, 0, 11, 0, 11, 11, 0, 11, 0, 0,
  844. 0, 0, 0, 0, 0, 0, 0, 0, 11, 11,
  845. 0, 11, 0, 11, 0, 11, 11, 7, 0, 0,
  846. 0, 7, 0, 7, 7, 0, 7, 0, 0, 0,
  847. 0, 0, 0, 0, 0, 0, 8, 7, 7, 0,
  848. 8, 0, 8, 8, 0, 8, 0, 0, 0, 0,
  849. 0, 0, 0, 0, 3, 0, 8, 8, 3, 0,
  850. 3, 0, 0, 3,
  851. };
  852. protected static short [] yyCheck = { 7,
  853. 0, 279, 273, 281, 334, 74, 259, 260, 0, 262,
  854. 263, 277, 1, 2, 259, 260, 269, 270, 285, 291,
  855. 273, 293, 287, 295, 296, 275, 271, 288, 289, 0,
  856. 266, 284, 101, 286, 274, 8, 44, 0, 259, 260,
  857. 274, 283, 284, 271, 297, 114, 299, 265, 301, 273,
  858. 303, 285, 305, 331, 307, 268, 309, 274, 311, 67,
  859. 313, 272, 315, 285, 317, 333, 319, 334, 321, 51,
  860. 52, 259, 260, 0, 262, 263, 65, 66, 274, 332,
  861. 333, 269, 270, 57, 58, 273, 59, 60, 61, 323,
  862. 274, 325, 274, 327, 49, 329, 104, 50, 286, 0,
  863. 334, 323, 62, 325, 38, 327, 36, 329, 285, 297,
  864. 113, 299, 334, 301, -1, 303, -1, 305, -1, 307,
  865. -1, 309, -1, 311, -1, 313, -1, 315, 0, 317,
  866. -1, 319, -1, 321, -1, 262, 263, 53, 54, 55,
  867. 56, -1, 269, -1, 332, 333, 323, -1, 325, -1,
  868. 327, -1, 329, -1, 0, 63, 64, 334, -1, -1,
  869. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  870. 297, -1, 299, -1, 301, -1, 303, -1, 305, -1,
  871. 307, -1, 309, 0, 311, -1, 313, -1, 315, -1,
  872. 317, -1, 319, -1, 321, -1, -1, -1, -1, -1,
  873. -1, -1, -1, -1, -1, -1, -1, -1, -1, 0,
  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, -1, -1, -1, -1, 0, -1,
  877. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  878. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  879. -1, -1, -1, -1, 0, -1, -1, -1, 268, -1,
  880. -1, -1, 272, -1, 274, 275, 268, 277, -1, 279,
  881. 272, 281, 274, 283, 284, 285, -1, 287, 288, 289,
  882. 0, 291, -1, 293, -1, 295, 296, 268, 0, -1,
  883. -1, 272, -1, 274, 275, 268, 277, -1, -1, 272,
  884. -1, 274, 275, -1, 277, -1, -1, 288, 289, -1,
  885. -1, -1, -1, 323, 0, 325, -1, 327, -1, 329,
  886. -1, 331, 259, 260, 334, -1, -1, 0, -1, -1,
  887. -1, 268, -1, -1, 271, 272, -1, 274, 275, -1,
  888. 277, -1, 279, 0, 281, -1, 283, 284, 259, 260,
  889. 287, 288, 289, -1, 291, -1, 293, 268, 295, 296,
  890. -1, 272, -1, 274, 275, -1, 277, -1, 279, 0,
  891. 281, -1, 283, 284, -1, -1, 287, 288, 289, -1,
  892. 291, -1, 293, -1, 295, 296, 268, -1, -1, -1,
  893. 272, -1, 274, 275, 331, 277, -1, 279, 0, 281,
  894. -1, 283, 284, -1, -1, 287, 288, 289, 0, 291,
  895. -1, 293, 268, 295, 296, -1, 272, -1, 274, 275,
  896. 331, 277, -1, 279, -1, 281, -1, 283, 284, -1,
  897. -1, 287, 288, 289, 0, 291, -1, 293, -1, 295,
  898. 296, 268, -1, -1, 0, 272, -1, 274, 275, 331,
  899. 277, -1, 279, -1, 281, -1, 283, 284, -1, -1,
  900. 287, 288, 289, -1, 291, -1, 293, 268, 295, 296,
  901. 0, 272, -1, 274, 275, 331, 277, -1, 279, -1,
  902. 281, -1, 283, 284, -1, -1, 287, 288, 289, -1,
  903. 291, -1, 293, -1, 295, 296, 268, -1, -1, 0,
  904. 272, -1, 274, 275, 331, 277, -1, 279, -1, 281,
  905. -1, 283, 284, -1, -1, 287, 288, 289, 0, 291,
  906. -1, 293, 268, 295, 296, -1, 272, -1, 274, 275,
  907. 331, 277, -1, 279, -1, 281, 0, 283, 284, -1,
  908. -1, 287, 288, 289, -1, 291, -1, 293, 268, 295,
  909. 296, -1, 272, -1, 274, 275, 268, 277, -1, 331,
  910. 272, -1, 274, 275, -1, 277, -1, 279, -1, 281,
  911. -1, 283, 284, -1, -1, -1, 288, 289, -1, 291,
  912. -1, 293, 268, 295, 296, 331, 272, -1, 274, 275,
  913. -1, 277, -1, -1, -1, 268, -1, 283, 284, 272,
  914. -1, 274, 288, 289, 277, 291, -1, 293, -1, 295,
  915. 296, 268, -1, -1, -1, 272, -1, 274, 275, 331,
  916. 277, -1, -1, -1, -1, -1, 283, 284, -1, -1,
  917. -1, 288, 289, -1, 291, -1, 293, 268, 295, 296,
  918. -1, 272, -1, 274, 275, -1, 277, -1, -1, -1,
  919. -1, -1, 283, 284, -1, -1, -1, 288, 289, -1,
  920. 291, -1, 293, -1, 295, 296, 268, -1, -1, -1,
  921. 272, -1, 274, 275, -1, 277, 268, -1, -1, -1,
  922. 272, -1, 274, 275, -1, 277, 288, 289, -1, 291,
  923. -1, 293, -1, 295, 296, -1, 288, 289, -1, 291,
  924. -1, 293, 268, 295, 296, -1, 272, -1, 274, 275,
  925. -1, 277, 268, -1, -1, -1, 272, -1, 274, 275,
  926. -1, 277, 288, 289, -1, 291, -1, 293, -1, 295,
  927. 296, -1, 288, 289, -1, 291, -1, 293, 268, 295,
  928. 296, -1, 272, -1, 274, 275, -1, 277, -1, -1,
  929. -1, -1, -1, -1, -1, -1, -1, -1, 288, 289,
  930. -1, 291, -1, 293, -1, 295, 296, 268, -1, -1,
  931. -1, 272, -1, 274, 275, -1, 277, -1, -1, -1,
  932. -1, -1, -1, -1, -1, -1, 268, 288, 289, -1,
  933. 272, -1, 274, 275, -1, 277, -1, -1, -1, -1,
  934. -1, -1, -1, -1, 268, -1, 288, 289, 272, -1,
  935. 274, -1, -1, 277,
  936. };
  937. #line 413 "Parser.jay"
  938. }
  939. #line default
  940. namespace yydebug {
  941. using System;
  942. public interface yyDebug {
  943. void push (int state, Object value);
  944. void lex (int state, int token, string name, Object value);
  945. void shift (int from, int to, int errorFlag);
  946. void pop (int state);
  947. void discard (int state, int token, string name, Object value);
  948. void reduce (int from, int to, int rule, string text, int len);
  949. void shift (int from, int to);
  950. void accept (Object value);
  951. void error (string message);
  952. void reject ();
  953. }
  954. class yyDebugSimple : yyDebug {
  955. void println (string s){
  956. Console.WriteLine (s);
  957. }
  958. public void push (int state, Object value) {
  959. println ("push\tstate "+state+"\tvalue "+value);
  960. }
  961. public void lex (int state, int token, string name, Object value) {
  962. println("lex\tstate "+state+"\treading "+name+"\tvalue "+value);
  963. }
  964. public void shift (int from, int to, int errorFlag) {
  965. switch (errorFlag) {
  966. default: // normally
  967. println("shift\tfrom state "+from+" to "+to);
  968. break;
  969. case 0: case 1: case 2: // in error recovery
  970. println("shift\tfrom state "+from+" to "+to
  971. +"\t"+errorFlag+" left to recover");
  972. break;
  973. case 3: // normally
  974. println("shift\tfrom state "+from+" to "+to+"\ton error");
  975. break;
  976. }
  977. }
  978. public void pop (int state) {
  979. println("pop\tstate "+state+"\ton error");
  980. }
  981. public void discard (int state, int token, string name, Object value) {
  982. println("discard\tstate "+state+"\ttoken "+name+"\tvalue "+value);
  983. }
  984. public void reduce (int from, int to, int rule, string text, int len) {
  985. println("reduce\tstate "+from+"\tuncover "+to
  986. +"\trule ("+rule+") "+text);
  987. }
  988. public void shift (int from, int to) {
  989. println("goto\tfrom state "+from+" to "+to);
  990. }
  991. public void accept (Object value) {
  992. println("accept\tvalue "+value);
  993. }
  994. public void error (string message) {
  995. println("error\t"+message);
  996. }
  997. public void reject () {
  998. println("reject");
  999. }
  1000. }
  1001. }
  1002. // %token constants
  1003. class Token {
  1004. public const int ERROR = 257;
  1005. public const int EOF = 258;
  1006. public const int SLASH = 259;
  1007. public const int SLASH2 = 260;
  1008. public const int DOT = 262;
  1009. public const int DOT2 = 263;
  1010. public const int COLON = 265;
  1011. public const int COLON2 = 266;
  1012. public const int COMMA = 268;
  1013. public const int AT = 269;
  1014. public const int FUNCTION_NAME = 270;
  1015. public const int BRACKET_OPEN = 271;
  1016. public const int BRACKET_CLOSE = 272;
  1017. public const int PAREN_OPEN = 273;
  1018. public const int PAREN_CLOSE = 274;
  1019. public const int AND = 275;
  1020. public const int and = 276;
  1021. public const int OR = 277;
  1022. public const int or = 278;
  1023. public const int DIV = 279;
  1024. public const int div = 280;
  1025. public const int MOD = 281;
  1026. public const int mod = 282;
  1027. public const int PLUS = 283;
  1028. public const int MINUS = 284;
  1029. public const int ASTERISK = 285;
  1030. public const int DOLLAR = 286;
  1031. public const int BAR = 287;
  1032. public const int EQ = 288;
  1033. public const int NE = 289;
  1034. public const int LE = 291;
  1035. public const int GE = 293;
  1036. public const int LT = 295;
  1037. public const int GT = 296;
  1038. public const int ANCESTOR = 297;
  1039. public const int ancestor = 298;
  1040. public const int ANCESTOR_OR_SELF = 299;
  1041. public const int ATTRIBUTE = 301;
  1042. public const int attribute = 302;
  1043. public const int CHILD = 303;
  1044. public const int child = 304;
  1045. public const int DESCENDANT = 305;
  1046. public const int descendant = 306;
  1047. public const int DESCENDANT_OR_SELF = 307;
  1048. public const int FOLLOWING = 309;
  1049. public const int following = 310;
  1050. public const int FOLLOWING_SIBLING = 311;
  1051. public const int sibling = 312;
  1052. public const int NAMESPACE = 313;
  1053. public const int NameSpace = 314;
  1054. public const int PARENT = 315;
  1055. public const int parent = 316;
  1056. public const int PRECEDING = 317;
  1057. public const int preceding = 318;
  1058. public const int PRECEDING_SIBLING = 319;
  1059. public const int SELF = 321;
  1060. public const int self = 322;
  1061. public const int COMMENT = 323;
  1062. public const int comment = 324;
  1063. public const int TEXT = 325;
  1064. public const int text = 326;
  1065. public const int PROCESSING_INSTRUCTION = 327;
  1066. public const int NODE = 329;
  1067. public const int node = 330;
  1068. public const int MULTIPLY = 331;
  1069. public const int NUMBER = 332;
  1070. public const int LITERAL = 333;
  1071. public const int NCName = 334;
  1072. public const int yyErrorCode = 256;
  1073. }
  1074. namespace yyParser {
  1075. using System;
  1076. /** thrown for irrecoverable syntax errors and stack overflow.
  1077. */
  1078. public class yyException : System.Exception {
  1079. public yyException (string message) : base (message) {
  1080. }
  1081. }
  1082. /** must be implemented by a scanner object to supply input to the parser.
  1083. */
  1084. public interface yyInput {
  1085. /** move on to next token.
  1086. @return false if positioned beyond tokens.
  1087. @throws IOException on input error.
  1088. */
  1089. bool advance (); // throws java.io.IOException;
  1090. /** classifies current token.
  1091. Should not be called if advance() returned false.
  1092. @return current %token or single character.
  1093. */
  1094. int token ();
  1095. /** associated with current token.
  1096. Should not be called if advance() returned false.
  1097. @return value for token().
  1098. */
  1099. Object value ();
  1100. }
  1101. }
  1102. } // close outermost namespace, that MUST HAVE BEEN opened in the prolog