Пример #1
0
  /** the generated parser.
      Maintains a state and a value stack, currently with fixed maximum size.
      @param yyLex scanner.
      @return result of the last reduction, if any.
      @throws yyException on irrecoverable parse error.
    */
  internal Object yyparse (yyParser.yyInput yyLex)
  {
    if (yyMax <= 0) yyMax = 256;		// initial size
    int yyState = 0;                   // state stack ptr
    int [] yyStates;               	// state stack 
    yyVal = null;
    yyToken = -1;
    int yyErrorFlag = 0;				// #tks to shift
	if (use_global_stacks && global_yyStates != null) {
		yyVals = global_yyVals;
		yyStates = global_yyStates;
   } else {
		yyVals = new object [yyMax];
		yyStates = new int [yyMax];
		if (use_global_stacks) {
			global_yyVals = yyVals;
			global_yyStates = yyStates;
		}
	}

    /*yyLoop:*/ for (yyTop = 0;; ++ yyTop) {
      if (yyTop >= yyStates.Length) {			// dynamically increase
        global::System.Array.Resize (ref yyStates, yyStates.Length+yyMax);
        global::System.Array.Resize (ref yyVals, yyVals.Length+yyMax);
      }
      yyStates[yyTop] = yyState;
      yyVals[yyTop] = yyVal;
      if (debug != null) debug.push(yyState, yyVal);

      /*yyDiscarded:*/ while (true) {	// discarding a token does not change stack
        int yyN;
        if ((yyN = yyDefRed[yyState]) == 0) {	// else [default] reduce (yyN)
          if (yyToken < 0) {
            yyToken = yyLex.advance() ? yyLex.token() : 0;
            if (debug != null)
              debug.lex(yyState, yyToken, yyname(yyToken), yyLex.value());
          }
          if ((yyN = yySindex[yyState]) != 0 && ((yyN += yyToken) >= 0)
              && (yyN < yyTable.Length) && (yyCheck[yyN] == yyToken)) {
            if (debug != null)
              debug.shift(yyState, yyTable[yyN], yyErrorFlag-1);
            yyState = yyTable[yyN];		// shift to yyN
            yyVal = yyLex.value();
            yyToken = -1;
            if (yyErrorFlag > 0) -- yyErrorFlag;
            goto continue_yyLoop;
          }
          if ((yyN = yyRindex[yyState]) != 0 && (yyN += yyToken) >= 0
              && yyN < yyTable.Length && yyCheck[yyN] == yyToken)
            yyN = yyTable[yyN];			// reduce (yyN)
          else
            switch (yyErrorFlag) {
  
            case 0:
              yyExpectingState = yyState;
              // yyerror(String.Format ("syntax error, got token `{0}'", yyname (yyToken)), yyExpecting(yyState));
              if (debug != null) debug.error("syntax error");
              if (yyToken == 0 /*eof*/ || yyToken == eof_token) throw new yyParser.yyUnexpectedEof ();
              goto case 1;
            case 1: case 2:
              yyErrorFlag = 3;
              do {
                if ((yyN = yySindex[yyStates[yyTop]]) != 0
                    && (yyN += Token.yyErrorCode) >= 0 && yyN < yyTable.Length
                    && yyCheck[yyN] == Token.yyErrorCode) {
                  if (debug != null)
                    debug.shift(yyStates[yyTop], yyTable[yyN], 3);
                  yyState = yyTable[yyN];
                  yyVal = yyLex.value();
                  goto continue_yyLoop;
                }
                if (debug != null) debug.pop(yyStates[yyTop]);
              } while (-- yyTop >= 0);
              if (debug != null) debug.reject();
              throw new yyParser.yyException("irrecoverable syntax error");
  
            case 3:
              if (yyToken == 0) {
                if (debug != null) debug.reject();
                throw new yyParser.yyException("irrecoverable syntax error at end-of-file");
              }
              if (debug != null)
                debug.discard(yyState, yyToken, yyname(yyToken),
  							yyLex.value());
              yyToken = -1;
              goto continue_yyDiscarded;		// leave stack alone
            }
        }
        int yyV = yyTop + 1-yyLen[yyN];
        if (debug != null)
          debug.reduce(yyState, yyStates[yyV-1], yyN, YYRules.getRule (yyN), yyLen[yyN]);
        yyVal = yyV > yyTop ? null : yyVals[yyV]; // yyVal = yyDefault(yyV > yyTop ? null : yyVals[yyV]);
        switch (yyN) {
case 2:
#line 175 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprUNION ((NodeSet) yyVals[-2+yyTop], (NodeSet) yyVals[0+yyTop]);
	}
  break;
case 3:
#line 182 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprRoot ();
	}
  break;
case 4:
#line 186 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprSLASH (new ExprRoot (), (NodeSet) yyVals[0+yyTop]);
	}
  break;
case 6:
#line 191 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprSLASH ((Expression) yyVals[-2+yyTop], (NodeSet) yyVals[0+yyTop]);
	}
  break;
case 7:
#line 195 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprSLASH2 ((Expression) yyVals[-2+yyTop], (NodeSet) yyVals[0+yyTop]);
	}
  break;
case 8:
#line 199 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprSLASH2 (new ExprRoot (), (NodeSet) yyVals[0+yyTop]);
	}
  break;
case 10:
  case_10();
  break;
case 11:
  case_11();
  break;
case 13:
#line 235 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprSLASH ((Expression) yyVals[-2+yyTop], (NodeSet) yyVals[0+yyTop]);
	}
  break;
case 14:
#line 239 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprSLASH2 ((Expression) yyVals[-2+yyTop], (NodeSet) yyVals[0+yyTop]);
	}
  break;
case 15:
#line 246 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = CreateNodeTest ((Axes) yyVals[-2+yyTop], yyVals[-1+yyTop], (ArrayList) yyVals[0+yyTop]);
	}
  break;
case 17:
#line 254 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = Axes.Child;
	}
  break;
case 18:
#line 258 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = Axes.Attribute;
	}
  break;
case 19:
#line 265 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = null;
	}
  break;
case 20:
  case_20();
  break;
case 23:
#line 288 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprOR ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 25:
#line 296 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprAND ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 27:
#line 304 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprEQ ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 28:
#line 308 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprNE ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 30:
#line 316 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprLT ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 31:
#line 320 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprGT ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 32:
#line 324 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprLE ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 33:
#line 328 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprGE ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 35:
#line 336 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprPLUS ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 36:
#line 340 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprMINUS ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 38:
#line 348 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprMULT ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 39:
#line 352 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprDIV ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 40:
#line 356 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprMOD ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 42:
#line 364 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprNEG ((Expression) yyVals[0+yyTop]);
	}
  break;
case 44:
#line 372 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprUNION ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 47:
#line 381 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprSLASH ((Expression) yyVals[-2+yyTop], (NodeSet) yyVals[0+yyTop]);
	}
  break;
case 48:
#line 385 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprSLASH2 ((Expression) yyVals[-2+yyTop], (NodeSet) yyVals[0+yyTop]);
	}
  break;
case 51:
#line 397 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprRoot ();
	}
  break;
case 52:
#line 401 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprSLASH (new ExprRoot (), (NodeSet) yyVals[0+yyTop]);
	}
  break;
case 53:
#line 405 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprSLASH2 (new ExprRoot (), (NodeSet) yyVals[0+yyTop]);
	}
  break;
case 55:
#line 413 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprSLASH ((NodeSet) yyVals[-2+yyTop], (NodeSet) yyVals[0+yyTop]);
	}
  break;
case 56:
#line 417 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprSLASH2 ((NodeSet) yyVals[-2+yyTop], (NodeSet) yyVals[0+yyTop]);
	}
  break;
case 57:
#line 424 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = CreateNodeTest ((Axes) yyVals[-2+yyTop], yyVals[-1+yyTop], (ArrayList) yyVals[0+yyTop]);
	}
  break;
case 60:
#line 433 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = (XPathNodeType) yyVals[-2+yyTop];
	}
  break;
case 61:
#line 437 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = (string) yyVals[-1+yyTop];
	}
  break;
case 62:
#line 444 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = XmlQualifiedName.Empty;
	}
  break;
case 64:
#line 452 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new NodeTypeTest (Axes.Self, XPathNodeType.All);
	}
  break;
case 65:
#line 456 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new NodeTypeTest (Axes.Parent, XPathNodeType.All);
	}
  break;
case 66:
#line 463 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = null;
	}
  break;
case 67:
  case_67();
  break;
case 68:
#line 478 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = yyVals[-1+yyTop];
	}
  break;
case 70:
#line 486 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = Axes.Child;
	}
  break;
case 71:
#line 490 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = Axes.Attribute;
	}
  break;
case 72:
#line 494 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  { yyVal = XPathNodeType.Comment; }
  break;
case 73:
#line 495 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  { yyVal = XPathNodeType.Text; }
  break;
case 74:
#line 496 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  { yyVal = XPathNodeType.ProcessingInstruction; }
  break;
case 75:
#line 497 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  { yyVal = XPathNodeType.All; }
  break;
case 77:
#line 506 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprFilter ((Expression) yyVals[-1+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 78:
  case_78();
  break;
case 79:
#line 524 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprParens ((Expression) yyVals[-1+yyTop]);
	}
  break;
case 80:
#line 528 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprLiteral ((String) yyVals[0+yyTop]);
	}
  break;
case 81:
#line 532 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new ExprNumber ((double) yyVals[0+yyTop]);
	}
  break;
case 83:
  case_83();
  break;
case 85:
#line 554 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new FunctionArguments ((Expression) yyVals[-1+yyTop], (FunctionArguments) yyVals[0+yyTop]);
	}
  break;
case 87:
#line 562 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = new FunctionArguments ((Expression) yyVals[-1+yyTop], (FunctionArguments) yyVals[0+yyTop]);
	}
  break;
case 88:
#line 569 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  {
		yyVal = yyVals[-1+yyTop];
	}
  break;
case 89:
#line 573 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  { yyVal = Axes.Ancestor; }
  break;
case 90:
#line 574 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  { yyVal = Axes.AncestorOrSelf; }
  break;
case 91:
#line 575 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  { yyVal = Axes.Attribute; }
  break;
case 92:
#line 576 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  { yyVal = Axes.Child; }
  break;
case 93:
#line 577 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  { yyVal = Axes.Descendant; }
  break;
case 94:
#line 578 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  { yyVal = Axes.DescendantOrSelf; }
  break;
case 95:
#line 579 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  { yyVal = Axes.Following; }
  break;
case 96:
#line 580 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  { yyVal = Axes.FollowingSibling; }
  break;
case 97:
#line 581 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  { yyVal = Axes.Namespace; }
  break;
case 98:
#line 582 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  { yyVal = Axes.Parent; }
  break;
case 99:
#line 583 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  { yyVal = Axes.Preceding; }
  break;
case 100:
#line 584 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  { yyVal = Axes.PrecedingSibling; }
  break;
case 101:
#line 585 "C:\DEV\SharpLang\src\mcs\class\System.XML\\Mono.Xml.Xsl\PatternParser.jay"
  { yyVal = Axes.Self; }
  break;
#line default
        }
        yyTop -= yyLen[yyN];
        yyState = yyStates[yyTop];
        int yyM = yyLhs[yyN];
        if (yyState == 0 && yyM == 0) {
          if (debug != null) debug.shift(0, yyFinal);
          yyState = yyFinal;
          if (yyToken < 0) {
            yyToken = yyLex.advance() ? yyLex.token() : 0;
            if (debug != null)
               debug.lex(yyState, yyToken,yyname(yyToken), yyLex.value());
          }
          if (yyToken == 0) {
            if (debug != null) debug.accept(yyVal);
            return yyVal;
          }
          goto continue_yyLoop;
        }
        if (((yyN = yyGindex[yyM]) != 0) && ((yyN += yyState) >= 0)
            && (yyN < yyTable.Length) && (yyCheck[yyN] == yyState))
          yyState = yyTable[yyN];
        else
          yyState = yyDgoto[yyM];
        if (debug != null) debug.shift(yyStates[yyTop], yyState);
	 goto continue_yyLoop;
      continue_yyDiscarded: ;	// implements the named-loop continue: 'continue yyDiscarded'
      }
    continue_yyLoop: ;		// implements the named-loop continue: 'continue yyLoop'
    }
  }
  /** the generated parser.
      Maintains a state and a value stack, currently with fixed maximum size.
      @param yyLex scanner.
      @return result of the last reduction, if any.
      @throws yyException on irrecoverable parse error.
    */
  internal Object yyparse (yyParser.yyInput yyLex)
  {
    if (yyMax <= 0) yyMax = 256;			// initial size
    int yyState = 0;                                   // state stack ptr
    int [] yyStates = new int[yyMax];	                // state stack 
    Object yyVal = null;                               // value stack ptr
    Object [] yyVals = new Object[yyMax];	        // value stack
    int yyToken = -1;					// current input
    int yyErrorFlag = 0;				// #tks to shift

    /*yyLoop:*/ for (int yyTop = 0;; ++ yyTop) {
      if (yyTop >= yyStates.Length) {			// dynamically increase
        int[] i = new int[yyStates.Length+yyMax];
        yyStates.CopyTo (i, 0);
        yyStates = i;
        Object[] o = new Object[yyVals.Length+yyMax];
        yyVals.CopyTo (o, 0);
        yyVals = o;
      }
      yyStates[yyTop] = yyState;
      yyVals[yyTop] = yyVal;
      if (debug != null) debug.push(yyState, yyVal);

      /*yyDiscarded:*/ for (;;) {	// discarding a token does not change stack
        int yyN;
        if ((yyN = yyDefRed[yyState]) == 0) {	// else [default] reduce (yyN)
          if (yyToken < 0) {
            yyToken = yyLex.advance() ? yyLex.token() : 0;
            if (debug != null)
              debug.lex(yyState, yyToken, yyname(yyToken), yyLex.value());
          }
          if ((yyN = yySindex[yyState]) != 0 && ((yyN += yyToken) >= 0)
              && (yyN < yyTable.Length) && (yyCheck[yyN] == yyToken)) {
            if (debug != null)
              debug.shift(yyState, yyTable[yyN], yyErrorFlag-1);
            yyState = yyTable[yyN];		// shift to yyN
            yyVal = yyLex.value();
            yyToken = -1;
            if (yyErrorFlag > 0) -- yyErrorFlag;
            goto continue_yyLoop;
          }
          if ((yyN = yyRindex[yyState]) != 0 && (yyN += yyToken) >= 0
              && yyN < yyTable.Length && yyCheck[yyN] == yyToken)
            yyN = yyTable[yyN];			// reduce (yyN)
          else
            switch (yyErrorFlag) {
  
            case 0:
              yyExpectingState = yyState;
              // yyerror(String.Format ("syntax error, got token `{0}'", yyname (yyToken)), yyExpecting(yyState));
              if (debug != null) debug.error("syntax error");
              if (yyToken == 0 /*eof*/ || yyToken == eof_token) throw new yyParser.yyUnexpectedEof ();
              goto case 1;
            case 1: case 2:
              yyErrorFlag = 3;
              do {
                if ((yyN = yySindex[yyStates[yyTop]]) != 0
                    && (yyN += Token.yyErrorCode) >= 0 && yyN < yyTable.Length
                    && yyCheck[yyN] == Token.yyErrorCode) {
                  if (debug != null)
                    debug.shift(yyStates[yyTop], yyTable[yyN], 3);
                  yyState = yyTable[yyN];
                  yyVal = yyLex.value();
                  goto continue_yyLoop;
                }
                if (debug != null) debug.pop(yyStates[yyTop]);
              } while (-- yyTop >= 0);
              if (debug != null) debug.reject();
              throw new yyParser.yyException("irrecoverable syntax error");
  
            case 3:
              if (yyToken == 0) {
                if (debug != null) debug.reject();
                throw new yyParser.yyException("irrecoverable syntax error at end-of-file");
              }
              if (debug != null)
                debug.discard(yyState, yyToken, yyname(yyToken),
  							yyLex.value());
              yyToken = -1;
              goto continue_yyDiscarded;		// leave stack alone
            }
        }
        int yyV = yyTop + 1-yyLen[yyN];
        if (debug != null)
          debug.reduce(yyState, yyStates[yyV-1], yyN, YYRules.getRule (yyN), yyLen[yyN]);
        yyVal = yyDefault(yyV > yyTop ? null : yyVals[yyV]);
        switch (yyN) {
case 2:
#line 170 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprUNION ((NodeSet) yyVals[-2+yyTop], (NodeSet) yyVals[0+yyTop]);
	}
  break;
case 3:
#line 177 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprRoot ();
	}
  break;
case 4:
#line 181 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprSLASH (new ExprRoot (), (NodeSet) yyVals[0+yyTop]);
	}
  break;
case 6:
#line 186 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprSLASH ((Expression) yyVals[-2+yyTop], (NodeSet) yyVals[0+yyTop]);
	}
  break;
case 7:
#line 190 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprSLASH2 ((Expression) yyVals[-2+yyTop], (NodeSet) yyVals[0+yyTop]);
	}
  break;
case 8:
#line 194 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprSLASH2 (new ExprRoot (), (NodeSet) yyVals[0+yyTop]);
	}
  break;
case 10:
#line 203 "Mono.Xml.Xsl/PatternParser.jay"
  {
		XmlQualifiedName name = (XmlQualifiedName) yyVals[-3+yyTop];
		if (name.Name != "id" || name.Namespace != String.Empty)
			throw new XPathException (String.Format ("Expected 'id' but got '{0}'", name));
		yyVal = ExprFunctionCall.Factory (name,
			new FunctionArguments (
				new ExprLiteral ((string) yyVals[-1+yyTop]),
				null),
			Context);
	}
  break;
case 11:
#line 214 "Mono.Xml.Xsl/PatternParser.jay"
  {
		XmlQualifiedName name = (XmlQualifiedName) yyVals[-5+yyTop];
		if (name.Name != "key" || name.Namespace != String.Empty)
			throw new XPathException (String.Format ("Expected 'key' but got '{0}'", name));
		yyVal = Context.TryGetFunction (name,
			new FunctionArguments (
				new ExprLiteral ((string) yyVals[-3+yyTop]),
				new FunctionArguments (
					new ExprLiteral ((string) yyVals[-1+yyTop]),
					null)));
	}
  break;
case 13:
#line 230 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprSLASH ((Expression) yyVals[-2+yyTop], (NodeSet) yyVals[0+yyTop]);
	}
  break;
case 14:
#line 234 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprSLASH2 ((Expression) yyVals[-2+yyTop], (NodeSet) yyVals[0+yyTop]);
	}
  break;
case 15:
#line 241 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = CreateNodeTest ((Axes) yyVals[-2+yyTop], yyVals[-1+yyTop], (ArrayList) yyVals[0+yyTop]);
	}
  break;
case 17:
#line 249 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = Axes.Child;
	}
  break;
case 18:
#line 253 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = Axes.Attribute;
	}
  break;
case 19:
#line 260 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = null;
	}
  break;
case 20:
#line 264 "Mono.Xml.Xsl/PatternParser.jay"
  {
		ArrayList al = (ArrayList) yyVals[-1+yyTop];
		if (al == null)
			al = new ArrayList ();
		al.Add ((Expression) yyVals[0+yyTop]);
		yyVal = al;
	}
  break;
case 23:
#line 283 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprOR ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 25:
#line 291 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprAND ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 27:
#line 299 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprEQ ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 28:
#line 303 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprNE ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 30:
#line 311 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprLT ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 31:
#line 315 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprGT ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 32:
#line 319 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprLE ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 33:
#line 323 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprGE ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 35:
#line 331 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprPLUS ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 36:
#line 335 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprMINUS ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 38:
#line 343 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprMULT ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 39:
#line 347 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprDIV ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 40:
#line 351 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprMOD ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 42:
#line 359 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprNEG ((Expression) yyVals[0+yyTop]);
	}
  break;
case 44:
#line 367 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprUNION ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 47:
#line 376 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprSLASH ((Expression) yyVals[-2+yyTop], (NodeSet) yyVals[0+yyTop]);
	}
  break;
case 48:
#line 380 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprSLASH2 ((Expression) yyVals[-2+yyTop], (NodeSet) yyVals[0+yyTop]);
	}
  break;
case 51:
#line 392 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprRoot ();
	}
  break;
case 52:
#line 396 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprSLASH (new ExprRoot (), (NodeSet) yyVals[0+yyTop]);
	}
  break;
case 53:
#line 400 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprSLASH2 (new ExprRoot (), (NodeSet) yyVals[0+yyTop]);
	}
  break;
case 55:
#line 408 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprSLASH ((NodeSet) yyVals[-2+yyTop], (NodeSet) yyVals[0+yyTop]);
	}
  break;
case 56:
#line 412 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprSLASH2 ((NodeSet) yyVals[-2+yyTop], (NodeSet) yyVals[0+yyTop]);
	}
  break;
case 57:
#line 419 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = CreateNodeTest ((Axes) yyVals[-2+yyTop], yyVals[-1+yyTop], (ArrayList) yyVals[0+yyTop]);
	}
  break;
case 60:
#line 428 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = (XPathNodeType) yyVals[-2+yyTop];
	}
  break;
case 61:
#line 432 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = (string) yyVals[-1+yyTop];
	}
  break;
case 62:
#line 439 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = XmlQualifiedName.Empty;
	}
  break;
case 64:
#line 447 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new NodeTypeTest (Axes.Self, XPathNodeType.All);
	}
  break;
case 65:
#line 451 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new NodeTypeTest (Axes.Parent, XPathNodeType.All);
	}
  break;
case 66:
#line 458 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = null;
	}
  break;
case 67:
#line 462 "Mono.Xml.Xsl/PatternParser.jay"
  {
		ArrayList al = (ArrayList) yyVals[-1+yyTop];
		if (al == null)
			al = new ArrayList ();
		al.Add (yyVals[0+yyTop]);
		yyVal = al;
	}
  break;
case 68:
#line 473 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = yyVals[-1+yyTop];
	}
  break;
case 70:
#line 481 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = Axes.Child;
	}
  break;
case 71:
#line 485 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = Axes.Attribute;
	}
  break;
case 72:
#line 491 "Mono.Xml.Xsl/PatternParser.jay"
  { yyVal = XPathNodeType.Comment; }
  break;
case 73:
#line 492 "Mono.Xml.Xsl/PatternParser.jay"
  { yyVal = XPathNodeType.Text; }
  break;
case 74:
#line 493 "Mono.Xml.Xsl/PatternParser.jay"
  { yyVal = XPathNodeType.ProcessingInstruction; }
  break;
case 75:
#line 494 "Mono.Xml.Xsl/PatternParser.jay"
  { yyVal = XPathNodeType.All; }
  break;
case 77:
#line 501 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprFilter ((Expression) yyVals[-1+yyTop], (Expression) yyVals[0+yyTop]);
	}
  break;
case 78:
#line 508 "Mono.Xml.Xsl/PatternParser.jay"
  {
		Expression ret = null;
		if (Context != null)
			ret = Context.TryGetVariable (((XmlQualifiedName) yyVals[0+yyTop]).ToString ());
		
		if (ret == null)
			ret = new ExprVariable ((XmlQualifiedName) yyVals[0+yyTop], Context);
			
		yyVal = ret;
	}
  break;
case 79:
#line 519 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprParens ((Expression) yyVals[-1+yyTop]);
	}
  break;
case 80:
#line 523 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprLiteral ((String) yyVals[0+yyTop]);
	}
  break;
case 81:
#line 527 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new ExprNumber ((double) yyVals[0+yyTop]);
	}
  break;
case 83:
#line 535 "Mono.Xml.Xsl/PatternParser.jay"
  {
		Expression ret = null;
		if (Context != null)
			ret = Context.TryGetFunction ((XmlQualifiedName) yyVals[-3+yyTop], (FunctionArguments) yyVals[-1+yyTop]);
		if (ret == null)
			ret = ExprFunctionCall.Factory ((XmlQualifiedName) yyVals[-3+yyTop], (FunctionArguments) yyVals[-1+yyTop], Context);
		
		yyVal = ret;
	}
  break;
case 85:
#line 549 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new FunctionArguments ((Expression) yyVals[-1+yyTop], (FunctionArguments) yyVals[0+yyTop]);
	}
  break;
case 87:
#line 557 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = new FunctionArguments ((Expression) yyVals[-1+yyTop], (FunctionArguments) yyVals[0+yyTop]);
	}
  break;
case 88:
#line 564 "Mono.Xml.Xsl/PatternParser.jay"
  {
		yyVal = yyVals[-1+yyTop];
	}
  break;
case 89:
#line 570 "Mono.Xml.Xsl/PatternParser.jay"
  { yyVal = Axes.Ancestor; }
  break;
case 90:
#line 571 "Mono.Xml.Xsl/PatternParser.jay"
  { yyVal = Axes.AncestorOrSelf; }
  break;
case 91:
#line 572 "Mono.Xml.Xsl/PatternParser.jay"
  { yyVal = Axes.Attribute; }
  break;
case 92:
#line 573 "Mono.Xml.Xsl/PatternParser.jay"
  { yyVal = Axes.Child; }
  break;
case 93:
#line 574 "Mono.Xml.Xsl/PatternParser.jay"
  { yyVal = Axes.Descendant; }
  break;
case 94:
#line 575 "Mono.Xml.Xsl/PatternParser.jay"
  { yyVal = Axes.DescendantOrSelf; }
  break;
case 95:
#line 576 "Mono.Xml.Xsl/PatternParser.jay"
  { yyVal = Axes.Following; }
  break;
case 96:
#line 577 "Mono.Xml.Xsl/PatternParser.jay"
  { yyVal = Axes.FollowingSibling; }
  break;
case 97:
#line 578 "Mono.Xml.Xsl/PatternParser.jay"
  { yyVal = Axes.Namespace; }
  break;
case 98:
#line 579 "Mono.Xml.Xsl/PatternParser.jay"
  { yyVal = Axes.Parent; }
  break;
case 99:
#line 580 "Mono.Xml.Xsl/PatternParser.jay"
  { yyVal = Axes.Preceding; }
  break;
case 100:
#line 581 "Mono.Xml.Xsl/PatternParser.jay"
  { yyVal = Axes.PrecedingSibling; }
  break;
case 101:
#line 582 "Mono.Xml.Xsl/PatternParser.jay"
  { yyVal = Axes.Self; }
  break;
#line default
        }
        yyTop -= yyLen[yyN];
        yyState = yyStates[yyTop];
        int yyM = yyLhs[yyN];
        if (yyState == 0 && yyM == 0) {
          if (debug != null) debug.shift(0, yyFinal);
          yyState = yyFinal;
          if (yyToken < 0) {
            yyToken = yyLex.advance() ? yyLex.token() : 0;
            if (debug != null)
               debug.lex(yyState, yyToken,yyname(yyToken), yyLex.value());
          }
          if (yyToken == 0) {
            if (debug != null) debug.accept(yyVal);
            return yyVal;
          }
          goto continue_yyLoop;
        }
        if (((yyN = yyGindex[yyM]) != 0) && ((yyN += yyState) >= 0)
            && (yyN < yyTable.Length) && (yyCheck[yyN] == yyState))
          yyState = yyTable[yyN];
        else
          yyState = yyDgoto[yyM];
        if (debug != null) debug.shift(yyStates[yyTop], yyState);
	 goto continue_yyLoop;
      continue_yyDiscarded: continue;	// implements the named-loop continue: 'continue yyDiscarded'
      }
    continue_yyLoop: continue;		// implements the named-loop continue: 'continue yyLoop'
    }
  }