private void ProcessWhereBooleanExpression(BooleanExpression BooleanExpression) { string ExpressionType = FragmentTypeParser.GetFragmentType(BooleanExpression); switch (ExpressionType) { case "BooleanComparisonExpression": var BoolComp = (BooleanComparisonExpression) BooleanExpression; ProcessWhereScalarExpression(BoolComp.FirstExpression); ProcessWhereScalarExpression(BoolComp.SecondExpression); if( (BoolComp.ComparisonType == BooleanComparisonType.Equals) && (FragmentTypeParser.GetFragmentType(BoolComp.FirstExpression)=="NullLiteral" || FragmentTypeParser.GetFragmentType(BoolComp.SecondExpression) == "NullLiteral") ) { _smells.SendFeedBack(46, BoolComp); } break; case "BooleanBinaryExpression": var BoolExpression = (BooleanBinaryExpression) BooleanExpression; ProcessWhereBooleanExpression(BoolExpression.FirstExpression); ProcessWhereBooleanExpression(BoolExpression.SecondExpression); break; default: break; } }
public SetTurn(BooleanExpression<Missile> eligibility, int _priority, double percentageOfTurn) : base(eligibility, _priority) { if (percentageOfTurn > 100.0d) percentageOfTurn = 100.0d; if (percentageOfTurn < -100.0d) percentageOfTurn = -100.0d; this.percentageOfTurn = percentageOfTurn; }
private void Search(BooleanExpression search) { if (search is BooleanBinaryExpression) { var bbe = search as BooleanBinaryExpression; Search(bbe.FirstExpression); Search(bbe.SecondExpression); } if (search is BooleanParenthesisExpression) { var bpe = search as BooleanParenthesisExpression; Search(bpe.Expression); } if (search is BooleanComparisonExpression) { CheckRewriteable(search); } }
private void BuildEqualsSameLiteral(BooleanExpression search, ScalarExpression firstParam, Literal literal) { var newExpression = new BooleanParenthesisExpression(); var expression = new BooleanBinaryExpression(); newExpression.Expression = expression; expression.BinaryExpressionType = BooleanBinaryExpressionType.Or; var isnull = new BooleanIsNullExpression(); isnull.Expression = firstParam; expression.FirstExpression = isnull; var second = new BooleanComparisonExpression(); second.FirstExpression = firstParam; second.SecondExpression = literal; expression.SecondExpression = second; var sql = ScriptDom.GenerateTSql(newExpression); _replacementsToMake.Add(new Replacements { Original = _script.Substring(search.StartOffset, search.FragmentLength), OriginalLength = search.FragmentLength, OriginalOffset = search.StartOffset, Replacement = sql, OriginalFragment = _currentFragment }); }
public override void ConstructBooleanExpression(BooleanExpression node) { this.Write(node.Value ? "true" : "false"); }
/** 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 1: #line 391 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Lexer.check_incorrect_doc_comment (); } break; case 2: #line 394 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Lexer.CompleteOnEOF = false; } break; case 6: #line 401 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyVals[0+yyTop] != null) { Attributes attrs = (Attributes) yyVals[0+yyTop]; report.Error (1730, attrs.Attrs [0].Location, "Assembly and module attributes must precede all other elements except using clauses and extern alias declarations"); } } break; case 7: #line 409 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { module.AddAttributes ((Attributes) yyVals[0+yyTop], current_namespace); } break; case 8: #line 413 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyToken == Token.EXTERN_ALIAS) report.Error (439, lexer.Location, "An extern alias declaration must precede all other elements"); else Error_SyntaxError (yyToken); } break; case 13: #line 433 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; string s = lt.Value; if (s != "alias"){ syntax_error (lt.Location, "`alias' expected"); } else if (lang_version == LanguageVersion.ISO_1) { FeatureIsNotAvailable (lt.Location, "external alias"); } else { lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; current_namespace.AddUsingExternalAlias (lt.Value, lt.Location, report); } } break; case 14: #line 446 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { syntax_error (GetLocation (yyVals[-1+yyTop]), "`alias' expected"); /* TODO: better*/ } break; case 17: #line 458 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; } break; case 18: #line 463 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; } break; case 19: #line 471 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; if (lang_version != LanguageVersion.ISO_1 && lt.Value == "global") { report.Warning (440, 2, lt.Location, "An alias named `global' will not be used when resolving `global::'. The global namespace will be used instead"); } current_namespace.AddUsingAlias (lt.Value, (MemberName) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop])); } break; case 20: #line 481 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = null; } break; case 21: #line 489 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_namespace.AddUsing ((MemberName) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); } break; case 22: #line 501 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Attributes attrs = (Attributes) yyVals[-2+yyTop]; MemberName name = (MemberName) yyVals[0+yyTop]; if (attrs != null) { bool valid_global_attrs = true; if ((current_namespace.DeclarationFound || current_namespace != file.NamespaceContainer)) { valid_global_attrs = false; } else { foreach (var a in attrs.Attrs) { if (a.ExplicitTarget == "assembly" || a.ExplicitTarget == "module") continue; valid_global_attrs = false; break; } } if (!valid_global_attrs) report.Error (1671, name.Location, "A namespace declaration cannot have modifiers or attributes"); } module.AddAttributes (attrs, current_namespace); current_namespace = new NamespaceContainer (name, module, current_namespace, file); module.AddTypesContainer (current_namespace); current_class = current_namespace.SlaveDeclSpace; current_container = current_class.PartialContainer; } break; case 23: #line 530 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; } break; case 24: #line 535 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyVals[0+yyTop] != null) lbag.AddLocation (current_namespace, GetLocation (yyVals[-9+yyTop]), GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop])); else lbag.AddLocation (current_namespace, GetLocation (yyVals[-9+yyTop]), GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-1+yyTop])); current_namespace = current_namespace.Parent; current_class = current_namespace.SlaveDeclSpace; current_container = current_class.PartialContainer; } break; case 25: #line 549 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new MemberName (lt.Value, lt.Location); } break; case 26: #line 554 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new MemberName ((MemberName) yyVals[-2+yyTop], lt.Value, lt.Location); } break; case 27: #line 559 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new MemberName ("<invalid>", lexer.Location); } break; case 32: #line 577 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { MemberName name = (MemberName) yyVals[0+yyTop]; if (name.TypeArguments != null) syntax_error (lexer.Location, "namespace name expected"); yyVal = name; } break; case 41: #line 609 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyVals[0+yyTop] != null) { TypeContainer ds = (TypeContainer)yyVals[0+yyTop]; if ((ds.ModFlags & (Modifiers.PRIVATE | Modifiers.PROTECTED)) != 0){ report.Error (1527, ds.Location, "Namespace elements cannot be explicitly declared as private, protected or protected internal"); } /* Here is a trick, for explicit attributes we don't know where they belong to until*/ /* we parse succeeding declaration hence we parse them as normal and re-attach them*/ /* when we know whether they are global (assembly:, module:) or local (type:).*/ if (ds.OptAttributes != null) { ds.OptAttributes.ConvertGlobalAttributes (ds, current_namespace, !current_namespace.DeclarationFound && current_namespace == file.NamespaceContainer); } } current_namespace.DeclarationFound = true; } break; case 42: #line 628 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_namespace.DeclarationFound = true; } break; case 50: #line 659 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var sect = (List<Attribute>) yyVals[0+yyTop]; yyVal = new Attributes (sect); } break; case 51: #line 664 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Attributes attrs = yyVals[-1+yyTop] as Attributes; var sect = (List<Attribute>) yyVals[0+yyTop]; if (attrs == null) attrs = new Attributes (sect); else attrs.AddAttributes (sect); yyVal = attrs; } break; case 52: #line 677 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.parsing_attribute_section = true; } break; case 53: #line 681 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.parsing_attribute_section = false; yyVal = yyVals[0+yyTop]; } break; case 54: #line 689 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_attr_target = (string) yyVals[-1+yyTop]; if (current_attr_target == "assembly" || current_attr_target == "module") { Lexer.check_incorrect_doc_comment (); } } break; case 55: #line 696 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { /* when attribute target is invalid*/ if (current_attr_target == string.Empty) yyVal = new List<Attribute> (0); else yyVal = yyVals[-2+yyTop]; current_attr_target = null; lexer.parsing_attribute_section = false; } break; case 56: #line 707 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = yyVals[-2+yyTop]; } break; case 57: #line 714 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = CheckAttributeTarget (lt.Value, lt.Location); } break; case 58: #line 718 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = "event"; } break; case 59: #line 719 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = "return"; } break; case 60: #line 721 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyToken == Token.IDENTIFIER) { Error_SyntaxError (yyToken); yyVal = null; } else { string name = GetTokenName (yyToken); yyVal = CheckAttributeTarget (name, GetLocation (yyVals[0+yyTop])); } } break; case 61: #line 734 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new List<Attribute> (4) { (Attribute) yyVals[0+yyTop] }; } break; case 62: #line 738 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var attrs = (List<Attribute>) yyVals[-2+yyTop]; attrs.Add ((Attribute) yyVals[0+yyTop]); yyVal = attrs; } break; case 63: #line 748 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { ++lexer.parsing_block; } break; case 64: #line 752 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { --lexer.parsing_block; MemberName mname = (MemberName) yyVals[-2+yyTop]; if (mname.IsGeneric) { report.Error (404, lexer.Location, "'<' unexpected: attributes cannot be generic"); } Arguments [] arguments = (Arguments []) yyVals[0+yyTop]; ATypeNameExpression expr = mname.GetTypeExpression (); yyVal = new Attribute (current_attr_target, expr, arguments, mname.Location, lexer.IsEscapedIdentifier (mname)); } break; case 66: #line 771 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = null; } break; case 67: #line 773 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; case 68: #line 780 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = null; } break; case 69: #line 782 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Arguments a = new Arguments (4); a.Add ((Argument) yyVals[0+yyTop]); yyVal = new Arguments [] { a, null }; } break; case 70: #line 788 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Arguments a = new Arguments (4); a.Add ((Argument) yyVals[0+yyTop]); yyVal = new Arguments [] { null, a }; } break; case 71: #line 794 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Arguments[] o = (Arguments[]) yyVals[-2+yyTop]; if (o [1] != null) { report.Error (1016, ((Argument) yyVals[0+yyTop]).Expr.Location, "Named attribute arguments must appear after the positional arguments"); o [0] = new Arguments (4); } Arguments args = ((Arguments) o [0]); if (args.Count > 0 && !(yyVals[0+yyTop] is NamedArgument) && args [args.Count - 1] is NamedArgument) Error_NamedArgumentExpected ((NamedArgument) args [args.Count - 1]); args.Add ((Argument) yyVals[0+yyTop]); } break; case 72: #line 808 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Arguments[] o = (Arguments[]) yyVals[-2+yyTop]; if (o [1] == null) { o [1] = new Arguments (4); } ((Arguments) o [1]).Add ((Argument) yyVals[0+yyTop]); } break; case 73: #line 820 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Argument ((Expression) yyVals[0+yyTop]); } break; case 75: #line 828 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { ++lexer.parsing_block; } break; case 76: #line 832 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { --lexer.parsing_block; var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; yyVal = new NamedArgument (lt.Value, lt.Location, (Expression) yyVals[0+yyTop]); } break; case 77: #line 841 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (lang_version <= LanguageVersion.V_3) FeatureIsNotAvailable (GetLocation (yyVals[-3+yyTop]), "named argument"); /* Avoid boxing in common case (no modifier)*/ var arg_mod = yyVals[-1+yyTop] == null ? Argument.AType.None : (Argument.AType) yyVals[-1+yyTop]; var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; yyVal = new NamedArgument (lt.Value, lt.Location, (Expression) yyVals[0+yyTop], arg_mod); } break; case 78: #line 854 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = null; } break; case 79: #line 856 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Argument.AType.Ref; } break; case 80: #line 860 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Argument.AType.Out; } break; case 83: #line 872 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.parsing_modifiers = true; } break; case 84: #line 876 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.parsing_modifiers = true; } break; case 97: #line 895 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Error (1519, lexer.Location, "Unexpected symbol `{0}' in class, struct, or interface member declaration", GetSymbolName (yyToken)); yyVal = null; lexer.parsing_generic_declaration = false; } break; case 98: #line 908 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.ConstraintsParsing = true; } break; case 99: #line 912 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { MemberName name = MakeName ((MemberName) yyVals[0+yyTop]); push_current_class (new Struct (current_namespace, current_class, name, (Modifiers) yyVals[-4+yyTop], (Attributes) yyVals[-5+yyTop]), yyVals[-3+yyTop]); } break; case 100: #line 918 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.ConstraintsParsing = false; current_class.SetParameterInfo ((List<Constraints>) yyVals[0+yyTop]); if (doc_support) current_container.DocComment = Lexer.consume_doc_comment (); lbag.AddMember (current_class, mod_locations, GetLocation (yyVals[-5+yyTop])); lexer.parsing_modifiers = true; } break; case 101: #line 931 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; } break; case 102: #line 936 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { --lexer.parsing_declaration; if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; } break; case 103: #line 942 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lbag.AppendToMember (current_class, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); yyVal = pop_current_class (); } break; case 104: #line 947 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Error_SyntaxError (yyToken); } break; case 105: #line 956 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; var mod = (Modifiers) yyVals[-3+yyTop]; current_field = new Const (current_class, (FullNamedExpression) yyVals[-1+yyTop], mod, new MemberName (lt.Value, lt.Location), (Attributes) yyVals[-4+yyTop]); current_container.AddConstant ((Const) current_field); if ((mod & Modifiers.STATIC) != 0) { report.Error (504, current_field.Location, "The constant `{0}' cannot be marked static", current_field.GetSignatureForError ()); } yyVal = current_field; } break; case 106: #line 969 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (doc_support) { current_field.DocComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } current_field.Initializer = (ConstInitializer) yyVals[-2+yyTop]; lbag.AddMember (current_field, mod_locations, GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[0+yyTop])); current_field = null; } break; case 117: #line 1003 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 118: #line 1007 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new SimpleName("dynamic",new Location(0,0)); } break; case 119: #line 1013 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.parsing_generic_declaration = false; var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; FullNamedExpression type = yyVals[0+yyTop] as FullNamedExpression; if(type == null){ report.Error (10008, GetLocation (yyVals[0+yyTop]), "Could not resolve type expression"); } current_field = new RoleField (current_class, type, Modifiers.PRIVATE | Modifiers.ROLE, new MemberName (lt.Value, lt.Location),null); current_container.AddField (current_field); yyVal = current_field; if (doc_support) { current_field.DocComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } lbag.AddMember (current_field, mod_locations, GetLocation (yyVals[-1+yyTop])); yyVal = current_field; current_role = current_field; current_field = null; } break; case 120: #line 1039 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_role = null; } break; case 121: #line 1045 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = null; } break; case 122: #line 1047 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { TypeParameter tparam = null; var simple = current_role.TypeExpression as SimpleName; if((simple != null && simple.Name != "dynamic") || (simple.Type != null && simple.Type.BuiltinType != BuiltinTypeSpec.Type.Dynamic)){ if(current_class.IsGeneric){ for(int i = 0; tparam == null && i<current_class.TypeParameters.Length;i++){ if(simple.Name == current_class.TypeParameters[i].Name){ tparam = current_class.TypeParameters[i]; } } } if(tparam == null) { report.Error (10009, GetLocation (yyVals[0+yyTop]), "Contracts can only be used for none typed roles"); } } var contractName = GetCurrentRoleContractName(); MemberName name = MakeName (new MemberName(contractName)); var inter = new Interface (current_namespace, current_class, name, Modifiers.PUBLIC, null); if(tparam != null) { tparam.Type.RolePlayerContract = inter.Type; var ns = current_namespace.NS; var className = new MemberName (ns.MemberName, new MemberName("><_extensionContainerFor" + GetCurrentRoleContractName(),GetLocation (yyVals[0+yyTop]))); current_extensionContainer = new Class (current_namespace, current_class.Parent, className, Modifiers.PUBLIC | Modifiers.STATIC, null); } RoleContracts.Add(contractName,inter); push_current_class (inter, null); lbag.AddMember (current_class, mod_locations, GetLocation (yyVals[0+yyTop])); } break; case 123: #line 1081 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { --lexer.parsing_declaration; if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; lbag.AppendToMember (current_class, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); if(current_extensionContainer != null) { var cls = current_class; var container = current_container; current_container = current_class.Module; push_current_class((Class)current_extensionContainer, null); lbag.AddMember (current_extensionContainer, mod_locations, GetLocation (yyVals[-4+yyTop])); lbag.AppendToMember (current_extensionContainer, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); pop_current_class(); current_class = cls; current_container = container; current_extensionContainer = null; } yyVal = pop_current_class (); } break; case 124: #line 1104 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 125: #line 1108 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 126: #line 1115 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), (ConstInitializer) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); } break; case 127: #line 1124 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { ++lexer.parsing_block; } break; case 128: #line 1128 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { --lexer.parsing_block; yyVal = new ConstInitializer (current_field, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); } break; case 129: #line 1133 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Error (145, lexer.Location, "A const field requires a value to be provided"); yyVal = null; } break; case 132: #line 1148 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.parsing_generic_declaration = false; FullNamedExpression type = (FullNamedExpression) yyVals[-1+yyTop]; if (type.Type != null && type.Type.Kind == MemberKind.Void) report.Error (670, GetLocation (yyVals[-1+yyTop]), "Fields cannot have void type"); var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; current_field = new Field (current_class, type, (Modifiers) yyVals[-2+yyTop], new MemberName (lt.Value, lt.Location), (Attributes) yyVals[-3+yyTop]); current_container.AddField (current_field); yyVal = current_field; } break; case 133: #line 1163 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (doc_support) { current_field.DocComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } lbag.AddMember (current_field, mod_locations, GetLocation (yyVals[0+yyTop])); yyVal = current_field; current_field = null; } break; case 134: #line 1176 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (lang_version < LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), "fixed size buffers"); var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; current_field = new FixedField (current_class, (FullNamedExpression) yyVals[-1+yyTop], (Modifiers) yyVals[-3+yyTop], new MemberName (lt.Value, lt.Location), (Attributes) yyVals[-4+yyTop]); current_container.AddField (current_field); } break; case 135: #line 1187 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (doc_support) { current_field.DocComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } current_field.Initializer = (ConstInitializer) yyVals[-2+yyTop]; lbag.AddMember (current_field, mod_locations, GetLocation (yyVals[0+yyTop])); yyVal = current_field; current_field = null; } break; case 136: #line 1202 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Error (1641, GetLocation (yyVals[-1+yyTop]), "A fixed size buffer field must have the array size specifier after the field name"); } break; case 138: #line 1210 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { ++lexer.parsing_block; current_local_parameters = ParametersCompiled.EmptyReadOnlyParameters; start_block (GetLocation (yyVals[0+yyTop])); } break; case 139: #line 1216 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { --lexer.parsing_block; current_field.Initializer = (Expression) yyVals[0+yyTop]; end_block (lexer.Location); current_local_parameters = null; } break; case 142: #line 1231 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 143: #line 1235 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 144: #line 1242 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), null); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } break; case 145: #line 1248 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { ++lexer.parsing_block; } break; case 146: #line 1252 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { --lexer.parsing_block; var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; yyVal = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop])); } break; case 149: #line 1267 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 150: #line 1271 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 151: #line 1278 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), (ConstInitializer) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); } break; case 152: #line 1287 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { ++lexer.parsing_block; } break; case 153: #line 1291 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { --lexer.parsing_block; yyVal = new ConstInitializer (current_field, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } break; case 154: #line 1297 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Error (443, lexer.Location, "Value or constant expected"); yyVal = null; } break; case 157: #line 1307 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { /* It has to be here for the parent to safely restore artificial block*/ Error_SyntaxError (yyToken); yyVal = null; } break; case 158: #line 1316 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (doc_support) Lexer.doc_state = XmlCommentState.NotAllowed; /* Add it early in the case of body being eof for full ast*/ Method m = (Method) yyVals[0+yyTop]; async_block = (m.ModFlags & Modifiers.ASYNC) != 0; current_container.AddMethod (m); } break; case 159: #line 1327 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Method method = (Method) yyVals[-2+yyTop]; method.Block = (ToplevelBlock) yyVals[0+yyTop]; async_block = false; if (method.Block == null) { method.ParameterInfo.CheckParameters (method); if ((method.ModFlags & Modifiers.ASYNC) != 0) { report.Error (1994, method.Location, "`{0}': The async modifier can only be used with methods that have a body", method.GetSignatureForError ()); } } else { if (current_container.Kind == MemberKind.Interface) { report.Error (531, method.Location, "`{0}': interface members cannot have a definition", method.GetSignatureForError ()); } } current_local_parameters = null; if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; } break; case 160: #line 1355 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (doc_support) Lexer.doc_state = XmlCommentState.NotAllowed; /* Add it early in the case of body being eof for full ast*/ Method m = (Method) yyVals[0+yyTop]; async_block = (m.ModFlags & Modifiers.ASYNC) != 0; current_container.AddMethod (m); } break; case 161: #line 1365 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { try{ Method method = (Method) yyVals[-2+yyTop]; method.Block = (ToplevelBlock) yyVals[0+yyTop]; async_block = false; if (method.Block == null) { method.ParameterInfo.CheckParameters (method); if ((method.ModFlags & Modifiers.ASYNC) != 0) { report.Error (1994, method.Location, "`{0}': The async modifier can only be used with methods that have a body", method.GetSignatureForError ()); } } else { if (current_container.Kind == MemberKind.Interface) { report.Error (531, method.Location, "`{0}': interface members cannot have a definition", method.GetSignatureForError ()); } } current_local_parameters = null; if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; } finally { isInteraction = false; interactionInitializationDone = false; } } break; case 162: #line 1399 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { isInteraction = true; interactionInitializationDone = false; } break; case 163: #line 1405 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { valid_param_mod = ParameterModifierType.All; } break; case 164: #line 1409 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.ConstraintsParsing = true; } break; case 165: #line 1413 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.ConstraintsParsing = false; valid_param_mod = 0; MemberName name = (MemberName) yyVals[-6+yyTop]; current_local_parameters = (ParametersCompiled) yyVals[-3+yyTop]; GenericMethod generic = null; if (name.TypeArguments != null) { generic = new GenericMethod (current_namespace, current_class, name, (FullNamedExpression) yyVals[-7+yyTop], current_local_parameters); generic.SetParameterInfo ((List<Constraints>) yyVals[0+yyTop]); } else if (yyVals[0+yyTop] != null) { report.Error (80, GetLocation (yyVals[0+yyTop]), "Constraints are not allowed on non-generic declarations"); } var modifiers = Modifiers.PUBLIC; var method = Method.Create (current_class, generic, (FullNamedExpression) yyVals[-7+yyTop], modifiers, name, current_local_parameters, (Attributes) yyVals[-10+yyTop], yyVals[0+yyTop] != null); if (doc_support) method.DocComment = Lexer.consume_doc_comment (); lbag.AddMember (method, mod_locations, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-2+yyTop])); yyVal = method; } break; case 166: #line 1444 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (doc_support) Lexer.doc_state = XmlCommentState.NotAllowed; isRoleMethod = true; /* Add it early in the case of body being eof for full ast*/ var m = (Method) yyVals[0+yyTop]; async_block = (m.ModFlags & Modifiers.ASYNC) != 0; current_container.AddMethod (m); } break; case 167: #line 1454 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var method = (Method) yyVals[-2+yyTop]; method.Block = (ToplevelBlock) yyVals[0+yyTop]; async_block = false; if (method.Block == null) { method.ParameterInfo.CheckParameters (method); if ((method.ModFlags & Modifiers.ASYNC) != 0) { report.Error (1994, method.Location, "`{0}': The async modifier can only be used with methods that have a body", method.GetSignatureForError ()); } } else { if (current_container.Kind == MemberKind.Interface) { report.Error (531, method.Location, "`{0}': interface members cannot have a definition", method.GetSignatureForError ()); } } current_local_parameters = null; if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; isRoleMethod = false; } break; case 168: #line 1483 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Modifiers.PRIVATE | Modifiers.ROLE; } break; case 169: #line 1487 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { { yyVal = Modifiers.PRIVATE | Modifiers.ROLE |Modifiers.ENTRY; } } break; case 170: #line 1499 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { isInteraction = false; valid_param_mod = ParameterModifierType.All; } break; case 171: #line 1504 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.ConstraintsParsing = true; } break; case 172: #line 1508 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.ConstraintsParsing = false; valid_param_mod = 0; MemberName name = (MemberName) yyVals[-6+yyTop]; current_local_parameters = (ParametersCompiled) yyVals[-3+yyTop]; var tempParameters = current_local_parameters.FixedParameters; var roleArgLocation = GetLocation (yyVals[-9+yyTop]); var realParameters = new Parameter[tempParameters.Length+1]; realParameters[0] = new Self(GetCurrentRoleContractName(), current_role.TypeExpression,"self",Parameter.Modifier.NONE,null,roleArgLocation); Array.Copy(tempParameters,0,realParameters,1,tempParameters.Length); current_local_parameters = new ParametersCompiled(realParameters); GenericMethod generic = null; if (name.TypeArguments != null) { generic = new GenericMethod (current_namespace, current_class, name, (FullNamedExpression) yyVals[-7+yyTop], current_local_parameters); generic.SetParameterInfo ((List<Constraints>) yyVals[0+yyTop]); } else if (yyVals[0+yyTop] != null) { report.Error (80, GetLocation (yyVals[0+yyTop]), "Constraints are not allowed on non-generic declarations"); } var typeExpr = (FullNamedExpression) yyVals[-7+yyTop]; var method = Method.Create (current_class, generic, typeExpr, (Modifiers)yyVals[-8+yyTop] | Modifiers.ROLE, name, current_local_parameters, (Attributes) yyVals[-9+yyTop], yyVals[0+yyTop] != null); lbag.AddMember (method, mod_locations, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-2+yyTop])); if (doc_support) method.DocComment = Lexer.consume_doc_comment (); yyVal = method; } break; case 173: #line 1547 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { isInteraction = false; valid_param_mod = ParameterModifierType.All; } break; case 174: #line 1552 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.ConstraintsParsing = true; } break; case 175: #line 1556 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.ConstraintsParsing = false; valid_param_mod = 0; MemberName name = (MemberName) yyVals[-6+yyTop]; current_local_parameters = (ParametersCompiled) yyVals[-3+yyTop]; GenericMethod generic = null; if (name.TypeArguments != null) { generic = new GenericMethod (current_namespace, current_class, name, (FullNamedExpression) yyVals[-7+yyTop], current_local_parameters); generic.SetParameterInfo ((List<Constraints>) yyVals[0+yyTop]); } else if (yyVals[0+yyTop] != null) { report.Error (80, GetLocation (yyVals[0+yyTop]), "Constraints are not allowed on non-generic declarations"); } var modifiers = (Modifiers) yyVals[-8+yyTop]; if((Modifiers.INTERACTION & modifiers) != 0){ modifiers = (modifiers ^ Modifiers.INTERACTION) | Modifiers.PUBLIC; isInteraction = true; } else { isInteraction = false; } var method = Method.Create (current_class, generic, (FullNamedExpression) yyVals[-7+yyTop], modifiers, name, current_local_parameters, (Attributes) yyVals[-9+yyTop], yyVals[0+yyTop] != null); if(current_container.Kind == MemberKind.Interface && current_extensionContainer != null){ var parameters = new List<Parameter>(); var typeExpression = new TypeExpression (compiler.BuiltinTypes.Object, GetLocation (yyVals[-9+yyTop])); var parameter = new Parameter(typeExpression, "self", Parameter.Modifier.This, null, GetLocation(yyVals[-9+yyTop])); parameters.Add(parameter); parameters.Add(new Parameter(typeExpression, "ctx", Parameter.Modifier.NONE, null, GetLocation(yyVals[-9+yyTop]))); var clone = current_local_parameters.Clone(); for(var i = 0; i < clone.Count; i++){ parameters.Add(clone[i]); } var parameterTypeExpressions = parameters.Select(p=>p.TypeExpression).ToList(); var key = current_namespace.NS.Name + "," + name.Name + "," + string.Join(",",parameterTypeExpressions.Select(p => p.ToString())); if(roleExtensionMethodDummies.Add(key)){ var returnType = (FullNamedExpression) yyVals[-7+yyTop]; var parametersCompiled = new ParametersCompiled(parameters.ToArray(),false); var dummy = Method.Create (current_extensionContainer, generic, (FullNamedExpression) yyVals[-7+yyTop], Modifiers.PUBLIC | Modifiers.STATIC, name, parametersCompiled, (Attributes) yyVals[-9+yyTop], yyVals[0+yyTop] != null); var location = GetLocation(yyVals[-9+yyTop]); var parameterName = new SimpleName("self", null, location); var getTypeAccess = new MemberAccess(parameterName, "GetType", null, location); var getTypeExpression = new Invocation(getTypeAccess, new Arguments(0)); var argCount = parameterTypeExpressions.Count-1; var argumentsForGetMethod = new Arguments(2); var stringLiteral = new StringLiteral(compiler.BuiltinTypes,name.Name,location); argumentsForGetMethod.Add(new Argument(stringLiteral)); var typeName = new SimpleName("Type", null, location); var types = parameterTypeExpressions.Skip(2) .Select(t =>(Expression)(t.Type != null ? new TypeOf(t.Type,location) : new TypeOf(t,location)) ).ToList(); var initializer = new ArrayInitializer(types,location); var parameterTypes = new ImplicitlyTypedArrayCreation ( new ComposedTypeSpecifier (1, location), initializer, location); lbag.AddLocation (parameterTypes, location, location); argumentsForGetMethod.Add(new Argument(parameterTypes)); var getMethodExpression = new Invocation(new MemberAccess(getTypeExpression,"GetMethod"),argumentsForGetMethod); var argumentsForMethod = new Arguments(2); var delegatedArguments = parameters.Skip(2).Select(p => (Expression)new Cast( new TypeExpression(compiler.BuiltinTypes.Object,location), new SimpleName(p.Name,location), location)).ToList(); argumentsForMethod.Add(new Argument(new SimpleName("self", null, location))); if(delegatedArguments.Any()){ initializer = new ArrayInitializer(delegatedArguments,location); argumentsForMethod.Add(new Argument(new ImplicitlyTypedArrayCreation( new ComposedTypeSpecifier (1, location), initializer, location))); } else { argumentsForMethod.Add(new Argument(new ArrayCreation(new TypeExpression(compiler.BuiltinTypes.Object,location),new ArrayInitializer(0,location)))); } var invocation = new Invocation(new MemberAccess(getMethodExpression,"Invoke"),argumentsForMethod); Statement statement = new StatementExpression(invocation); var retType = (returnType as TypeExpression); if(retType != null && retType.Type.Name != "Void"){ var cast = new Cast(returnType,invocation,location); statement = new Return(cast,location); } dummy.Block = new ToplevelBlock (compiler, parametersCompiled, GetLocation(yyVals[-9+yyTop])); /*var exceptionExpression = new New(new MemberName("InvalidOperationException",GetLocation($1)).GetTypeExpression(),new Arguments(0),GetLocation($1));*/ dummy.Block.AddStatement( statement); lbag.AddMember(dummy,mod_locations, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-2+yyTop])); ((Class)current_extensionContainer).AddMethod(dummy); } } if (doc_support) method.DocComment = Lexer.consume_doc_comment (); lbag.AddMember (method, mod_locations, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-2+yyTop])); yyVal = method; } break; case 176: #line 1666 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.parsing_generic_declaration = true; } break; case 177: #line 1671 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.parsing_generic_declaration = false; valid_param_mod = ParameterModifierType.All; } break; case 178: #line 1676 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.ConstraintsParsing = true; } break; case 179: #line 1680 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.ConstraintsParsing = false; valid_param_mod = 0; MemberName name = (MemberName) yyVals[-6+yyTop]; current_local_parameters = (ParametersCompiled) yyVals[-3+yyTop]; if (yyVals[-1+yyTop] != null && name.TypeArguments == null) report.Error (80, lexer.Location, "Constraints are not allowed on non-generic declarations"); GenericMethod generic = null; if (name.TypeArguments != null) { generic = new GenericMethod (current_namespace, current_class, name, new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[-8+yyTop])), current_local_parameters); generic.SetParameterInfo ((List<Constraints>) yyVals[-1+yyTop]); } var modifiers = (Modifiers) yyVals[-10+yyTop]; modifiers |= Modifiers.PARTIAL; var method = Method.Create (current_class, generic, new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[-8+yyTop])), modifiers, name, current_local_parameters, (Attributes) yyVals[-11+yyTop], yyVals[-1+yyTop] != null); if (doc_support) method.DocComment = Lexer.consume_doc_comment (); StoreModifierLocation (Modifiers.PARTIAL, GetLocation (yyVals[-9+yyTop])); lbag.AddMember (method, mod_locations, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-2+yyTop])); yyVal = method; } break; case 180: #line 1717 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { MemberName name = (MemberName) yyVals[-3+yyTop]; report.Error (1585, name.Location, "Member modifier `{0}' must precede the member type and name", ModifiersExtensions.Name ((Modifiers) yyVals[-4+yyTop])); var method = Method.Create (current_class, null, (FullNamedExpression) yyVals[-5+yyTop], 0, name, (ParametersCompiled) yyVals[-1+yyTop], (Attributes) yyVals[-7+yyTop], false); current_local_parameters = (ParametersCompiled) yyVals[-1+yyTop]; if (doc_support) method.DocComment = Lexer.consume_doc_comment (); yyVal = method; } break; case 182: #line 1736 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = null; } break; case 183: #line 1740 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = ParametersCompiled.EmptyReadOnlyParameters; } break; case 185: #line 1746 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var pars_list = (List<Parameter>) yyVals[0+yyTop]; yyVal = new ParametersCompiled (pars_list.ToArray ()); } break; case 186: #line 1751 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var pars_list = (List<Parameter>) yyVals[-2+yyTop]; pars_list.Add ((Parameter) yyVals[0+yyTop]); yyVal = new ParametersCompiled (pars_list.ToArray ()); } break; case 187: #line 1758 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var pars_list = (List<Parameter>) yyVals[-2+yyTop]; pars_list.Add (new ArglistParameter (GetLocation (yyVals[0+yyTop]))); yyVal = new ParametersCompiled (pars_list.ToArray (), true); } break; case 188: #line 1764 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyVals[-2+yyTop] != null) report.Error (231, ((Parameter) yyVals[-2+yyTop]).Location, "A params parameter must be the last parameter in a formal parameter list"); yyVal = new ParametersCompiled (new Parameter[] { (Parameter) yyVals[-2+yyTop] } ); } break; case 189: #line 1771 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyVals[-2+yyTop] != null) report.Error (231, ((Parameter) yyVals[-2+yyTop]).Location, "A params parameter must be the last parameter in a formal parameter list"); var pars_list = (List<Parameter>) yyVals[-4+yyTop]; pars_list.Add (new ArglistParameter (GetLocation (yyVals[-2+yyTop]))); yyVal = new ParametersCompiled (pars_list.ToArray (), true); } break; case 190: #line 1781 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Error (257, GetLocation (yyVals[-2+yyTop]), "An __arglist parameter must be the last parameter in a formal parameter list"); yyVal = new ParametersCompiled (new Parameter [] { new ArglistParameter (GetLocation (yyVals[-2+yyTop])) }, true); } break; case 191: #line 1787 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Error (257, GetLocation (yyVals[-2+yyTop]), "An __arglist parameter must be the last parameter in a formal parameter list"); var pars_list = (List<Parameter>) yyVals[-4+yyTop]; pars_list.Add (new ArglistParameter (GetLocation (yyVals[-2+yyTop]))); yyVal = new ParametersCompiled (pars_list.ToArray (), true); } break; case 192: #line 1796 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new ParametersCompiled (new Parameter[] { (Parameter) yyVals[0+yyTop] } ); } break; case 193: #line 1800 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new ParametersCompiled (new Parameter [] { new ArglistParameter (GetLocation (yyVals[0+yyTop])) }, true); } break; case 194: #line 1804 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = ParametersCompiled.EmptyReadOnlyParameters; } break; case 195: #line 1812 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { parameters_bucket.Clear (); Parameter p = (Parameter) yyVals[0+yyTop]; parameters_bucket.Add (p); default_parameter_used = p.HasDefaultValue; yyVal = parameters_bucket; } break; case 196: #line 1821 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var pars = (List<Parameter>) yyVals[-2+yyTop]; Parameter p = (Parameter) yyVals[0+yyTop]; if (p != null) { if (p.HasExtensionMethodModifier) report.Error (1100, p.Location, "The parameter modifier `this' can only be used on the first parameter"); else if (!p.HasDefaultValue && default_parameter_used) report.Error (1737, p.Location, "Optional parameter cannot precede required parameters"); default_parameter_used |= p.HasDefaultValue; pars.Add (p); lbag.AddLocation (p, GetLocation (yyVals[-1+yyTop])); } yyVal = yyVals[-2+yyTop]; } break; case 197: #line 1845 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new Parameter ((FullNamedExpression) yyVals[-1+yyTop], lt.Value, (Parameter.Modifier) yyVals[-2+yyTop], (Attributes) yyVals[-3+yyTop], lt.Location); } break; case 198: #line 1853 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; report.Error (1552, lt.Location, "Array type specifier, [], must appear before parameter name"); yyVal = new Parameter ((FullNamedExpression) yyVals[-3+yyTop], lt.Value, (Parameter.Modifier) yyVals[-4+yyTop], (Attributes) yyVals[-5+yyTop], lt.Location); } break; case 199: #line 1862 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Error_SyntaxError (yyToken); Location l = GetLocation (yyVals[0+yyTop]); yyVal = new Parameter ((FullNamedExpression) yyVals[-1+yyTop], null, (Parameter.Modifier) yyVals[-2+yyTop], (Attributes) yyVals[-3+yyTop], l); } break; case 200: #line 1872 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { ++lexer.parsing_block; } break; case 201: #line 1876 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { --lexer.parsing_block; if (lang_version <= LanguageVersion.V_3) { FeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), "optional parameter"); } Parameter.Modifier mod = (Parameter.Modifier) yyVals[-5+yyTop]; if (mod != Parameter.Modifier.NONE) { switch (mod) { case Parameter.Modifier.REF: case Parameter.Modifier.OUT: report.Error (1741, GetLocation (yyVals[-5+yyTop]), "Cannot specify a default value for the `{0}' parameter", Parameter.GetModifierSignature (mod)); break; case Parameter.Modifier.This: report.Error (1743, GetLocation (yyVals[-5+yyTop]), "Cannot specify a default value for the `{0}' parameter", Parameter.GetModifierSignature (mod)); break; default: throw new NotImplementedException (mod.ToString ()); } mod = Parameter.Modifier.NONE; } if ((valid_param_mod & ParameterModifierType.DefaultValue) == 0) report.Error (1065, GetLocation (yyVals[-2+yyTop]), "Optional parameter is not valid in this context"); var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; yyVal = new Parameter ((FullNamedExpression) yyVals[-4+yyTop], lt.Value, mod, (Attributes) yyVals[-6+yyTop], lt.Location); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); if (yyVals[0+yyTop] != null) ((Parameter) yyVal).DefaultValue = new DefaultParameterValueExpression ((Expression) yyVals[0+yyTop]); } break; case 202: #line 1915 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Parameter.Modifier.NONE; } break; case 204: #line 1921 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 205: #line 1925 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Parameter.Modifier p2 = (Parameter.Modifier)yyVals[0+yyTop]; Parameter.Modifier mod = (Parameter.Modifier)yyVals[-1+yyTop] | p2; if (((Parameter.Modifier)yyVals[-1+yyTop] & p2) == p2) { Error_DuplicateParameterModifier (lexer.Location, p2); } else { switch (mod & ~Parameter.Modifier.This) { case Parameter.Modifier.REF: report.Error (1101, lexer.Location, "The parameter modifiers `this' and `ref' cannot be used altogether"); break; case Parameter.Modifier.OUT: report.Error (1102, lexer.Location, "The parameter modifiers `this' and `out' cannot be used altogether"); break; default: report.Error (1108, lexer.Location, "A parameter cannot have specified more than one modifier"); break; } } yyVal = mod; } break; case 206: #line 1949 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if ((valid_param_mod & ParameterModifierType.Ref) == 0) Error_ParameterModifierNotValid ("ref", GetLocation (yyVals[0+yyTop])); yyVal = Parameter.Modifier.REF; } break; case 207: #line 1956 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if ((valid_param_mod & ParameterModifierType.Out) == 0) Error_ParameterModifierNotValid ("out", GetLocation (yyVals[0+yyTop])); yyVal = Parameter.Modifier.OUT; } break; case 208: #line 1963 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if ((valid_param_mod & ParameterModifierType.This) == 0) Error_ParameterModifierNotValid ("this", GetLocation (yyVals[0+yyTop])); if (lang_version <= LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[0+yyTop]), "extension methods"); yyVal = Parameter.Modifier.This; } break; case 209: #line 1976 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new ParamsParameter ((FullNamedExpression) yyVals[-1+yyTop], lt.Value, (Attributes) yyVals[-3+yyTop], lt.Location); } break; case 210: #line 1981 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Error (1751, GetLocation (yyVals[-4+yyTop]), "Cannot specify a default value for a parameter array"); var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; yyVal = new ParamsParameter ((FullNamedExpression) yyVals[-3+yyTop], lt.Value, (Attributes) yyVals[-5+yyTop], lt.Location); } break; case 211: #line 1988 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = null; } break; case 212: #line 1996 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if ((valid_param_mod & ParameterModifierType.Params) == 0) report.Error (1670, (GetLocation (yyVals[0+yyTop])), "The `params' modifier is not allowed in current context"); } break; case 213: #line 2001 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Parameter.Modifier mod = (Parameter.Modifier)yyVals[0+yyTop]; if ((mod & Parameter.Modifier.This) != 0) { report.Error (1104, GetLocation (yyVals[-1+yyTop]), "The parameter modifiers `this' and `params' cannot be used altogether"); } else { report.Error (1611, GetLocation (yyVals[-1+yyTop]), "The params parameter cannot be declared as ref or out"); } } break; case 214: #line 2010 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Error_DuplicateParameterModifier (GetLocation (yyVals[-1+yyTop]), Parameter.Modifier.PARAMS); } break; case 215: #line 2017 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if ((valid_param_mod & ParameterModifierType.Arglist) == 0) report.Error (1669, GetLocation (yyVals[0+yyTop]), "__arglist is not valid in this context"); } break; case 216: #line 2028 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (doc_support) tmpComment = Lexer.consume_doc_comment (); } break; case 217: #line 2033 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var type = (FullNamedExpression) yyVals[-3+yyTop]; current_property = new Property (current_class, type, (Modifiers) yyVals[-4+yyTop], (MemberName) yyVals[-2+yyTop], (Attributes) yyVals[-5+yyTop]); if (type.Type != null && type.Type.Kind == MemberKind.Void) report.Error (547, GetLocation (yyVals[-3+yyTop]), "`{0}': property or indexer cannot have void type", current_property.GetSignatureForError ()); current_container.AddProperty ((Property)current_property); lbag.AddMember (current_property, mod_locations, GetLocation (yyVals[0+yyTop])); lexer.PropertyParsing = true; } break; case 218: #line 2047 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.PropertyParsing = false; if (doc_support) current_property.DocComment = ConsumeStoredComment (); } break; case 219: #line 2054 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lbag.AppendToMember (current_property, GetLocation (yyVals[0+yyTop])); current_property = null; } break; case 220: #line 2064 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { valid_param_mod = ParameterModifierType.Params | ParameterModifierType.DefaultValue; } break; case 221: #line 2068 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { valid_param_mod = 0; var type = (FullNamedExpression) yyVals[-6+yyTop]; Indexer indexer = new Indexer (current_class, type, (MemberName) yyVals[-5+yyTop], (Modifiers) yyVals[-7+yyTop], (ParametersCompiled) yyVals[-2+yyTop], (Attributes) yyVals[-8+yyTop]); current_property = indexer; current_container.AddIndexer (indexer); lbag.AddMember (current_property, mod_locations, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop])); if (type.Type != null && type.Type.Kind == MemberKind.Void) report.Error (620, GetLocation (yyVals[-6+yyTop]), "`{0}': indexer return type cannot be `void'", indexer.GetSignatureForError ()); if (indexer.ParameterInfo.IsEmpty) { report.Error (1551, GetLocation (yyVals[-4+yyTop]), "Indexers must have at least one parameter"); } if (doc_support) { tmpComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } lexer.PropertyParsing = true; } break; case 222: #line 2093 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.PropertyParsing = false; } break; case 223: #line 2097 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (current_property.AccessorFirst != null && current_property.AccessorFirst.Block == null) ((Indexer) current_property).ParameterInfo.CheckParameters (current_property); if (doc_support) current_property.DocComment = ConsumeStoredComment (); lbag.AppendToMember (current_property, GetLocation (yyVals[-1+yyTop])); current_property = null; } break; case 228: #line 2116 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyToken == Token.CLOSE_BRACE) { report.Error (548, lexer.Location, "`{0}': property or indexer must have at least one accessor", current_property.GetSignatureForError ()); } else { if (yyToken == Token.SEMICOLON) report.Error (1597, lexer.Location, "Semicolon after method or accessor block is not valid"); else report.Error (1014, GetLocation (yyVals[0+yyTop]), "A get or set accessor expected"); } } break; case 229: #line 2130 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyVals[-1+yyTop] != ModifierNone && lang_version == LanguageVersion.ISO_1) { FeatureIsNotAvailable (GetLocation (yyVals[-1+yyTop]), "access modifiers on properties"); } if (current_property.Get != null) { report.Error (1007, GetLocation (yyVals[0+yyTop]), "Property accessor already defined"); } if (current_property is Indexer) { current_property.Get = new Indexer.GetIndexerMethod (current_property, (Modifiers) yyVals[-1+yyTop], ((Indexer)current_property).ParameterInfo.Clone (), (Attributes) yyVals[-2+yyTop], GetLocation (yyVals[0+yyTop])); } else { current_property.Get = new Property.GetMethod (current_property, (Modifiers) yyVals[-1+yyTop], (Attributes) yyVals[-2+yyTop], GetLocation (yyVals[0+yyTop])); } current_local_parameters = current_property.Get.ParameterInfo; lbag.AddMember (current_property.Get, mod_locations); lexer.PropertyParsing = false; } break; case 230: #line 2152 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyVals[0+yyTop] != null) { current_property.Get.Block = (ToplevelBlock) yyVals[0+yyTop]; if (current_container.Kind == MemberKind.Interface) { report.Error (531, current_property.Get.Block.StartLocation, "`{0}': interface members cannot have a definition", current_property.Get.GetSignatureForError ()); } } current_local_parameters = null; lexer.PropertyParsing = true; if (doc_support) if (Lexer.doc_state == XmlCommentState.Error) Lexer.doc_state = XmlCommentState.NotAllowed; } break; case 231: #line 2173 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyVals[-1+yyTop] != ModifierNone && lang_version == LanguageVersion.ISO_1) { FeatureIsNotAvailable (GetLocation (yyVals[-1+yyTop]), "access modifiers on properties"); } if (current_property.Set != null) { report.Error (1007, GetLocation (yyVals[0+yyTop]), "Property accessor already defined"); } if (current_property is Indexer) { current_property.Set = new Indexer.SetIndexerMethod (current_property, (Modifiers) yyVals[-1+yyTop], ParametersCompiled.MergeGenerated (compiler, ((Indexer)current_property).ParameterInfo, true, new Parameter ( current_property.TypeExpression, "value", Parameter.Modifier.NONE, null, GetLocation (yyVals[0+yyTop])), null), (Attributes) yyVals[-2+yyTop], GetLocation (yyVals[0+yyTop])); } else { current_property.Set = new Property.SetMethod (current_property, (Modifiers) yyVals[-1+yyTop], ParametersCompiled.CreateImplicitParameter (current_property.TypeExpression, GetLocation (yyVals[0+yyTop])), (Attributes) yyVals[-2+yyTop], GetLocation (yyVals[0+yyTop])); } current_local_parameters = current_property.Set.ParameterInfo; lbag.AddMember (current_property.Set, mod_locations); lexer.PropertyParsing = false; } break; case 232: #line 2200 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyVals[0+yyTop] != null) { current_property.Set.Block = (ToplevelBlock) yyVals[0+yyTop]; if (current_container.Kind == MemberKind.Interface) { report.Error (531, current_property.Set.Block.StartLocation, "`{0}': interface members cannot have a definition", current_property.Set.GetSignatureForError ()); } } current_local_parameters = null; lexer.PropertyParsing = true; if (doc_support && Lexer.doc_state == XmlCommentState.Error) Lexer.doc_state = XmlCommentState.NotAllowed; } break; case 234: #line 2222 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { /* TODO: lbag*/ yyVal = null; } break; case 235: #line 2227 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Error_SyntaxError (1043, yyToken, "Invalid accessor body"); yyVal = null; } break; case 236: #line 2238 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.ConstraintsParsing = true; } break; case 237: #line 2242 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { MemberName name = MakeName ((MemberName) yyVals[0+yyTop]); push_current_class (new Interface (current_namespace, current_class, name, (Modifiers) yyVals[-4+yyTop], (Attributes) yyVals[-5+yyTop]), yyVals[-3+yyTop]); lbag.AddMember (current_class, mod_locations, GetLocation (yyVals[-2+yyTop])); } break; case 238: #line 2249 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.ConstraintsParsing = false; current_class.SetParameterInfo ((List<Constraints>) yyVals[0+yyTop]); if (doc_support) { current_container.DocComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } lexer.parsing_modifiers = true; } break; case 239: #line 2262 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { --lexer.parsing_declaration; if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; } break; case 240: #line 2268 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lbag.AppendToMember (current_class, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop])); yyVal = pop_current_class (); } break; case 241: #line 2273 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Error_SyntaxError (yyToken); } break; case 244: #line 2285 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.parsing_modifiers = true; } break; case 245: #line 2289 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.parsing_modifiers = true; } break; case 246: #line 2296 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Error (525, GetLocation (yyVals[0+yyTop]), "Interfaces cannot contain fields or constants"); } break; case 247: #line 2300 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Error (525, GetLocation (yyVals[0+yyTop]), "Interfaces cannot contain fields or constants"); } break; case 252: #line 2308 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Error (567, GetLocation (yyVals[0+yyTop]), "Interfaces cannot contain operators"); } break; case 253: #line 2312 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Error (526, GetLocation (yyVals[0+yyTop]), "Interfaces cannot contain contructors"); } break; case 254: #line 2316 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Error (524, GetLocation (yyVals[0+yyTop]), "Interfaces cannot declare classes, structs, interfaces, delegates, or enumerations"); } break; case 255: #line 2323 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { } break; case 256: #line 2326 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { OperatorDeclaration decl = (OperatorDeclaration) yyVals[-2+yyTop]; if (decl != null) { Operator op = new Operator ( current_class, decl.optype, decl.ret_type, (Modifiers) yyVals[-3+yyTop], current_local_parameters, (ToplevelBlock) yyVals[0+yyTop], (Attributes) yyVals[-4+yyTop], decl.location); if (op.Block == null) op.ParameterInfo.CheckParameters (op); if (doc_support) { op.DocComment = tmpComment; Lexer.doc_state = XmlCommentState.Allowed; } /* Note again, checking is done in semantic analysis*/ current_container.AddOperator (op); lbag.AddMember (op, mod_locations, lbag.GetLocations (decl)); } current_local_parameters = null; } break; case 258: #line 2354 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = null; } break; case 260: #line 2360 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Error (590, GetLocation (yyVals[0+yyTop]), "User-defined operators cannot return void"); yyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop])); } break; case 261: #line 2368 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { valid_param_mod = ParameterModifierType.DefaultValue; } break; case 262: #line 2372 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { valid_param_mod = 0; Location loc = GetLocation (yyVals[-5+yyTop]); Operator.OpType op = (Operator.OpType) yyVals[-4+yyTop]; current_local_parameters = (ParametersCompiled)yyVals[-1+yyTop]; int p_count = current_local_parameters.Count; if (p_count == 1) { if (op == Operator.OpType.Addition) op = Operator.OpType.UnaryPlus; else if (op == Operator.OpType.Subtraction) op = Operator.OpType.UnaryNegation; } if (IsUnaryOperator (op)) { if (p_count == 2) { report.Error (1020, loc, "Overloadable binary operator expected"); } else if (p_count != 1) { report.Error (1535, loc, "Overloaded unary operator `{0}' takes one parameter", Operator.GetName (op)); } } else { if (p_count > 2) { report.Error (1534, loc, "Overloaded binary operator `{0}' takes two parameters", Operator.GetName (op)); } else if (p_count != 2) { report.Error (1019, loc, "Overloadable unary operator expected"); } } if (doc_support) { tmpComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.NotAllowed; } yyVal = new OperatorDeclaration (op, (FullNamedExpression) yyVals[-6+yyTop], loc); lbag.AddLocation (yyVal, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop])); } break; case 264: #line 2416 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Operator.OpType.LogicalNot; } break; case 265: #line 2417 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Operator.OpType.OnesComplement; } break; case 266: #line 2418 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Operator.OpType.Increment; } break; case 267: #line 2419 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Operator.OpType.Decrement; } break; case 268: #line 2420 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Operator.OpType.True; } break; case 269: #line 2421 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Operator.OpType.False; } break; case 270: #line 2423 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Operator.OpType.Addition; } break; case 271: #line 2424 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Operator.OpType.Subtraction; } break; case 272: #line 2426 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Operator.OpType.Multiply; } break; case 273: #line 2427 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Operator.OpType.Division; } break; case 274: #line 2428 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Operator.OpType.Modulus; } break; case 275: #line 2429 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Operator.OpType.BitwiseAnd; } break; case 276: #line 2430 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Operator.OpType.BitwiseOr; } break; case 277: #line 2431 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Operator.OpType.ExclusiveOr; } break; case 278: #line 2432 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Operator.OpType.LeftShift; } break; case 279: #line 2433 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Operator.OpType.RightShift; } break; case 280: #line 2434 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Operator.OpType.Equality; } break; case 281: #line 2435 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Operator.OpType.Inequality; } break; case 282: #line 2436 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Operator.OpType.GreaterThan; } break; case 283: #line 2437 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Operator.OpType.LessThan; } break; case 284: #line 2438 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Operator.OpType.GreaterThanOrEqual; } break; case 285: #line 2439 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Operator.OpType.LessThanOrEqual; } break; case 286: #line 2444 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { valid_param_mod = ParameterModifierType.DefaultValue; } break; case 287: #line 2448 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { valid_param_mod = 0; Location loc = GetLocation (yyVals[-5+yyTop]); current_local_parameters = (ParametersCompiled)yyVals[-1+yyTop]; if (doc_support) { tmpComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.NotAllowed; } yyVal = new OperatorDeclaration (Operator.OpType.Implicit, (FullNamedExpression) yyVals[-4+yyTop], loc); lbag.AddLocation (yyVal, GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop])); } break; case 288: #line 2463 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { valid_param_mod = ParameterModifierType.DefaultValue; } break; case 289: #line 2467 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { valid_param_mod = 0; Location loc = GetLocation (yyVals[-5+yyTop]); current_local_parameters = (ParametersCompiled)yyVals[-1+yyTop]; if (doc_support) { tmpComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.NotAllowed; } yyVal = new OperatorDeclaration (Operator.OpType.Explicit, (FullNamedExpression) yyVals[-4+yyTop], loc); lbag.AddLocation (yyVal, GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop])); } break; case 290: #line 2482 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Error_SyntaxError (yyToken); current_local_parameters = ParametersCompiled.EmptyReadOnlyParameters; yyVal = new OperatorDeclaration (Operator.OpType.Implicit, null, GetLocation (yyVals[-1+yyTop])); } break; case 291: #line 2488 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Error_SyntaxError (yyToken); current_local_parameters = ParametersCompiled.EmptyReadOnlyParameters; yyVal = new OperatorDeclaration (Operator.OpType.Explicit, null, GetLocation (yyVals[-1+yyTop])); } break; case 292: #line 2498 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Constructor c = (Constructor) yyVals[-1+yyTop]; c.Block = (ToplevelBlock) yyVals[0+yyTop]; if (doc_support) c.DocComment = ConsumeStoredComment (); current_container.AddConstructor (c); current_local_parameters = null; if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; current_method = null; } break; case 293: #line 2518 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (doc_support) { tmpComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } valid_param_mod = ParameterModifierType.All; } break; case 294: #line 2527 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { valid_param_mod = 0; current_local_parameters = (ParametersCompiled) yyVals[-1+yyTop]; /**/ /* start block here, so possible anonymous methods inside*/ /* constructor initializer can get correct parent block*/ /**/ start_block (lexer.Location); } break; case 295: #line 2538 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-6+yyTop]; var mods = (Modifiers) yyVals[-7+yyTop]; ConstructorInitializer ci = (ConstructorInitializer) yyVals[0+yyTop]; Constructor c = new Constructor (current_class, lt.Value, mods, (Attributes) yyVals[-8+yyTop], current_local_parameters, ci, lt.Location); current_method = c; if (lt.Value != current_container.MemberName.Name) { report.Error (1520, c.Location, "Class, struct, or interface method must have a return type"); } else if ((mods & Modifiers.STATIC) != 0) { if ((mods & Modifiers.AccessibilityMask) != 0){ report.Error (515, c.Location, "`{0}': static constructor cannot have an access modifier", c.GetSignatureForError ()); } if (ci != null) { report.Error (514, c.Location, "`{0}': static constructor cannot have an explicit `this' or `base' constructor call", c.GetSignatureForError ()); } } lbag.AddMember (c, mod_locations, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop])); yyVal = c; } break; case 297: #line 2569 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_block = null; yyVal = null; } break; case 300: #line 2579 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { ++lexer.parsing_block; } break; case 301: #line 2583 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { --lexer.parsing_block; yyVal = new ConstructorBaseInitializer ((Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop])); } break; case 302: #line 2589 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { ++lexer.parsing_block; } break; case 303: #line 2593 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { --lexer.parsing_block; yyVal = new ConstructorThisInitializer ((Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop])); } break; case 304: #line 2599 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = null; } break; case 305: #line 2607 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (doc_support) { tmpComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.NotAllowed; } current_local_parameters = ParametersCompiled.EmptyReadOnlyParameters; } break; case 306: #line 2616 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; if (lt.Value != current_container.MemberName.Name){ report.Error (574, lt.Location, "Name of destructor must match name of class"); } else if (current_container.Kind != MemberKind.Class){ report.Error (575, lt.Location, "Only class types can contain destructor"); } Destructor d = new Destructor (current_class, (Modifiers) yyVals[-6+yyTop], ParametersCompiled.EmptyReadOnlyParameters, (Attributes) yyVals[-7+yyTop], lt.Location); if (doc_support) d.DocComment = ConsumeStoredComment (); d.Block = (ToplevelBlock) yyVals[0+yyTop]; current_container.AddMethod (d); lbag.AddMember (d, mod_locations, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[-1+yyTop])); current_local_parameters = null; } break; case 307: #line 2641 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_event_field = new EventField (current_class, (FullNamedExpression) yyVals[-1+yyTop], (Modifiers) yyVals[-3+yyTop], (MemberName) yyVals[0+yyTop], (Attributes) yyVals[-4+yyTop]); current_container.AddEvent (current_event_field); if (current_event_field.MemberName.Left != null) { report.Error (71, current_event_field.Location, "`{0}': An explicit interface implementation of an event must use property syntax", current_event_field.GetSignatureForError ()); } yyVal = current_event_field; } break; case 308: #line 2655 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (doc_support) { current_event_field.DocComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } lbag.AddMember (current_event_field, mod_locations, GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[0+yyTop])); current_event_field = null; } break; case 309: #line 2668 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_event = new EventProperty (current_class, (FullNamedExpression) yyVals[-2+yyTop], (Modifiers) yyVals[-4+yyTop], (MemberName) yyVals[-1+yyTop], (Attributes) yyVals[-5+yyTop]); current_container.AddEvent (current_event); lbag.AddMember (current_event, mod_locations, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop])); lexer.EventParsing = true; } break; case 310: #line 2676 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (current_container.Kind == MemberKind.Interface) report.Error (69, GetLocation (yyVals[-2+yyTop]), "Event in interface cannot have add or remove accessors"); lexer.EventParsing = false; } break; case 311: #line 2683 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (doc_support) { current_event.DocComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } lbag.AppendToMember (current_event, GetLocation (yyVals[-1+yyTop])); current_event = null; current_local_parameters = null; } break; case 313: #line 2698 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { ++lexer.parsing_block; } break; case 314: #line 2702 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { --lexer.parsing_block; current_event_field.Initializer = (Expression) yyVals[0+yyTop]; } break; case 317: #line 2715 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_event_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 318: #line 2719 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_event_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 319: #line 2726 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), null); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } break; case 320: #line 2732 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { ++lexer.parsing_block; } break; case 321: #line 2736 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { --lexer.parsing_block; var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; yyVal = new FieldDeclarator (new SimpleMemberName (lt.Value, lt.Location), (Expression) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop])); } break; case 322: #line 2745 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (current_container.Kind == MemberKind.Interface) { report.Error (68, lexer.Location, "`{0}': event in interface cannot have an initializer", current_event_field.GetSignatureForError ()); } if ((current_event_field.ModFlags & Modifiers.ABSTRACT) != 0) { report.Error (74, lexer.Location, "`{0}': abstract event cannot have an initializer", current_event_field.GetSignatureForError ()); } } break; case 323: #line 2757 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 326: #line 2766 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Error (65, lexer.Location, "`{0}': event property must have both add and remove accessors", current_event.GetSignatureForError ()); } break; case 327: #line 2771 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Error (65, lexer.Location, "`{0}': event property must have both add and remove accessors", current_event.GetSignatureForError ()); } break; case 328: #line 2776 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Error (1055, GetLocation (yyVals[0+yyTop]), "An add or remove accessor expected"); yyVal = null; } break; case 329: #line 2784 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyVals[-1+yyTop] != ModifierNone) { report.Error (1609, GetLocation (yyVals[-1+yyTop]), "Modifiers cannot be placed on event accessor declarations"); } current_event.Add = new EventProperty.AddDelegateMethod (current_event, (Attributes) yyVals[-2+yyTop], GetLocation (yyVals[0+yyTop])); current_local_parameters = current_event.Add.ParameterInfo; lbag.AddMember (current_event.Add, mod_locations); lexer.EventParsing = false; } break; case 330: #line 2796 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.EventParsing = true; current_event.Add.Block = (ToplevelBlock) yyVals[0+yyTop]; if (current_container.Kind == MemberKind.Interface) { report.Error (531, current_event.Add.Block.StartLocation, "`{0}': interface members cannot have a definition", current_event.Add.GetSignatureForError ()); } current_local_parameters = null; } break; case 331: #line 2812 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyVals[-1+yyTop] != ModifierNone) { report.Error (1609, GetLocation (yyVals[-1+yyTop]), "Modifiers cannot be placed on event accessor declarations"); } current_event.Remove = new EventProperty.RemoveDelegateMethod (current_event, (Attributes) yyVals[-2+yyTop], GetLocation (yyVals[0+yyTop])); current_local_parameters = current_event.Remove.ParameterInfo; lbag.AddMember (current_event.Remove, mod_locations); lexer.EventParsing = false; } break; case 332: #line 2824 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.EventParsing = true; current_event.Remove.Block = (ToplevelBlock) yyVals[0+yyTop]; if (current_container.Kind == MemberKind.Interface) { report.Error (531, current_event.Remove.Block.StartLocation, "`{0}': interface members cannot have a definition", current_event.Remove.GetSignatureForError ()); } current_local_parameters = null; } break; case 333: #line 2840 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Error (73, lexer.Location, "An add or remove accessor must have a body"); yyVal = null; } break; case 335: #line 2852 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (doc_support) enumTypeComment = Lexer.consume_doc_comment (); } break; case 336: #line 2857 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; MemberName name = (MemberName) yyVals[-3+yyTop]; if (name.IsGeneric) { report.Error (1675, name.Location, "Enums cannot have type parameters"); } push_current_class (new Enum (current_namespace, current_class, (TypeExpression) yyVals[-2+yyTop], (Modifiers) yyVals[-5+yyTop], MakeName (name), (Attributes) yyVals[-6+yyTop]), null); } break; case 337: #line 2869 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { /* here will be evaluated after CLOSE_BLACE is consumed.*/ if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; } break; case 338: #line 2875 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (doc_support) current_class.DocComment = enumTypeComment; --lexer.parsing_declaration; /* if (doc_support)*/ /* em.DocComment = ev.DocComment;*/ lbag.AddMember (current_class, mod_locations, GetLocation (yyVals[-9+yyTop]), GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-1+yyTop])); yyVal = pop_current_class (); } break; case 340: #line 2892 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var te = yyVals[0+yyTop] as TypeExpression; if (te == null || !EnumSpec.IsValidUnderlyingType (te.Type)) { Enum.Error_1008 (GetLocation (yyVals[0+yyTop]), report); yyVal = null; } else { yyVal = yyVals[0+yyTop]; } } break; case 341: #line 2902 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Error_TypeExpected (GetLocation (yyVals[-1+yyTop])); yyVal = null; } break; case 344: #line 2912 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lbag.AddLocation (yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop])); } break; case 346: #line 2920 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lbag.AddLocation (yyVals[-2+yyTop], GetLocation (yyVals[-1+yyTop])); yyVal = yyVals[0+yyTop]; } break; case 347: #line 2928 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; var em = new EnumMember ((Enum) current_class, new MemberName (lt.Value, lt.Location), (Attributes) yyVals[-1+yyTop]); ((Enum) current_class).AddEnumMember (em); if (doc_support) { em.DocComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } yyVal = em; } break; case 348: #line 2941 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { ++lexer.parsing_block; if (doc_support) { tmpComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.NotAllowed; } } break; case 349: #line 2949 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { --lexer.parsing_block; var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; var em = new EnumMember ((Enum) current_class, new MemberName (lt.Value, lt.Location), (Attributes) yyVals[-4+yyTop]); em.Initializer = new ConstInitializer (em, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); ((Enum) current_class).AddEnumMember (em); if (doc_support) em.DocComment = ConsumeStoredComment (); yyVal = em; } break; case 350: #line 2970 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out | ParameterModifierType.Params | ParameterModifierType.DefaultValue; } break; case 351: #line 2974 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { valid_param_mod = 0; MemberName name = MakeName ((MemberName) yyVals[-4+yyTop]); ParametersCompiled p = (ParametersCompiled) yyVals[-1+yyTop]; Delegate del = new Delegate (current_namespace, current_class, (FullNamedExpression) yyVals[-5+yyTop], (Modifiers) yyVals[-7+yyTop], name, p, (Attributes) yyVals[-8+yyTop]); p.CheckParameters (del); current_container.AddDelegate (del); current_delegate = del; lexer.ConstraintsParsing = true; } break; case 352: #line 2990 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.ConstraintsParsing = false; } break; case 353: #line 2994 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (doc_support) { current_delegate.DocComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } current_delegate.SetParameterInfo ((List<Constraints>) yyVals[-2+yyTop]); lbag.AddMember (current_delegate, mod_locations, GetLocation (yyVals[-10+yyTop]), GetLocation (yyVals[-7+yyTop]), GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[0+yyTop])); yyVal = current_delegate; current_delegate = null; } break; case 355: #line 3012 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (lang_version < LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[0+yyTop]), "nullable types"); yyVal = ComposedTypeSpecifier.CreateNullable (GetLocation (yyVals[0+yyTop])); } break; case 357: #line 3023 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt1 = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; var lt2 = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberName (lt1.Value, lt2.Value, (TypeArguments) yyVals[0+yyTop], lt1.Location); } break; case 359: #line 3034 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberName ((MemberName) yyVals[-3+yyTop], lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); } break; case 360: #line 3043 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberName (lt.Value, (TypeArguments)yyVals[0+yyTop], lt.Location); } break; case 362: #line 3055 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (lang_version < LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), "generics"); yyVal = yyVals[-1+yyTop]; } break; case 363: #line 3062 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Error_TypeExpected (lexer.Location); yyVal = new TypeArguments (); } break; case 364: #line 3070 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { TypeArguments type_args = new TypeArguments (); type_args.Add ((FullNamedExpression) yyVals[0+yyTop]); yyVal = type_args; } break; case 365: #line 3076 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { TypeArguments type_args = (TypeArguments) yyVals[-2+yyTop]; type_args.Add ((FullNamedExpression) yyVals[0+yyTop]); yyVal = type_args; } break; case 366: #line 3088 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.parsing_generic_declaration = true; } break; case 367: #line 3092 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.parsing_generic_declaration = false; var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; yyVal = new MemberName (lt.Value, (TypeArguments)yyVals[0+yyTop], lt.Location); } break; case 368: #line 3101 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { MemberName mn = (MemberName)yyVals[0+yyTop]; if (mn.TypeArguments != null) syntax_error (mn.Location, string.Format ("Member `{0}' cannot declare type arguments", mn.GetSignatureForError ())); } break; case 370: #line 3112 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.parsing_generic_declaration = false; var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberName ((MemberName) yyVals[-2+yyTop], lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location); } break; case 371: #line 3121 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.parsing_generic_declaration = false; yyVal = new MemberName (TypeContainer.DefaultIndexerName, GetLocation (yyVals[0+yyTop])); } break; case 372: #line 3126 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.parsing_generic_declaration = false; yyVal = new MemberName ((MemberName) yyVals[-1+yyTop], TypeContainer.DefaultIndexerName, null, GetLocation (yyVals[-1+yyTop])); } break; case 373: #line 3134 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; yyVal = new MemberName (lt.Value, (TypeArguments) yyVals[-1+yyTop], lt.Location); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } break; case 374: #line 3140 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt1 = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; var lt2 = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; yyVal = new MemberName (lt1.Value, lt2.Value, (TypeArguments) yyVals[-1+yyTop], lt1.Location); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } break; case 375: #line 3148 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; yyVal = new MemberName ((MemberName) yyVals[-3+yyTop], lt.Value, (TypeArguments) yyVals[-1+yyTop], lt.Location); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } break; case 377: #line 3158 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (lang_version < LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), "generics"); yyVal = yyVals[-1+yyTop]; lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } break; case 378: #line 3169 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { TypeArguments type_args = new TypeArguments (); type_args.Add ((FullNamedExpression)yyVals[0+yyTop]); yyVal = type_args; } break; case 379: #line 3175 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { TypeArguments type_args = (TypeArguments) yyVals[-2+yyTop]; type_args.Add ((FullNamedExpression)yyVals[0+yyTop]); yyVal = type_args; lbag.AddLocation (yyVals[0+yyTop], GetLocation (yyVals[0+yyTop])); } break; case 380: #line 3185 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken)yyVals[0+yyTop]; yyVal = new TypeParameterName (lt.Value, (Attributes)yyVals[-2+yyTop], (Variance) yyVals[-1+yyTop], lt.Location); } break; case 381: #line 3190 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (GetTokenName (yyToken) == "type") report.Error (81, GetLocation (yyVals[0+yyTop]), "Type parameter declaration must be an identifier not a type"); else Error_SyntaxError (yyToken); yyVal = new TypeParameterName ("", null, lexer.Location); } break; case 383: #line 3206 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop])); } break; case 384: #line 3213 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.parsing_generic_declaration = true; } break; case 386: #line 3224 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Expression.Error_VoidInvalidInTheContext (GetLocation (yyVals[0+yyTop]), report); yyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop])); } break; case 388: #line 3233 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Expression.Error_VoidInvalidInTheContext (GetLocation (yyVals[0+yyTop]), report); yyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop])); } break; case 390: #line 3242 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Error (1536, GetLocation (yyVals[0+yyTop]), "Invalid parameter type `void'"); yyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop])); } break; case 392: #line 3251 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; case 393: #line 3258 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { MemberName name = (MemberName) yyVals[-1+yyTop]; if (yyVals[0+yyTop] != null) { yyVal = new ComposedCast (name.GetTypeExpression (), (ComposedTypeSpecifier) yyVals[0+yyTop]); } else { if (name.Left == null && name.Name == "var") yyVal = new VarExpr (name.Location); else yyVal = name.GetTypeExpression (); } } break; case 394: #line 3271 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new ComposedCast (((MemberName) yyVals[-1+yyTop]).GetTypeExpression (), (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; case 395: #line 3275 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyVals[0+yyTop] != null) yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; case 396: #line 3280 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; case 397: #line 3284 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new ComposedCast (new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[-1+yyTop])), (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; case 398: #line 3291 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var types = new List<FullNamedExpression> (2); types.Add ((FullNamedExpression) yyVals[0+yyTop]); yyVal = types; } break; case 399: #line 3297 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var types = (List<FullNamedExpression>) yyVals[-2+yyTop]; types.Add ((FullNamedExpression) yyVals[0+yyTop]); yyVal = types; } break; case 400: #line 3306 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyVals[0+yyTop] is ComposedCast) { report.Error (1521, GetLocation (yyVals[0+yyTop]), "Invalid base type `{0}'", ((ComposedCast)yyVals[0+yyTop]).GetSignatureForError ()); } yyVal = yyVals[0+yyTop]; } break; case 401: #line 3313 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Error_TypeExpected (lexer.Location); yyVal = null; } break; case 402: #line 3324 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Object, GetLocation (yyVals[0+yyTop])); } break; case 403: #line 3325 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.String, GetLocation (yyVals[0+yyTop])); } break; case 404: #line 3326 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Bool, GetLocation (yyVals[0+yyTop])); } break; case 405: #line 3327 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Decimal, GetLocation (yyVals[0+yyTop])); } break; case 406: #line 3328 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Float, GetLocation (yyVals[0+yyTop])); } break; case 407: #line 3329 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Double, GetLocation (yyVals[0+yyTop])); } break; case 409: #line 3334 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.SByte, GetLocation (yyVals[0+yyTop])); } break; case 410: #line 3335 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Byte, GetLocation (yyVals[0+yyTop])); } break; case 411: #line 3336 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Short, GetLocation (yyVals[0+yyTop])); } break; case 412: #line 3337 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.UShort, GetLocation (yyVals[0+yyTop])); } break; case 413: #line 3338 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Int, GetLocation (yyVals[0+yyTop])); } break; case 414: #line 3339 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.UInt, GetLocation (yyVals[0+yyTop])); } break; case 415: #line 3340 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Long, GetLocation (yyVals[0+yyTop])); } break; case 416: #line 3341 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.ULong, GetLocation (yyVals[0+yyTop])); } break; case 417: #line 3342 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Char, GetLocation (yyVals[0+yyTop])); } break; case 418: #line 3352 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { checkForInteraction((Expression)yyVals[0+yyTop]); } break; case 439: #line 3382 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new SimpleName (lt.Value, (TypeArguments)yyVals[0+yyTop], lt.Location); } break; case 440: #line 3386 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new CompletionSimpleName (MemberName.MakeName (lt.Value, null), lt.Location); } break; case 444: #line 3396 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new NullLiteral (GetLocation (yyVals[0+yyTop])); } break; case 445: #line 3400 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new BoolLiteral (compiler.BuiltinTypes, true, GetLocation (yyVals[0+yyTop])); } break; case 446: #line 3401 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new BoolLiteral (compiler.BuiltinTypes, false, GetLocation (yyVals[0+yyTop])); } break; case 451: #line 3427 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new ParenthesizedExpression ((Expression) yyVals[-1+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } break; case 452: #line 3432 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new ParenthesizedExpression ((Expression) yyVals[-1+yyTop]); } break; case 453: #line 3439 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); } break; case 454: #line 3445 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); } break; case 455: #line 3451 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberAccess (new BaseThis (GetLocation (yyVals[-3+yyTop])), lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); } break; case 456: #line 3457 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt1 = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; var lt2 = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new QualifiedAliasMember (lt1.Value, lt2.Value, (TypeArguments) yyVals[0+yyTop], lt1.Location); } break; case 457: #line 3463 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new CompletionMemberAccess ((Expression) yyVals[-2+yyTop], null,GetLocation (yyVals[0+yyTop])); } break; case 458: #line 3466 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new CompletionMemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, lt.Location); } break; case 459: #line 3471 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new CompletionMemberAccess ((Expression) yyVals[-2+yyTop], null, lexer.Location); } break; case 460: #line 3474 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new CompletionMemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, lt.Location); } break; case 461: #line 3482 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { isInteractionArgumentList = isInteraction; } break; case 462: #line 3486 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { isInteractionArgumentList = false; } break; case 463: #line 3490 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var instance = (Expression) yyVals[-5+yyTop]; var arguments = (Arguments) yyVals[-2+yyTop]; yyVal = new Invocation (instance,arguments); lbag.AddLocation (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); } break; case 464: #line 3500 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = null; } break; case 466: #line 3506 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyVals[-1+yyTop] == null) { yyVal = CollectionOrObjectInitializers.Empty; /* TODO: lbag*/ } else { yyVal = new CollectionOrObjectInitializers ((List<Expression>) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } } break; case 467: #line 3516 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new CollectionOrObjectInitializers ((List<Expression>) yyVals[-2+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop])); } break; case 468: #line 3523 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = null; } break; case 469: #line 3525 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 470: #line 3532 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var a = new List<Expression> (); a.Add ((Expression) yyVals[0+yyTop]); yyVal = a; } break; case 471: #line 3538 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var a = (List<Expression>)yyVals[-2+yyTop]; a.Add ((Expression) yyVals[0+yyTop]); yyVal = a; } break; case 472: #line 3543 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = yyVals[-1+yyTop]; } break; case 473: #line 3551 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; yyVal = new ElementInitializer (lt.Value, (Expression)yyVals[0+yyTop], lt.Location); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } break; case 474: #line 3557 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new CompletionElementInitializer (null, GetLocation (yyVals[0+yyTop])); } break; case 475: #line 3560 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { CompletionSimpleName csn = yyVals[-1+yyTop] as CompletionSimpleName; if (csn == null) yyVal = new CollectionElementInitializer ((Expression)yyVals[-1+yyTop]); else yyVal = new CompletionElementInitializer (csn.Prefix, csn.Location); } break; case 476: #line 3568 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyVals[-1+yyTop] == null) yyVal = null; else yyVal = new CollectionElementInitializer ((List<Expression>)yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); } break; case 477: #line 3575 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Error (1920, GetLocation (yyVals[-1+yyTop]), "An element initializer cannot be empty"); yyVal = null; } break; case 480: #line 3587 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = null; } break; case 482: #line 3593 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Arguments list = new Arguments (4); list.Add ((Argument) yyVals[0+yyTop]); yyVal = list; } break; case 483: #line 3599 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Arguments list = (Arguments) yyVals[-2+yyTop]; if (list [list.Count - 1] is NamedArgument) Error_NamedArgumentExpected ((NamedArgument) list [list.Count - 1]); list.Add ((Argument) yyVals[0+yyTop]); yyVal = list; } break; case 484: #line 3608 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Arguments list = (Arguments) yyVals[-2+yyTop]; NamedArgument a = (NamedArgument) yyVals[0+yyTop]; for (int i = 0; i < list.Count; ++i) { NamedArgument na = list [i] as NamedArgument; if (na != null && na.Name == a.Name) report.Error (1740, na.Location, "Named argument `{0}' specified multiple times", na.Name); } list.Add (a); yyVal = list; } break; case 485: #line 3622 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Error (839, GetLocation (yyVals[0+yyTop]), "An argument is missing"); yyVal = yyVals[-1+yyTop]; } break; case 486: #line 3627 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Error (839, GetLocation (yyVals[-1+yyTop]), "An argument is missing"); yyVal = null; } break; case 487: #line 3635 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Argument ((Expression) yyVals[0+yyTop]); } break; case 491: #line 3648 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Argument ((Expression) yyVals[0+yyTop], Argument.AType.Ref); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } break; case 492: #line 3653 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Argument ((Expression) yyVals[0+yyTop], Argument.AType.Out); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } break; case 493: #line 3658 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Argument (new Arglist ((Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]))); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } break; case 494: #line 3663 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Argument (new Arglist (GetLocation (yyVals[-2+yyTop]))); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop])); } break; case 496: #line 3675 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new ElementAccess ((Expression) yyVals[-3+yyTop], (Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } break; case 497: #line 3683 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var list = new List<Expression> (4); list.Add ((Expression) yyVals[0+yyTop]); yyVal = list; } break; case 498: #line 3689 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var list = (List<Expression>) yyVals[-2+yyTop]; list.Add ((Expression) yyVals[0+yyTop]); yyVal = list; } break; case 499: #line 3694 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = yyVals[-1+yyTop]; } break; case 500: #line 3702 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Arguments args = new Arguments (4); args.Add ((Argument) yyVals[0+yyTop]); yyVal = args; } break; case 501: #line 3708 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Arguments args = (Arguments) yyVals[-2+yyTop]; if (args [args.Count - 1] is NamedArgument && !(yyVals[0+yyTop] is NamedArgument)) Error_NamedArgumentExpected ((NamedArgument) args [args.Count - 1]); args.Add ((Argument) yyVals[0+yyTop]); yyVal = args; } break; case 502: #line 3720 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Argument ((Expression) yyVals[0+yyTop]); } break; case 504: #line 3728 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if(isRoleMethod) { report.Error (10077, lexer.Location, "Can't use this explicitly in role methods. Use self or role name to refer to the role"); } yyVal = new This (GetLocation (yyVals[0+yyTop])); } break; case 505: #line 3739 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new ElementAccess (new BaseThis (GetLocation (yyVals[-3+yyTop])), (Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } break; case 506: #line 3744 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new ElementAccess (null, null, GetLocation (yyVals[-1+yyTop])); } break; case 507: #line 3752 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new UnaryMutator (UnaryMutator.Mode.PostIncrement, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop])); } break; case 508: #line 3759 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new UnaryMutator (UnaryMutator.Mode.PostDecrement, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop])); } break; case 509: #line 3766 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyVals[0+yyTop] != null) { if (lang_version <= LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-5+yyTop]), "object initializers"); yyVal = new NewInitialize ((FullNamedExpression) yyVals[-4+yyTop], (Arguments) yyVals[-2+yyTop], (CollectionOrObjectInitializers) yyVals[0+yyTop], GetLocation (yyVals[-5+yyTop])); } else { yyVal = new New ((FullNamedExpression) yyVals[-4+yyTop], (Arguments) yyVals[-2+yyTop], GetLocation (yyVals[-5+yyTop])); } lbag.AddLocation (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); } break; case 510: #line 3779 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (lang_version <= LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), "collection initializers"); yyVal = new NewInitialize ((FullNamedExpression) yyVals[-1+yyTop], null, (CollectionOrObjectInitializers) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); } break; case 511: #line 3791 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new ArrayCreation ((FullNamedExpression) yyVals[-5+yyTop], (List<Expression>) yyVals[-3+yyTop], new ComposedTypeSpecifier (((List<Expression>) yyVals[-3+yyTop]).Count, GetLocation (yyVals[-4+yyTop])) { Next = (ComposedTypeSpecifier) yyVals[-1+yyTop] }, (ArrayInitializer) yyVals[0+yyTop], GetLocation (yyVals[-6+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop])); } break; case 512: #line 3799 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyVals[0+yyTop] == null) report.Error (1586, GetLocation (yyVals[-3+yyTop]), "Array creation must have array size or array initializer"); yyVal = new ArrayCreation ((FullNamedExpression) yyVals[-2+yyTop], (ComposedTypeSpecifier) yyVals[-1+yyTop], (ArrayInitializer) yyVals[0+yyTop], GetLocation (yyVals[-3+yyTop])); } break; case 513: #line 3806 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (lang_version <= LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), "implicitly typed arrays"); yyVal = new ImplicitlyTypedArrayCreation ((ComposedTypeSpecifier) yyVals[-1+yyTop], (ArrayInitializer) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); } break; case 514: #line 3813 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Error (178, GetLocation (yyVals[-1+yyTop]), "Invalid rank specifier, expecting `,' or `]'"); yyVal = new ArrayCreation ((FullNamedExpression) yyVals[-5+yyTop], null, GetLocation (yyVals[-6+yyTop])); } break; case 515: #line 3818 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Error_SyntaxError (1526, yyToken, "Unexpected symbol"); yyVal = new ArrayCreation ((FullNamedExpression) yyVals[-1+yyTop], null, GetLocation (yyVals[-2+yyTop])); } break; case 516: #line 3825 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { ++lexer.parsing_type; } break; case 517: #line 3829 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { --lexer.parsing_type; yyVal = yyVals[0+yyTop]; } break; case 518: #line 3837 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (lang_version <= LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-3+yyTop]), "anonymous types"); yyVal = new NewAnonymousType ((List<AnonymousTypeParameter>) yyVals[-1+yyTop], current_container, GetLocation (yyVals[-3+yyTop])); /* TODO: lbag comma location*/ lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } break; case 521: #line 3854 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = null; } break; case 523: #line 3860 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var a = new List<AnonymousTypeParameter> (4); a.Add ((AnonymousTypeParameter) yyVals[0+yyTop]); yyVal = a; } break; case 524: #line 3866 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var a = (List<AnonymousTypeParameter>) yyVals[-2+yyTop]; a.Add ((AnonymousTypeParameter) yyVals[0+yyTop]); yyVal = a; } break; case 525: #line 3875 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken)yyVals[-2+yyTop]; yyVal = new AnonymousTypeParameter ((Expression)yyVals[0+yyTop], lt.Value, lt.Location); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } break; case 526: #line 3881 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken)yyVals[0+yyTop]; yyVal = new AnonymousTypeParameter (new SimpleName (lt.Value, lt.Location), lt.Value, lt.Location); } break; case 527: #line 3887 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { MemberAccess ma = (MemberAccess) yyVals[0+yyTop]; yyVal = new AnonymousTypeParameter (ma, ma.Name, ma.Location); } break; case 528: #line 3892 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Error (746, lexer.Location, "Invalid anonymous type member declarator. Anonymous type members must be a member assignment, simple name or member access expression"); yyVal = null; } break; case 532: #line 3907 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { ((ComposedTypeSpecifier) yyVals[-1+yyTop]).Next = (ComposedTypeSpecifier) yyVals[0+yyTop]; yyVal = yyVals[-1+yyTop]; } break; case 533: #line 3915 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = ComposedTypeSpecifier.CreateArrayDimension (1, GetLocation (yyVals[-1+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } break; case 534: #line 3920 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = ComposedTypeSpecifier.CreateArrayDimension ((int)yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } break; case 535: #line 3928 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = 2; } break; case 536: #line 3932 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = ((int) yyVals[-1+yyTop]) + 1; } break; case 537: #line 3939 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = null; } break; case 538: #line 3943 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 539: #line 3950 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var ai = new ArrayInitializer (0, GetLocation (yyVals[-1+yyTop])); ai.VariableDeclaration = current_variable; lbag.AddLocation (ai, GetLocation (yyVals[0+yyTop])); yyVal = ai; } break; case 540: #line 3957 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var ai = new ArrayInitializer ((List<Expression>) yyVals[-2+yyTop], GetLocation (yyVals[-3+yyTop])); ai.VariableDeclaration = current_variable; if (yyVals[-1+yyTop] != null) { lbag.AddLocation (ai, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop])); } else { lbag.AddLocation (ai, GetLocation (yyVals[0+yyTop])); } yyVal = ai; } break; case 541: #line 3971 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var list = new List<Expression> (4); list.Add ((Expression) yyVals[0+yyTop]); yyVal = list; } break; case 542: #line 3977 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var list = (List<Expression>) yyVals[-2+yyTop]; list.Add ((Expression) yyVals[0+yyTop]); yyVal = list; } break; case 543: #line 3986 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.TypeOfParsing = true; } break; case 544: #line 3990 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.TypeOfParsing = false; yyVal = new TypeOf ((FullNamedExpression) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } break; case 547: #line 4001 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Error_TypeExpected (lexer.Location); yyVal = null; } break; case 548: #line 4009 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new SimpleName (lt.Value, (int) yyVals[0+yyTop], lt.Location); } break; case 549: #line 4015 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt1 = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; var lt2 = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new QualifiedAliasMember (lt1.Value, lt2.Value, (int) yyVals[0+yyTop], lt1.Location); } break; case 550: #line 4022 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new MemberAccess ((Expression) yyVals[-2+yyTop], lt.Value, lt.Location); } break; case 551: #line 4028 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, (int) yyVals[0+yyTop], lt.Location); } break; case 552: #line 4034 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var te = ((MemberName) yyVals[-3+yyTop]).GetTypeExpression (); if (te.HasTypeArguments) Error_TypeExpected (GetLocation (yyVals[0+yyTop])); var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberAccess (te, lt.Value, (int) yyVals[0+yyTop], lt.Location); } break; case 553: #line 4046 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (lang_version < LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[0+yyTop]), "generics"); yyVal = yyVals[0+yyTop]; } break; case 554: #line 4056 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; if (lang_version == LanguageVersion.ISO_1) FeatureIsNotAvailable (lt.Location, "namespace alias qualifier"); yyVal = lt; } break; case 555: #line 4067 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new SizeOf ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } break; case 556: #line 4075 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new CheckedExpr ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } break; case 557: #line 4083 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new UnCheckedExpr ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } break; case 558: #line 4091 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberAccess (new Indirection ((Expression) yyVals[-3+yyTop], GetLocation (yyVals[-2+yyTop])), lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location); } break; case 559: #line 4099 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { start_anonymous (false, (ParametersCompiled) yyVals[0+yyTop], false, GetLocation (yyVals[-1+yyTop])); } break; case 560: #line 4103 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]); } break; case 561: #line 4107 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { start_anonymous (false, (ParametersCompiled) yyVals[0+yyTop], true, GetLocation (yyVals[-2+yyTop])); } break; case 562: #line 4111 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]); } break; case 563: #line 4118 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = ParametersCompiled.Undefined; } break; case 565: #line 4126 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; } break; case 566: #line 4130 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { valid_param_mod = 0; yyVal = yyVals[-1+yyTop]; } break; case 567: #line 4138 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (lang_version < LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-3+yyTop]), "default value expression"); yyVal = new DefaultValueExpression ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } break; case 569: #line 4150 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Unary (Unary.Operator.LogicalNot, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 570: #line 4154 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Unary (Unary.Operator.OnesComplement, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 571: #line 4158 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Cast ((FullNamedExpression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } break; case 572: #line 4163 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (!async_block) { report.Error (1992, GetLocation (yyVals[-1+yyTop]), "The `await' operator can only be used when its containing method or lambda expression is marked with the `async' modifier"); } else { current_block.ParametersBlock.IsAsync = true; } yyVal = new Await ((Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 574: #line 4182 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Unary (Unary.Operator.UnaryPlus, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 575: #line 4186 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Unary (Unary.Operator.UnaryNegation, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 576: #line 4190 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new UnaryMutator (UnaryMutator.Mode.PreIncrement, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 577: #line 4194 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new UnaryMutator (UnaryMutator.Mode.PreDecrement, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 578: #line 4198 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Indirection ((Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 579: #line 4202 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Unary (Unary.Operator.AddressOf, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 581: #line 4210 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Binary (Binary.Operator.Multiply, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 582: #line 4215 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Binary (Binary.Operator.Division, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 583: #line 4220 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Binary (Binary.Operator.Modulus, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 585: #line 4229 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Binary (Binary.Operator.Addition, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 586: #line 4234 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Binary (Binary.Operator.Subtraction, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 587: #line 4238 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { /* Shift/Reduce conflict*/ yyVal = new Binary (Binary.Operator.Subtraction, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 588: #line 4243 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new As ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 589: #line 4247 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Is ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 591: #line 4255 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Binary (Binary.Operator.LeftShift, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 592: #line 4260 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Binary (Binary.Operator.RightShift, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 594: #line 4269 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Binary (Binary.Operator.LessThan, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 595: #line 4274 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Binary (Binary.Operator.GreaterThan, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 596: #line 4279 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Binary (Binary.Operator.LessThanOrEqual, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 597: #line 4284 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Binary (Binary.Operator.GreaterThanOrEqual, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 599: #line 4293 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Binary (Binary.Operator.Equality, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 600: #line 4298 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Binary (Binary.Operator.Inequality, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 602: #line 4307 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Binary (Binary.Operator.BitwiseAnd, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 604: #line 4316 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Binary (Binary.Operator.ExclusiveOr, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 606: #line 4325 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Binary (Binary.Operator.BitwiseOr, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 608: #line 4334 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Binary (Binary.Operator.LogicalAnd, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 610: #line 4343 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Binary (Binary.Operator.LogicalOr, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 612: #line 4352 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (lang_version < LanguageVersion.ISO_2) FeatureIsNotAvailable (GetLocation (yyVals[-1+yyTop]), "null coalescing operator"); yyVal = new Nullable.NullCoalescingOperator ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 614: #line 4363 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Conditional (new BooleanExpression ((Expression) yyVals[-4+yyTop]), (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop])); } break; case 615: #line 4371 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var potentialRolePlayer = yyVals[0+yyTop] as Expression; var memberExpression = yyVals[-2+yyTop] as MemberAccess; var simpleNameForRole = memberExpression != null ? memberExpression.LeftExpression as SimpleName : yyVals[-2+yyTop] as SimpleName; if(simpleNameForRole != null){ var role = FindField(simpleNameForRole.Name, GetLocation(yyVals[-2+yyTop])); var isRole = role != null && role.IsRole; if(current_method as Constructor != null){ /*might be assigning to a role*/ yyVal = new RoleAssign ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } else if(isRole) { report.Error (10000, GetLocation(potentialRolePlayer), "Roles can only be assigned to players in constructor"); } else{ yyVal = new SimpleAssign ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } } else { yyVal = new SimpleAssign ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } } break; case 616: #line 4391 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.Multiply, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 617: #line 4396 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.Division, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 618: #line 4401 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.Modulus, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 619: #line 4406 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.Addition, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 620: #line 4411 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.Subtraction, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 621: #line 4416 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.LeftShift, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 622: #line 4421 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.RightShift, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 623: #line 4426 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.BitwiseAnd, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 624: #line 4431 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.BitwiseOr, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 625: #line 4436 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.ExclusiveOr, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 626: #line 4444 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var pars = new List<Parameter> (4); pars.Add ((Parameter) yyVals[0+yyTop]); yyVal = pars; } break; case 627: #line 4451 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var pars = (List<Parameter>) yyVals[-2+yyTop]; Parameter p = (Parameter)yyVals[0+yyTop]; if (pars[0].GetType () != p.GetType ()) { report.Error (748, p.Location, "All lambda parameters must be typed either explicitly or implicitly"); } pars.Add (p); yyVal = pars; } break; case 628: #line 4465 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new Parameter ((FullNamedExpression) yyVals[-1+yyTop], lt.Value, (Parameter.Modifier) yyVals[-2+yyTop], null, lt.Location); } break; case 629: #line 4471 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new Parameter ((FullNamedExpression) yyVals[-1+yyTop], lt.Value, Parameter.Modifier.NONE, null, lt.Location); } break; case 630: #line 4477 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new ImplicitLambdaParameter (lt.Value, lt.Location); } break; case 631: #line 4484 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = ParametersCompiled.EmptyReadOnlyParameters; } break; case 632: #line 4485 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var pars_list = (List<Parameter>) yyVals[0+yyTop]; yyVal = new ParametersCompiled (pars_list.ToArray ()); } break; case 635: #line 4497 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { start_block (lexer.Location); } break; case 636: #line 4501 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Block b = end_block (lexer.Location); b.AddStatement (new ContextualReturn ((Expression) yyVals[0+yyTop])); yyVal = b; } break; case 638: #line 4511 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = EmptyExpression.Null; } break; case 639: #line 4519 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; Parameter p = new ImplicitLambdaParameter (lt.Value, lt.Location); start_anonymous (true, new ParametersCompiled (p), false, lt.Location); } break; case 640: #line 4525 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop])); } break; case 641: #line 4530 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; Parameter p = new ImplicitLambdaParameter (lt.Value, lt.Location); start_anonymous (true, new ParametersCompiled (p), true, lt.Location); } break; case 642: #line 4536 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop])); } break; case 643: #line 4541 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; } break; case 644: #line 4545 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { valid_param_mod = 0; start_anonymous (true, (ParametersCompiled) yyVals[-2+yyTop], false, GetLocation (yyVals[-4+yyTop])); } break; case 645: #line 4550 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-2+yyTop])); } break; case 646: #line 4555 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; } break; case 647: #line 4559 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { valid_param_mod = 0; start_anonymous (true, (ParametersCompiled) yyVals[-2+yyTop], true, GetLocation (yyVals[-5+yyTop])); } break; case 648: #line 4564 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]); lbag.AddLocation (yyVal, GetLocation (yyVals[-7+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-2+yyTop])); } break; case 654: #line 4580 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new ArglistAccess (GetLocation (yyVals[0+yyTop])); } break; case 655: #line 4587 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new RefValueExpr ((Expression) yyVals[-3+yyTop], (FullNamedExpression) yyVals[-1+yyTop], GetLocation (yyVals[-5+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } break; case 656: #line 4592 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new RefTypeExpr ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } break; case 657: #line 4597 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new MakeRefExpr ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } break; case 659: #line 4609 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new BooleanExpression ((Expression) yyVals[0+yyTop]); } break; case 660: #line 4622 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.ConstraintsParsing = true; } break; case 661: #line 4626 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { MemberName name = MakeName ((MemberName) yyVals[0+yyTop]); Class c = new Class (current_namespace, current_class, name, (Modifiers) yyVals[-4+yyTop], (Attributes) yyVals[-5+yyTop]); if (((c.ModFlags & Modifiers.STATIC) != 0) && lang_version == LanguageVersion.ISO_1) { FeatureIsNotAvailable (c.Location, "static classes"); } push_current_class (c, yyVals[-3+yyTop]); } break; case 662: #line 4637 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.ConstraintsParsing = false; current_class.SetParameterInfo ((List<Constraints>) yyVals[0+yyTop]); lbag.AddMember (current_class, mod_locations, GetLocation (yyVals[-5+yyTop])); if (doc_support) { current_container.DocComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } lexer.parsing_modifiers = true; } break; case 663: #line 4651 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { --lexer.parsing_declaration; if (doc_support) Lexer.doc_state = XmlCommentState.Allowed; } break; case 664: #line 4657 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lbag.AppendToMember (current_class, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); yyVal = pop_current_class (); } break; case 665: #line 4665 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = null; } break; case 666: #line 4667 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 667: #line 4672 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { mod_locations = null; yyVal = ModifierNone; lexer.parsing_modifiers = false; } break; case 668: #line 4678 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.parsing_modifiers = false; } break; case 670: #line 4686 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var m1 = (Modifiers) yyVals[-1+yyTop]; var m2 = (Modifiers) yyVals[0+yyTop]; if ((m1 & m2) != 0) { report.Error (1004, lexer.Location - ModifiersExtensions.Name (m2).Length, "Duplicate `{0}' modifier", ModifiersExtensions.Name (m2)); } else if ((m2 & Modifiers.AccessibilityMask) != 0 && (m1 & Modifiers.AccessibilityMask) != 0 && ((m2 | m1 & Modifiers.AccessibilityMask) != (Modifiers.PROTECTED | Modifiers.INTERNAL))) { report.Error (107, lexer.Location - ModifiersExtensions.Name (m2).Length, "More than one protection modifier specified"); } yyVal = m1 | m2; } break; case 671: #line 4705 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Modifiers.NEW; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); if (current_container == module) report.Error (1530, GetLocation (yyVals[0+yyTop]), "Keyword `new' is not allowed on namespace elements"); } break; case 672: #line 4713 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Modifiers.PUBLIC; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } break; case 673: #line 4718 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Modifiers.PROTECTED; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } break; case 674: #line 4723 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Modifiers.INTERNAL; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } break; case 675: #line 4728 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Modifiers.PRIVATE; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } break; case 676: #line 4733 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Modifiers.ABSTRACT; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } break; case 677: #line 4738 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Modifiers.SEALED; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } break; case 678: #line 4743 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Modifiers.STATIC; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } break; case 679: #line 4748 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Modifiers.READONLY; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } break; case 680: #line 4753 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Modifiers.VIRTUAL; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } break; case 681: #line 4758 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Modifiers.OVERRIDE; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } break; case 682: #line 4763 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Modifiers.EXTERN; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } break; case 683: #line 4768 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Modifiers.VOLATILE; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } break; case 684: #line 4773 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Modifiers.UNSAFE; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); if (!settings.Unsafe) Error_UnsafeCodeNotAllowed (GetLocation (yyVals[0+yyTop])); } break; case 685: #line 4780 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Modifiers.ASYNC; StoreModifierLocation (yyVal, GetLocation (yyVals[0+yyTop])); } break; case 687: #line 4789 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_container.AddBasesForPart (current_class, (List<FullNamedExpression>) yyVals[0+yyTop]); } break; case 689: #line 4797 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 690: #line 4801 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = null; } break; case 691: #line 4809 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var constraints = new List<Constraints> (1); constraints.Add ((Constraints) yyVals[0+yyTop]); yyVal = constraints; } break; case 692: #line 4815 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var constraints = (List<Constraints>) yyVals[-1+yyTop]; Constraints new_constraint = (Constraints)yyVals[0+yyTop]; foreach (Constraints c in constraints) { if (new_constraint.TypeParameter.Value == c.TypeParameter.Value) { report.Error (409, new_constraint.Location, "A constraint clause has already been specified for type parameter `{0}'", new_constraint.TypeParameter.Value); } } constraints.Add (new_constraint); yyVal = constraints; } break; case 693: #line 4834 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; yyVal = new Constraints (new SimpleMemberName (lt.Value, lt.Location), (List<FullNamedExpression>) yyVals[0+yyTop], GetLocation (yyVals[-3+yyTop])); } break; case 694: #line 4842 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var constraints = new List<FullNamedExpression> (1); constraints.Add ((FullNamedExpression) yyVals[0+yyTop]); yyVal = constraints; } break; case 695: #line 4848 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var constraints = (List<FullNamedExpression>) yyVals[-2+yyTop]; var prev = constraints [constraints.Count - 1] as SpecialContraintExpr; if (prev != null && (prev.Constraint & SpecialConstraint.Constructor) != 0) { report.Error (401, GetLocation (yyVals[-1+yyTop]), "The `new()' constraint must be the last constraint specified"); } prev = yyVals[0+yyTop] as SpecialContraintExpr; if (prev != null) { if ((prev.Constraint & (SpecialConstraint.Class | SpecialConstraint.Struct)) != 0) { report.Error (449, prev.Location, "The `class' or `struct' constraint must be the first constraint specified"); } else { prev = constraints [0] as SpecialContraintExpr; if (prev != null && (prev.Constraint & SpecialConstraint.Struct) != 0) { report.Error (451, GetLocation (yyVals[0+yyTop]), "The `new()' constraint cannot be used with the `struct' constraint"); } } } constraints.Add ((FullNamedExpression) yyVals[0+yyTop]); yyVal = constraints; } break; case 696: #line 4874 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyVals[0+yyTop] is ComposedCast) report.Error (706, GetLocation (yyVals[0+yyTop]), "Invalid constraint type `{0}'", ((ComposedCast)yyVals[0+yyTop]).GetSignatureForError ()); yyVal = yyVals[0+yyTop]; } break; case 697: #line 4881 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new SpecialContraintExpr (SpecialConstraint.Constructor, GetLocation (yyVals[-2+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop])); } break; case 698: #line 4886 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new SpecialContraintExpr (SpecialConstraint.Class, GetLocation (yyVals[0+yyTop])); } break; case 699: #line 4890 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new SpecialContraintExpr (SpecialConstraint.Struct, GetLocation (yyVals[0+yyTop])); } break; case 700: #line 4897 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Variance.None; } break; case 701: #line 4901 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (lang_version <= LanguageVersion.V_3) FeatureIsNotAvailable (lexer.Location, "generic type variance"); yyVal = yyVals[0+yyTop]; } break; case 702: #line 4911 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Variance.Covariant; } break; case 703: #line 4915 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = Variance.Contravariant; } break; case 704: #line 4935 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { ++lexer.parsing_block; start_block (GetLocation (yyVals[0+yyTop])); } break; case 705: #line 4940 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 706: #line 4947 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { --lexer.parsing_block; yyVal = end_block (GetLocation (yyVals[0+yyTop])); } break; case 707: #line 4952 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { --lexer.parsing_block; yyVal = end_block (lexer.Location); } break; case 708: #line 4961 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { ++lexer.parsing_block; current_block.StartLocation = GetLocation (yyVals[0+yyTop]); } break; case 709: #line 4966 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { --lexer.parsing_block; yyVal = end_block (GetLocation (yyVals[0+yyTop])); } break; case 714: #line 4984 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_block.AddStatement ((Statement) yyVals[0+yyTop]); } break; case 715: #line 4988 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_block.AddStatement ((Statement) yyVals[0+yyTop]); } break; case 717: #line 4993 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = null; } break; case 720: #line 5012 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_block.AddStatement ((Statement) yyVals[0+yyTop]); } break; case 721: #line 5016 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_block.AddStatement ((Statement) yyVals[0+yyTop]); } break; case 750: #line 5057 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Error (1023, GetLocation (yyVals[0+yyTop]), "An embedded statement may not be a declaration or labeled statement"); yyVal = null; } break; case 751: #line 5062 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Error (1023, GetLocation (yyVals[0+yyTop]), "An embedded statement may not be a declaration or labeled statement"); yyVal = null; } break; case 752: #line 5067 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new EmptyStatement (GetLocation (yyVals[0+yyTop])); } break; case 753: #line 5075 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { /* Uses lexer.Location because semicolon location is not kept in quick mode*/ yyVal = new EmptyStatement (lexer.Location); } break; case 754: #line 5083 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; LabeledStatement labeled = new LabeledStatement (lt.Value, current_block, lt.Location); current_block.AddLabel (labeled); current_block.AddStatement (labeled); } break; case 757: #line 5096 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyVals[-1+yyTop] is VarExpr) yyVals[-1+yyTop] = new SimpleName ("var", ((VarExpr) yyVals[-1+yyTop]).Location); yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; case 758: #line 5112 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { /* Ok, the above "primary_expression" is there to get rid of*/ /* both reduce/reduce and shift/reduces in the grammar, it should*/ /* really just be "type_name". If you use type_name, a reduce/reduce*/ /* creeps up. If you use namespace_or_type_name (which is all we need*/ /* really) two shift/reduces appear.*/ /* */ /* So the super-trick is that primary_expression*/ /* can only be either a SimpleName or a MemberAccess. */ /* The MemberAccess case arises when you have a fully qualified type-name like :*/ /* Foo.Bar.Blah i;*/ /* SimpleName is when you have*/ /* Blah i;*/ Expression expr = (Expression) yyVals[-1+yyTop]; if (yyVals[0+yyTop] == null) { SimpleName sn = expr as SimpleName; if (sn != null && sn.Name == "var") yyVal = new VarExpr (sn.Location); else yyVal = yyVals[-1+yyTop]; } else if (expr is ATypeNameExpression) { yyVal = new ComposedCast ((ATypeNameExpression)expr, (ComposedTypeSpecifier) yyVals[0+yyTop]); } else { Error_ExpectingTypeName (expr); yyVal = null; } } break; case 759: #line 5142 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { ATypeNameExpression expr = yyVals[-1+yyTop] as ATypeNameExpression; if (expr != null) { yyVal = new ComposedCast (expr, (ComposedTypeSpecifier) yyVals[0+yyTop]); } else { Error_ExpectingTypeName ((Expression)yyVals[-1+yyTop]); yyVal = expr; } } break; case 760: #line 5153 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyVals[0+yyTop] == null) yyVal = yyVals[-1+yyTop]; else yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; case 761: #line 5160 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; case 762: #line 5164 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new ComposedCast (new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[-1+yyTop])), (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; case 763: #line 5168 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Expression.Error_VoidInvalidInTheContext (GetLocation (yyVals[0+yyTop]), report); yyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop])); } break; case 765: #line 5177 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { ((ComposedTypeSpecifier) yyVals[-1+yyTop]).Next = (ComposedTypeSpecifier) yyVals[0+yyTop]; yyVal = yyVals[-1+yyTop]; } break; case 766: #line 5185 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = ComposedTypeSpecifier.CreatePointer (GetLocation (yyVals[0+yyTop])); } break; case 768: #line 5193 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (async_block) { report.Error (4003, GetLocation (yyVals[0+yyTop]), "`await' cannot be used as an identifier within an async method or lambda expression"); yyVal = Tokenizer.LocatedToken.Create ("await", GetLocation (yyVals[0+yyTop])); } } break; case 769: #line 5203 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; var li = new LocalVariable (current_block, lt.Value, lt.Location); current_block.AddLocalName (li); current_variable = new BlockVariableDeclaration ((FullNamedExpression) yyVals[-1+yyTop], li); } break; case 770: #line 5210 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = current_variable; current_variable = null; lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } break; case 771: #line 5216 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; var li = new LocalVariable (current_block, lt.Value, LocalVariable.Flags.Constant, lt.Location); current_block.AddLocalName (li); current_variable = new BlockConstantDeclaration ((FullNamedExpression) yyVals[-1+yyTop], li); } break; case 772: #line 5223 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = current_variable; current_variable = null; lbag.AddLocation (yyVal, GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[0+yyTop])); } break; case 774: #line 5233 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_variable.Initializer = (Expression) yyVals[0+yyTop]; /* TODO: lbag*/ } break; case 775: #line 5238 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyToken == Token.OPEN_BRACKET_EXPR) { report.Error (650, lexer.Location, "Syntax error, bad array declarator. To declare a managed array the rank specifier precedes the variable's identifier. To declare a fixed size buffer field, use the fixed keyword before the field type"); } else { Error_SyntaxError (yyToken); } } break; case 779: #line 5256 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { foreach (var d in current_variable.Declarators) { if (d.Initializer == null) Error_MissingInitializer (d.Variable.Location); } } break; case 782: #line 5271 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; var li = new LocalVariable (current_variable.Variable, lt.Value, lt.Location); var d = new BlockVariableDeclaration.Declarator (li, null); current_variable.AddDeclarator (d); current_block.AddLocalName (li); lbag.AddLocation (d, GetLocation (yyVals[-1+yyTop])); } break; case 783: #line 5280 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; var li = new LocalVariable (current_variable.Variable, lt.Value, lt.Location); var d = new BlockVariableDeclaration.Declarator (li, (Expression) yyVals[0+yyTop]); current_variable.AddDeclarator (d); current_block.AddLocalName (li); lbag.AddLocation (d, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); } break; case 784: #line 5292 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Error (145, lexer.Location, "A const field requires a value to be provided"); } break; case 785: #line 5296 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_variable.Initializer = (Expression) yyVals[0+yyTop]; } break; case 790: #line 5313 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; var li = new LocalVariable (current_block, lt.Value, LocalVariable.Flags.Constant, lt.Location); var d = new BlockVariableDeclaration.Declarator (li, (Expression) yyVals[0+yyTop]); current_variable.AddDeclarator (d); current_block.AddLocalName (li); lbag.AddLocation (d, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); } break; case 792: #line 5326 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new StackAlloc ((Expression) yyVals[-3+yyTop], (Expression) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } break; case 793: #line 5331 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Error (1575, GetLocation (yyVals[-1+yyTop]), "A stackalloc expression requires [] after type"); yyVal = new StackAlloc ((Expression) yyVals[0+yyTop], null, GetLocation (yyVals[-1+yyTop])); } break; case 794: #line 5339 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = yyVals[-1+yyTop]; lbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop])); } break; case 795: #line 5343 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; case 796: #line 5347 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; case 797: #line 5348 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; case 798: #line 5357 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { ExpressionStatement s = yyVals[0+yyTop] as ExpressionStatement; if (s == null) { Expression.Error_InvalidExpressionStatement (report, GetLocation (yyVals[0+yyTop])); yyVal = new StatementExpression (EmptyExpressionStatement.Instance); } else { yyVal = new StatementExpression (s); } } break; case 799: #line 5370 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Expression expr = (Expression) yyVals[0+yyTop]; ExpressionStatement s; s = new OptionalAssign (new SimpleName ("$retval", lexer.Location), expr, lexer.Location); yyVal = new StatementExpression (s); } break; case 800: #line 5378 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new EmptyStatement (GetLocation (yyVals[0+yyTop])); } break; case 803: #line 5392 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); yyVal = new If ((BooleanExpression) yyVals[-2+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); } break; case 804: #line 5401 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new If ((BooleanExpression) yyVals[-4+yyTop], (Statement) yyVals[-2+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-6+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); if (yyVals[-2+yyTop] is EmptyStatement) Warning_EmptyStatement (GetLocation (yyVals[-2+yyTop])); if (yyVals[0+yyTop] is EmptyStatement) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); } break; case 805: #line 5414 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { start_block (GetLocation (yyVals[0+yyTop])); } break; case 806: #line 5418 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Switch ((Expression) yyVals[-5+yyTop], (ExplicitBlock) current_block.Explicit, (List<SwitchSection>) yyVals[-1+yyTop], GetLocation (yyVals[-7+yyTop])); end_block (GetLocation (yyVals[0+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-4+yyTop])); } break; case 807: #line 5427 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Warning (1522, 1, current_block.StartLocation, "Empty switch block"); yyVal = new List<SwitchSection> (); } break; case 809: #line 5436 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var sections = new List<SwitchSection> (4); sections.Add ((SwitchSection) yyVals[0+yyTop]); yyVal = sections; } break; case 810: #line 5443 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var sections = (List<SwitchSection>) yyVals[-1+yyTop]; sections.Add ((SwitchSection) yyVals[0+yyTop]); yyVal = sections; } break; case 811: #line 5450 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new List<SwitchSection> (); } break; case 812: #line 5458 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_block = current_block.CreateSwitchBlock (lexer.Location); } break; case 813: #line 5462 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new SwitchSection ((List<SwitchLabel>) yyVals[-2+yyTop], current_block); } break; case 814: #line 5469 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var labels = new List<SwitchLabel> (2); labels.Add ((SwitchLabel) yyVals[0+yyTop]); yyVal = labels; } break; case 815: #line 5476 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var labels = (List<SwitchLabel>) (yyVals[-1+yyTop]); labels.Add ((SwitchLabel) yyVals[0+yyTop]); yyVal = labels; } break; case 816: #line 5486 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new SwitchLabel ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); lbag.AddLocation (yyVal, GetLocation (yyVals[0+yyTop])); } break; case 817: #line 5491 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new SwitchLabel (null, GetLocation (yyVals[0+yyTop])); } break; case 822: #line 5505 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); yyVal = new While ((BooleanExpression) yyVals[-2+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); } break; case 823: #line 5517 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Do ((Statement) yyVals[-5+yyTop], (BooleanExpression) yyVals[-2+yyTop], GetLocation (yyVals[-6+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop])); } break; case 824: #line 5525 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { start_block (GetLocation (yyVals[0+yyTop])); current_block.IsCompilerGenerated = true; } break; case 825: #line 5530 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 826: #line 5541 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); For f = new For ((Statement) yyVals[-6+yyTop], (BooleanExpression) yyVals[-4+yyTop], (Statement) yyVals[-2+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-9+yyTop])); current_block.AddStatement (f); lbag.AddStatement (f, current_block.StartLocation, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); yyVal = end_block (GetLocation (yyVals[-5+yyTop])); } break; case 827: #line 5553 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = end_block (current_block.StartLocation); } break; case 828: #line 5560 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new EmptyStatement (lexer.Location); } break; case 830: #line 5566 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; var li = new LocalVariable (current_block, lt.Value, lt.Location); current_block.AddLocalName (li); current_variable = new BlockVariableDeclaration ((FullNamedExpression) yyVals[-1+yyTop], li); } break; case 831: #line 5573 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = current_variable; current_variable = null; } break; case 833: #line 5581 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = null; } break; case 835: #line 5586 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new EmptyStatement (lexer.Location); } break; case 839: #line 5597 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var sl = yyVals[-2+yyTop] as StatementList; if (sl == null) { sl = new StatementList ((Statement) yyVals[-2+yyTop], (Statement) yyVals[0+yyTop]); lbag.AddStatement (sl, GetLocation (yyVals[-1+yyTop])); } else { sl.Add ((Statement) yyVals[0+yyTop]); lbag.AppendTo (sl, GetLocation (yyVals[-1+yyTop])); } yyVal = sl; } break; case 840: #line 5613 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Error (230, GetLocation (yyVals[-5+yyTop]), "Type and identifier are both required in a foreach statement"); yyVal = null; } break; case 841: #line 5618 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { start_block (GetLocation (yyVals[-5+yyTop])); current_block.IsCompilerGenerated = true; var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; var li = new LocalVariable (current_block, lt.Value, LocalVariable.Flags.ForeachVariable | LocalVariable.Flags.Used, lt.Location); current_block.AddLocalName (li); yyVal = li; } break; case 842: #line 5628 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); Foreach f = new Foreach ((Expression) yyVals[-6+yyTop], (LocalVariable) yyVals[-1+yyTop], (Expression) yyVals[-3+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-8+yyTop])); current_block.AddStatement (f); lbag.AddStatement (f, GetLocation (yyVals[-7+yyTop]), GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop])); yyVal = end_block (GetLocation (yyVals[-2+yyTop])); } break; case 849: #line 5651 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Break (GetLocation (yyVals[-1+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop])); } break; case 850: #line 5659 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Continue (GetLocation (yyVals[-1+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop])); } break; case 851: #line 5667 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new Goto (lt.Value, lt.Location); lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } break; case 852: #line 5673 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new GotoCase ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } break; case 853: #line 5678 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new GotoDefault (GetLocation (yyVals[-2+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop])); } break; case 854: #line 5686 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Return ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop])); } break; case 855: #line 5694 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Throw ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop])); } break; case 856: #line 5702 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; string s = lt.Value; if (s != "yield"){ report.Error (1003, lt.Location, "; expected"); } else if (yyVals[-1+yyTop] == null) { report.Error (1627, GetLocation (yyVals[0+yyTop]), "Expression expected after yield return"); } else if (lang_version == LanguageVersion.ISO_1){ FeatureIsNotAvailable (lt.Location, "iterators"); } current_block.ParametersBlock.TopBlock.IsIterator = true; yyVal = new Yield ((Expression) yyVals[-1+yyTop], lt.Location); lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop])); } break; case 857: #line 5718 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; string s = lt.Value; if (s != "yield"){ report.Error (1003, lt.Location, "; expected"); } else if (lang_version == LanguageVersion.ISO_1){ FeatureIsNotAvailable (lt.Location, "iterators"); } current_block.ParametersBlock.TopBlock.IsIterator = true; yyVal = new YieldBreak (lt.Location); lbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop])); } break; case 860: #line 5740 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new TryCatch ((Block) yyVals[-1+yyTop], (List<Catch>) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop]), false); } break; case 861: #line 5744 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new TryFinally ((Statement) yyVals[-2+yyTop], (Block) yyVals[0+yyTop], GetLocation (yyVals[-3+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop])); } break; case 862: #line 5749 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new TryFinally (new TryCatch ((Block) yyVals[-3+yyTop], (List<Catch>) yyVals[-2+yyTop], GetLocation (yyVals[-4+yyTop]), true), (Block) yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[-1+yyTop])); } break; case 863: #line 5754 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { report.Error (1524, GetLocation (yyVals[-2+yyTop]), "Expected catch or finally"); yyVal = null; } break; case 864: #line 5762 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var l = new List<Catch> (2); l.Add ((Catch) yyVals[0+yyTop]); yyVal = l; } break; case 865: #line 5769 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var l = (List<Catch>) yyVals[-1+yyTop]; Catch c = (Catch) yyVals[0+yyTop]; if (l [0].IsGeneral) { report.Error (1017, c.loc, "Try statement already has an empty catch block"); } else { if (c.IsGeneral) l.Insert (0, c); else l.Add (c); } yyVal = l; } break; case 868: #line 5793 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Catch ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 869: #line 5797 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { start_block (GetLocation (yyVals[-3+yyTop])); var c = new Catch (current_block, GetLocation (yyVals[-4+yyTop])); c.TypeExpression = (FullNamedExpression) yyVals[-2+yyTop]; if (yyVals[-1+yyTop] != null) { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; c.Variable = new LocalVariable (current_block, lt.Value, lt.Location); current_block.AddLocalName (c.Variable); } lbag.AddLocation (c, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop])); yyVal = c; } break; case 870: #line 5812 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; case 871: #line 5816 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyToken == Token.CLOSE_PARENS) { report.Error (1015, lexer.Location, "A type that derives from `System.Exception', `object', or `string' expected"); } else { Error_SyntaxError (yyToken); } yyVal = new Catch (null, GetLocation (yyVals[-2+yyTop])); } break; case 872: #line 5830 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Checked ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 873: #line 5837 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Unchecked ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 874: #line 5844 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (!settings.Unsafe) Error_UnsafeCodeNotAllowed (GetLocation (yyVals[0+yyTop])); } break; case 875: #line 5847 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Unsafe ((Block) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); } break; case 876: #line 5854 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); yyVal = new Lock ((Expression) yyVals[-2+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop])); lbag.AddStatement (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); } break; case 877: #line 5865 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { start_block (GetLocation (yyVals[-2+yyTop])); current_block.IsCompilerGenerated = true; var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; var li = new LocalVariable (current_block, lt.Value, LocalVariable.Flags.FixedVariable | LocalVariable.Flags.Used, lt.Location); current_block.AddLocalName (li); current_variable = new Fixed.VariableDeclaration ((FullNamedExpression) yyVals[-1+yyTop], li); } break; case 878: #line 5875 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = current_variable; current_variable = null; } break; case 879: #line 5880 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); Fixed f = new Fixed ((Fixed.VariableDeclaration) yyVals[-1+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-9+yyTop])); current_block.AddStatement (f); yyVal = end_block (GetLocation (yyVals[-2+yyTop])); } break; case 880: #line 5892 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { start_block (GetLocation (yyVals[-2+yyTop])); current_block.IsCompilerGenerated = true; var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; var li = new LocalVariable (current_block, lt.Value, LocalVariable.Flags.UsingVariable | LocalVariable.Flags.Used, lt.Location); current_block.AddLocalName (li); current_variable = new Using.VariableDeclaration ((FullNamedExpression) yyVals[-1+yyTop], li); } break; case 881: #line 5902 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = current_variable; current_variable = null; } break; case 882: #line 5907 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); Using u = new Using ((Using.VariableDeclaration) yyVals[-1+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-9+yyTop])); current_block.AddStatement (u); yyVal = end_block (GetLocation (yyVals[-2+yyTop])); } break; case 883: #line 5916 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE) Warning_EmptyStatement (GetLocation (yyVals[0+yyTop])); Using u = new Using ((Expression) yyVals[-2+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop])); lbag.AddStatement (u, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop])); yyVal = u; } break; case 884: #line 5928 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Error_MissingInitializer (lexer.Location); } break; case 885: #line 5932 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_variable.Initializer = (Expression) yyVals[0+yyTop]; yyVal = current_variable; } break; case 886: #line 5943 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.query_parsing = false; Linq.AQueryClause from = yyVals[-1+yyTop] as Linq.AQueryClause; from.Tail.Next = (Linq.AQueryClause)yyVals[0+yyTop]; yyVal = from; current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; } break; case 887: #line 5955 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Linq.AQueryClause from = yyVals[-1+yyTop] as Linq.AQueryClause; from.Tail.Next = (Linq.AQueryClause)yyVals[0+yyTop]; yyVal = from; current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; } break; case 888: #line 5966 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { lexer.query_parsing = false; yyVal = yyVals[-1+yyTop]; current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; } break; case 889: #line 5973 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = yyVals[-1+yyTop]; current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; } break; case 890: #line 5982 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; var rv = new Linq.RangeVariable (lt.Value, lt.Location); yyVal = new Linq.QueryExpression (new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)yyVals[0+yyTop], rv, GetLocation (yyVals[-3+yyTop]))); } break; case 891: #line 5990 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; var rv = new Linq.RangeVariable (lt.Value, lt.Location); yyVal = new Linq.QueryExpression ( new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)yyVals[0+yyTop], rv, GetLocation (yyVals[-4+yyTop])) { IdentifierType = (FullNamedExpression)yyVals[-3+yyTop] } ); } break; case 892: #line 6005 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; var rv = new Linq.RangeVariable (lt.Value, lt.Location); yyVal = new Linq.QueryExpression (new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)yyVals[0+yyTop], rv, GetLocation (yyVals[-3+yyTop]))); } break; case 893: #line 6013 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; var rv = new Linq.RangeVariable (lt.Value, lt.Location); yyVal = new Linq.QueryExpression ( new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)yyVals[0+yyTop], rv, GetLocation (yyVals[-4+yyTop])) { IdentifierType = (FullNamedExpression)yyVals[-3+yyTop] } ); } break; case 894: #line 6028 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); } break; case 895: #line 6032 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; var sn = new Linq.RangeVariable (lt.Value, lt.Location); yyVal = new Linq.SelectMany ((Linq.QueryBlock)current_block, sn, (Expression)yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop])); current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; ((Linq.QueryBlock)current_block).AddRangeVariable (sn); } break; case 896: #line 6043 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); } break; case 897: #line 6047 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; var sn = new Linq.RangeVariable (lt.Value, lt.Location); yyVal = new Linq.SelectMany ((Linq.QueryBlock)current_block, sn, (Expression)yyVals[0+yyTop], GetLocation (yyVals[-5+yyTop])) { IdentifierType = (FullNamedExpression)yyVals[-4+yyTop] }; current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; ((Linq.QueryBlock)current_block).AddRangeVariable (sn); } break; case 898: #line 6064 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Linq.AQueryClause head = (Linq.AQueryClause)yyVals[-1+yyTop]; if (yyVals[0+yyTop] != null) head.Next = (Linq.AQueryClause)yyVals[0+yyTop]; if (yyVals[-2+yyTop] != null) { Linq.AQueryClause clause = (Linq.AQueryClause)yyVals[-2+yyTop]; clause.Tail.Next = head; head = clause; } yyVal = head; } break; case 900: #line 6080 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = null; } break; case 901: #line 6088 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); } break; case 902: #line 6092 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Linq.Select ((Linq.QueryBlock)current_block, (Expression)yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; } break; case 903: #line 6099 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (linq_clause_blocks == null) linq_clause_blocks = new Stack<Linq.QueryBlock> (); current_block = new Linq.QueryBlock (current_block, lexer.Location); linq_clause_blocks.Push ((Linq.QueryBlock)current_block); } break; case 904: #line 6107 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; current_block = new Linq.QueryBlock (current_block, lexer.Location); } break; case 905: #line 6114 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Linq.GroupBy ((Linq.QueryBlock)current_block, (Expression)yyVals[-3+yyTop], linq_clause_blocks.Pop (), (Expression)yyVals[0+yyTop], GetLocation (yyVals[-5+yyTop])); current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; } break; case 909: #line 6130 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { ((Linq.AQueryClause)yyVals[-1+yyTop]).Tail.Next = (Linq.AQueryClause)yyVals[0+yyTop]; yyVal = yyVals[-1+yyTop]; } break; case 915: #line 6146 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); } break; case 916: #line 6150 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; var sn = new Linq.RangeVariable (lt.Value, lt.Location); yyVal = new Linq.Let ((Linq.QueryBlock) current_block, sn, (Expression)yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop])); current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; ((Linq.QueryBlock)current_block).AddRangeVariable (sn); } break; case 917: #line 6164 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); } break; case 918: #line 6168 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Linq.Where ((Linq.QueryBlock)current_block, (Expression)yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; } break; case 919: #line 6178 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (linq_clause_blocks == null) linq_clause_blocks = new Stack<Linq.QueryBlock> (); current_block = new Linq.QueryBlock (current_block, lexer.Location); linq_clause_blocks.Push ((Linq.QueryBlock) current_block); } break; case 920: #line 6186 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; current_block = new Linq.QueryBlock (current_block, lexer.Location); linq_clause_blocks.Push ((Linq.QueryBlock) current_block); } break; case 921: #line 6194 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop])); current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; current_block = new Linq.QueryBlock (current_block, lexer.Location); } break; case 922: #line 6202 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop])); current_block.SetEndLocation (lexer.Location); var outer_selector = linq_clause_blocks.Pop (); var block = linq_clause_blocks.Pop (); var lt = (Tokenizer.LocatedToken) yyVals[-10+yyTop]; var sn = new Linq.RangeVariable (lt.Value, lt.Location); Linq.RangeVariable into; if (yyVals[0+yyTop] == null) { into = sn; yyVal = new Linq.Join (block, sn, (Expression)yyVals[-7+yyTop], outer_selector, (Linq.QueryBlock) current_block, GetLocation (yyVals[-11+yyTop])); } else { /**/ /* Set equals right side parent to beginning of linq query, it is not accessible therefore cannot cause name collisions*/ /**/ var parent = block.Parent; while (parent is Linq.QueryBlock) { parent = parent.Parent; } current_block.Parent = parent; ((Linq.QueryBlock)current_block).AddRangeVariable (sn); lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; into = new Linq.RangeVariable (lt.Value, lt.Location); yyVal = new Linq.GroupJoin (block, sn, (Expression)yyVals[-7+yyTop], outer_selector, (Linq.QueryBlock) current_block, into, GetLocation (yyVals[-11+yyTop])); } current_block = block.Parent; ((Linq.QueryBlock)current_block).AddRangeVariable (into); } break; case 923: #line 6238 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (linq_clause_blocks == null) linq_clause_blocks = new Stack<Linq.QueryBlock> (); current_block = new Linq.QueryBlock (current_block, lexer.Location); linq_clause_blocks.Push ((Linq.QueryBlock) current_block); } break; case 924: #line 6246 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; current_block = new Linq.QueryBlock (current_block, lexer.Location); linq_clause_blocks.Push ((Linq.QueryBlock) current_block); } break; case 925: #line 6254 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop])); current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; current_block = new Linq.QueryBlock (current_block, lexer.Location); } break; case 926: #line 6262 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop])); current_block.SetEndLocation (lexer.Location); var outer_selector = linq_clause_blocks.Pop (); var block = linq_clause_blocks.Pop (); var lt = (Tokenizer.LocatedToken) yyVals[-10+yyTop]; var sn = new Linq.RangeVariable (lt.Value, lt.Location); Linq.RangeVariable into; if (yyVals[0+yyTop] == null) { into = sn; yyVal = new Linq.Join (block, sn, (Expression)yyVals[-7+yyTop], outer_selector, (Linq.QueryBlock) current_block, GetLocation (yyVals[-12+yyTop])) { IdentifierType = (FullNamedExpression)yyVals[-11+yyTop] }; } else { /**/ /* Set equals right side parent to beginning of linq query, it is not accessible therefore cannot cause name collisions*/ /**/ var parent = block.Parent; while (parent is Linq.QueryBlock) { parent = parent.Parent; } current_block.Parent = parent; ((Linq.QueryBlock)current_block).AddRangeVariable (sn); lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; into = new Linq.RangeVariable (lt.Value, lt.Location); /* TODO:*/ yyVal = new Linq.GroupJoin (block, sn, (Expression)yyVals[-7+yyTop], outer_selector, (Linq.QueryBlock) current_block, into, GetLocation (yyVals[-12+yyTop])) { IdentifierType = (FullNamedExpression)yyVals[-11+yyTop] }; } current_block = block.Parent; ((Linq.QueryBlock)current_block).AddRangeVariable (into); } break; case 928: #line 6306 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 929: #line 6313 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); } break; case 930: #line 6317 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; yyVal = yyVals[0+yyTop]; } break; case 932: #line 6328 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; current_block = new Linq.QueryBlock (current_block, lexer.Location); } break; case 933: #line 6335 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { ((Linq.AQueryClause)yyVals[-3+yyTop]).Next = (Linq.AQueryClause)yyVals[0+yyTop]; yyVal = yyVals[-3+yyTop]; } break; case 935: #line 6344 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; current_block = new Linq.QueryBlock ((Linq.QueryBlock) current_block, lexer.Location); } break; case 936: #line 6351 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { ((Linq.AQueryClause)yyVals[-3+yyTop]).Tail.Next = (Linq.AQueryClause)yyVals[0+yyTop]; yyVal = yyVals[-3+yyTop]; } break; case 937: #line 6359 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Linq.OrderByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[0+yyTop]); } break; case 938: #line 6363 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Linq.OrderByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]); } break; case 939: #line 6367 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Linq.OrderByDescending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]); } break; case 940: #line 6374 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Linq.ThenByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[0+yyTop]); } break; case 941: #line 6378 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Linq.ThenByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]); } break; case 942: #line 6382 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new Linq.ThenByDescending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]); } break; case 944: #line 6391 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { /* query continuation block is not linked with query block but with block*/ /* before. This means each query can use same range variable names for*/ /* different identifiers.*/ current_block.SetEndLocation (GetLocation (yyVals[-1+yyTop])); current_block = current_block.Parent; current_block = new Linq.QueryBlock (current_block, lexer.Location); if (linq_clause_blocks == null) linq_clause_blocks = new Stack<Linq.QueryBlock> (); linq_clause_blocks.Push ((Linq.QueryBlock) current_block); } break; case 945: #line 6407 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var current_block = linq_clause_blocks.Pop (); var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; var rv = new Linq.RangeVariable (lt.Value, lt.Location); yyVal = new Linq.QueryStartClause ((Linq.QueryBlock)current_block, null, rv, GetLocation (yyVals[-3+yyTop])) { next = (Linq.AQueryClause)yyVals[0+yyTop] }; } break; case 948: #line 6434 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { current_container = new Class (current_namespace, current_class, new MemberName ("<InteractiveExpressionClass>"), Modifiers.PUBLIC, null); current_class = current_container; /* (ref object retval)*/ Parameter [] mpar = new Parameter [1]; mpar [0] = new Parameter (new TypeExpression (compiler.BuiltinTypes.Object, Location.Null), "$retval", Parameter.Modifier.REF, null, Location.Null); ParametersCompiled pars = new ParametersCompiled (mpar); var mods = Modifiers.PUBLIC | Modifiers.STATIC; if (settings.Unsafe) mods |= Modifiers.UNSAFE; current_local_parameters = pars; Method method = new Method ( current_class, null, /* generic*/ new TypeExpression (compiler.BuiltinTypes.Void, Location.Null), mods, new MemberName ("Host"), pars, null /* attributes */); current_container.AddMethod (method); oob_stack.Push (method); ++lexer.parsing_block; start_block (lexer.Location); } break; case 949: #line 6464 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { --lexer.parsing_block; Method method = (Method) oob_stack.Pop (); method.Block = (ToplevelBlock) end_block(lexer.Location); InteractiveResult = (Class) pop_current_class (); current_local_parameters = null; } break; case 957: #line 6496 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { module.DocumentationBuilder.ParsedName = (MemberName) yyVals[0+yyTop]; } break; case 958: #line 6503 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { module.DocumentationBuilder.ParsedParameters = (List<DocumentationParameter>)yyVals[0+yyTop]; } break; case 959: #line 6507 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { module.DocumentationBuilder.ParsedBuiltinType = (TypeExpression)yyVals[-1+yyTop]; module.DocumentationBuilder.ParsedParameters = (List<DocumentationParameter>)yyVals[0+yyTop]; yyVal = null; } break; case 960: #line 6513 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { module.DocumentationBuilder.ParsedBuiltinType = (TypeExpression)yyVals[-3+yyTop]; module.DocumentationBuilder.ParsedParameters = (List<DocumentationParameter>)yyVals[0+yyTop]; var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberName (lt.Value); } break; case 961: #line 6520 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new MemberName ((MemberName) yyVals[-2+yyTop], new MemberName (MemberCache.IndexerNameAlias)); } break; case 962: #line 6524 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; } break; case 963: #line 6528 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { module.DocumentationBuilder.ParsedParameters = (List<DocumentationParameter>)yyVals[-1+yyTop]; yyVal = new MemberName ((MemberName) yyVals[-6+yyTop], new MemberName (MemberCache.IndexerNameAlias)); } break; case 964: #line 6533 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var p = (List<DocumentationParameter>)yyVals[0+yyTop] ?? new List<DocumentationParameter> (1); p.Add (new DocumentationParameter ((FullNamedExpression) yyVals[-1+yyTop])); module.DocumentationBuilder.ParsedParameters = p; module.DocumentationBuilder.ParsedOperator = Operator.OpType.Explicit; yyVal = null; } break; case 965: #line 6541 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var p = (List<DocumentationParameter>)yyVals[0+yyTop] ?? new List<DocumentationParameter> (1); p.Add (new DocumentationParameter ((FullNamedExpression) yyVals[-1+yyTop])); module.DocumentationBuilder.ParsedParameters = p; module.DocumentationBuilder.ParsedOperator = Operator.OpType.Implicit; yyVal = null; } break; case 966: #line 6549 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var p = (List<DocumentationParameter>)yyVals[0+yyTop] ?? new List<DocumentationParameter> (1); module.DocumentationBuilder.ParsedParameters = p; module.DocumentationBuilder.ParsedOperator = (Operator.OpType) yyVals[-1+yyTop]; yyVal = null; } break; case 968: #line 6560 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new MemberName (((MemberName) yyVals[-2+yyTop]), (MemberName) yyVals[0+yyTop]); } break; case 970: #line 6568 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; } break; case 971: #line 6572 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; case 972: #line 6579 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { yyVal = new List<DocumentationParameter> (0); } break; case 974: #line 6587 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var parameters = new List<DocumentationParameter> (); parameters.Add ((DocumentationParameter) yyVals[0+yyTop]); yyVal = parameters; } break; case 975: #line 6593 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { var parameters = yyVals[-2+yyTop] as List<DocumentationParameter>; parameters.Add ((DocumentationParameter) yyVals[0+yyTop]); yyVal = parameters; } break; case 976: #line 6602 "D:\GitHub\M\Marvin\mcs\cs-parser.jay" { if (yyVals[-1+yyTop] != null) yyVal = new DocumentationParameter ((Parameter.Modifier) yyVals[-1+yyTop], (FullNamedExpression) yyVals[0+yyTop]); else yyVal = new DocumentationParameter ((FullNamedExpression) yyVals[0+yyTop]); } 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' } }
int IExpressionVisitor <int> .VisitBoolean(BooleanExpression expression) { _Writer.Write(expression.Value ? "true" : "false"); return(0); }
public virtual object Visit (BooleanExpression booleanExpression) { return null; }
public override object Visit (BooleanExpression booleanExpression) { return booleanExpression.Expr.Accept (this); }
public Where(ToplevelBlock block, BooleanExpression expr, Location loc) : base(block, expr, loc) { }
/** 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; //t 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; //t if (debug != null) //t debug.lex(yyState, yyToken, yyname(yyToken), yyLex.value()); } if ((yyN = yySindex[yyState]) != 0 && ((yyN += yyToken) >= 0) && (yyN < yyTable.Length) && (yyCheck[yyN] == yyToken)) { //t if (debug != null) //t 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)); //t 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) { //t if (debug != null) //t debug.shift(yyStates[yyTop], yyTable[yyN], 3); yyState = yyTable[yyN]; yyVal = yyLex.value(); goto continue_yyLoop; } //t if (debug != null) debug.pop(yyStates[yyTop]); } while (-- yyTop >= 0); //t if (debug != null) debug.reject(); throw new yyParser.yyException("irrecoverable syntax error"); case 3: if (yyToken == 0) { //t if (debug != null) debug.reject(); throw new yyParser.yyException("irrecoverable syntax error at end-of-file"); } //t if (debug != null) //t debug.discard(yyState, yyToken, yyname(yyToken), //t yyLex.value()); yyToken = -1; goto continue_yyDiscarded; // leave stack alone } } int yyV = yyTop + 1-yyLen[yyN]; //t if (debug != null) //t 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 5: #line 374 "cs-parser.jay" { Lexer.CompleteOnEOF = false; } break; case 7: #line 381 "cs-parser.jay" { Lexer.check_incorrect_doc_comment (); } break; case 8: #line 385 "cs-parser.jay" { Lexer.check_incorrect_doc_comment (); } break; case 16: case_16(); break; case 17: #line 421 "cs-parser.jay" { syntax_error (GetLocation (yyVals[-1+yyTop]), "`alias' expected"); /* TODO: better*/ } break; case 20: case_20(); break; case 21: case_21(); break; case 22: case_22(); break; case 23: case_23(); break; case 24: case_24(); break; case 25: case_25(); break; case 26: case_26(); break; case 27: case_27(); break; case 28: case_28(); break; case 29: case_29(); break; case 34: case_34(); break; case 35: case_35(); break; case 36: #line 546 "cs-parser.jay" { ubag.CloseNamespace (GetLocation (yyVals[-2+yyTop])); } break; case 45: case_45(); break; case 46: #line 583 "cs-parser.jay" { current_namespace.DeclarationFound = true; } break; case 47: #line 587 "cs-parser.jay" { Report.Error (116, ((MemberCore) yyVals[0+yyTop]).Location, "A namespace can only contain types and namespace declarations"); } break; case 48: #line 590 "cs-parser.jay" { Report.Error (116, ((MemberCore) yyVals[0+yyTop]).Location, "A namespace can only contain types and namespace declarations"); } break; case 49: #line 594 "cs-parser.jay" { Error_SyntaxError (yyToken); } break; case 55: case_55(); break; case 56: case_56(); break; case 57: case_57(); break; case 58: case_58(); break; case 59: case_59(); break; case 60: #line 715 "cs-parser.jay" { yyVal = yyVals[-2+yyTop]; } break; case 61: #line 719 "cs-parser.jay" { yyVal = yyVals[-2+yyTop]; } break; case 62: case_62(); break; case 63: case_63(); break; case 64: #line 736 "cs-parser.jay" { yyVal = "event"; } break; case 65: #line 737 "cs-parser.jay" { yyVal = "return"; } break; case 66: case_66(); break; case 67: #line 749 "cs-parser.jay" { yyVal = new List<Attribute> (4) { (Attribute) yyVals[0+yyTop] }; } break; case 68: case_68(); break; case 69: #line 763 "cs-parser.jay" { ++lexer.parsing_block; } break; case 70: case_70(); break; case 71: #line 788 "cs-parser.jay" { /* reserved attribute name or identifier: 17.4 */ } break; case 72: #line 792 "cs-parser.jay" { yyVal = null; } break; case 73: #line 796 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; case 74: #line 801 "cs-parser.jay" { yyVal = null; } break; case 75: case_75(); break; case 76: case_76(); break; case 77: case_77(); break; case 78: case_78(); break; case 79: #line 845 "cs-parser.jay" { yyVal = new Argument ((Expression) yyVals[0+yyTop]); } break; case 81: #line 853 "cs-parser.jay" { ++lexer.parsing_block; } break; case 82: case_82(); break; case 83: case_83(); break; case 84: #line 877 "cs-parser.jay" { yyVal = null; } break; case 85: #line 881 "cs-parser.jay" { yyVal = Argument.AType.Ref; } break; case 86: #line 885 "cs-parser.jay" { yyVal = Argument.AType.Out; } break; case 101: case_101(); break; case 102: #line 926 "cs-parser.jay" { lexer.ConstraintsParsing = true; } break; case 103: case_103(); break; case 104: case_104(); break; case 105: case_105(); break; case 106: case_106(); break; case 107: #line 958 "cs-parser.jay" { Error_SyntaxError (yyToken); } break; case 108: case_108(); break; case 109: #line 970 "cs-parser.jay" { lbag.AppendToMember (current_class, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop])); } break; case 124: case_124(); break; case 125: case_125(); break; case 128: #line 1039 "cs-parser.jay" { current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 129: #line 1043 "cs-parser.jay" { current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 130: case_130(); break; case 131: #line 1059 "cs-parser.jay" { ++lexer.parsing_block; } break; case 132: case_132(); break; case 133: case_133(); break; case 136: case_136(); break; case 137: case_137(); break; case 138: case_138(); break; case 139: case_139(); break; case 140: #line 1137 "cs-parser.jay" { Report.Error (1641, GetLocation (yyVals[-1+yyTop]), "A fixed size buffer field must have the array size specifier after the field name"); } break; case 142: case_142(); break; case 143: case_143(); break; case 146: #line 1167 "cs-parser.jay" { current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 147: #line 1171 "cs-parser.jay" { current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 148: case_148(); break; case 149: #line 1184 "cs-parser.jay" { ++lexer.parsing_block; } break; case 150: case_150(); break; case 153: #line 1203 "cs-parser.jay" { current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 154: #line 1207 "cs-parser.jay" { current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 155: case_155(); break; case 156: #line 1223 "cs-parser.jay" { ++lexer.parsing_block; } break; case 157: case_157(); break; case 158: case_158(); break; case 161: case_161(); break; case 162: case_162(); break; case 163: case_163(); break; case 164: #line 1277 "cs-parser.jay" { valid_param_mod = ParameterModifierType.All; } break; case 165: #line 1281 "cs-parser.jay" { lexer.ConstraintsParsing = true; } break; case 166: case_166(); break; case 167: #line 1322 "cs-parser.jay" { valid_param_mod = ParameterModifierType.All; } break; case 168: #line 1326 "cs-parser.jay" { lexer.ConstraintsParsing = true; } break; case 169: case_169(); break; case 170: case_170(); break; case 172: #line 1402 "cs-parser.jay" { yyVal = null; } break; case 173: #line 1406 "cs-parser.jay" { yyVal = ParametersCompiled.EmptyReadOnlyParameters; } break; case 175: case_175(); break; case 176: case_176(); break; case 177: case_177(); break; case 178: case_178(); break; case 179: case_179(); break; case 180: case_180(); break; case 181: case_181(); break; case 182: #line 1465 "cs-parser.jay" { yyVal = new ParametersCompiled (new Parameter[] { (Parameter) yyVals[0+yyTop] } ); } break; case 183: #line 1469 "cs-parser.jay" { yyVal = new ParametersCompiled (new Parameter [] { new ArglistParameter (GetLocation (yyVals[0+yyTop])) }, true); } break; case 184: case_184(); break; case 185: case_185(); break; case 186: case_186(); break; case 187: case_187(); break; case 188: case_188(); break; case 189: case_189(); break; case 190: #line 1544 "cs-parser.jay" { ++lexer.parsing_block; } break; case 191: case_191(); break; case 192: #line 1585 "cs-parser.jay" { yyVal = Parameter.Modifier.NONE; } break; case 194: case_194(); break; case 195: case_195(); break; case 196: case_196(); break; case 197: case_197(); break; case 198: case_198(); break; case 199: case_199(); break; case 200: case_200(); break; case 201: case_201(); break; case 202: case_202(); break; case 203: case_203(); break; case 204: #line 1683 "cs-parser.jay" { Error_DuplicateParameterModifier (GetLocation (yyVals[-1+yyTop]), Parameter.Modifier.PARAMS); } break; case 205: case_205(); break; case 206: case_206(); break; case 207: case_207(); break; case 208: case_208(); break; case 209: case_209(); break; case 210: #line 1736 "cs-parser.jay" { valid_param_mod = ParameterModifierType.Params | ParameterModifierType.DefaultValue; } break; case 211: case_211(); break; case 212: #line 1766 "cs-parser.jay" { lexer.PropertyParsing = false; } break; case 213: case_213(); break; case 218: case_218(); break; case 219: case_219(); break; case 220: case_220(); break; case 221: case_221(); break; case 222: case_222(); break; case 224: case_224(); break; case 225: case_225(); break; case 226: #line 1908 "cs-parser.jay" { lexer.ConstraintsParsing = true; } break; case 227: case_227(); break; case 228: case_228(); break; case 229: case_229(); break; case 230: case_230(); break; case 231: #line 1941 "cs-parser.jay" { Error_SyntaxError (yyToken); } break; case 236: #line 1958 "cs-parser.jay" { Report.Error (525, GetLocation (yyVals[0+yyTop]), "Interfaces cannot contain fields or constants"); } break; case 237: #line 1962 "cs-parser.jay" { Report.Error (525, GetLocation (yyVals[0+yyTop]), "Interfaces cannot contain fields or constants"); } break; case 242: #line 1970 "cs-parser.jay" { Report.Error (567, GetLocation (yyVals[0+yyTop]), "Interfaces cannot contain operators"); } break; case 243: #line 1974 "cs-parser.jay" { Report.Error (526, GetLocation (yyVals[0+yyTop]), "Interfaces cannot contain contructors"); } break; case 244: #line 1978 "cs-parser.jay" { Report.Error (524, GetLocation (yyVals[0+yyTop]), "Interfaces cannot declare classes, structs, interfaces, delegates, or enumerations"); } break; case 245: #line 1984 "cs-parser.jay" { } break; case 246: case_246(); break; case 248: #line 2011 "cs-parser.jay" { yyVal = null; } break; case 250: case_250(); break; case 251: #line 2027 "cs-parser.jay" { valid_param_mod = ParameterModifierType.DefaultValue; } break; case 252: case_252(); break; case 254: #line 2073 "cs-parser.jay" { yyVal = Operator.OpType.LogicalNot; } break; case 255: #line 2074 "cs-parser.jay" { yyVal = Operator.OpType.OnesComplement; } break; case 256: #line 2075 "cs-parser.jay" { yyVal = Operator.OpType.Increment; } break; case 257: #line 2076 "cs-parser.jay" { yyVal = Operator.OpType.Decrement; } break; case 258: #line 2077 "cs-parser.jay" { yyVal = Operator.OpType.True; } break; case 259: #line 2078 "cs-parser.jay" { yyVal = Operator.OpType.False; } break; case 260: #line 2080 "cs-parser.jay" { yyVal = Operator.OpType.Addition; } break; case 261: #line 2081 "cs-parser.jay" { yyVal = Operator.OpType.Subtraction; } break; case 262: #line 2083 "cs-parser.jay" { yyVal = Operator.OpType.Multiply; } break; case 263: #line 2084 "cs-parser.jay" { yyVal = Operator.OpType.Division; } break; case 264: #line 2085 "cs-parser.jay" { yyVal = Operator.OpType.Modulus; } break; case 265: #line 2086 "cs-parser.jay" { yyVal = Operator.OpType.BitwiseAnd; } break; case 266: #line 2087 "cs-parser.jay" { yyVal = Operator.OpType.BitwiseOr; } break; case 267: #line 2088 "cs-parser.jay" { yyVal = Operator.OpType.ExclusiveOr; } break; case 268: #line 2089 "cs-parser.jay" { yyVal = Operator.OpType.LeftShift; } break; case 269: #line 2090 "cs-parser.jay" { yyVal = Operator.OpType.RightShift; } break; case 270: #line 2091 "cs-parser.jay" { yyVal = Operator.OpType.Equality; } break; case 271: #line 2092 "cs-parser.jay" { yyVal = Operator.OpType.Inequality; } break; case 272: #line 2093 "cs-parser.jay" { yyVal = Operator.OpType.GreaterThan; } break; case 273: #line 2094 "cs-parser.jay" { yyVal = Operator.OpType.LessThan; } break; case 274: #line 2095 "cs-parser.jay" { yyVal = Operator.OpType.GreaterThanOrEqual; } break; case 275: #line 2096 "cs-parser.jay" { yyVal = Operator.OpType.LessThanOrEqual; } break; case 276: #line 2103 "cs-parser.jay" { valid_param_mod = ParameterModifierType.DefaultValue; } break; case 277: case_277(); break; case 278: #line 2122 "cs-parser.jay" { valid_param_mod = ParameterModifierType.DefaultValue; } break; case 279: case_279(); break; case 280: case_280(); break; case 281: case_281(); break; case 282: case_282(); break; case 283: case_283(); break; case 284: case_284(); break; case 285: case_285(); break; case 287: #line 2225 "cs-parser.jay" { current_block = null; yyVal = null; } break; case 290: #line 2237 "cs-parser.jay" { ++lexer.parsing_block; } break; case 291: case_291(); break; case 292: #line 2247 "cs-parser.jay" { ++lexer.parsing_block; } break; case 293: case_293(); break; case 294: case_294(); break; case 295: case_295(); break; case 296: case_296(); break; case 297: case_297(); break; case 298: case_298(); break; case 299: case_299(); break; case 300: case_300(); break; case 301: case_301(); break; case 303: #line 2356 "cs-parser.jay" { ++lexer.parsing_block; } break; case 304: case_304(); break; case 307: #line 2373 "cs-parser.jay" { current_event_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 308: #line 2377 "cs-parser.jay" { current_event_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 309: case_309(); break; case 310: #line 2390 "cs-parser.jay" { ++lexer.parsing_block; } break; case 311: case_311(); break; case 312: case_312(); break; case 313: #line 2415 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 316: case_316(); break; case 317: case_317(); break; case 318: case_318(); break; case 319: case_319(); break; case 320: case_320(); break; case 321: case_321(); break; case 322: case_322(); break; case 323: case_323(); break; case 325: case_325(); break; case 326: case_326(); break; case 327: case_327(); break; case 328: case_328(); break; case 330: case_330(); break; case 331: case_331(); break; case 334: #line 2574 "cs-parser.jay" { lbag.AddLocation (yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop])); } break; case 336: case_336(); break; case 337: case_337(); break; case 338: case_338(); break; case 339: case_339(); break; case 340: #line 2632 "cs-parser.jay" { valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out | ParameterModifierType.Params | ParameterModifierType.DefaultValue; } break; case 341: case_341(); break; case 342: #line 2655 "cs-parser.jay" { lexer.ConstraintsParsing = false; } break; case 343: case_343(); break; case 345: case_345(); break; case 347: case_347(); break; case 349: case_349(); break; case 350: case_350(); break; case 352: case_352(); break; case 353: case_353(); break; case 354: case_354(); break; case 355: case_355(); break; case 356: #line 2752 "cs-parser.jay" { lexer.parsing_generic_declaration = true; } break; case 357: case_357(); break; case 358: case_358(); break; case 360: case_360(); break; case 361: case_361(); break; case 362: case_362(); break; case 363: case_363(); break; case 364: case_364(); break; case 365: case_365(); break; case 367: case_367(); break; case 368: case_368(); break; case 369: case_369(); break; case 370: case_370(); break; case 371: case_371(); break; case 373: #line 2872 "cs-parser.jay" { yyVal = new TypeExpression (TypeManager.void_type, GetLocation (yyVals[0+yyTop])); } break; case 374: #line 2879 "cs-parser.jay" { lexer.parsing_generic_declaration = true; } break; case 376: case_376(); break; case 378: case_378(); break; case 380: case_380(); break; case 382: #line 2917 "cs-parser.jay" { yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; case 383: case_383(); break; case 384: #line 2937 "cs-parser.jay" { yyVal = new ComposedCast (((MemberName) yyVals[-1+yyTop]).GetTypeExpression (), (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; case 385: case_385(); break; case 386: #line 2946 "cs-parser.jay" { yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; case 387: #line 2950 "cs-parser.jay" { yyVal = new ComposedCast (new TypeExpression (TypeManager.void_type, GetLocation (yyVals[-1+yyTop])), (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; case 388: case_388(); break; case 389: case_389(); break; case 390: case_390(); break; case 391: case_391(); break; case 392: #line 2988 "cs-parser.jay" { yyVal = new TypeExpression (TypeManager.object_type, GetLocation (yyVals[0+yyTop])); } break; case 393: #line 2989 "cs-parser.jay" { yyVal = new TypeExpression (TypeManager.string_type, GetLocation (yyVals[0+yyTop])); } break; case 394: #line 2990 "cs-parser.jay" { yyVal = new TypeExpression (TypeManager.bool_type, GetLocation (yyVals[0+yyTop])); } break; case 395: #line 2991 "cs-parser.jay" { yyVal = new TypeExpression (TypeManager.decimal_type, GetLocation (yyVals[0+yyTop])); } break; case 396: #line 2992 "cs-parser.jay" { yyVal = new TypeExpression (TypeManager.float_type, GetLocation (yyVals[0+yyTop])); } break; case 397: #line 2993 "cs-parser.jay" { yyVal = new TypeExpression (TypeManager.double_type, GetLocation (yyVals[0+yyTop])); } break; case 399: #line 2998 "cs-parser.jay" { yyVal = new TypeExpression (TypeManager.sbyte_type, GetLocation (yyVals[0+yyTop])); } break; case 400: #line 2999 "cs-parser.jay" { yyVal = new TypeExpression (TypeManager.byte_type, GetLocation (yyVals[0+yyTop])); } break; case 401: #line 3000 "cs-parser.jay" { yyVal = new TypeExpression (TypeManager.short_type, GetLocation (yyVals[0+yyTop])); } break; case 402: #line 3001 "cs-parser.jay" { yyVal = new TypeExpression (TypeManager.ushort_type, GetLocation (yyVals[0+yyTop])); } break; case 403: #line 3002 "cs-parser.jay" { yyVal = new TypeExpression (TypeManager.int32_type, GetLocation (yyVals[0+yyTop])); } break; case 404: #line 3003 "cs-parser.jay" { yyVal = new TypeExpression (TypeManager.uint32_type, GetLocation (yyVals[0+yyTop])); } break; case 405: #line 3004 "cs-parser.jay" { yyVal = new TypeExpression (TypeManager.int64_type, GetLocation (yyVals[0+yyTop])); } break; case 406: #line 3005 "cs-parser.jay" { yyVal = new TypeExpression (TypeManager.uint64_type, GetLocation (yyVals[0+yyTop])); } break; case 407: #line 3006 "cs-parser.jay" { yyVal = new TypeExpression (TypeManager.char_type, GetLocation (yyVals[0+yyTop])); } break; case 427: case_427(); break; case 428: case_428(); break; case 432: #line 3052 "cs-parser.jay" { yyVal = new NullLiteral (GetLocation (yyVals[0+yyTop])); } break; case 433: #line 3056 "cs-parser.jay" { yyVal = new BoolLiteral (true, GetLocation (yyVals[0+yyTop])); } break; case 434: #line 3057 "cs-parser.jay" { yyVal = new BoolLiteral (false, GetLocation (yyVals[0+yyTop])); } break; case 439: case_439(); break; case 440: #line 3090 "cs-parser.jay" { yyVal = new ParenthesizedExpression ((Expression) yyVals[-1+yyTop]); } break; case 441: case_441(); break; case 442: case_442(); break; case 443: case_443(); break; case 444: case_444(); break; case 445: #line 3121 "cs-parser.jay" { yyVal = new CompletionMemberAccess ((Expression) yyVals[-2+yyTop], null,GetLocation (yyVals[0+yyTop])); } break; case 446: case_446(); break; case 447: #line 3129 "cs-parser.jay" { yyVal = new CompletionMemberAccess ((Expression) yyVals[-2+yyTop], null, lexer.Location); } break; case 448: case_448(); break; case 449: case_449(); break; case 450: #line 3145 "cs-parser.jay" { yyVal = null; } break; case 452: case_452(); break; case 453: case_453(); break; case 454: #line 3168 "cs-parser.jay" { yyVal = null; } break; case 455: #line 3172 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 456: case_456(); break; case 457: case_457(); break; case 458: case_458(); break; case 459: case_459(); break; case 460: #line 3204 "cs-parser.jay" { yyVal = new CompletionElementInitializer (null, GetLocation (yyVals[0+yyTop])); } break; case 461: case_461(); break; case 462: case_462(); break; case 463: case_463(); break; case 466: #line 3232 "cs-parser.jay" { yyVal = null; } break; case 468: case_468(); break; case 469: case_469(); break; case 470: case_470(); break; case 471: case_471(); break; case 472: case_472(); break; case 473: #line 3284 "cs-parser.jay" { yyVal = new Argument ((Expression) yyVals[0+yyTop]); } break; case 477: case_477(); break; case 478: case_478(); break; case 479: case_479(); break; case 480: case_480(); break; case 482: case_482(); break; case 483: case_483(); break; case 484: case_484(); break; case 485: case_485(); break; case 486: case_486(); break; case 487: case_487(); break; case 488: #line 3371 "cs-parser.jay" { yyVal = new Argument ((Expression) yyVals[0+yyTop]); } break; case 490: #line 3379 "cs-parser.jay" { yyVal = new This (GetLocation (yyVals[0+yyTop])); } break; case 491: case_491(); break; case 492: case_492(); break; case 493: #line 3399 "cs-parser.jay" { yyVal = new UnaryMutator (UnaryMutator.Mode.PostIncrement, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop])); } break; case 494: #line 3406 "cs-parser.jay" { yyVal = new UnaryMutator (UnaryMutator.Mode.PostDecrement, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop])); } break; case 495: case_495(); break; case 496: case_496(); break; case 497: case_497(); break; case 498: case_498(); break; case 499: case_499(); break; case 500: case_500(); break; case 501: case_501(); break; case 502: #line 3472 "cs-parser.jay" { ++lexer.parsing_type; } break; case 503: case_503(); break; case 504: case_504(); break; case 507: #line 3501 "cs-parser.jay" { yyVal = null; } break; case 509: case_509(); break; case 510: case_510(); break; case 511: case_511(); break; case 512: case_512(); break; case 513: case_513(); break; case 514: case_514(); break; case 518: case_518(); break; case 519: case_519(); break; case 520: case_520(); break; case 521: #line 3577 "cs-parser.jay" { yyVal = 2; } break; case 522: #line 3581 "cs-parser.jay" { yyVal = ((int) yyVals[-1+yyTop]) + 1; } break; case 523: #line 3588 "cs-parser.jay" { yyVal = null; } break; case 524: #line 3592 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 525: case_525(); break; case 526: case_526(); break; case 527: case_527(); break; case 528: case_528(); break; case 529: #line 3636 "cs-parser.jay" { lexer.TypeOfParsing = true; } break; case 530: case_530(); break; case 533: case_533(); break; case 534: case_534(); break; case 535: case_535(); break; case 536: case_536(); break; case 537: case_537(); break; case 538: case_538(); break; case 539: case_539(); break; case 540: case_540(); break; case 541: case_541(); break; case 542: case_542(); break; case 543: case_543(); break; case 544: case_544(); break; case 545: #line 3751 "cs-parser.jay" { start_anonymous (false, (ParametersCompiled) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 546: #line 3755 "cs-parser.jay" { yyVal = end_anonymous ((ParametersBlock) yyVals[0+yyTop]); } break; case 547: #line 3762 "cs-parser.jay" { yyVal = ParametersCompiled.Undefined; } break; case 549: #line 3770 "cs-parser.jay" { valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; } break; case 550: case_550(); break; case 551: case_551(); break; case 553: #line 3794 "cs-parser.jay" { yyVal = new Unary (Unary.Operator.LogicalNot, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 554: #line 3798 "cs-parser.jay" { yyVal = new Unary (Unary.Operator.OnesComplement, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 556: case_556(); break; case 558: #line 3819 "cs-parser.jay" { yyVal = new Unary (Unary.Operator.UnaryPlus, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 559: #line 3823 "cs-parser.jay" { yyVal = new Unary (Unary.Operator.UnaryNegation, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 560: #line 3827 "cs-parser.jay" { yyVal = new UnaryMutator (UnaryMutator.Mode.PreIncrement, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 561: #line 3831 "cs-parser.jay" { yyVal = new UnaryMutator (UnaryMutator.Mode.PreDecrement, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 562: #line 3835 "cs-parser.jay" { yyVal = new Indirection ((Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 563: #line 3839 "cs-parser.jay" { yyVal = new Unary (Unary.Operator.AddressOf, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 565: case_565(); break; case 566: case_566(); break; case 567: case_567(); break; case 569: case_569(); break; case 570: #line 3871 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.Subtraction, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 571: case_571(); break; case 572: #line 3880 "cs-parser.jay" { yyVal = new As ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 573: #line 3884 "cs-parser.jay" { yyVal = new Is ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 575: case_575(); break; case 576: case_576(); break; case 578: case_578(); break; case 579: case_579(); break; case 580: case_580(); break; case 581: case_581(); break; case 583: case_583(); break; case 584: case_584(); break; case 586: case_586(); break; case 588: case_588(); break; case 590: case_590(); break; case 592: case_592(); break; case 594: case_594(); break; case 596: case_596(); break; case 598: case_598(); break; case 599: #line 4008 "cs-parser.jay" { yyVal = new SimpleAssign ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 600: case_600(); break; case 601: case_601(); break; case 602: case_602(); break; case 603: case_603(); break; case 604: case_604(); break; case 605: case_605(); break; case 606: case_606(); break; case 607: case_607(); break; case 608: case_608(); break; case 609: case_609(); break; case 610: case_610(); break; case 611: case_611(); break; case 612: case_612(); break; case 613: case_613(); break; case 614: case_614(); break; case 615: #line 4103 "cs-parser.jay" { yyVal = ParametersCompiled.EmptyReadOnlyParameters; } break; case 616: case_616(); break; case 619: #line 4118 "cs-parser.jay" { start_block (lexer.Location); } break; case 620: case_620(); break; case 622: case_622(); break; case 623: case_623(); break; case 624: case_624(); break; case 625: case_625(); break; case 626: case_626(); break; case 627: case_627(); break; case 633: #line 4179 "cs-parser.jay" { yyVal = new ArglistAccess (GetLocation (yyVals[0+yyTop])); } break; case 635: #line 4190 "cs-parser.jay" { yyVal = new BooleanExpression ((Expression) yyVals[0+yyTop]); } break; case 636: #line 4203 "cs-parser.jay" { lexer.ConstraintsParsing = true; } break; case 637: case_637(); break; case 638: case_638(); break; case 639: case_639(); break; case 640: case_640(); break; case 641: #line 4237 "cs-parser.jay" { yyVal = null; } break; case 642: #line 4239 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 643: case_643(); break; case 646: case_646(); break; case 647: case_647(); break; case 648: case_648(); break; case 649: case_649(); break; case 650: case_650(); break; case 651: case_651(); break; case 652: case_652(); break; case 653: case_653(); break; case 654: case_654(); break; case 655: case_655(); break; case 656: case_656(); break; case 657: case_657(); break; case 658: case_658(); break; case 659: case_659(); break; case 660: case_660(); break; case 662: #line 4354 "cs-parser.jay" { current_container.AddBasesForPart (current_class, (List<FullNamedExpression>) yyVals[0+yyTop]); } break; case 664: #line 4362 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 665: case_665(); break; case 666: case_666(); break; case 667: case_667(); break; case 668: case_668(); break; case 669: case_669(); break; case 670: case_670(); break; case 671: case_671(); break; case 672: #line 4446 "cs-parser.jay" { yyVal = new SpecialContraintExpr (SpecialConstraint.Class, GetLocation (yyVals[0+yyTop])); } break; case 673: #line 4450 "cs-parser.jay" { yyVal = new SpecialContraintExpr (SpecialConstraint.Struct, GetLocation (yyVals[0+yyTop])); } break; case 674: #line 4457 "cs-parser.jay" { yyVal = Variance.None; } break; case 675: case_675(); break; case 676: #line 4473 "cs-parser.jay" { yyVal = Variance.Covariant; } break; case 677: #line 4477 "cs-parser.jay" { yyVal = Variance.Contravariant; } break; case 678: case_678(); break; case 679: #line 4502 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 680: case_680(); break; case 681: case_681(); break; case 682: case_682(); break; case 683: case_683(); break; case 688: #line 4546 "cs-parser.jay" { current_block.AddStatement ((Statement) yyVals[0+yyTop]); } break; case 689: #line 4550 "cs-parser.jay" { current_block.AddStatement ((Statement) yyVals[0+yyTop]); } break; case 691: case_691(); break; case 694: #line 4574 "cs-parser.jay" { current_block.AddStatement ((Statement) yyVals[0+yyTop]); } break; case 695: #line 4578 "cs-parser.jay" { current_block.AddStatement ((Statement) yyVals[0+yyTop]); } break; case 724: case_724(); break; case 725: case_725(); break; case 726: case_726(); break; case 727: case_727(); break; case 728: case_728(); break; case 731: case_731(); break; case 732: case_732(); break; case 733: case_733(); break; case 734: case_734(); break; case 735: #line 4722 "cs-parser.jay" { yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; case 736: #line 4726 "cs-parser.jay" { yyVal = new ComposedCast (new TypeExpression (TypeManager.void_type, GetLocation (yyVals[-1+yyTop])), (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; case 737: case_737(); break; case 739: case_739(); break; case 740: #line 4747 "cs-parser.jay" { yyVal = ComposedTypeSpecifier.CreatePointer (GetLocation (yyVals[0+yyTop])); } break; case 741: case_741(); break; case 742: case_742(); break; case 743: case_743(); break; case 744: case_744(); break; case 746: case_746(); break; case 747: case_747(); break; case 752: case_752(); break; case 753: case_753(); break; case 754: #line 4832 "cs-parser.jay" { Report.Error (145, lexer.Location, "A const field requires a value to be provided"); } break; case 755: #line 4836 "cs-parser.jay" { current_variable.Initializer = (Expression) yyVals[0+yyTop]; } break; case 760: case_760(); break; case 762: case_762(); break; case 763: case_763(); break; case 764: case_764(); break; case 765: #line 4881 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; case 766: #line 4885 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; case 767: #line 4886 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; case 768: case_768(); break; case 769: case_769(); break; case 770: case_770(); break; case 773: case_773(); break; case 774: case_774(); break; case 775: #line 4954 "cs-parser.jay" { start_block (GetLocation (yyVals[0+yyTop])); } break; case 776: case_776(); break; case 777: case_777(); break; case 779: case_779(); break; case 780: case_780(); break; case 781: case_781(); break; case 782: #line 4998 "cs-parser.jay" { current_block = current_block.CreateSwitchBlock (lexer.Location); } break; case 783: #line 5002 "cs-parser.jay" { yyVal = new SwitchSection ((List<SwitchLabel>) yyVals[-2+yyTop], current_block); } break; case 784: case_784(); break; case 785: case_785(); break; case 786: case_786(); break; case 787: #line 5031 "cs-parser.jay" { yyVal = new SwitchLabel (null, GetLocation (yyVals[0+yyTop])); } break; case 792: case_792(); break; case 793: case_793(); break; case 794: case_794(); break; case 795: case_795(); break; case 796: #line 5085 "cs-parser.jay" { yyVal = new EmptyStatement (lexer.Location); } break; case 798: case_798(); break; case 799: case_799(); break; case 801: #line 5106 "cs-parser.jay" { yyVal = null; } break; case 803: #line 5111 "cs-parser.jay" { yyVal = new EmptyStatement (lexer.Location); } break; case 807: case_807(); break; case 808: case_808(); break; case 809: case_809(); break; case 810: case_810(); break; case 817: case_817(); break; case 818: case_818(); break; case 819: case_819(); break; case 820: case_820(); break; case 821: case_821(); break; case 822: case_822(); break; case 823: case_823(); break; case 824: case_824(); break; case 825: case_825(); break; case 828: #line 5266 "cs-parser.jay" { yyVal = new TryCatch ((Block) yyVals[-1+yyTop], (List<Catch>) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop]), false); } break; case 829: case_829(); break; case 830: case_830(); break; case 831: case_831(); break; case 832: case_832(); break; case 833: case_833(); break; case 836: #line 5319 "cs-parser.jay" { yyVal = new Catch ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 837: case_837(); break; case 838: #line 5338 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; case 839: case_839(); break; case 840: #line 5356 "cs-parser.jay" { yyVal = new Checked ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 841: #line 5363 "cs-parser.jay" { yyVal = new Unchecked ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 842: case_842(); break; case 843: #line 5373 "cs-parser.jay" { yyVal = new Unsafe ((Block) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); } break; case 844: case_844(); break; case 845: case_845(); break; case 846: case_846(); break; case 847: case_847(); break; case 848: case_848(); break; case 849: case_849(); break; case 850: case_850(); break; case 851: case_851(); break; case 852: #line 5455 "cs-parser.jay" { Report.Error (210, lexer.Location, "You must provide an initializer in a fixed or using statement declaration"); } break; case 853: case_853(); break; case 854: case_854(); break; case 855: case_855(); break; case 856: case_856(); break; case 857: case_857(); break; case 858: case_858(); break; case 859: case_859(); break; case 860: case_860(); break; case 861: case_861(); break; case 862: #line 5555 "cs-parser.jay" { current_block = new Linq.QueryBlock (compiler, current_block, lexer.Location); } break; case 863: case_863(); break; case 864: #line 5570 "cs-parser.jay" { current_block = new Linq.QueryBlock (compiler, current_block, lexer.Location); } break; case 865: case_865(); break; case 866: case_866(); break; case 868: #line 5610 "cs-parser.jay" { current_block = new Linq.QueryBlock (compiler, current_block, lexer.Location); } break; case 869: case_869(); break; case 870: case_870(); break; case 871: case_871(); break; case 872: case_872(); break; case 876: case_876(); break; case 882: #line 5668 "cs-parser.jay" { current_block = new Linq.QueryBlock (compiler, current_block, lexer.Location); } break; case 883: case_883(); break; case 884: #line 5686 "cs-parser.jay" { current_block = new Linq.QueryBlock (compiler, current_block, lexer.Location); } break; case 885: case_885(); break; case 886: case_886(); break; case 887: case_887(); break; case 888: case_888(); break; case 889: case_889(); break; case 890: case_890(); break; case 891: case_891(); break; case 892: case_892(); break; case 893: case_893(); break; case 895: #line 5828 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 896: #line 5835 "cs-parser.jay" { current_block = new Linq.QueryBlock (compiler, current_block, lexer.Location); } break; case 897: case_897(); break; case 899: case_899(); break; case 900: case_900(); break; case 902: case_902(); break; case 903: case_903(); break; case 904: #line 5881 "cs-parser.jay" { yyVal = new Linq.OrderByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[0+yyTop]); } break; case 905: #line 5885 "cs-parser.jay" { yyVal = new Linq.OrderByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]); } break; case 906: #line 5889 "cs-parser.jay" { yyVal = new Linq.OrderByDescending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]); } break; case 907: #line 5896 "cs-parser.jay" { yyVal = new Linq.ThenByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[0+yyTop]); } break; case 908: #line 5900 "cs-parser.jay" { yyVal = new Linq.ThenByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]); } break; case 909: #line 5904 "cs-parser.jay" { yyVal = new Linq.ThenByDescending ((Linq.QueryBlock) current_block, (Expression)yyVals[-1+yyTop]); } break; case 911: case_911(); break; case 912: case_912(); break; case 915: case_915(); break; case 916: case_916(); break; case 917: #line 5996 "cs-parser.jay" { Evaluator.LoadAliases (current_namespace); } break; #line default } yyTop -= yyLen[yyN]; yyState = yyStates[yyTop]; int yyM = yyLhs[yyN]; if (yyState == 0 && yyM == 0) { //t if (debug != null) debug.shift(0, yyFinal); yyState = yyFinal; if (yyToken < 0) { yyToken = yyLex.advance() ? yyLex.token() : 0; //t if (debug != null) //t debug.lex(yyState, yyToken,yyname(yyToken), yyLex.value()); } if (yyToken == 0) { //t 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]; //t 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' } }
bool GetConditionResult(string line) { int startIndex = line.IndexOf('(') + 1; int endIndex = line.LastIndexOf(')'); string conditionString = Substring(line, startIndex, endIndex); string[] sections = conditionString.Split(' '); var numericalValues = new List <float> (); var operators = new List <string> (); string currentString = ""; // First simplify the condition by finding and evaluating any/all numerical expressions within it. // Store as list of values and operators. // For example, "3+2 < 7-1 or 2 > 3-2" will be simplified to [5,6,2,1], ["<", "or", ">"] // TODO: Resolve brackets that don't belong to the numerical expression // For example, in "if ((3+2>5 or 2<5+2) and 3 < 10)", the inner brackets belong to the 'or' for (int i = 0; i < sections.Length; i++) { string section = sections[i]; bool isConditionOperator = ArrayContainsString(comparisonOperators, section); if (isConditionOperator || i == sections.Length - 1) { if (isConditionOperator) { operators.Add(section); } if (!string.IsNullOrEmpty(currentString)) { var expression = new NumericalExpression(new ValueString(currentString, variables)); numericalValues.Add(expression.Evaluate()); currentString = ""; } } else { currentString += section + " "; } } // Evaluate comparisons to bool values // e.g. (3 < 2 or 8 > 6) should evalulate to (false or true) var boolValues = new List <bool> (); var boolOperators = new List <BooleanExpression.Element> (); for (int i = 0; i < operators.Count; i++) { float a = numericalValues[i]; float b = numericalValues[i + 1]; string op = operators[i]; switch (op) { case "<": boolValues.Add(a < b); boolOperators.Add(BooleanExpression.Element.Value); break; case "<=": boolValues.Add(a <= b); boolOperators.Add(BooleanExpression.Element.Value); break; case "==": boolValues.Add(a == b); boolOperators.Add(BooleanExpression.Element.Value); break; case ">=": boolValues.Add(a >= b); boolOperators.Add(BooleanExpression.Element.Value); break; case ">": boolValues.Add(a > b); boolOperators.Add(BooleanExpression.Element.Value); break; case "and": boolOperators.Add(BooleanExpression.Element.And); break; case "or": boolOperators.Add(BooleanExpression.Element.Or); break; } } var booleanExpression = new BooleanExpression(boolValues, boolOperators); bool result = booleanExpression.Evaluate(); return(result); }
/// <summary> /// Groups the target expression. Set validClosing to false if there is no closing symbol /// </summary> public Grouping(BooleanExpression target, bool validClosing) { _target = target; _validClosing = validClosing; }
private bool?CheckFaultDetectionLogic(MeterDataSet meterDataSet, DataGroup dataGroup) { MeterInfoDataContext meterInfo = m_dbAdapterContainer.GetAdapter <MeterInfoDataContext>(); FaultLocationInfoDataContext faultInfo = m_dbAdapterContainer.GetAdapter <FaultLocationInfoDataContext>(); string expressionText; int meterLineID; expressionText = null; // Find MeterLine record corresponding to the meter that produced // the data and the line associated with the data group meterLineID = meterInfo.MeterLines .Where(meterLine => meterLine.MeterID == meterDataSet.Meter.ID) .Where(meterLine => meterLine.LineID == dataGroup.Line.ID) .Select(meterLine => (int?)meterLine.ID) .FirstOrDefault() ?? -1; if (meterLineID > 0) { // Find fault detection logic defined for the meter and line expressionText = faultInfo.FaultDetectionLogics .Where(logic => logic.MeterLineID == meterLineID) .Select(logic => logic.Expression) .FirstOrDefault(); } try { if ((object)expressionText == null) { if (m_faultLocationSettings.WarnMissingDetectionLogic) { throw new Exception($"Expression text is not defined for line '{dataGroup.Line.AssetKey}'."); } return(null); } // Parse fault detection logic into a boolean expression BooleanExpression expression = new BooleanExpression(expressionText); // Put digital values into a lookup table Dictionary <string, bool> digitalLookup = dataGroup.DataSeries .Where(series => series.SeriesInfo.Channel.MeasurementType.Name.Equals("Digital", StringComparison.OrdinalIgnoreCase)) .GroupBy(series => series.SeriesInfo.Channel.Name) .Where(grouping => grouping.Count() == 1) .ToDictionary(grouping => grouping.Key, grouping => grouping.Single().DataPoints.Any(dataPoint => Convert.ToBoolean(dataPoint.Value)), StringComparer.OrdinalIgnoreCase); // Apply the digital values to the variables in the boolean expression foreach (BooleanExpression.Variable variable in expression.Variables) { if (!digitalLookup.TryGetValue(variable.Identifier, out variable.Value)) { throw new Exception($"Channel '{variable.Identifier}' that was required for fault detection logic was missing from the meter data set."); } } // Evaluate the boolean expression return(expression.Evaluate()); } catch (Exception ex) { // Log the exception as a warning Log.Warn(ex.Message, ex); return(null); } }
private void SwagItemsControl_TreeViewItemDrop(object sender, RoutedEventArgs e) { TreeViewItemDropEventArgs tviea = (TreeViewItemDropEventArgs)e; tviea.TargetItem.BorderThickness = new Thickness(0, 0, 0, 0); if (!CheckIfValidDrop(tviea)) //Drops are still possible because TreeViewItemDropPreview can be skipped { return; } MoveType moveType = GetMoveType(tviea); BooleanExpression targetExpression = (BooleanExpression)tviea.TargetItem.DataContext; BooleanExpression droppedExpression = (BooleanExpression)tviea.DroppedItem.DataContext; BooleanGroupExpression originalDroppedParent = droppedExpression.Parent; Boolean sameParent = originalDroppedParent == targetExpression.Parent; Int32 originalDroppedSequence = droppedExpression.Sequence, currentDroppedSequence = droppedExpression.Sequence, targetSequence = targetExpression.Sequence, delta = targetSequence - originalDroppedSequence; switch (moveType) { case MoveType.Above: case MoveType.Below: if (!sameParent) { originalDroppedParent.Children.Remove(droppedExpression); droppedExpression.Sequence = -1; //reset sequence targetExpression.Parent.Children.Add(droppedExpression); currentDroppedSequence = droppedExpression.Sequence; delta = targetSequence - currentDroppedSequence; } switch (moveType) { case MoveType.Above: if (delta != 0) { foreach (BooleanExpression sibling in targetExpression.Parent.Children) { if (sibling.Sequence >= Math.Min(currentDroppedSequence, targetSequence) && sibling.Sequence < Math.Max(currentDroppedSequence, targetSequence)) { sibling.Sequence = (sibling.Sequence + (delta > 0 ? -1 : 1)); } } droppedExpression.Sequence = targetSequence + (delta > 0 ? -1 : 0); if (targetExpression.Parent == null) { CollectionViewSource.GetDefaultView(RootExpression).Refresh(); } else { CollectionViewSource.GetDefaultView(targetExpression.Parent.Children).Refresh(); } } break; case MoveType.Below: if (delta != 0) { foreach (BooleanExpression sibling in targetExpression.Parent.Children) { if (sibling.Sequence > Math.Min(currentDroppedSequence, targetSequence) && sibling.Sequence <= Math.Max(currentDroppedSequence, targetSequence)) { sibling.Sequence = (sibling.Sequence + (delta > 0 ? -1 : 1)); } } droppedExpression.Sequence = targetSequence + (delta > 0 ? 0 : 1); if (targetExpression.Parent == null) { CollectionViewSource.GetDefaultView(RootExpression).Refresh(); } else { CollectionViewSource.GetDefaultView(targetExpression.Parent.Children).Refresh(); } } break; } break; case MoveType.Into: if (tviea.TargetItem.DataContext is BooleanOperationExpression opExp) { originalDroppedParent.Children.Remove(droppedExpression); droppedExpression.Sequence = -1; //reset sequence opExp.Children.Add(droppedExpression); } break; } }
public SqlServerJoinedTableNode CreateJoinedTableNode(string joinType, JoinTableReference joinTableReference, BooleanExpression searchCondition = null) { return(TreeHelper.Create <SqlServerJoinedTableNode>(n => { n.Left.SetValue(VisitTableReference(joinTableReference.FirstTableReference)); n.Right.SetValue(VisitTableReference(joinTableReference.SecondTableReference)); if (searchCondition != null) { n.Expression.SetValue(ExpressionVisitor.VisitBooleanExpression(searchCondition)); } n.JoinType = joinType; SqlServerTree.PutFragmentSpan(n, joinTableReference); })); }
public override void ExplicitVisit(BooleanExpression fragment) { _fragments.Add(fragment); }
/// <summary> /// Gets the <see cref="BooleanExpression"/>'s viewmodel /// </summary> /// <typeparam name="T">Needed to correctly specify the rules the <see cref="viewModel"/> parameters needs to satisfy.</typeparam> /// <param name="booleanExpression">The <see cref="BooleanExpression"/> that needs to be checked, so the right viewmodel can be created and returned.</param> /// <param name="viewModel">A viewmodel that implements the <see cref="IViewModelBase{Thing}"/> and the <see cref="IISession"/> interfaces</param> /// <returns>Implementation of <see cref="IRowViewModelBase{BooleanExpression}"/></returns> public static IRowViewModelBase <BooleanExpression> GetBooleanExpressionViewModel <T>(this BooleanExpression booleanExpression, T viewModel) where T : IViewModelBase <Thing>, IISession { if (booleanExpression is NotExpression notExpression) { return(new NotExpressionRowViewModel(notExpression, viewModel.Session, viewModel)); } if (booleanExpression is AndExpression andExpression) { return(new AndExpressionRowViewModel(andExpression, viewModel.Session, viewModel)); } if (booleanExpression is OrExpression orExpression) { return(new OrExpressionRowViewModel(orExpression, viewModel.Session, viewModel)); } if (booleanExpression is ExclusiveOrExpression exclusiveOrExpression) { return(new ExclusiveOrExpressionRowViewModel(exclusiveOrExpression, viewModel.Session, viewModel)); } if (booleanExpression is RelationalExpression relationalExpression) { return(new RelationalExpressionRowViewModel(relationalExpression, viewModel.Session, viewModel)); } return(null); }
/** 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 Object yyVal = null; // value stack ptr Object [] yyVals; // value stack int yyToken = -1; // current input 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 (int 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:*/ 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 5: #line 379 "cs-parser.jay" { Lexer.CompleteOnEOF = false; } break; case 7: #line 384 "cs-parser.jay" { Lexer.check_incorrect_doc_comment (); } break; case 8: #line 388 "cs-parser.jay" { Lexer.check_incorrect_doc_comment (); } break; case 16: #line 411 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; string s = lt.Value; if (s != "alias"){ syntax_error (lt.Location, "`alias' expected"); } else if (RootContext.Version == LanguageVersion.ISO_1) { Report.FeatureIsNotAvailable (lt.Location, "external alias"); } else { lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; current_namespace.AddUsingExternalAlias (lt.Value, lt.Location, Report); } } break; case 17: #line 424 "cs-parser.jay" { syntax_error (GetLocation (yyVals[-1+yyTop]), "`alias' expected"); /* TODO: better*/ } break; case 20: #line 436 "cs-parser.jay" { if (RootContext.Documentation != null) Lexer.doc_state = XmlCommentState.Allowed; } break; case 21: #line 441 "cs-parser.jay" { if (RootContext.Documentation != null) Lexer.doc_state = XmlCommentState.Allowed; } break; case 22: #line 449 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; current_namespace.AddUsingAlias (lt.Value, (MemberName) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop])); } break; case 23: #line 453 "cs-parser.jay" { CheckIdentifierToken (yyToken, GetLocation (yyVals[0+yyTop])); yyVal = null; } break; case 24: #line 461 "cs-parser.jay" { current_namespace.AddUsing ((MemberName) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); } break; case 25: #line 473 "cs-parser.jay" { MemberName name = (MemberName) yyVals[0+yyTop]; if (yyVals[-2+yyTop] != null) { Report.Error(1671, name.Location, "A namespace declaration cannot have modifiers or attributes"); } current_namespace = new NamespaceEntry ( current_namespace, file, name.GetName ()); current_class = current_namespace.SlaveDeclSpace; current_container = current_class.PartialContainer; } break; case 26: #line 486 "cs-parser.jay" { current_namespace = current_namespace.Parent; current_class = current_namespace.SlaveDeclSpace; current_container = current_class.PartialContainer; } break; case 27: #line 495 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new MemberName (lt.Value, lt.Location); } break; case 28: #line 500 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new MemberName ((MemberName) yyVals[-2+yyTop], lt.Value, lt.Location); } break; case 29: #line 505 "cs-parser.jay" { syntax_error (lexer.Location, "`.' expected"); yyVal = new MemberName ("<invalid>", lexer.Location); } break; case 34: #line 523 "cs-parser.jay" { MemberName name = (MemberName) yyVals[0+yyTop]; if (name.TypeArguments != null) syntax_error (lexer.Location, "namespace name expected"); yyVal = name; } break; case 35: #line 535 "cs-parser.jay" { if (RootContext.Documentation != null) Lexer.doc_state = XmlCommentState.Allowed; } break; case 38: #line 548 "cs-parser.jay" { Report.Error (1518, lexer.Location, "Expected `class', `delegate', `enum', `interface', or `struct'"); } break; case 40: #line 556 "cs-parser.jay" { Report.Error (1513, lexer.Location, "Expected `}'"); } break; case 49: #line 583 "cs-parser.jay" { if (yyVals[0+yyTop] != null) { DeclSpace ds = (DeclSpace)yyVals[0+yyTop]; if ((ds.ModFlags & (Modifiers.PRIVATE|Modifiers.PROTECTED)) != 0){ Report.Error (1527, ds.Location, "Namespace elements cannot be explicitly declared as private, protected or protected internal"); } } current_namespace.DeclarationFound = true; } break; case 50: #line 594 "cs-parser.jay" { current_namespace.DeclarationFound = true; } break; case 51: #line 598 "cs-parser.jay" { Report.Error (116, ((MemberCore) yyVals[0+yyTop]).Location, "A namespace can only contain types and namespace declarations"); } break; case 52: #line 601 "cs-parser.jay" { Report.Error (116, ((MemberCore) yyVals[0+yyTop]).Location, "A namespace can only contain types and namespace declarations"); } break; case 58: #line 627 "cs-parser.jay" { if (yyVals[0+yyTop] != null) { Attributes attrs = (Attributes)yyVals[0+yyTop]; if (global_attrs_enabled) { CodeGen.Assembly.AddAttributes (attrs.Attrs, current_namespace); } else { foreach (Attribute a in attrs.Attrs) { Report.Error (1730, a.Location, "Assembly and module attributes must precede all other elements except using clauses and extern alias declarations"); } } } yyVal = yyVals[0+yyTop]; } break; case 59: #line 644 "cs-parser.jay" { global_attrs_enabled = false; yyVal = null; } break; case 60: #line 649 "cs-parser.jay" { global_attrs_enabled = false; yyVal = yyVals[0+yyTop]; } break; case 61: #line 658 "cs-parser.jay" { if (current_attr_target != String.Empty) { var sect = (List<Attribute>) yyVals[0+yyTop]; if (global_attrs_enabled) { if (current_attr_target == "module") { current_container.Module.Compiled.AddAttributes (sect); yyVal = null; } else if (current_attr_target != null && current_attr_target.Length > 0) { CodeGen.Assembly.AddAttributes (sect, current_namespace); yyVal = null; } else { yyVal = new Attributes (sect); } if (yyVal == null) { if (RootContext.Documentation != null) { Lexer.check_incorrect_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } } } else { yyVal = new Attributes (sect); } } else yyVal = null; current_attr_target = null; } break; case 62: #line 688 "cs-parser.jay" { if (current_attr_target != String.Empty) { Attributes attrs = yyVals[-1+yyTop] as Attributes; var sect = (List<Attribute>) yyVals[0+yyTop]; if (global_attrs_enabled) { if (current_attr_target == "module") { current_container.Module.Compiled.AddAttributes (sect); yyVal = null; } else if (current_attr_target == "assembly") { CodeGen.Assembly.AddAttributes (sect, current_namespace); yyVal = null; } else { if (attrs == null) attrs = new Attributes (sect); else attrs.AddAttributes (sect); } } else { if (attrs == null) attrs = new Attributes (sect); else attrs.AddAttributes (sect); } yyVal = attrs; } else yyVal = null; current_attr_target = null; } break; case 63: #line 722 "cs-parser.jay" { yyVal = yyVals[-2+yyTop]; } break; case 64: #line 726 "cs-parser.jay" { yyVal = yyVals[-2+yyTop]; } break; case 65: #line 733 "cs-parser.jay" { current_attr_target = (string)yyVals[-1+yyTop]; yyVal = yyVals[-1+yyTop]; } break; case 66: #line 741 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = CheckAttributeTarget (lt.Value, lt.Location); } break; case 67: #line 745 "cs-parser.jay" { yyVal = "event"; } break; case 68: #line 746 "cs-parser.jay" { yyVal = "return"; } break; case 69: #line 748 "cs-parser.jay" { string name = GetTokenName (yyToken); yyVal = CheckAttributeTarget (name, GetLocation (yyVals[0+yyTop])); } break; case 70: #line 756 "cs-parser.jay" { yyVal = new List<Attribute> (4) { (Attribute) yyVals[0+yyTop] }; } break; case 71: #line 760 "cs-parser.jay" { var attrs = (List<Attribute>) yyVals[-2+yyTop]; attrs.Add ((Attribute) yyVals[0+yyTop]); yyVal = attrs; } break; case 72: #line 770 "cs-parser.jay" { ++lexer.parsing_block; } break; case 73: #line 774 "cs-parser.jay" { --lexer.parsing_block; MemberName mname = (MemberName) yyVals[-2+yyTop]; if (mname.IsGeneric) { Report.Error (404, lexer.Location, "'<' unexpected: attributes cannot be generic"); } Arguments [] arguments = (Arguments []) yyVals[0+yyTop]; ATypeNameExpression expr = mname.GetTypeExpression (); if (current_attr_target == String.Empty) yyVal = null; else if (global_attrs_enabled && (current_attr_target == "assembly" || current_attr_target == "module")) /* FIXME: supply "nameEscaped" parameter here.*/ yyVal = new GlobalAttribute (current_namespace, current_attr_target, expr, arguments, mname.Location, lexer.IsEscapedIdentifier (mname.Location)); else yyVal = new Attribute (current_attr_target, expr, arguments, mname.Location, lexer.IsEscapedIdentifier (mname.Location)); } break; case 74: #line 797 "cs-parser.jay" { /* reserved attribute name or identifier: 17.4 */ } break; case 75: #line 801 "cs-parser.jay" { yyVal = null; } break; case 76: #line 803 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; case 77: #line 810 "cs-parser.jay" { yyVal = null; } break; case 78: #line 812 "cs-parser.jay" { Arguments a = new Arguments (4); a.Add ((Argument) yyVals[0+yyTop]); yyVal = new Arguments [] { a, null }; } break; case 79: #line 818 "cs-parser.jay" { Arguments a = new Arguments (4); a.Add ((Argument) yyVals[0+yyTop]); yyVal = new Arguments [] { null, a }; } break; case 80: #line 824 "cs-parser.jay" { Arguments[] o = (Arguments[]) yyVals[-2+yyTop]; if (o [1] != null) { Report.Error (1016, ((Argument) yyVals[0+yyTop]).Expr.Location, "Named attribute arguments must appear after the positional arguments"); o [0] = new Arguments (4); } Arguments args = ((Arguments) o [0]); if (args.Count > 0 && !(yyVals[0+yyTop] is NamedArgument) && args [args.Count - 1] is NamedArgument) Error_NamedArgumentExpected ((NamedArgument) args [args.Count - 1]); args.Add ((Argument) yyVals[0+yyTop]); } break; case 81: #line 838 "cs-parser.jay" { Arguments[] o = (Arguments[]) yyVals[-2+yyTop]; if (o [1] == null) { o [1] = new Arguments (4); } ((Arguments) o [1]).Add ((Argument) yyVals[0+yyTop]); } break; case 82: #line 850 "cs-parser.jay" { yyVal = new Argument ((Expression) yyVals[0+yyTop]); } break; case 84: #line 858 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; yyVal = new NamedArgument (lt.Value, lt.Location, (Expression) yyVals[0+yyTop]); } break; case 85: #line 866 "cs-parser.jay" { if (RootContext.Version <= LanguageVersion.V_3) Report.FeatureIsNotAvailable (GetLocation (yyVals[-3+yyTop]), "named argument"); /* Avoid boxing in common case (no modifier)*/ var arg_mod = yyVals[-1+yyTop] == null ? Argument.AType.None : (Argument.AType) yyVals[-1+yyTop]; var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; yyVal = new NamedArgument (lt.Value, lt.Location, (Expression) yyVals[0+yyTop], arg_mod); } break; case 86: #line 879 "cs-parser.jay" { yyVal = null; } break; case 87: #line 881 "cs-parser.jay" { yyVal = Argument.AType.Ref; } break; case 88: #line 885 "cs-parser.jay" { yyVal = Argument.AType.Out; } break; case 104: #line 917 "cs-parser.jay" { Report.Error (1519, lexer.Location, "Unexpected symbol `{0}' in class, struct, or interface member declaration", GetSymbolName (yyToken)); yyVal = null; lexer.parsing_generic_declaration = false; } break; case 105: #line 930 "cs-parser.jay" { lexer.ConstraintsParsing = true; } break; case 106: #line 934 "cs-parser.jay" { MemberName name = MakeName ((MemberName) yyVals[0+yyTop]); push_current_class (new Struct (current_namespace, current_class, name, (Modifiers) yyVals[-4+yyTop], (Attributes) yyVals[-5+yyTop]), yyVals[-3+yyTop]); } break; case 107: #line 940 "cs-parser.jay" { lexer.ConstraintsParsing = false; current_class.SetParameterInfo ((List<Constraints>) yyVals[0+yyTop]); if (RootContext.Documentation != null) current_container.DocComment = Lexer.consume_doc_comment (); } break; case 108: #line 949 "cs-parser.jay" { --lexer.parsing_declaration; if (RootContext.Documentation != null) Lexer.doc_state = XmlCommentState.Allowed; } break; case 109: #line 955 "cs-parser.jay" { yyVal = pop_current_class (); } break; case 110: #line 958 "cs-parser.jay" { CheckIdentifierToken (yyToken, GetLocation (yyVals[0+yyTop])); } break; case 111: #line 965 "cs-parser.jay" { if (RootContext.Documentation != null) Lexer.doc_state = XmlCommentState.Allowed; } break; case 127: #line 1007 "cs-parser.jay" { var modflags = (Modifiers) yyVals[-4+yyTop]; foreach (VariableDeclaration constant in (List<object>) yyVals[-1+yyTop]){ Location l = constant.Location; if ((modflags & Modifiers.STATIC) != 0) { Report.Error (504, l, "The constant `{0}' cannot be marked static", current_container.GetSignatureForError () + "." + (string) constant.identifier); continue; } Const c = new Const ( current_class, (FullNamedExpression) yyVals[-2+yyTop], (string) constant.identifier, constant.GetInitializer ((FullNamedExpression) yyVals[-2+yyTop]), modflags, (Attributes) yyVals[-5+yyTop], l); if (RootContext.Documentation != null) { c.DocComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } current_container.AddConstant (c); } } break; case 128: #line 1032 "cs-parser.jay" { variables_bucket.Clear (); if (yyVals[0+yyTop] != null) variables_bucket.Add (yyVals[0+yyTop]); yyVal = variables_bucket; } break; case 129: #line 1039 "cs-parser.jay" { if (yyVals[0+yyTop] != null) { var constants = (List<object>) yyVals[-2+yyTop]; constants.Add (yyVals[0+yyTop]); } } break; case 130: #line 1049 "cs-parser.jay" { ++lexer.parsing_block; } break; case 131: #line 1053 "cs-parser.jay" { --lexer.parsing_block; yyVal = new VariableDeclaration ((Tokenizer.LocatedToken) yyVals[-3+yyTop], (Expression) yyVals[0+yyTop]); } break; case 132: #line 1058 "cs-parser.jay" { /* A const field requires a value to be provided*/ Report.Error (145, GetLocation (yyVals[0+yyTop]), "A const field requires a value to be provided"); yyVal = null; } break; case 135: #line 1076 "cs-parser.jay" { FullNamedExpression type = (FullNamedExpression) yyVals[-2+yyTop]; if (type == TypeManager.system_void_expr) Report.Error (670, GetLocation (yyVals[-2+yyTop]), "Fields cannot have void type"); var mod = (Modifiers) yyVals[-3+yyTop]; foreach (VariableMemberDeclaration var in (List<object>) yyVals[-1+yyTop]){ Field field = new Field (current_class, type, mod, var.MemberName, (Attributes) yyVals[-4+yyTop]); field.Initializer = var.GetInitializer (type); if (RootContext.Documentation != null) { field.DocComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } current_container.AddField (field); yyVal = field; /* FIXME: might be better if it points to the top item*/ } } break; case 136: #line 1102 "cs-parser.jay" { FullNamedExpression type = (FullNamedExpression) yyVals[-2+yyTop]; var mod = (Modifiers) yyVals[-4+yyTop]; foreach (VariableDeclaration var in (List<VariableDeclaration>) yyVals[-1+yyTop]) { FixedField field = new FixedField (current_class, type, mod, var.identifier, var.GetInitializer (type), (Attributes) yyVals[-5+yyTop], var.Location); if (RootContext.Version < LanguageVersion.ISO_2) Report.FeatureIsNotAvailable (GetLocation (yyVals[-3+yyTop]), "fixed size buffers"); if (RootContext.Documentation != null) { field.DocComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } current_container.AddField (field); yyVal = field; /* FIXME: might be better if it points to the top item*/ } } break; case 137: #line 1127 "cs-parser.jay" { Report.Error (1641, GetLocation (yyVals[-1+yyTop]), "A fixed size buffer field must have the array size specifier after the field name"); } break; case 138: #line 1134 "cs-parser.jay" { var decl = new List<VariableDeclaration> (2); decl.Add ((VariableDeclaration)yyVals[0+yyTop]); yyVal = decl; } break; case 139: #line 1140 "cs-parser.jay" { var decls = (List<VariableDeclaration>) yyVals[-2+yyTop]; decls.Add ((VariableDeclaration)yyVals[0+yyTop]); yyVal = yyVals[-2+yyTop]; } break; case 140: #line 1149 "cs-parser.jay" { yyVal = new VariableDeclaration ((Tokenizer.LocatedToken) yyVals[-3+yyTop], (Expression) yyVals[-1+yyTop]); } break; case 141: #line 1153 "cs-parser.jay" { Report.Error (443, lexer.Location, "Value or constant expected"); yyVal = new VariableDeclaration ((Tokenizer.LocatedToken) yyVals[-2+yyTop], null); } break; case 142: #line 1162 "cs-parser.jay" { variables_bucket.Clear (); if (yyVals[0+yyTop] != null) variables_bucket.Add (yyVals[0+yyTop]); yyVal = variables_bucket; } break; case 143: #line 1169 "cs-parser.jay" { var decls = (List<object>) yyVals[-2+yyTop]; decls.Add (yyVals[0+yyTop]); yyVal = yyVals[-2+yyTop]; } break; case 144: #line 1178 "cs-parser.jay" { yyVal = new VariableDeclaration ((Tokenizer.LocatedToken) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); } break; case 145: #line 1182 "cs-parser.jay" { yyVal = new VariableDeclaration ((Tokenizer.LocatedToken) yyVals[0+yyTop], null); } break; case 146: #line 1186 "cs-parser.jay" { yyVal = null; } break; case 149: #line 1195 "cs-parser.jay" { yyVal = new StackAlloc ((Expression) yyVals[-3+yyTop], (Expression) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop])); } break; case 150: #line 1199 "cs-parser.jay" { yyVal = new ArglistAccess (GetLocation (yyVals[0+yyTop])); } break; case 151: #line 1203 "cs-parser.jay" { Report.Error (1575, GetLocation (yyVals[-1+yyTop]), "A stackalloc expression requires [] after type"); yyVal = new StackAlloc ((Expression) yyVals[0+yyTop], null, GetLocation (yyVals[-1+yyTop])); } break; case 152: #line 1211 "cs-parser.jay" { variables_bucket.Clear (); if (yyVals[0+yyTop] != null) variables_bucket.Add (yyVals[0+yyTop]); yyVal = variables_bucket; } break; case 153: #line 1218 "cs-parser.jay" { var decls = (List<object>) yyVals[-2+yyTop]; decls.Add (yyVals[0+yyTop]); yyVal = yyVals[-2+yyTop]; } break; case 154: #line 1227 "cs-parser.jay" { ++lexer.parsing_block; lexer.parsing_generic_declaration = false; } break; case 155: #line 1232 "cs-parser.jay" { --lexer.parsing_block; yyVal = new VariableMemberDeclaration ((MemberName) yyVals[-3+yyTop], (Expression) yyVals[0+yyTop]); } break; case 156: #line 1237 "cs-parser.jay" { lexer.parsing_generic_declaration = false; yyVal = new VariableMemberDeclaration ((MemberName) yyVals[0+yyTop], null); } break; case 157: #line 1242 "cs-parser.jay" { lexer.parsing_generic_declaration = false; yyVal = null; } break; case 158: #line 1250 "cs-parser.jay" { Report.Error (650, GetLocation (yyVals[-2+yyTop]), "Syntax error, bad array declarator. To declare a managed array the rank specifier precedes the variable's identifier. " + "To declare a fixed size buffer field, use the fixed keyword before the field type"); } break; case 161: #line 1262 "cs-parser.jay" { if (RootContext.Documentation != null) Lexer.doc_state = XmlCommentState.NotAllowed; } break; case 162: #line 1267 "cs-parser.jay" { Method method = (Method) yyVals[-2+yyTop]; method.Block = (ToplevelBlock) yyVals[0+yyTop]; current_container.AddMethod (method); if (current_container.Kind == MemberKind.Interface && method.Block != null) { Report.Error (531, method.Location, "`{0}': interface members cannot have a definition", method.GetSignatureForError ()); } current_generic_method = null; current_local_parameters = null; if (RootContext.Documentation != null) Lexer.doc_state = XmlCommentState.Allowed; } break; case 163: #line 1289 "cs-parser.jay" { valid_param_mod = ParameterModifierType.All; } break; case 164: #line 1293 "cs-parser.jay" { lexer.ConstraintsParsing = true; } break; case 165: #line 1297 "cs-parser.jay" { lexer.ConstraintsParsing = false; valid_param_mod = 0; MemberName name = (MemberName) yyVals[-6+yyTop]; current_local_parameters = (ParametersCompiled) yyVals[-3+yyTop]; GenericMethod generic = null; if (name.TypeArguments != null) { generic = new GenericMethod (current_namespace, current_class, name, (FullNamedExpression) yyVals[-7+yyTop], current_local_parameters); generic.SetParameterInfo ((List<Constraints>) yyVals[0+yyTop]); } else if (yyVals[0+yyTop] != null) { Report.Error (80, GetLocation (yyVals[0+yyTop]), "Constraints are not allowed on non-generic declarations"); } Method method = new Method (current_class, generic, (FullNamedExpression) yyVals[-7+yyTop], (Modifiers) yyVals[-8+yyTop], name, current_local_parameters, (Attributes) yyVals[-9+yyTop]); if (yyVals[0+yyTop] != null && ((method.ModFlags & Modifiers.OVERRIDE) != 0 || method.IsExplicitImpl)) { Report.Error (460, method.Location, "`{0}': Cannot specify constraints for overrides and explicit interface implementation methods", method.GetSignatureForError ()); } current_generic_method = generic; if (RootContext.Documentation != null) method.DocComment = Lexer.consume_doc_comment (); yyVal = method; } break; case 166: #line 1335 "cs-parser.jay" { valid_param_mod = ParameterModifierType.All; } break; case 167: #line 1339 "cs-parser.jay" { lexer.ConstraintsParsing = true; } break; case 168: #line 1343 "cs-parser.jay" { lexer.ConstraintsParsing = false; valid_param_mod = 0; MemberName name = (MemberName) yyVals[-6+yyTop]; current_local_parameters = (ParametersCompiled) yyVals[-3+yyTop]; if (yyVals[-1+yyTop] != null && name.TypeArguments == null) Report.Error (80, lexer.Location, "Constraints are not allowed on non-generic declarations"); Method method; GenericMethod generic = null; if (name.TypeArguments != null) { generic = new GenericMethod (current_namespace, current_class, name, TypeManager.system_void_expr, current_local_parameters); generic.SetParameterInfo ((List<Constraints>) yyVals[0+yyTop]); } var modifiers = (Modifiers) yyVals[-9+yyTop]; const Modifiers invalid_partial_mod = Modifiers.AccessibilityMask | Modifiers.ABSTRACT | Modifiers.EXTERN | Modifiers.NEW | Modifiers.OVERRIDE | Modifiers.SEALED | Modifiers.VIRTUAL; if ((modifiers & invalid_partial_mod) != 0) { Report.Error (750, name.Location, "A partial method cannot define access modifier or " + "any of abstract, extern, new, override, sealed, or virtual modifiers"); modifiers &= ~invalid_partial_mod; } if ((current_class.ModFlags & Modifiers.PARTIAL) == 0) { Report.Error (751, name.Location, "A partial method must be declared within a " + "partial class or partial struct"); } modifiers |= Modifiers.PARTIAL | Modifiers.PRIVATE; method = new Method (current_class, generic, TypeManager.system_void_expr, modifiers, name, current_local_parameters, (Attributes) yyVals[-10+yyTop]); current_generic_method = generic; if (RootContext.Documentation != null) method.DocComment = Lexer.consume_doc_comment (); yyVal = method; } break; case 169: #line 1396 "cs-parser.jay" { MemberName name = (MemberName) yyVals[-3+yyTop]; Report.Error (1585, name.Location, "Member modifier `{0}' must precede the member type and name", ModifiersExtensions.Name ((Modifiers) yyVals[-4+yyTop])); Method method = new Method (current_class, null, TypeManager.system_void_expr, 0, name, (ParametersCompiled) yyVals[-1+yyTop], (Attributes) yyVals[-7+yyTop]); current_local_parameters = (ParametersCompiled) yyVals[-1+yyTop]; if (RootContext.Documentation != null) method.DocComment = Lexer.consume_doc_comment (); yyVal = method; } break; case 171: #line 1415 "cs-parser.jay" { yyVal = null; } break; case 172: #line 1419 "cs-parser.jay" { yyVal = ParametersCompiled.EmptyReadOnlyParameters; } break; case 174: #line 1425 "cs-parser.jay" { var pars_list = (List<Parameter>) yyVals[0+yyTop]; yyVal = new ParametersCompiled (compiler, pars_list.ToArray ()); } break; case 175: #line 1430 "cs-parser.jay" { var pars_list = (List<Parameter>) yyVals[-2+yyTop]; pars_list.Add ((Parameter) yyVals[0+yyTop]); yyVal = new ParametersCompiled (compiler, pars_list.ToArray ()); } break; case 176: #line 1437 "cs-parser.jay" { var pars_list = (List<Parameter>) yyVals[-2+yyTop]; pars_list.Add (new ArglistParameter (GetLocation (yyVals[0+yyTop]))); yyVal = new ParametersCompiled (compiler, pars_list.ToArray (), true); } break; case 177: #line 1443 "cs-parser.jay" { if (yyVals[-2+yyTop] != null) Report.Error (231, ((Parameter) yyVals[-2+yyTop]).Location, "A params parameter must be the last parameter in a formal parameter list"); yyVal = new ParametersCompiled (compiler, new Parameter[] { (Parameter) yyVals[-2+yyTop] } ); } break; case 178: #line 1450 "cs-parser.jay" { if (yyVals[-2+yyTop] != null) Report.Error (231, ((Parameter) yyVals[-2+yyTop]).Location, "A params parameter must be the last parameter in a formal parameter list"); var pars_list = (List<Parameter>) yyVals[-4+yyTop]; pars_list.Add (new ArglistParameter (GetLocation (yyVals[-2+yyTop]))); yyVal = new ParametersCompiled (compiler, pars_list.ToArray (), true); } break; case 179: #line 1460 "cs-parser.jay" { Report.Error (257, GetLocation (yyVals[-2+yyTop]), "An __arglist parameter must be the last parameter in a formal parameter list"); yyVal = new ParametersCompiled (compiler, new Parameter [] { new ArglistParameter (GetLocation (yyVals[-2+yyTop])) }, true); } break; case 180: #line 1466 "cs-parser.jay" { Report.Error (257, GetLocation (yyVals[-2+yyTop]), "An __arglist parameter must be the last parameter in a formal parameter list"); var pars_list = (List<Parameter>) yyVals[-4+yyTop]; pars_list.Add (new ArglistParameter (GetLocation (yyVals[-2+yyTop]))); yyVal = new ParametersCompiled (compiler, pars_list.ToArray (), true); } break; case 181: #line 1475 "cs-parser.jay" { yyVal = new ParametersCompiled (compiler, new Parameter[] { (Parameter) yyVals[0+yyTop] } ); } break; case 182: #line 1479 "cs-parser.jay" { yyVal = new ParametersCompiled (compiler, new Parameter [] { new ArglistParameter (GetLocation (yyVals[0+yyTop])) }, true); } break; case 183: #line 1486 "cs-parser.jay" { parameters_bucket.Clear (); Parameter p = (Parameter) yyVals[0+yyTop]; parameters_bucket.Add (p); default_parameter_used = p.HasDefaultValue; yyVal = parameters_bucket; } break; case 184: #line 1495 "cs-parser.jay" { var pars = (List<Parameter>) yyVals[-2+yyTop]; Parameter p = (Parameter) yyVals[0+yyTop]; if (p != null) { if (p.HasExtensionMethodModifier) Report.Error (1100, p.Location, "The parameter modifier `this' can only be used on the first parameter"); else if (!p.HasDefaultValue && default_parameter_used) Report.Error (1737, p.Location, "Optional parameter cannot precede required parameters"); default_parameter_used |= p.HasDefaultValue; pars.Add (p); } yyVal = yyVals[-2+yyTop]; } break; case 185: #line 1516 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new Parameter ((FullNamedExpression) yyVals[-1+yyTop], lt.Value, (Parameter.Modifier) yyVals[-2+yyTop], (Attributes) yyVals[-3+yyTop], lt.Location); } break; case 186: #line 1524 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; Report.Error (1552, lt.Location, "Array type specifier, [], must appear before parameter name"); yyVal = new Parameter ((FullNamedExpression) yyVals[-3+yyTop], lt.Value, (Parameter.Modifier) yyVals[-4+yyTop], (Attributes) yyVals[-5+yyTop], lt.Location); } break; case 187: #line 1533 "cs-parser.jay" { Location l = GetLocation (yyVals[0+yyTop]); CheckIdentifierToken (yyToken, l); yyVal = new Parameter ((FullNamedExpression) yyVals[-1+yyTop], "NeedSomeGeneratorHere", (Parameter.Modifier) yyVals[-2+yyTop], (Attributes) yyVals[-3+yyTop], l); } break; case 188: #line 1544 "cs-parser.jay" { if (RootContext.Version <= LanguageVersion.V_3) { Report.FeatureIsNotAvailable (GetLocation (yyVals[-1+yyTop]), "optional parameter"); } Parameter.Modifier mod = (Parameter.Modifier) yyVals[-4+yyTop]; if (mod != Parameter.Modifier.NONE) { switch (mod) { case Parameter.Modifier.REF: case Parameter.Modifier.OUT: Report.Error (1741, GetLocation (yyVals[-4+yyTop]), "Cannot specify a default value for the `{0}' parameter", Parameter.GetModifierSignature (mod)); break; case Parameter.Modifier.This: Report.Error (1743, GetLocation (yyVals[-4+yyTop]), "Cannot specify a default value for the `{0}' parameter", Parameter.GetModifierSignature (mod)); break; default: throw new NotImplementedException (mod.ToString ()); } mod = Parameter.Modifier.NONE; } if ((valid_param_mod & ParameterModifierType.DefaultValue) == 0) Report.Error (1065, GetLocation (yyVals[0+yyTop]), "Optional parameter is not valid in this context"); var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; yyVal = new Parameter ((FullNamedExpression) yyVals[-3+yyTop], lt.Value, mod, (Attributes) yyVals[-5+yyTop], lt.Location); if (yyVals[0+yyTop] != null) ((Parameter) yyVal).DefaultValue = (Expression) yyVals[0+yyTop]; } break; case 189: #line 1580 "cs-parser.jay" { yyVal = Parameter.Modifier.NONE; } break; case 191: #line 1586 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 192: #line 1590 "cs-parser.jay" { Parameter.Modifier p2 = (Parameter.Modifier)yyVals[0+yyTop]; Parameter.Modifier mod = (Parameter.Modifier)yyVals[-1+yyTop] | p2; if (((Parameter.Modifier)yyVals[-1+yyTop] & p2) == p2) { Error_DuplicateParameterModifier (lexer.Location, p2); } else { switch (mod & ~Parameter.Modifier.This) { case Parameter.Modifier.REF: Report.Error (1101, lexer.Location, "The parameter modifiers `this' and `ref' cannot be used altogether"); break; case Parameter.Modifier.OUT: Report.Error (1102, lexer.Location, "The parameter modifiers `this' and `out' cannot be used altogether"); break; default: Report.Error (1108, lexer.Location, "A parameter cannot have specified more than one modifier"); break; } } yyVal = mod; } break; case 193: #line 1614 "cs-parser.jay" { if ((valid_param_mod & ParameterModifierType.Ref) == 0) Error_ParameterModifierNotValid ("ref", GetLocation (yyVals[0+yyTop])); yyVal = Parameter.Modifier.REF; } break; case 194: #line 1621 "cs-parser.jay" { if ((valid_param_mod & ParameterModifierType.Out) == 0) Error_ParameterModifierNotValid ("out", GetLocation (yyVals[0+yyTop])); yyVal = Parameter.Modifier.OUT; } break; case 195: #line 1628 "cs-parser.jay" { if ((valid_param_mod & ParameterModifierType.This) == 0) Error_ParameterModifierNotValid ("this", GetLocation (yyVals[0+yyTop])); if (RootContext.Version <= LanguageVersion.ISO_2) Report.FeatureIsNotAvailable (GetLocation (yyVals[0+yyTop]), "extension methods"); yyVal = Parameter.Modifier.This; } break; case 196: #line 1641 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new ParamsParameter ((FullNamedExpression) yyVals[-1+yyTop], lt.Value, (Attributes) yyVals[-3+yyTop], lt.Location); } break; case 197: #line 1646 "cs-parser.jay" { Report.Error (1751, GetLocation (yyVals[-4+yyTop]), "Cannot specify a default value for a parameter array"); var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; yyVal = new ParamsParameter ((FullNamedExpression) yyVals[-3+yyTop], lt.Value, (Attributes) yyVals[-5+yyTop], lt.Location); } break; case 198: #line 1652 "cs-parser.jay" { CheckIdentifierToken (yyToken, GetLocation (yyVals[0+yyTop])); yyVal = null; } break; case 199: #line 1660 "cs-parser.jay" { if ((valid_param_mod & ParameterModifierType.Params) == 0) Report.Error (1670, (GetLocation (yyVals[0+yyTop])), "The `params' modifier is not allowed in current context"); } break; case 200: #line 1665 "cs-parser.jay" { Parameter.Modifier mod = (Parameter.Modifier)yyVals[0+yyTop]; if ((mod & Parameter.Modifier.This) != 0) { Report.Error (1104, GetLocation (yyVals[-1+yyTop]), "The parameter modifiers `this' and `params' cannot be used altogether"); } else { Report.Error (1611, GetLocation (yyVals[-1+yyTop]), "The params parameter cannot be declared as ref or out"); } } break; case 201: #line 1674 "cs-parser.jay" { Error_DuplicateParameterModifier (GetLocation (yyVals[-1+yyTop]), Parameter.Modifier.PARAMS); } break; case 202: #line 1681 "cs-parser.jay" { if ((valid_param_mod & ParameterModifierType.Arglist) == 0) Report.Error (1669, GetLocation (yyVals[0+yyTop]), "__arglist is not valid in this context"); } break; case 203: #line 1692 "cs-parser.jay" { if (RootContext.Documentation != null) tmpComment = Lexer.consume_doc_comment (); } break; case 204: #line 1697 "cs-parser.jay" { implicit_value_parameter_type = (FullNamedExpression) yyVals[-3+yyTop]; lexer.PropertyParsing = true; } break; case 205: #line 1702 "cs-parser.jay" { lexer.PropertyParsing = false; has_get = has_set = false; } break; case 206: #line 1707 "cs-parser.jay" { Property prop; Accessors accessors = (Accessors) yyVals[-2+yyTop]; Accessor get_block = accessors != null ? accessors.get_or_add : null; Accessor set_block = accessors != null ? accessors.set_or_remove : null; bool order = accessors != null ? accessors.declared_in_reverse : false; MemberName name = (MemberName) yyVals[-6+yyTop]; FullNamedExpression ptype = (FullNamedExpression) yyVals[-7+yyTop]; prop = new Property (current_class, ptype, (Modifiers) yyVals[-8+yyTop], name, (Attributes) yyVals[-9+yyTop], get_block, set_block, order, current_block); if (ptype == TypeManager.system_void_expr) Report.Error (547, name.Location, "`{0}': property or indexer cannot have void type", prop.GetSignatureForError ()); if (accessors == null) Report.Error (548, prop.Location, "`{0}': property or indexer must have at least one accessor", prop.GetSignatureForError ()); if (current_container.Kind == MemberKind.Interface) { if (prop.Get.Block != null) Report.Error (531, prop.Location, "`{0}.get': interface members cannot have a definition", prop.GetSignatureForError ()); if (prop.Set.Block != null) Report.Error (531, prop.Location, "`{0}.set': interface members cannot have a definition", prop.GetSignatureForError ()); } current_container.AddProperty (prop); implicit_value_parameter_type = null; if (RootContext.Documentation != null) prop.DocComment = ConsumeStoredComment (); } break; case 207: #line 1745 "cs-parser.jay" { yyVal = new Accessors ((Accessor) yyVals[0+yyTop], null); } break; case 208: #line 1749 "cs-parser.jay" { Accessors accessors = (Accessors) yyVals[0+yyTop]; accessors.get_or_add = (Accessor) yyVals[-1+yyTop]; yyVal = accessors; } break; case 209: #line 1755 "cs-parser.jay" { yyVal = new Accessors (null, (Accessor) yyVals[0+yyTop]); } break; case 210: #line 1759 "cs-parser.jay" { Accessors accessors = (Accessors) yyVals[0+yyTop]; accessors.set_or_remove = (Accessor) yyVals[-1+yyTop]; accessors.declared_in_reverse = true; yyVal = accessors; } break; case 211: #line 1766 "cs-parser.jay" { if (yyToken == Token.CLOSE_BRACE) { yyVal = null; } else { if (yyToken == Token.SEMICOLON) Report.Error (1597, lexer.Location, "Semicolon after method or accessor block is not valid"); else Report.Error (1014, GetLocation (yyVals[0+yyTop]), "A get or set accessor expected"); yyVal = new Accessors (null, null); } } break; case 212: #line 1782 "cs-parser.jay" { /* If this is not the case, then current_local_parameters has already*/ /* been set in indexer_declaration*/ if (parsing_indexer == false) current_local_parameters = ParametersCompiled.EmptyReadOnlyParameters; else current_local_parameters = indexer_parameters; lexer.PropertyParsing = false; } break; case 213: #line 1792 "cs-parser.jay" { if (has_get) { Report.Error (1007, GetLocation (yyVals[-2+yyTop]), "Property accessor already defined"); break; } Accessor accessor = new Accessor ((ToplevelBlock) yyVals[0+yyTop], (Modifiers) yyVals[-3+yyTop], (Attributes) yyVals[-4+yyTop], current_local_parameters, GetLocation (yyVals[-2+yyTop])); has_get = true; current_local_parameters = null; lexer.PropertyParsing = true; if (RootContext.Documentation != null) if (Lexer.doc_state == XmlCommentState.Error) Lexer.doc_state = XmlCommentState.NotAllowed; yyVal = accessor; } break; case 214: #line 1812 "cs-parser.jay" { Parameter implicit_value_parameter = new Parameter ( implicit_value_parameter_type, "value", Parameter.Modifier.NONE, null, GetLocation (yyVals[0+yyTop])); if (!parsing_indexer) { current_local_parameters = new ParametersCompiled (compiler, new Parameter [] { implicit_value_parameter }); } else { current_local_parameters = ParametersCompiled.MergeGenerated (compiler, indexer_parameters, true, implicit_value_parameter, null); } lexer.PropertyParsing = false; } break; case 215: #line 1827 "cs-parser.jay" { if (has_set) { Report.Error (1007, GetLocation (yyVals[-2+yyTop]), "Property accessor already defined"); break; } Accessor accessor = new Accessor ((ToplevelBlock) yyVals[0+yyTop], (Modifiers) yyVals[-3+yyTop], (Attributes) yyVals[-4+yyTop], current_local_parameters, GetLocation (yyVals[-2+yyTop])); has_set = true; current_local_parameters = null; lexer.PropertyParsing = true; if (RootContext.Documentation != null && Lexer.doc_state == XmlCommentState.Error) Lexer.doc_state = XmlCommentState.NotAllowed; yyVal = accessor; } break; case 217: #line 1848 "cs-parser.jay" { yyVal = null; } break; case 218: #line 1852 "cs-parser.jay" { Error_SyntaxError (1043, yyToken, "Invalid accessor body"); yyVal = null; } break; case 219: #line 1863 "cs-parser.jay" { lexer.ConstraintsParsing = true; } break; case 220: #line 1867 "cs-parser.jay" { MemberName name = MakeName ((MemberName) yyVals[0+yyTop]); push_current_class (new Interface (current_namespace, current_class, name, (Modifiers) yyVals[-4+yyTop], (Attributes) yyVals[-5+yyTop]), yyVals[-3+yyTop]); } break; case 221: #line 1873 "cs-parser.jay" { lexer.ConstraintsParsing = false; current_class.SetParameterInfo ((List<Constraints>) yyVals[0+yyTop]); if (RootContext.Documentation != null) { current_container.DocComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } } break; case 222: #line 1884 "cs-parser.jay" { --lexer.parsing_declaration; if (RootContext.Documentation != null) Lexer.doc_state = XmlCommentState.Allowed; } break; case 223: #line 1890 "cs-parser.jay" { yyVal = pop_current_class (); } break; case 224: #line 1893 "cs-parser.jay" { CheckIdentifierToken (yyToken, GetLocation (yyVals[0+yyTop])); } break; case 230: #line 1916 "cs-parser.jay" { Report.Error (525, GetLocation (yyVals[0+yyTop]), "Interfaces cannot contain fields or constants"); } break; case 231: #line 1920 "cs-parser.jay" { Report.Error (525, GetLocation (yyVals[0+yyTop]), "Interfaces cannot contain fields or constants"); } break; case 236: #line 1928 "cs-parser.jay" { Report.Error (567, GetLocation (yyVals[0+yyTop]), "Interfaces cannot contain operators"); } break; case 237: #line 1932 "cs-parser.jay" { Report.Error (526, GetLocation (yyVals[0+yyTop]), "Interfaces cannot contain contructors"); } break; case 238: #line 1936 "cs-parser.jay" { Report.Error (524, GetLocation (yyVals[0+yyTop]), "Interfaces cannot declare classes, structs, interfaces, delegates, or enumerations"); } break; case 239: #line 1943 "cs-parser.jay" { } break; case 240: #line 1946 "cs-parser.jay" { if (yyVals[-2+yyTop] == null) break; OperatorDeclaration decl = (OperatorDeclaration) yyVals[-2+yyTop]; Operator op = new Operator ( current_class, decl.optype, decl.ret_type, (Modifiers) yyVals[-3+yyTop], current_local_parameters, (ToplevelBlock) yyVals[0+yyTop], (Attributes) yyVals[-4+yyTop], decl.location); if (RootContext.Documentation != null) { op.DocComment = tmpComment; Lexer.doc_state = XmlCommentState.Allowed; } /* Note again, checking is done in semantic analysis*/ current_container.AddOperator (op); current_local_parameters = null; } break; case 242: #line 1970 "cs-parser.jay" { yyVal = null; } break; case 244: #line 1976 "cs-parser.jay" { Report.Error (590, GetLocation (yyVals[0+yyTop]), "User-defined operators cannot return void"); yyVal = TypeManager.system_void_expr; } break; case 245: #line 1984 "cs-parser.jay" { valid_param_mod = ParameterModifierType.DefaultValue; } break; case 246: #line 1988 "cs-parser.jay" { valid_param_mod = 0; Location loc = GetLocation (yyVals[-5+yyTop]); Operator.OpType op = (Operator.OpType) yyVals[-4+yyTop]; current_local_parameters = (ParametersCompiled)yyVals[-1+yyTop]; int p_count = current_local_parameters.Count; if (p_count == 1) { if (op == Operator.OpType.Addition) op = Operator.OpType.UnaryPlus; else if (op == Operator.OpType.Subtraction) op = Operator.OpType.UnaryNegation; } if (IsUnaryOperator (op)) { if (p_count == 2) { Report.Error (1020, loc, "Overloadable binary operator expected"); } else if (p_count != 1) { Report.Error (1535, loc, "Overloaded unary operator `{0}' takes one parameter", Operator.GetName (op)); } } else { if (p_count > 2) { Report.Error (1534, loc, "Overloaded binary operator `{0}' takes two parameters", Operator.GetName (op)); } else if (p_count != 2) { Report.Error (1019, loc, "Overloadable unary operator expected"); } } if (RootContext.Documentation != null) { tmpComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.NotAllowed; } yyVal = new OperatorDeclaration (op, (FullNamedExpression) yyVals[-6+yyTop], loc); } break; case 248: #line 2031 "cs-parser.jay" { yyVal = Operator.OpType.LogicalNot; } break; case 249: #line 2032 "cs-parser.jay" { yyVal = Operator.OpType.OnesComplement; } break; case 250: #line 2033 "cs-parser.jay" { yyVal = Operator.OpType.Increment; } break; case 251: #line 2034 "cs-parser.jay" { yyVal = Operator.OpType.Decrement; } break; case 252: #line 2035 "cs-parser.jay" { yyVal = Operator.OpType.True; } break; case 253: #line 2036 "cs-parser.jay" { yyVal = Operator.OpType.False; } break; case 254: #line 2038 "cs-parser.jay" { yyVal = Operator.OpType.Addition; } break; case 255: #line 2039 "cs-parser.jay" { yyVal = Operator.OpType.Subtraction; } break; case 256: #line 2041 "cs-parser.jay" { yyVal = Operator.OpType.Multiply; } break; case 257: #line 2042 "cs-parser.jay" { yyVal = Operator.OpType.Division; } break; case 258: #line 2043 "cs-parser.jay" { yyVal = Operator.OpType.Modulus; } break; case 259: #line 2044 "cs-parser.jay" { yyVal = Operator.OpType.BitwiseAnd; } break; case 260: #line 2045 "cs-parser.jay" { yyVal = Operator.OpType.BitwiseOr; } break; case 261: #line 2046 "cs-parser.jay" { yyVal = Operator.OpType.ExclusiveOr; } break; case 262: #line 2047 "cs-parser.jay" { yyVal = Operator.OpType.LeftShift; } break; case 263: #line 2048 "cs-parser.jay" { yyVal = Operator.OpType.RightShift; } break; case 264: #line 2049 "cs-parser.jay" { yyVal = Operator.OpType.Equality; } break; case 265: #line 2050 "cs-parser.jay" { yyVal = Operator.OpType.Inequality; } break; case 266: #line 2051 "cs-parser.jay" { yyVal = Operator.OpType.GreaterThan; } break; case 267: #line 2052 "cs-parser.jay" { yyVal = Operator.OpType.LessThan; } break; case 268: #line 2053 "cs-parser.jay" { yyVal = Operator.OpType.GreaterThanOrEqual; } break; case 269: #line 2054 "cs-parser.jay" { yyVal = Operator.OpType.LessThanOrEqual; } break; case 270: #line 2059 "cs-parser.jay" { valid_param_mod = ParameterModifierType.DefaultValue; } break; case 271: #line 2063 "cs-parser.jay" { valid_param_mod = 0; Location loc = GetLocation (yyVals[-5+yyTop]); current_local_parameters = (ParametersCompiled)yyVals[-1+yyTop]; if (RootContext.Documentation != null) { tmpComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.NotAllowed; } yyVal = new OperatorDeclaration (Operator.OpType.Implicit, (FullNamedExpression) yyVals[-4+yyTop], loc); } break; case 272: #line 2077 "cs-parser.jay" { valid_param_mod = ParameterModifierType.DefaultValue; } break; case 273: #line 2081 "cs-parser.jay" { valid_param_mod = 0; Location loc = GetLocation (yyVals[-5+yyTop]); current_local_parameters = (ParametersCompiled)yyVals[-1+yyTop]; if (RootContext.Documentation != null) { tmpComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.NotAllowed; } yyVal = new OperatorDeclaration (Operator.OpType.Explicit, (FullNamedExpression) yyVals[-4+yyTop], loc); } break; case 274: #line 2095 "cs-parser.jay" { Error_SyntaxError (yyToken); current_local_parameters = ParametersCompiled.EmptyReadOnlyParameters; yyVal = new OperatorDeclaration (Operator.OpType.Implicit, null, GetLocation (yyVals[-1+yyTop])); } break; case 275: #line 2101 "cs-parser.jay" { Error_SyntaxError (yyToken); current_local_parameters = ParametersCompiled.EmptyReadOnlyParameters; yyVal = new OperatorDeclaration (Operator.OpType.Explicit, null, GetLocation (yyVals[-1+yyTop])); } break; case 276: #line 2111 "cs-parser.jay" { Constructor c = (Constructor) yyVals[-1+yyTop]; c.Block = (ToplevelBlock) yyVals[0+yyTop]; if (RootContext.Documentation != null) c.DocComment = ConsumeStoredComment (); current_container.AddConstructor (c); current_local_parameters = null; if (RootContext.Documentation != null) Lexer.doc_state = XmlCommentState.Allowed; } break; case 277: #line 2130 "cs-parser.jay" { if (RootContext.Documentation != null) { tmpComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } valid_param_mod = ParameterModifierType.All; } break; case 278: #line 2139 "cs-parser.jay" { valid_param_mod = 0; current_local_parameters = (ParametersCompiled) yyVals[-1+yyTop]; /**/ /* start block here, so possible anonymous methods inside*/ /* constructor initializer can get correct parent block*/ /**/ start_block (lexer.Location); } break; case 279: #line 2150 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-6+yyTop]; var mods = (Modifiers) yyVals[-7+yyTop]; ConstructorInitializer ci = (ConstructorInitializer) yyVals[0+yyTop]; Constructor c = new Constructor (current_class, lt.Value, mods, (Attributes) yyVals[-8+yyTop], current_local_parameters, ci, lt.Location); if (lt.Value != current_container.MemberName.Name) { Report.Error (1520, c.Location, "Class, struct, or interface method must have a return type"); } else if ((mods & Modifiers.STATIC) != 0) { if ((mods & Modifiers.AccessibilityMask) != 0){ Report.Error (515, c.Location, "`{0}': static constructor cannot have an access modifier", c.GetSignatureForError ()); } if (ci != null) { Report.Error (514, c.Location, "`{0}': static constructor cannot have an explicit `this' or `base' constructor call", c.GetSignatureForError ()); } } yyVal = c; } break; case 281: #line 2180 "cs-parser.jay" { current_block = null; yyVal = null; } break; case 284: #line 2190 "cs-parser.jay" { ++lexer.parsing_block; } break; case 285: #line 2194 "cs-parser.jay" { --lexer.parsing_block; yyVal = new ConstructorBaseInitializer ((Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop])); } break; case 286: #line 2199 "cs-parser.jay" { ++lexer.parsing_block; } break; case 287: #line 2203 "cs-parser.jay" { --lexer.parsing_block; yyVal = new ConstructorThisInitializer ((Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop])); } break; case 288: #line 2207 "cs-parser.jay" { Report.Error (1018, GetLocation (yyVals[-1+yyTop]), "Keyword `this' or `base' expected"); yyVal = null; } break; case 289: #line 2215 "cs-parser.jay" { if (RootContext.Documentation != null) { tmpComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.NotAllowed; } current_local_parameters = ParametersCompiled.EmptyReadOnlyParameters; } break; case 290: #line 2224 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; if (lt.Value != current_container.MemberName.Name){ Report.Error (574, lt.Location, "Name of destructor must match name of class"); } else if (current_container.Kind != MemberKind.Class){ Report.Error (575, lt.Location, "Only class types can contain destructor"); } else { Destructor d = new Destructor (current_class, (Modifiers) yyVals[-6+yyTop], ParametersCompiled.EmptyReadOnlyParameters, (Attributes) yyVals[-7+yyTop], lt.Location); if (RootContext.Documentation != null) d.DocComment = ConsumeStoredComment (); d.Block = (ToplevelBlock) yyVals[0+yyTop]; current_container.AddMethod (d); } current_local_parameters = null; } break; case 291: #line 2248 "cs-parser.jay" { foreach (VariableMemberDeclaration var in (List<object>) yyVals[-1+yyTop]) { EventField e = new EventField ( current_class, (FullNamedExpression) yyVals[-2+yyTop], (Modifiers) yyVals[-4+yyTop], var.MemberName, (Attributes) yyVals[-5+yyTop]); e.Initializer = var.GetInitializer ((FullNamedExpression) yyVals[-2+yyTop]); if (current_container.Kind == MemberKind.Interface && e.Initializer != null) { Report.Error (68, e.Location, "`{0}': event in interface cannot have initializer", e.GetSignatureForError ()); } if (var.MemberName.Left != null) { Report.Error (71, e.Location, "`{0}': An explicit interface implementation of an event must use property syntax", e.GetSignatureForError ()); } current_container.AddEvent (e); if (RootContext.Documentation != null) { e.DocComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } } } break; case 292: #line 2277 "cs-parser.jay" { implicit_value_parameter_type = (FullNamedExpression) yyVals[-2+yyTop]; current_local_parameters = new ParametersCompiled (compiler, new Parameter (implicit_value_parameter_type, "value", Parameter.Modifier.NONE, null, GetLocation (yyVals[-3+yyTop]))); lexer.EventParsing = true; } break; case 293: #line 2286 "cs-parser.jay" { lexer.EventParsing = false; } break; case 294: #line 2290 "cs-parser.jay" { MemberName name = (MemberName) yyVals[-5+yyTop]; if (current_container.Kind == MemberKind.Interface) { Report.Error (69, GetLocation (yyVals[-7+yyTop]), "Event in interface cannot have add or remove accessors"); yyVals[-2+yyTop] = new Accessors (null, null); } else if (yyVals[-2+yyTop] == null) { Report.Error (65, GetLocation (yyVals[-7+yyTop]), "`{0}.{1}': event property must have both add and remove accessors", current_container.GetSignatureForError (), name.GetSignatureForError ()); yyVals[-2+yyTop] = new Accessors (null, null); } Accessors accessors = (Accessors) yyVals[-2+yyTop]; if (accessors.get_or_add == null || accessors.set_or_remove == null) /* CS0073 is already reported, so no CS0065 here.*/ yyVal = null; else { Event e = new EventProperty ( current_class, (FullNamedExpression) yyVals[-6+yyTop], (Modifiers) yyVals[-8+yyTop], name, (Attributes) yyVals[-9+yyTop], accessors.get_or_add, accessors.set_or_remove); if (RootContext.Documentation != null) { e.DocComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } current_container.AddEvent (e); implicit_value_parameter_type = null; } current_local_parameters = null; } break; case 295: #line 2322 "cs-parser.jay" { MemberName mn = (MemberName) yyVals[-1+yyTop]; if (mn.Left != null) Report.Error (71, mn.Location, "An explicit interface implementation of an event must use property syntax"); if (RootContext.Documentation != null) Lexer.doc_state = XmlCommentState.Allowed; Error_SyntaxError (yyToken); yyVal = null; } break; case 296: #line 2337 "cs-parser.jay" { yyVal = new Accessors ((Accessor) yyVals[-1+yyTop], (Accessor) yyVals[0+yyTop]); } break; case 297: #line 2341 "cs-parser.jay" { Accessors accessors = new Accessors ((Accessor) yyVals[0+yyTop], (Accessor) yyVals[-1+yyTop]); accessors.declared_in_reverse = true; yyVal = accessors; } break; case 298: #line 2346 "cs-parser.jay" { yyVal = null; } break; case 299: #line 2347 "cs-parser.jay" { yyVal = null; } break; case 300: #line 2349 "cs-parser.jay" { Report.Error (1055, GetLocation (yyVals[0+yyTop]), "An add or remove accessor expected"); yyVal = null; } break; case 301: #line 2353 "cs-parser.jay" { yyVal = null; } break; case 302: #line 2358 "cs-parser.jay" { lexer.EventParsing = false; } break; case 303: #line 2362 "cs-parser.jay" { Accessor accessor = new Accessor ((ToplevelBlock) yyVals[0+yyTop], 0, (Attributes) yyVals[-3+yyTop], null, GetLocation (yyVals[-2+yyTop])); lexer.EventParsing = true; yyVal = accessor; } break; case 304: #line 2367 "cs-parser.jay" { Report.Error (73, GetLocation (yyVals[-1+yyTop]), "An add or remove accessor must have a body"); yyVal = null; } break; case 305: #line 2371 "cs-parser.jay" { Report.Error (1609, GetLocation (yyVals[0+yyTop]), "Modifiers cannot be placed on event accessor declarations"); yyVal = null; } break; case 306: #line 2379 "cs-parser.jay" { lexer.EventParsing = false; } break; case 307: #line 2383 "cs-parser.jay" { yyVal = new Accessor ((ToplevelBlock) yyVals[0+yyTop], 0, (Attributes) yyVals[-3+yyTop], null, GetLocation (yyVals[-2+yyTop])); lexer.EventParsing = true; } break; case 308: #line 2387 "cs-parser.jay" { Report.Error (73, GetLocation (yyVals[-1+yyTop]), "An add or remove accessor must have a body"); yyVal = null; } break; case 309: #line 2391 "cs-parser.jay" { Report.Error (1609, GetLocation (yyVals[0+yyTop]), "Modifiers cannot be placed on event accessor declarations"); yyVal = null; } break; case 310: #line 2400 "cs-parser.jay" { valid_param_mod = ParameterModifierType.Params | ParameterModifierType.DefaultValue; } break; case 311: #line 2405 "cs-parser.jay" { valid_param_mod = 0; implicit_value_parameter_type = (FullNamedExpression) yyVals[-6+yyTop]; indexer_parameters = (ParametersCompiled) yyVals[-2+yyTop]; if (indexer_parameters.IsEmpty) { Report.Error (1551, GetLocation (yyVals[-4+yyTop]), "Indexers must have at least one parameter"); } if (RootContext.Documentation != null) { tmpComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } lexer.PropertyParsing = true; parsing_indexer = true; } break; case 312: #line 2424 "cs-parser.jay" { lexer.PropertyParsing = false; has_get = has_set = false; parsing_indexer = false; } break; case 313: #line 2430 "cs-parser.jay" { Accessors accessors = (Accessors) yyVals[-2+yyTop]; Accessor get_block = accessors != null ? accessors.get_or_add : null; Accessor set_block = accessors != null ? accessors.set_or_remove : null; bool order = accessors != null ? accessors.declared_in_reverse : false; Indexer indexer = new Indexer (current_class, (FullNamedExpression) yyVals[-10+yyTop], (MemberName)yyVals[-9+yyTop], (Modifiers) yyVals[-11+yyTop], (ParametersCompiled) yyVals[-6+yyTop], (Attributes) yyVals[-12+yyTop], get_block, set_block, order); if (yyVals[-10+yyTop] == TypeManager.system_void_expr) Report.Error (620, GetLocation (yyVals[-10+yyTop]), "`{0}': indexer return type cannot be `void'", indexer.GetSignatureForError ()); if (accessors == null) Report.Error (548, indexer.Location, "`{0}': property or indexer must have at least one accessor", indexer.GetSignatureForError ()); if (current_container.Kind == MemberKind.Interface) { if (indexer.Get.Block != null) Report.Error (531, indexer.Location, "`{0}.get': interface members cannot have a definition", indexer.GetSignatureForError ()); if (indexer.Set.Block != null) Report.Error (531, indexer.Location, "`{0}.set': interface members cannot have a definition", indexer.GetSignatureForError ()); } if (RootContext.Documentation != null) indexer.DocComment = ConsumeStoredComment (); current_container.AddIndexer (indexer); current_local_parameters = null; implicit_value_parameter_type = null; indexer_parameters = null; } break; case 314: #line 2469 "cs-parser.jay" { if (RootContext.Documentation != null) enumTypeComment = Lexer.consume_doc_comment (); } break; case 315: #line 2475 "cs-parser.jay" { MemberName name = (MemberName) yyVals[-4+yyTop]; if (name.IsGeneric) { Report.Error (1675, name.Location, "Enums cannot have type parameters"); } name = MakeName (name); Enum e = new Enum (current_namespace, current_class, (TypeExpr) yyVals[-3+yyTop], (Modifiers) yyVals[-6+yyTop], name, (Attributes) yyVals[-7+yyTop]); if (RootContext.Documentation != null) e.DocComment = enumTypeComment; EnumMember em = null; foreach (VariableDeclaration ev in (IList<VariableDeclaration>) yyVals[-1+yyTop]) { em = new EnumMember ( e, em, ev.identifier, ev.GetInitializer ((FullNamedExpression) yyVals[-3+yyTop]), ev.OptAttributes, ev.Location); /* if (RootContext.Documentation != null)*/ em.DocComment = ev.DocComment; e.AddEnumMember (em); } if (RootContext.EvalMode) undo.AddTypeContainer (current_container, e); current_container.AddTypeContainer (e); yyVal = e; } break; case 316: #line 2512 "cs-parser.jay" { yyVal = TypeManager.system_int32_expr; } break; case 317: #line 2516 "cs-parser.jay" { if (yyVals[0+yyTop] != TypeManager.system_int32_expr && yyVals[0+yyTop] != TypeManager.system_uint32_expr && yyVals[0+yyTop] != TypeManager.system_int64_expr && yyVals[0+yyTop] != TypeManager.system_uint64_expr && yyVals[0+yyTop] != TypeManager.system_int16_expr && yyVals[0+yyTop] != TypeManager.system_uint16_expr && yyVals[0+yyTop] != TypeManager.system_byte_expr && yyVals[0+yyTop] != TypeManager.system_sbyte_expr) { Enum.Error_1008 (GetLocation (yyVals[0+yyTop]), Report); yyVals[0+yyTop] = TypeManager.system_int32_expr; } yyVal = yyVals[0+yyTop]; } break; case 318: #line 2528 "cs-parser.jay" { Error_TypeExpected (GetLocation (yyVals[-1+yyTop])); yyVal = TypeManager.system_int32_expr; } break; case 319: #line 2536 "cs-parser.jay" { if (RootContext.Documentation != null) Lexer.doc_state = XmlCommentState.Allowed; } break; case 320: #line 2541 "cs-parser.jay" { /* here will be evaluated after CLOSE_BLACE is consumed.*/ if (RootContext.Documentation != null) Lexer.doc_state = XmlCommentState.Allowed; } break; case 321: #line 2547 "cs-parser.jay" { yyVal = yyVals[-2+yyTop]; } break; case 322: #line 2553 "cs-parser.jay" { yyVal = new VariableDeclaration [0]; } break; case 323: #line 2554 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; case 324: #line 2559 "cs-parser.jay" { var l = new List<VariableDeclaration> (4); l.Add ((VariableDeclaration) yyVals[0+yyTop]); yyVal = l; } break; case 325: #line 2565 "cs-parser.jay" { var l = (List<VariableDeclaration>) yyVals[-2+yyTop]; l.Add ((VariableDeclaration) yyVals[0+yyTop]); yyVal = l; } break; case 326: #line 2574 "cs-parser.jay" { VariableDeclaration vd = new VariableDeclaration ( (Tokenizer.LocatedToken) yyVals[0+yyTop], null, (Attributes) yyVals[-1+yyTop]); if (RootContext.Documentation != null) { vd.DocComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } yyVal = vd; } break; case 327: #line 2586 "cs-parser.jay" { ++lexer.parsing_block; if (RootContext.Documentation != null) { tmpComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.NotAllowed; } } break; case 328: #line 2594 "cs-parser.jay" { --lexer.parsing_block; VariableDeclaration vd = new VariableDeclaration ( (Tokenizer.LocatedToken) yyVals[-3+yyTop], (Expression) yyVals[0+yyTop], (Attributes) yyVals[-4+yyTop]); if (RootContext.Documentation != null) vd.DocComment = ConsumeStoredComment (); yyVal = vd; } break; case 329: #line 2612 "cs-parser.jay" { valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out | ParameterModifierType.Params | ParameterModifierType.DefaultValue; } break; case 330: #line 2616 "cs-parser.jay" { valid_param_mod = 0; MemberName name = MakeName ((MemberName) yyVals[-4+yyTop]); ParametersCompiled p = (ParametersCompiled) yyVals[-1+yyTop]; Delegate del = new Delegate (current_namespace, current_class, (FullNamedExpression) yyVals[-5+yyTop], (Modifiers) yyVals[-7+yyTop], name, p, (Attributes) yyVals[-8+yyTop]); if (RootContext.Documentation != null) { del.DocComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } current_container.AddDelegate (del); current_delegate = del; lexer.ConstraintsParsing = true; } break; case 331: #line 2635 "cs-parser.jay" { lexer.ConstraintsParsing = false; } break; case 332: #line 2639 "cs-parser.jay" { current_delegate.SetParameterInfo ((List<Constraints>) yyVals[-2+yyTop]); yyVal = current_delegate; current_delegate = null; } break; case 333: #line 2649 "cs-parser.jay" { yyVal = null; } break; case 334: #line 2653 "cs-parser.jay" { if (RootContext.MetadataCompatibilityVersion < MetadataVersion.v2) Report.FeatureIsNotSupported (GetLocation (yyVals[0+yyTop]), "nullable types"); else if (RootContext.Version < LanguageVersion.ISO_2) Report.FeatureIsNotAvailable (GetLocation (yyVals[0+yyTop]), "nullable types"); yyVal = this; } break; case 336: #line 2666 "cs-parser.jay" { var lt1 = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; var lt2 = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberName (lt1.Value, lt2.Value, (TypeArguments) yyVals[0+yyTop], lt1.Location); } break; case 338: #line 2677 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberName ((MemberName) yyVals[-3+yyTop], lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location); } break; case 339: #line 2685 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberName (lt.Value, (TypeArguments)yyVals[0+yyTop], lt.Location); } break; case 340: #line 2695 "cs-parser.jay" { yyVal = null; } break; case 341: #line 2697 "cs-parser.jay" { if (RootContext.MetadataCompatibilityVersion < MetadataVersion.v2) Report.FeatureIsNotSupported (GetLocation (yyVals[-2+yyTop]), "generics"); else if (RootContext.Version < LanguageVersion.ISO_2) Report.FeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), "generics"); yyVal = yyVals[-1+yyTop]; } break; case 342: #line 2706 "cs-parser.jay" { Error_TypeExpected (lexer.Location); yyVal = new TypeArguments (); } break; case 343: #line 2714 "cs-parser.jay" { TypeArguments type_args = new TypeArguments (); type_args.Add ((FullNamedExpression) yyVals[0+yyTop]); yyVal = type_args; } break; case 344: #line 2720 "cs-parser.jay" { TypeArguments type_args = (TypeArguments) yyVals[-2+yyTop]; type_args.Add ((FullNamedExpression) yyVals[0+yyTop]); yyVal = type_args; } break; case 345: #line 2732 "cs-parser.jay" { lexer.parsing_generic_declaration = true; } break; case 346: #line 2736 "cs-parser.jay" { lexer.parsing_generic_declaration = false; var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; yyVal = new MemberName (lt.Value, (TypeArguments)yyVals[0+yyTop], lt.Location); } break; case 347: #line 2745 "cs-parser.jay" { MemberName mn = (MemberName)yyVals[0+yyTop]; if (mn.TypeArguments != null) syntax_error (mn.Location, string.Format ("Member `{0}' cannot declare type arguments", mn.GetSignatureForError ())); } break; case 349: #line 2756 "cs-parser.jay" { lexer.parsing_generic_declaration = false; var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberName ((MemberName) yyVals[-2+yyTop], lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location); } break; case 350: #line 2765 "cs-parser.jay" { lexer.parsing_generic_declaration = false; yyVal = new MemberName (TypeContainer.DefaultIndexerName, GetLocation (yyVals[0+yyTop])); } break; case 351: #line 2770 "cs-parser.jay" { lexer.parsing_generic_declaration = false; yyVal = new MemberName ((MemberName) yyVals[-1+yyTop], TypeContainer.DefaultIndexerName, null, GetLocation (yyVals[-1+yyTop])); } break; case 352: #line 2778 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; yyVal = new MemberName (lt.Value, (TypeArguments) yyVals[-1+yyTop], lt.Location); } break; case 353: #line 2783 "cs-parser.jay" { var lt1 = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; var lt2 = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; yyVal = new MemberName (lt1.Value, lt2.Value, (TypeArguments) yyVals[-1+yyTop], lt1.Location); } break; case 354: #line 2790 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; yyVal = new MemberName ((MemberName) yyVals[-3+yyTop], lt.Value, (TypeArguments) yyVals[-1+yyTop], lt.Location); } break; case 355: #line 2797 "cs-parser.jay" { yyVal = null; } break; case 356: #line 2799 "cs-parser.jay" { if (RootContext.MetadataCompatibilityVersion < MetadataVersion.v2) Report.FeatureIsNotSupported (GetLocation (yyVals[-2+yyTop]), "generics"); else if (RootContext.Version < LanguageVersion.ISO_2) Report.FeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), "generics"); yyVal = yyVals[-1+yyTop]; } break; case 357: #line 2811 "cs-parser.jay" { TypeArguments type_args = new TypeArguments (); type_args.Add ((FullNamedExpression)yyVals[0+yyTop]); yyVal = type_args; } break; case 358: #line 2817 "cs-parser.jay" { TypeArguments type_args = (TypeArguments) yyVals[-2+yyTop]; type_args.Add ((FullNamedExpression)yyVals[0+yyTop]); yyVal = type_args; } break; case 359: #line 2826 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken)yyVals[0+yyTop]; yyVal = new TypeParameterName (lt.Value, (Attributes)yyVals[-2+yyTop], (Variance) yyVals[-1+yyTop], lt.Location); } break; case 360: #line 2831 "cs-parser.jay" { if (GetTokenName (yyToken) == "type") Report.Error (81, GetLocation (yyVals[0+yyTop]), "Type parameter declaration must be an identifier not a type"); else Error_SyntaxError (yyToken); yyVal = new TypeParameterName ("", null, lexer.Location); } break; case 362: #line 2847 "cs-parser.jay" { yyVal = TypeManager.system_void_expr; } break; case 363: #line 2854 "cs-parser.jay" { lexer.parsing_generic_declaration = true; } break; case 365: #line 2865 "cs-parser.jay" { Expression.Error_VoidInvalidInTheContext (GetLocation (yyVals[0+yyTop]), Report); yyVal = TypeManager.system_void_expr; } break; case 367: #line 2874 "cs-parser.jay" { Expression.Error_VoidInvalidInTheContext (GetLocation (yyVals[0+yyTop]), Report); yyVal = TypeManager.system_void_expr; } break; case 369: #line 2883 "cs-parser.jay" { Report.Error (1536, GetLocation (yyVals[0+yyTop]), "Invalid parameter type `void'"); yyVal = TypeManager.system_void_expr; } break; case 371: #line 2892 "cs-parser.jay" { string rank_specifiers = (string) yyVals[0+yyTop]; yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], rank_specifiers); } break; case 372: #line 2900 "cs-parser.jay" { MemberName name = (MemberName) yyVals[-1+yyTop]; if (yyVals[0+yyTop] != null) { yyVal = new ComposedCast (name.GetTypeExpression (), "?", lexer.Location); } else { if (name.Left == null && name.Name == "var") yyVal = new VarExpr (name.Location); else yyVal = name.GetTypeExpression (); } } break; case 373: #line 2913 "cs-parser.jay" { if (yyVals[0+yyTop] != null) yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], "?", lexer.Location); } break; case 374: #line 2918 "cs-parser.jay" { /**/ /* Note that here only unmanaged types are allowed but we*/ /* can't perform checks during this phase - we do it during*/ /* semantic analysis.*/ /**/ yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], "*", Lexer.Location); } break; case 375: #line 2927 "cs-parser.jay" { yyVal = new ComposedCast (TypeManager.system_void_expr, "*", GetLocation (yyVals[-1+yyTop])); } break; case 376: #line 2934 "cs-parser.jay" { var types = new List<FullNamedExpression> (2); types.Add ((FullNamedExpression) yyVals[0+yyTop]); yyVal = types; } break; case 377: #line 2940 "cs-parser.jay" { var types = (List<FullNamedExpression>) yyVals[-2+yyTop]; types.Add ((FullNamedExpression) yyVals[0+yyTop]); yyVal = types; } break; case 378: #line 2949 "cs-parser.jay" { if (yyVals[0+yyTop] is ComposedCast) { Report.Error (1521, GetLocation (yyVals[0+yyTop]), "Invalid base type `{0}'", ((ComposedCast)yyVals[0+yyTop]).GetSignatureForError ()); } yyVal = yyVals[0+yyTop]; } break; case 379: #line 2956 "cs-parser.jay" { Error_TypeExpected (lexer.Location); yyVal = null; } break; case 380: #line 2967 "cs-parser.jay" { yyVal = TypeManager.system_object_expr; } break; case 381: #line 2968 "cs-parser.jay" { yyVal = TypeManager.system_string_expr; } break; case 382: #line 2969 "cs-parser.jay" { yyVal = TypeManager.system_boolean_expr; } break; case 383: #line 2970 "cs-parser.jay" { yyVal = TypeManager.system_decimal_expr; } break; case 384: #line 2971 "cs-parser.jay" { yyVal = TypeManager.system_single_expr; } break; case 385: #line 2972 "cs-parser.jay" { yyVal = TypeManager.system_double_expr; } break; case 387: #line 2977 "cs-parser.jay" { yyVal = TypeManager.system_sbyte_expr; } break; case 388: #line 2978 "cs-parser.jay" { yyVal = TypeManager.system_byte_expr; } break; case 389: #line 2979 "cs-parser.jay" { yyVal = TypeManager.system_int16_expr; } break; case 390: #line 2980 "cs-parser.jay" { yyVal = TypeManager.system_uint16_expr; } break; case 391: #line 2981 "cs-parser.jay" { yyVal = TypeManager.system_int32_expr; } break; case 392: #line 2982 "cs-parser.jay" { yyVal = TypeManager.system_uint32_expr; } break; case 393: #line 2983 "cs-parser.jay" { yyVal = TypeManager.system_int64_expr; } break; case 394: #line 2984 "cs-parser.jay" { yyVal = TypeManager.system_uint64_expr; } break; case 395: #line 2985 "cs-parser.jay" { yyVal = TypeManager.system_char_expr; } break; case 397: #line 2991 "cs-parser.jay" { yyVal = TypeManager.system_void_expr; } break; case 401: #line 3009 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new SimpleName (lt.Value, (TypeArguments)yyVals[0+yyTop], lt.Location); } break; case 402: #line 3013 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new CompletionSimpleName (MemberName.MakeName (lt.Value, null), lt.Location); } break; case 422: #line 3039 "cs-parser.jay" { yyVal = new NullLiteral (GetLocation (yyVals[0+yyTop])); } break; case 423: #line 3043 "cs-parser.jay" { yyVal = new BoolLiteral (true, GetLocation (yyVals[0+yyTop])); } break; case 424: #line 3044 "cs-parser.jay" { yyVal = new BoolLiteral (false, GetLocation (yyVals[0+yyTop])); } break; case 429: #line 3070 "cs-parser.jay" { yyVal = new ParenthesizedExpression ((Expression) yyVals[-1+yyTop]); } break; case 430: #line 3074 "cs-parser.jay" { yyVal = new ParenthesizedExpression ((Expression) yyVals[-1+yyTop]); } break; case 431: #line 3081 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location); } break; case 432: #line 3086 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; /* TODO: Location is wrong as some predefined types doesn't hold a location*/ yyVal = new MemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location); } break; case 433: #line 3092 "cs-parser.jay" { var lt1 = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; var lt2 = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new QualifiedAliasMember (lt1.Value, lt2.Value, (TypeArguments) yyVals[0+yyTop], lt1.Location); } break; case 434: #line 3098 "cs-parser.jay" { yyVal = new CompletionMemberAccess ((Expression) yyVals[-2+yyTop], null,GetLocation (yyVals[0+yyTop])); } break; case 435: #line 3101 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new CompletionMemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, lt.Location); } break; case 436: #line 3106 "cs-parser.jay" { /* TODO: Location is wrong as some predefined types doesn't hold a location*/ yyVal = new CompletionMemberAccess ((Expression) yyVals[-2+yyTop], null, lexer.Location); } break; case 437: #line 3110 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new CompletionMemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, lt.Location); } break; case 438: #line 3118 "cs-parser.jay" { yyVal = new Invocation ((Expression) yyVals[-3+yyTop], (Arguments) yyVals[-1+yyTop]); } break; case 439: #line 3124 "cs-parser.jay" { yyVal = null; } break; case 441: #line 3130 "cs-parser.jay" { if (yyVals[-1+yyTop] == null) yyVal = CollectionOrObjectInitializers.Empty; else yyVal = new CollectionOrObjectInitializers ((List<Expression>) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); } break; case 442: #line 3137 "cs-parser.jay" { yyVal = new CollectionOrObjectInitializers ((List<Expression>) yyVals[-2+yyTop], GetLocation (yyVals[-3+yyTop])); } break; case 443: #line 3143 "cs-parser.jay" { yyVal = null; } break; case 444: #line 3145 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 445: #line 3152 "cs-parser.jay" { var a = new List<Expression> (); a.Add ((Expression) yyVals[0+yyTop]); yyVal = a; } break; case 446: #line 3158 "cs-parser.jay" { var a = (List<Expression>)yyVals[-2+yyTop]; a.Add ((Expression) yyVals[0+yyTop]); yyVal = a; } break; case 447: #line 3163 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = yyVals[-1+yyTop]; } break; case 448: #line 3171 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; yyVal = new ElementInitializer (lt.Value, (Expression)yyVals[0+yyTop], lt.Location); } break; case 449: #line 3176 "cs-parser.jay" { yyVal = new CompletionElementInitializer (null, GetLocation (yyVals[0+yyTop])); } break; case 450: #line 3179 "cs-parser.jay" { CompletionSimpleName csn = yyVals[-1+yyTop] as CompletionSimpleName; if (csn == null) yyVal = new CollectionElementInitializer ((Expression)yyVals[-1+yyTop]); else yyVal = new CompletionElementInitializer (csn.Prefix, csn.Location); } break; case 451: #line 3187 "cs-parser.jay" { if (yyVals[-1+yyTop] == null) yyVal = null; else yyVal = new CollectionElementInitializer ((List<Expression>)yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); } break; case 452: #line 3194 "cs-parser.jay" { Report.Error (1920, GetLocation (yyVals[-1+yyTop]), "An element initializer cannot be empty"); yyVal = null; } break; case 455: #line 3206 "cs-parser.jay" { yyVal = null; } break; case 457: #line 3212 "cs-parser.jay" { Arguments list = new Arguments (4); list.Add ((Argument) yyVals[0+yyTop]); yyVal = list; } break; case 458: #line 3218 "cs-parser.jay" { Arguments list = (Arguments) yyVals[-2+yyTop]; if (list [list.Count - 1] is NamedArgument) Error_NamedArgumentExpected ((NamedArgument) list [list.Count - 1]); list.Add ((Argument) yyVals[0+yyTop]); yyVal = list; } break; case 459: #line 3227 "cs-parser.jay" { Arguments list = (Arguments) yyVals[-2+yyTop]; NamedArgument a = (NamedArgument) yyVals[0+yyTop]; for (int i = 0; i < list.Count; ++i) { NamedArgument na = list [i] as NamedArgument; if (na != null && na.Name == a.Name) Report.Error (1740, na.Location, "Named argument `{0}' specified multiple times", na.Name); } list.Add (a); yyVal = list; } break; case 460: #line 3241 "cs-parser.jay" { Report.Error (839, GetLocation (yyVals[0+yyTop]), "An argument is missing"); yyVal = yyVals[-1+yyTop]; } break; case 461: #line 3246 "cs-parser.jay" { Report.Error (839, GetLocation (yyVals[-1+yyTop]), "An argument is missing"); yyVal = yyVals[-1+yyTop]; } break; case 462: #line 3254 "cs-parser.jay" { yyVal = new Argument ((Expression) yyVals[0+yyTop]); } break; case 466: #line 3267 "cs-parser.jay" { yyVal = new Argument ((Expression) yyVals[0+yyTop], Argument.AType.Ref); } break; case 467: #line 3271 "cs-parser.jay" { yyVal = new Argument ((Expression) yyVals[0+yyTop], Argument.AType.Out); } break; case 468: #line 3275 "cs-parser.jay" { yyVal = new Argument (new Arglist ((Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop]))); } break; case 469: #line 3279 "cs-parser.jay" { yyVal = new Argument (new Arglist (GetLocation (yyVals[-2+yyTop]))); } break; case 470: #line 3283 "cs-parser.jay" { yyVal = new Argument (new ArglistAccess (GetLocation (yyVals[0+yyTop]))); } break; case 472: #line 3294 "cs-parser.jay" { yyVal = new ElementAccess ((Expression) yyVals[-3+yyTop], (Arguments) yyVals[-1+yyTop]); } break; case 473: #line 3298 "cs-parser.jay" { /* LAMESPEC: Not allowed according to specification*/ yyVal = new ElementAccess ((Expression) yyVals[-3+yyTop], (Arguments) yyVals[-1+yyTop]); } break; case 474: #line 3303 "cs-parser.jay" { /* So the super-trick is that primary_expression*/ /* can only be either a SimpleName or a MemberAccess. */ /* The MemberAccess case arises when you have a fully qualified type-name like :*/ /* Foo.Bar.Blah i;*/ /* SimpleName is when you have*/ /* Blah i;*/ Expression expr = (Expression) yyVals[-1+yyTop]; if (expr is ComposedCast){ yyVal = new ComposedCast ((ComposedCast)expr, (string) yyVals[0+yyTop]); } else if (expr is ATypeNameExpression){ /**/ /* So we extract the string corresponding to the SimpleName*/ /* or MemberAccess*/ /* */ yyVal = new ComposedCast ((ATypeNameExpression)expr, (string) yyVals[0+yyTop]); } else { Error_ExpectingTypeName (expr); yyVal = TypeManager.system_object_expr; } } break; case 475: #line 3329 "cs-parser.jay" { var list = new List<Expression> (4); list.Add ((Expression) yyVals[0+yyTop]); yyVal = list; } break; case 476: #line 3335 "cs-parser.jay" { var list = (List<Expression>) yyVals[-2+yyTop]; list.Add ((Expression) yyVals[0+yyTop]); yyVal = list; } break; case 477: #line 3340 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = yyVals[-1+yyTop]; } break; case 478: #line 3348 "cs-parser.jay" { Arguments args = new Arguments (4); args.Add ((Argument) yyVals[0+yyTop]); yyVal = args; } break; case 479: #line 3354 "cs-parser.jay" { Arguments args = (Arguments) yyVals[-2+yyTop]; args.Add ((Argument) yyVals[0+yyTop]); yyVal = args; } break; case 480: #line 3363 "cs-parser.jay" { yyVal = new Argument ((Expression) yyVals[0+yyTop]); } break; case 482: #line 3371 "cs-parser.jay" { yyVal = new This (current_block, GetLocation (yyVals[0+yyTop])); } break; case 483: #line 3378 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new BaseAccess (lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location); } break; case 484: #line 3383 "cs-parser.jay" { yyVal = new BaseIndexerAccess ((Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); } break; case 485: #line 3387 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new BaseAccess (null, GetLocation (yyVals[0+yyTop])); } break; case 486: #line 3395 "cs-parser.jay" { yyVal = new UnaryMutator (UnaryMutator.Mode.PostIncrement, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop])); } break; case 487: #line 3402 "cs-parser.jay" { yyVal = new UnaryMutator (UnaryMutator.Mode.PostDecrement, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop])); } break; case 488: #line 3409 "cs-parser.jay" { if (yyVals[0+yyTop] != null) { if (RootContext.Version <= LanguageVersion.ISO_2) Report.FeatureIsNotAvailable (GetLocation (yyVals[-4+yyTop]), "object initializers"); yyVal = new NewInitialize ((Expression) yyVals[-4+yyTop], (Arguments) yyVals[-2+yyTop], (CollectionOrObjectInitializers) yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop])); } else yyVal = new New ((Expression) yyVals[-4+yyTop], (Arguments) yyVals[-2+yyTop], GetLocation (yyVals[-4+yyTop])); } break; case 489: #line 3420 "cs-parser.jay" { if (RootContext.Version <= LanguageVersion.ISO_2) Report.FeatureIsNotAvailable (GetLocation (yyVals[-1+yyTop]), "collection initializers"); yyVal = new NewInitialize ((Expression) yyVals[-1+yyTop], null, (CollectionOrObjectInitializers) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 490: #line 3432 "cs-parser.jay" { yyVal = new ArrayCreation ((FullNamedExpression) yyVals[-5+yyTop], (List<Expression>) yyVals[-3+yyTop], (string) yyVals[-1+yyTop], (ArrayInitializer) yyVals[0+yyTop], GetLocation (yyVals[-5+yyTop])); } break; case 491: #line 3436 "cs-parser.jay" { if (yyVals[0+yyTop] == null) Report.Error (1586, GetLocation (yyVals[-2+yyTop]), "Array creation must have array size or array initializer"); yyVal = new ArrayCreation ((FullNamedExpression) yyVals[-2+yyTop], (string) yyVals[-1+yyTop], (ArrayInitializer) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); } break; case 492: #line 3443 "cs-parser.jay" { if (RootContext.Version <= LanguageVersion.ISO_2) Report.FeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), "implicitly typed arrays"); yyVal = new ImplicitlyTypedArrayCreation ((string) yyVals[-1+yyTop], (ArrayInitializer) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); } break; case 493: #line 3450 "cs-parser.jay" { Report.Error (1526, GetLocation (yyVals[-1+yyTop]), "A new expression requires () or [] after type"); yyVal = new ArrayCreation ((FullNamedExpression) yyVals[-1+yyTop], "[]", null, GetLocation (yyVals[-1+yyTop])); } break; case 494: #line 3458 "cs-parser.jay" { ++lexer.parsing_type; } break; case 495: #line 3462 "cs-parser.jay" { --lexer.parsing_type; yyVal = yyVals[0+yyTop]; } break; case 496: #line 3470 "cs-parser.jay" { if (RootContext.MetadataCompatibilityVersion < MetadataVersion.v2) Report.FeatureIsNotSupported (GetLocation (yyVals[-3+yyTop]), "anonymous types"); else if (RootContext.Version <= LanguageVersion.ISO_2) Report.FeatureIsNotAvailable (GetLocation (yyVals[-3+yyTop]), "anonymous types"); yyVal = new NewAnonymousType ((List<AnonymousTypeParameter>) yyVals[-1+yyTop], current_container, GetLocation (yyVals[-3+yyTop])); } break; case 499: #line 3486 "cs-parser.jay" { yyVal = null; } break; case 501: #line 3492 "cs-parser.jay" { var a = new List<AnonymousTypeParameter> (4); a.Add ((AnonymousTypeParameter) yyVals[0+yyTop]); yyVal = a; } break; case 502: #line 3498 "cs-parser.jay" { var a = (List<AnonymousTypeParameter>) yyVals[-2+yyTop]; a.Add ((AnonymousTypeParameter) yyVals[0+yyTop]); yyVal = a; } break; case 503: #line 3507 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken)yyVals[-2+yyTop]; yyVal = new AnonymousTypeParameter ((Expression)yyVals[0+yyTop], lt.Value, lt.Location); } break; case 504: #line 3512 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken)yyVals[0+yyTop]; yyVal = new AnonymousTypeParameter (new SimpleName (lt.Value, lt.Location), lt.Value, lt.Location); } break; case 505: #line 3518 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; BaseAccess ba = new BaseAccess (lt.Value, (TypeArguments) yyVals[0+yyTop], lt.Location); yyVal = new AnonymousTypeParameter (ba, lt.Value, lt.Location); } break; case 506: #line 3524 "cs-parser.jay" { MemberAccess ma = (MemberAccess) yyVals[0+yyTop]; yyVal = new AnonymousTypeParameter (ma, ma.Name, ma.Location); } break; case 507: #line 3529 "cs-parser.jay" { Report.Error (746, lexer.Location, "Invalid anonymous type member declarator. Anonymous type members must be a member assignment, simple name or member access expression"); yyVal = null; } break; case 508: #line 3538 "cs-parser.jay" { yyVal = ""; } break; case 509: #line 3542 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 510: #line 3549 "cs-parser.jay" { if (yyVals[0+yyTop] != null) yyVal = "?"; else yyVal = string.Empty; } break; case 511: #line 3556 "cs-parser.jay" { if (yyVals[-1+yyTop] != null) yyVal = "?" + (string) yyVals[0+yyTop]; else yyVal = yyVals[0+yyTop]; } break; case 513: #line 3567 "cs-parser.jay" { yyVal = (string) yyVals[-1+yyTop] + (string) yyVals[0+yyTop]; } break; case 514: #line 3574 "cs-parser.jay" { yyVal = "[]"; } break; case 515: #line 3578 "cs-parser.jay" { yyVal = "[" + (string) yyVals[-1+yyTop] + "]"; } break; case 516: #line 3582 "cs-parser.jay" { Error_SyntaxError (178, yyToken, "Invalid rank specifier"); yyVal = "[]"; } break; case 517: #line 3590 "cs-parser.jay" { yyVal = ","; } break; case 518: #line 3594 "cs-parser.jay" { yyVal = (string) yyVals[-1+yyTop] + ","; } break; case 519: #line 3601 "cs-parser.jay" { yyVal = null; } break; case 520: #line 3605 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 521: #line 3612 "cs-parser.jay" { yyVal = new ArrayInitializer (0, GetLocation (yyVals[-1+yyTop])); } break; case 522: #line 3616 "cs-parser.jay" { yyVal = new ArrayInitializer ((List<Expression>) yyVals[-2+yyTop], GetLocation (yyVals[-3+yyTop])); } break; case 523: #line 3623 "cs-parser.jay" { var list = new List<Expression> (4); list.Add ((Expression) yyVals[0+yyTop]); yyVal = list; } break; case 524: #line 3629 "cs-parser.jay" { var list = (List<Expression>) yyVals[-2+yyTop]; list.Add ((Expression) yyVals[0+yyTop]); yyVal = list; } break; case 525: #line 3635 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new List<Expression> (); } break; case 526: #line 3643 "cs-parser.jay" { lexer.TypeOfParsing = true; } break; case 527: #line 3647 "cs-parser.jay" { lexer.TypeOfParsing = false; Expression type = (Expression)yyVals[-1+yyTop]; if (type == TypeManager.system_void_expr) yyVal = new TypeOfVoid (GetLocation (yyVals[-4+yyTop])); else yyVal = new TypeOf (type, GetLocation (yyVals[-4+yyTop])); } break; case 530: #line 3661 "cs-parser.jay" { Error_TypeExpected (lexer.Location); yyVal = null; } break; case 531: #line 3669 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new SimpleName (lt.Value, (int) yyVals[0+yyTop], lt.Location); } break; case 532: #line 3675 "cs-parser.jay" { var lt1 = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; var lt2 = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new QualifiedAliasMember (lt1.Value, lt2.Value, (int) yyVals[0+yyTop], lt1.Location); } break; case 533: #line 3682 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new MemberAccess ((Expression) yyVals[-2+yyTop], lt.Value, lt.Location); } break; case 534: #line 3688 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new MemberAccess ((Expression) yyVals[-3+yyTop], lt.Value, (int) yyVals[0+yyTop], lt.Location); } break; case 535: #line 3694 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; MemberName name = (MemberName) yyVals[-3+yyTop]; yyVal = new MemberAccess (name.GetTypeExpression (), lt.Value, (int) yyVals[0+yyTop], lt.Location); } break; case 536: #line 3704 "cs-parser.jay" { if (RootContext.MetadataCompatibilityVersion < MetadataVersion.v2) Report.FeatureIsNotSupported (GetLocation (yyVals[0+yyTop]), "generics"); else if (RootContext.Version < LanguageVersion.ISO_2) Report.FeatureIsNotAvailable (GetLocation (yyVals[0+yyTop]), "generics"); yyVal = yyVals[0+yyTop]; } break; case 537: #line 3716 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; if (RootContext.Version == LanguageVersion.ISO_1) Report.FeatureIsNotAvailable (lt.Location, "namespace alias qualifier"); yyVal = lt; } break; case 538: #line 3726 "cs-parser.jay" { yyVal = new SizeOf ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); } break; case 539: #line 3733 "cs-parser.jay" { yyVal = new CheckedExpr ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); } break; case 540: #line 3740 "cs-parser.jay" { yyVal = new UnCheckedExpr ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); } break; case 541: #line 3747 "cs-parser.jay" { Expression deref; var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; deref = new Indirection ((Expression) yyVals[-2+yyTop], lt.Location); yyVal = new MemberAccess (deref, lt.Value); } break; case 542: #line 3758 "cs-parser.jay" { start_anonymous (false, (ParametersCompiled) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 543: #line 3762 "cs-parser.jay" { yyVal = end_anonymous ((ToplevelBlock) yyVals[0+yyTop]); } break; case 544: #line 3769 "cs-parser.jay" { yyVal = ParametersCompiled.Undefined; } break; case 546: #line 3777 "cs-parser.jay" { valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; } break; case 547: #line 3781 "cs-parser.jay" { valid_param_mod = 0; yyVal = yyVals[-1+yyTop]; } break; case 548: #line 3789 "cs-parser.jay" { if (RootContext.Version < LanguageVersion.ISO_2) Report.FeatureIsNotAvailable (GetLocation (yyVals[-3+yyTop]), "default value expression"); yyVal = new DefaultValueExpression ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); } break; case 550: #line 3800 "cs-parser.jay" { yyVal = new Unary (Unary.Operator.LogicalNot, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 551: #line 3804 "cs-parser.jay" { yyVal = new Unary (Unary.Operator.OnesComplement, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 553: #line 3812 "cs-parser.jay" { yyVal = new Cast ((FullNamedExpression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-3+yyTop])); } break; case 554: #line 3816 "cs-parser.jay" { yyVal = new Cast ((FullNamedExpression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-3+yyTop])); } break; case 556: #line 3828 "cs-parser.jay" { yyVal = new Unary (Unary.Operator.UnaryPlus, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 557: #line 3832 "cs-parser.jay" { yyVal = new Unary (Unary.Operator.UnaryNegation, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 558: #line 3836 "cs-parser.jay" { yyVal = new UnaryMutator (UnaryMutator.Mode.PreIncrement, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 559: #line 3840 "cs-parser.jay" { yyVal = new UnaryMutator (UnaryMutator.Mode.PreDecrement, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 560: #line 3844 "cs-parser.jay" { yyVal = new Indirection ((Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 561: #line 3848 "cs-parser.jay" { yyVal = new Unary (Unary.Operator.AddressOf, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 563: #line 3856 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.Multiply, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 564: #line 3861 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.Division, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 565: #line 3866 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.Modulus, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 567: #line 3875 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.Addition, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 568: #line 3880 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.Subtraction, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 569: #line 3884 "cs-parser.jay" { /* Shift/Reduce conflict*/ yyVal = new Binary (Binary.Operator.Subtraction, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 570: #line 3889 "cs-parser.jay" { yyVal = new As ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 571: #line 3893 "cs-parser.jay" { yyVal = new Is ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 573: #line 3901 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.LeftShift, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 574: #line 3906 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.RightShift, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 576: #line 3915 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.LessThan, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 577: #line 3920 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.GreaterThan, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 578: #line 3925 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.LessThanOrEqual, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 579: #line 3930 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.GreaterThanOrEqual, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 581: #line 3939 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.Equality, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 582: #line 3944 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.Inequality, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 584: #line 3953 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.BitwiseAnd, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 586: #line 3962 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.ExclusiveOr, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 588: #line 3971 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.BitwiseOr, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 590: #line 3980 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.LogicalAnd, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 592: #line 3989 "cs-parser.jay" { yyVal = new Binary (Binary.Operator.LogicalOr, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 594: #line 3998 "cs-parser.jay" { if (RootContext.Version < LanguageVersion.ISO_2) Report.FeatureIsNotAvailable (GetLocation (yyVals[-1+yyTop]), "null coalescing operator"); yyVal = new Nullable.NullCoalescingOperator ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 596: #line 4009 "cs-parser.jay" { yyVal = new Conditional (new BooleanExpression ((Expression) yyVals[-4+yyTop]), (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); } break; case 597: #line 4016 "cs-parser.jay" { yyVal = new SimpleAssign ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); } break; case 598: #line 4020 "cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.Multiply, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); } break; case 599: #line 4025 "cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.Division, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); } break; case 600: #line 4030 "cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.Modulus, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); } break; case 601: #line 4035 "cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.Addition, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); } break; case 602: #line 4040 "cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.Subtraction, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); } break; case 603: #line 4045 "cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.LeftShift, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); } break; case 604: #line 4050 "cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.RightShift, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); } break; case 605: #line 4055 "cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.BitwiseAnd, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); } break; case 606: #line 4060 "cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.BitwiseOr, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); } break; case 607: #line 4065 "cs-parser.jay" { yyVal = new CompoundAssign ( Binary.Operator.ExclusiveOr, (Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]); } break; case 608: #line 4073 "cs-parser.jay" { var pars = new List<Parameter> (4); pars.Add ((Parameter) yyVals[0+yyTop]); yyVal = pars; } break; case 609: #line 4080 "cs-parser.jay" { var pars = (List<Parameter>) yyVals[-2+yyTop]; Parameter p = (Parameter)yyVals[0+yyTop]; if (pars[0].GetType () != p.GetType ()) { Report.Error (748, p.Location, "All lambda parameters must be typed either explicitly or implicitly"); } pars.Add (p); yyVal = pars; } break; case 610: #line 4094 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new Parameter ((FullNamedExpression) yyVals[-1+yyTop], lt.Value, (Parameter.Modifier) yyVals[-2+yyTop], null, lt.Location); } break; case 611: #line 4100 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new Parameter ((FullNamedExpression) yyVals[-1+yyTop], lt.Value, Parameter.Modifier.NONE, null, lt.Location); } break; case 612: #line 4106 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; yyVal = new ImplicitLambdaParameter (lt.Value, lt.Location); } break; case 613: #line 4113 "cs-parser.jay" { yyVal = ParametersCompiled.EmptyReadOnlyParameters; } break; case 614: #line 4114 "cs-parser.jay" { var pars_list = (List<Parameter>) yyVals[0+yyTop]; yyVal = new ParametersCompiled (compiler, pars_list.ToArray ()); } break; case 615: #line 4121 "cs-parser.jay" { start_block (lexer.Location); } break; case 616: #line 4125 "cs-parser.jay" { Block b = end_block (lexer.Location); b.AddStatement (new ContextualReturn ((Expression) yyVals[0+yyTop])); yyVal = b; } break; case 617: #line 4130 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 618: #line 4137 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; Parameter p = new ImplicitLambdaParameter (lt.Value, lt.Location); start_anonymous (true, new ParametersCompiled (compiler, p), GetLocation (yyVals[-1+yyTop])); } break; case 619: #line 4143 "cs-parser.jay" { yyVal = end_anonymous ((ToplevelBlock) yyVals[0+yyTop]); } break; case 620: #line 4147 "cs-parser.jay" { if (RootContext.Version <= LanguageVersion.ISO_2) Report.FeatureIsNotAvailable (GetLocation (yyVals[0+yyTop]), "lambda expressions"); valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; } break; case 621: #line 4154 "cs-parser.jay" { valid_param_mod = 0; start_anonymous (true, (ParametersCompiled) yyVals[-2+yyTop], GetLocation (yyVals[-4+yyTop])); } break; case 622: #line 4159 "cs-parser.jay" { yyVal = end_anonymous ((ToplevelBlock) yyVals[0+yyTop]); } break; case 629: #line 4181 "cs-parser.jay" { yyVal = new BooleanExpression ((Expression) yyVals[0+yyTop]); } break; case 630: #line 4194 "cs-parser.jay" { lexer.ConstraintsParsing = true; } break; case 631: #line 4198 "cs-parser.jay" { MemberName name = MakeName ((MemberName) yyVals[0+yyTop]); push_current_class (new Class (current_namespace, current_class, name, (Modifiers) yyVals[-4+yyTop], (Attributes) yyVals[-5+yyTop]), yyVals[-3+yyTop]); } break; case 632: #line 4204 "cs-parser.jay" { lexer.ConstraintsParsing = false; current_class.SetParameterInfo ((List<Constraints>) yyVals[0+yyTop]); if (RootContext.Documentation != null) { current_container.DocComment = Lexer.consume_doc_comment (); Lexer.doc_state = XmlCommentState.Allowed; } } break; case 633: #line 4215 "cs-parser.jay" { --lexer.parsing_declaration; if (RootContext.Documentation != null) Lexer.doc_state = XmlCommentState.Allowed; } break; case 634: #line 4221 "cs-parser.jay" { yyVal = pop_current_class (); } break; case 635: #line 4228 "cs-parser.jay" { yyVal = null; } break; case 636: #line 4230 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 637: #line 4234 "cs-parser.jay" { yyVal = (int) 0; } break; case 640: #line 4241 "cs-parser.jay" { var m1 = (Modifiers) yyVals[-1+yyTop]; var m2 = (Modifiers) yyVals[0+yyTop]; if ((m1 & m2) != 0) { Location l = lexer.Location; Report.Error (1004, l, "Duplicate `{0}' modifier", ModifiersExtensions.Name (m2)); } yyVal = m1 | m2; } break; case 641: #line 4255 "cs-parser.jay" { yyVal = Modifiers.NEW; if (current_container == RootContext.ToplevelTypes) Report.Error (1530, GetLocation (yyVals[0+yyTop]), "Keyword `new' is not allowed on namespace elements"); } break; case 642: #line 4260 "cs-parser.jay" { yyVal = Modifiers.PUBLIC; } break; case 643: #line 4261 "cs-parser.jay" { yyVal = Modifiers.PROTECTED; } break; case 644: #line 4262 "cs-parser.jay" { yyVal = Modifiers.INTERNAL; } break; case 645: #line 4263 "cs-parser.jay" { yyVal = Modifiers.PRIVATE; } break; case 646: #line 4264 "cs-parser.jay" { yyVal = Modifiers.ABSTRACT; } break; case 647: #line 4265 "cs-parser.jay" { yyVal = Modifiers.SEALED; } break; case 648: #line 4266 "cs-parser.jay" { yyVal = Modifiers.STATIC; } break; case 649: #line 4267 "cs-parser.jay" { yyVal = Modifiers.READONLY; } break; case 650: #line 4268 "cs-parser.jay" { yyVal = Modifiers.VIRTUAL; } break; case 651: #line 4269 "cs-parser.jay" { yyVal = Modifiers.OVERRIDE; } break; case 652: #line 4270 "cs-parser.jay" { yyVal = Modifiers.EXTERN; } break; case 653: #line 4271 "cs-parser.jay" { yyVal = Modifiers.VOLATILE; } break; case 654: #line 4272 "cs-parser.jay" { yyVal = Modifiers.UNSAFE; } break; case 657: #line 4282 "cs-parser.jay" { current_container.AddBasesForPart (current_class, (List<FullNamedExpression>) yyVals[0+yyTop]); } break; case 658: #line 4288 "cs-parser.jay" { yyVal = null; } break; case 659: #line 4290 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 660: #line 4297 "cs-parser.jay" { var constraints = new List<Constraints> (1); constraints.Add ((Constraints) yyVals[0+yyTop]); yyVal = constraints; } break; case 661: #line 4303 "cs-parser.jay" { var constraints = (List<Constraints>) yyVals[-1+yyTop]; Constraints new_constraint = (Constraints)yyVals[0+yyTop]; foreach (Constraints c in constraints) { if (new_constraint.TypeParameter.Value == c.TypeParameter.Value) { Report.Error (409, new_constraint.Location, "A constraint clause has already been specified for type parameter `{0}'", new_constraint.TypeParameter.Value); } } constraints.Add (new_constraint); yyVal = constraints; } break; case 662: #line 4322 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; yyVal = new Constraints (new SimpleMemberName (lt.Value, lt.Location), (List<FullNamedExpression>) yyVals[0+yyTop], GetLocation (yyVals[-3+yyTop])); } break; case 663: #line 4330 "cs-parser.jay" { var constraints = new List<FullNamedExpression> (1); constraints.Add ((FullNamedExpression) yyVals[0+yyTop]); yyVal = constraints; } break; case 664: #line 4336 "cs-parser.jay" { var constraints = (List<FullNamedExpression>) yyVals[-2+yyTop]; var prev = constraints [constraints.Count - 1] as SpecialContraintExpr; if (prev != null && (prev.Constraint & SpecialConstraint.Constructor) != 0) { Report.Error (401, GetLocation (yyVals[-1+yyTop]), "The `new()' constraint must be the last constraint specified"); } prev = yyVals[0+yyTop] as SpecialContraintExpr; if (prev != null) { if ((prev.Constraint & (SpecialConstraint.Class | SpecialConstraint.Struct)) != 0) { Report.Error (449, prev.Location, "The `class' or `struct' constraint must be the first constraint specified"); } else { prev = constraints [0] as SpecialContraintExpr; if (prev != null && (prev.Constraint & SpecialConstraint.Struct) != 0) { Report.Error (451, GetLocation (yyVals[0+yyTop]), "The `new()' constraint cannot be used with the `struct' constraint"); } } } constraints.Add ((FullNamedExpression) yyVals[0+yyTop]); yyVal = constraints; } break; case 665: #line 4362 "cs-parser.jay" { if (yyVals[0+yyTop] is ComposedCast) Report.Error (706, GetLocation (yyVals[0+yyTop]), "Invalid constraint type `{0}'", ((ComposedCast)yyVals[0+yyTop]).GetSignatureForError ()); yyVal = yyVals[0+yyTop]; } break; case 666: #line 4369 "cs-parser.jay" { yyVal = new SpecialContraintExpr (SpecialConstraint.Constructor, GetLocation (yyVals[-2+yyTop])); } break; case 667: #line 4373 "cs-parser.jay" { yyVal = new SpecialContraintExpr (SpecialConstraint.Class, GetLocation (yyVals[0+yyTop])); } break; case 668: #line 4377 "cs-parser.jay" { yyVal = new SpecialContraintExpr (SpecialConstraint.Struct, GetLocation (yyVals[0+yyTop])); } break; case 669: #line 4384 "cs-parser.jay" { yyVal = Variance.None; } break; case 670: #line 4388 "cs-parser.jay" { if (RootContext.MetadataCompatibilityVersion < MetadataVersion.v2) Report.FeatureIsNotSupported (lexer.Location, "generic type variance"); else if (RootContext.Version <= LanguageVersion.V_3) Report.FeatureIsNotAvailable (lexer.Location, "generic type variance"); yyVal = yyVals[0+yyTop]; } break; case 671: #line 4400 "cs-parser.jay" { yyVal = Variance.Covariant; } break; case 672: #line 4404 "cs-parser.jay" { yyVal = Variance.Contravariant; } break; case 673: #line 4424 "cs-parser.jay" { ++lexer.parsing_block; start_block (GetLocation (yyVals[0+yyTop])); } break; case 674: #line 4429 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 675: #line 4436 "cs-parser.jay" { --lexer.parsing_block; yyVal = end_block (GetLocation (yyVals[0+yyTop])); } break; case 676: #line 4441 "cs-parser.jay" { --lexer.parsing_block; yyVal = end_block (lexer.Location); } break; case 677: #line 4450 "cs-parser.jay" { ++lexer.parsing_block; current_block.StartLocation = GetLocation (yyVals[0+yyTop]); } break; case 678: #line 4455 "cs-parser.jay" { --lexer.parsing_block; yyVal = end_block (GetLocation (yyVals[0+yyTop])); } break; case 683: #line 4473 "cs-parser.jay" { if (yyVals[0+yyTop] != null && (Block) yyVals[0+yyTop] != current_block){ current_block.AddStatement ((Statement) yyVals[0+yyTop]); current_block = (Block) yyVals[0+yyTop]; } } break; case 684: #line 4480 "cs-parser.jay" { current_block.AddStatement ((Statement) yyVals[0+yyTop]); } break; case 688: #line 4499 "cs-parser.jay" { if (yyVals[0+yyTop] != null && (Block) yyVals[0+yyTop] != current_block){ current_block.AddStatement ((Statement) yyVals[0+yyTop]); current_block = (Block) yyVals[0+yyTop]; } } break; case 689: #line 4506 "cs-parser.jay" { current_block.AddStatement ((Statement) yyVals[0+yyTop]); } break; case 718: #line 4547 "cs-parser.jay" { Report.Error (1023, GetLocation (yyVals[0+yyTop]), "An embedded statement may not be a declaration or labeled statement"); yyVal = null; } break; case 719: #line 4552 "cs-parser.jay" { Report.Error (1023, GetLocation (yyVals[0+yyTop]), "An embedded statement may not be a declaration or labeled statement"); yyVal = null; } break; case 720: #line 4560 "cs-parser.jay" { yyVal = new EmptyStatement (GetLocation (yyVals[0+yyTop])); } break; case 721: #line 4567 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; LabeledStatement labeled = new LabeledStatement (lt.Value, lt.Location); if (current_block.AddLabel (labeled)) current_block.AddStatement (labeled); } break; case 723: #line 4579 "cs-parser.jay" { if (yyVals[-1+yyTop] != null){ var de = (Tuple<FullNamedExpression, List<object>>) yyVals[-1+yyTop]; yyVal = declare_local_variables (de.Item1, de.Item2, de.Item1.Location); } } break; case 724: #line 4587 "cs-parser.jay" { if (yyVals[-1+yyTop] != null){ var de = (Tuple<FullNamedExpression, List<object>>) yyVals[-1+yyTop]; yyVal = declare_local_constants (de.Item1, de.Item2); } } break; case 725: #line 4604 "cs-parser.jay" { /* FIXME: Do something smart here regarding the composition of the type.*/ /* Ok, the above "primary_expression" is there to get rid of*/ /* both reduce/reduce and shift/reduces in the grammar, it should*/ /* really just be "type_name". If you use type_name, a reduce/reduce*/ /* creeps up. If you use namespace_or_type_name (which is all we need*/ /* really) two shift/reduces appear.*/ /* */ /* So the super-trick is that primary_expression*/ /* can only be either a SimpleName or a MemberAccess. */ /* The MemberAccess case arises when you have a fully qualified type-name like :*/ /* Foo.Bar.Blah i;*/ /* SimpleName is when you have*/ /* Blah i;*/ Expression expr = (Expression) yyVals[-1+yyTop]; string rank_or_nullable = (string) yyVals[0+yyTop]; if (expr is ComposedCast){ yyVal = new ComposedCast ((ComposedCast)expr, rank_or_nullable); } else if (expr is ATypeNameExpression){ /**/ /* So we extract the string corresponding to the SimpleName*/ /* or MemberAccess*/ /**/ if (rank_or_nullable.Length == 0) { SimpleName sn = expr as SimpleName; if (sn != null && sn.Name == "var") yyVal = new VarExpr (sn.Location); else yyVal = yyVals[-1+yyTop]; } else { yyVal = new ComposedCast ((ATypeNameExpression)expr, rank_or_nullable); } } else { Error_ExpectingTypeName (expr); yyVal = TypeManager.system_object_expr; } } break; case 726: #line 4646 "cs-parser.jay" { if ((string) yyVals[0+yyTop] == "") yyVal = yyVals[-1+yyTop]; else yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (string) yyVals[0+yyTop], lexer.Location); } break; case 727: #line 4653 "cs-parser.jay" { Expression.Error_VoidInvalidInTheContext (GetLocation (yyVals[-1+yyTop]), Report); yyVal = TypeManager.system_void_expr; } break; case 728: #line 4661 "cs-parser.jay" { ATypeNameExpression expr = yyVals[-1+yyTop] as ATypeNameExpression; if (expr != null) { yyVal = new ComposedCast (expr, "*"); } else { Error_ExpectingTypeName ((Expression)yyVals[-1+yyTop]); yyVal = expr; } } break; case 729: #line 4672 "cs-parser.jay" { yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], "*", GetLocation (yyVals[-1+yyTop])); } break; case 730: #line 4676 "cs-parser.jay" { yyVal = new ComposedCast (TypeManager.system_void_expr, "*", GetLocation (yyVals[-1+yyTop])); } break; case 731: #line 4680 "cs-parser.jay" { yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], "*"); } break; case 733: #line 4688 "cs-parser.jay" { if (yyVals[-1+yyTop] != null){ string rank = (string)yyVals[0+yyTop]; if (rank == "") yyVal = yyVals[-1+yyTop]; else yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], rank); } else { yyVal = null; } } break; case 734: #line 4704 "cs-parser.jay" { if (yyVals[-1+yyTop] != null) { VarExpr ve = yyVals[-1+yyTop] as VarExpr; if (ve != null) { if (!((VariableDeclaration) ((List<object>)yyVals[0+yyTop]) [0]).HasInitializer) ve.VariableInitializersCount = 0; else ve.VariableInitializersCount = ((List<object>)yyVals[0+yyTop]).Count; } yyVal = new Tuple<FullNamedExpression, List<object>> ((FullNamedExpression) yyVals[-1+yyTop], (List<object>) yyVals[0+yyTop]); } else yyVal = null; } break; case 735: #line 4722 "cs-parser.jay" { if (yyVals[-1+yyTop] != null) yyVal = new Tuple<FullNamedExpression, List<object>> ((FullNamedExpression) yyVals[-1+yyTop], (List<object>) yyVals[0+yyTop]); else yyVal = null; } break; case 736: #line 4731 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; case 737: #line 4732 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; case 738: #line 4736 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; case 739: #line 4737 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; case 740: #line 4746 "cs-parser.jay" { ExpressionStatement s = yyVals[0+yyTop] as ExpressionStatement; if (s == null) { Expression.Error_InvalidExpressionStatement (Report, GetLocation (yyVals[0+yyTop])); s = EmptyExpressionStatement.Instance; } yyVal = new StatementExpression (s); } break; case 741: #line 4756 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = null; } break; case 742: #line 4764 "cs-parser.jay" { Expression expr = (Expression) yyVals[0+yyTop]; ExpressionStatement s; s = new OptionalAssign (new SimpleName ("$retval", lexer.Location), expr, lexer.Location); yyVal = new StatementExpression (s); } break; case 743: #line 4772 "cs-parser.jay" { Error_SyntaxError (yyToken); yyVal = new EmptyStatement (GetLocation (yyVals[0+yyTop])); } break; case 746: #line 4786 "cs-parser.jay" { if (yyVals[0+yyTop] is EmptyStatement) Report.Warning (642, 3, GetLocation (yyVals[0+yyTop]), "Possible mistaken empty statement"); yyVal = new If ((BooleanExpression) yyVals[-2+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop])); } break; case 747: #line 4794 "cs-parser.jay" { yyVal = new If ((BooleanExpression) yyVals[-4+yyTop], (Statement) yyVals[-2+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-6+yyTop])); if (yyVals[-2+yyTop] is EmptyStatement) Report.Warning (642, 3, GetLocation (yyVals[-2+yyTop]), "Possible mistaken empty statement"); if (yyVals[0+yyTop] is EmptyStatement) Report.Warning (642, 3, GetLocation (yyVals[0+yyTop]), "Possible mistaken empty statement"); } break; case 748: #line 4806 "cs-parser.jay" { if (switch_stack == null) switch_stack = new Stack<Block> (2); switch_stack.Push (current_block); } break; case 749: #line 4813 "cs-parser.jay" { yyVal = new Switch ((Expression) yyVals[-2+yyTop], (List<SwitchSection>) yyVals[0+yyTop], GetLocation (yyVals[-5+yyTop])); current_block = (Block) switch_stack.Pop (); } break; case 750: #line 4823 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; case 751: #line 4830 "cs-parser.jay" { Report.Warning (1522, 1, lexer.Location, "Empty switch block"); yyVal = new List<SwitchSection> (); } break; case 753: #line 4839 "cs-parser.jay" { var sections = new List<SwitchSection> (4); sections.Add ((SwitchSection) yyVals[0+yyTop]); yyVal = sections; } break; case 754: #line 4846 "cs-parser.jay" { var sections = (List<SwitchSection>) yyVals[-1+yyTop]; sections.Add ((SwitchSection) yyVals[0+yyTop]); yyVal = sections; } break; case 755: #line 4856 "cs-parser.jay" { current_block = current_block.CreateSwitchBlock (lexer.Location); } break; case 756: #line 4860 "cs-parser.jay" { yyVal = new SwitchSection ((List<SwitchLabel>) yyVals[-2+yyTop], current_block.Explicit); } break; case 757: #line 4867 "cs-parser.jay" { var labels = new List<SwitchLabel> (4); labels.Add ((SwitchLabel) yyVals[0+yyTop]); yyVal = labels; } break; case 758: #line 4874 "cs-parser.jay" { var labels = (List<SwitchLabel>) (yyVals[-1+yyTop]); labels.Add ((SwitchLabel) yyVals[0+yyTop]); yyVal = labels; } break; case 759: #line 4884 "cs-parser.jay" { yyVal = new SwitchLabel ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); } break; case 760: #line 4888 "cs-parser.jay" { yyVal = new SwitchLabel (null, GetLocation (yyVals[0+yyTop])); } break; case 765: #line 4902 "cs-parser.jay" { Location l = GetLocation (yyVals[-4+yyTop]); yyVal = new While ((BooleanExpression) yyVals[-2+yyTop], (Statement) yyVals[0+yyTop], l); } break; case 766: #line 4911 "cs-parser.jay" { Location l = GetLocation (yyVals[-6+yyTop]); yyVal = new Do ((Statement) yyVals[-5+yyTop], (BooleanExpression) yyVals[-2+yyTop], l); } break; case 767: #line 4920 "cs-parser.jay" { Location l = lexer.Location; start_block (l); Block assign_block = current_block; if (yyVals[-1+yyTop] is Tuple<FullNamedExpression, List<object>>){ var de = (Tuple<FullNamedExpression, List<object>>) yyVals[-1+yyTop]; var type = de.Item1; foreach (VariableDeclaration decl in de.Item2){ LocalInfo vi; vi = current_block.AddVariable (type, decl.identifier, decl.Location); if (vi == null) continue; Expression expr = decl.GetInitializer (type); LocalVariableReference var; var = new LocalVariableReference (assign_block, decl.identifier, l); if (expr != null) { Assign a = new SimpleAssign (var, expr, decl.Location); assign_block.AddStatement (new StatementExpression (a)); } } /* Note: the $$ below refers to the value of this code block, not of the LHS non-terminal.*/ /* This can be referred to as $5 below.*/ yyVal = null; } else { yyVal = yyVals[-1+yyTop]; } } break; case 768: #line 4960 "cs-parser.jay" { Location l = GetLocation (yyVals[-9+yyTop]); For f = new For ((Statement) yyVals[-5+yyTop], (BooleanExpression) yyVals[-4+yyTop], (Statement) yyVals[-2+yyTop], (Statement) yyVals[0+yyTop], l); current_block.AddStatement (f); yyVal = end_block (lexer.Location); } break; case 769: #line 4972 "cs-parser.jay" { yyVal = new EmptyStatement (lexer.Location); } break; case 773: #line 4982 "cs-parser.jay" { yyVal = null; } break; case 775: #line 4987 "cs-parser.jay" { yyVal = new EmptyStatement (lexer.Location); } break; case 778: #line 4997 "cs-parser.jay" { /* CHANGE: was `null'*/ Statement s = (Statement) yyVals[0+yyTop]; Block b = new Block (current_block, s.loc, lexer.Location); b.AddStatement (s); yyVal = b; } break; case 779: #line 5006 "cs-parser.jay" { Block b = (Block) yyVals[-2+yyTop]; b.AddStatement ((Statement) yyVals[0+yyTop]); yyVal = yyVals[-2+yyTop]; } break; case 780: #line 5016 "cs-parser.jay" { Report.Error (230, GetLocation (yyVals[-5+yyTop]), "Type and identifier are both required in a foreach statement"); yyVal = null; } break; case 781: #line 5022 "cs-parser.jay" { start_block (lexer.Location); Block foreach_block = current_block; var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; Location l = lt.Location; LocalInfo vi = foreach_block.AddVariable ((Expression) yyVals[-4+yyTop], lt.Value, l); if (vi != null) { vi.SetReadOnlyContext (LocalInfo.ReadOnlyContext.Foreach); /* Get a writable reference to this read-only variable.*/ /**/ /* Note that the $$ here refers to the value of _this_ code block,*/ /* not the value of the LHS non-terminal. This can be referred to as $8 below.*/ yyVal = new LocalVariableReference (foreach_block, lt.Value, l, vi, false); } else { yyVal = null; } } break; case 782: #line 5042 "cs-parser.jay" { LocalVariableReference v = (LocalVariableReference) yyVals[-1+yyTop]; Location l = GetLocation (yyVals[-8+yyTop]); if (v != null) { Foreach f = new Foreach ((Expression) yyVals[-6+yyTop], v, (Expression) yyVals[-3+yyTop], (Statement) yyVals[0+yyTop], l); current_block.AddStatement (f); } yyVal = end_block (lexer.Location); } break; case 789: #line 5066 "cs-parser.jay" { yyVal = new Break (GetLocation (yyVals[-1+yyTop])); } break; case 790: #line 5073 "cs-parser.jay" { yyVal = new Continue (GetLocation (yyVals[-1+yyTop])); } break; case 791: #line 5080 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop]; yyVal = new Goto (lt.Value, lt.Location); } break; case 792: #line 5085 "cs-parser.jay" { yyVal = new GotoCase ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-3+yyTop])); } break; case 793: #line 5089 "cs-parser.jay" { yyVal = new GotoDefault (GetLocation (yyVals[-2+yyTop])); } break; case 794: #line 5096 "cs-parser.jay" { yyVal = new Return ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); } break; case 795: #line 5103 "cs-parser.jay" { yyVal = new Throw ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); } break; case 796: #line 5110 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; string s = lt.Value; if (s != "yield"){ Report.Error (1003, lt.Location, "; expected"); yyVal = null; } if (RootContext.Version == LanguageVersion.ISO_1){ Report.FeatureIsNotAvailable (lt.Location, "yield statement"); yyVal = null; } current_block.Toplevel.IsIterator = true; yyVal = new Yield ((Expression) yyVals[-1+yyTop], lt.Location); } break; case 797: #line 5125 "cs-parser.jay" { Report.Error (1627, GetLocation (yyVals[-1+yyTop]), "Expression expected after yield return"); yyVal = null; } break; case 798: #line 5130 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; string s = lt.Value; if (s != "yield"){ Report.Error (1003, lt.Location, "; expected"); yyVal = null; } if (RootContext.Version == LanguageVersion.ISO_1){ Report.FeatureIsNotAvailable (lt.Location, "yield statement"); yyVal = null; } current_block.Toplevel.IsIterator = true; yyVal = new YieldBreak (lt.Location); } break; case 801: #line 5154 "cs-parser.jay" { yyVal = new TryCatch ((Block) yyVals[-1+yyTop], (List<Catch>) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop]), false); } break; case 802: #line 5158 "cs-parser.jay" { yyVal = new TryFinally ((Statement) yyVals[-2+yyTop], (Block) yyVals[0+yyTop], GetLocation (yyVals[-3+yyTop])); } break; case 803: #line 5162 "cs-parser.jay" { yyVal = new TryFinally (new TryCatch ((Block) yyVals[-3+yyTop], (List<Catch>) yyVals[-2+yyTop], GetLocation (yyVals[-4+yyTop]), true), (Block) yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop])); } break; case 804: #line 5166 "cs-parser.jay" { Report.Error (1524, GetLocation (yyVals[-2+yyTop]), "Expected catch or finally"); yyVal = null; } break; case 805: #line 5174 "cs-parser.jay" { var l = new List<Catch> (2); l.Add ((Catch) yyVals[0+yyTop]); yyVal = l; } break; case 806: #line 5181 "cs-parser.jay" { var l = (List<Catch>) yyVals[-1+yyTop]; Catch c = (Catch) yyVals[0+yyTop]; if (l [0].IsGeneral) { Report.Error (1017, c.loc, "Try statement already has an empty catch block"); } else { if (c.IsGeneral) l.Insert (0, c); else l.Add (c); } yyVal = l; } break; case 807: #line 5199 "cs-parser.jay" { yyVal = null; } break; case 809: #line 5205 "cs-parser.jay" { if (yyVals[0+yyTop] != null) { var cc = (Tuple<FullNamedExpression, Tokenizer.LocatedToken>) yyVals[0+yyTop]; var lt = cc.Item2; if (lt != null){ List<object> one = new List<object> (1); one.Add (new VariableDeclaration (lt, null)); start_block (lexer.Location); current_block = declare_local_variables (cc.Item1, one, lt.Location); } } } break; case 810: #line 5219 "cs-parser.jay" { Expression type = null; string id = null; Block var_block = null; if (yyVals[-2+yyTop] != null){ var cc = (Tuple<FullNamedExpression, Tokenizer.LocatedToken>) yyVals[-2+yyTop]; type = cc.Item1; var lt = cc.Item2; if (lt != null){ id = lt.Value; var_block = end_block (lexer.Location); } } yyVal = new Catch (type, id, (Block) yyVals[0+yyTop], var_block, ((Block) yyVals[0+yyTop]).loc); } break; case 811: #line 5240 "cs-parser.jay" { yyVal = null; } break; case 813: #line 5246 "cs-parser.jay" { yyVal = new Tuple<FullNamedExpression, Tokenizer.LocatedToken> ((FullNamedExpression)yyVals[-2+yyTop], (Tokenizer.LocatedToken) yyVals[-1+yyTop]); } break; case 814: #line 5250 "cs-parser.jay" { Report.Error (1015, GetLocation (yyVals[-1+yyTop]), "A type that derives from `System.Exception', `object', or `string' expected"); yyVal = null; } break; case 815: #line 5258 "cs-parser.jay" { yyVal = new Checked ((Block) yyVals[0+yyTop]); } break; case 816: #line 5265 "cs-parser.jay" { yyVal = new Unchecked ((Block) yyVals[0+yyTop]); } break; case 817: #line 5272 "cs-parser.jay" { RootContext.CheckUnsafeOption (GetLocation (yyVals[0+yyTop]), Report); } break; case 818: #line 5274 "cs-parser.jay" { yyVal = new Unsafe ((Block) yyVals[0+yyTop]); } break; case 819: #line 5283 "cs-parser.jay" { start_block (lexer.Location); } break; case 820: #line 5287 "cs-parser.jay" { Expression type = (Expression) yyVals[-4+yyTop]; var list = (List<KeyValuePair<Tokenizer.LocatedToken, Expression>>) yyVals[-3+yyTop]; Fixed f = new Fixed (type, list.ConvertAll (i => { var v = new KeyValuePair<LocalInfo, Expression> (current_block.AddVariable (type, i.Key.Value, i.Key.Location), i.Value); if (v.Key != null) { v.Key.SetReadOnlyContext (LocalInfo.ReadOnlyContext.Fixed); v.Key.Pinned = true; } return v; }), (Statement) yyVals[0+yyTop], GetLocation (yyVals[-6+yyTop])); current_block.AddStatement (f); yyVal = end_block (lexer.Location); } break; case 821: #line 5307 "cs-parser.jay" { var declarators = new List<KeyValuePair<Tokenizer.LocatedToken, Expression>> (2); if (yyVals[0+yyTop] != null) declarators.Add ((KeyValuePair<Tokenizer.LocatedToken, Expression>)yyVals[0+yyTop]); yyVal = declarators; } break; case 822: #line 5314 "cs-parser.jay" { var declarators = (List<KeyValuePair<Tokenizer.LocatedToken, Expression>>) yyVals[-2+yyTop]; if (yyVals[0+yyTop] != null) declarators.Add ((KeyValuePair<Tokenizer.LocatedToken, Expression>)yyVals[0+yyTop]); yyVal = declarators; } break; case 823: #line 5324 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; yyVal = new KeyValuePair<Tokenizer.LocatedToken, Expression> (lt, (Expression) yyVals[0+yyTop]); } break; case 824: #line 5329 "cs-parser.jay" { Report.Error (210, ((Tokenizer.LocatedToken) yyVals[0+yyTop]).Location, "You must provide an initializer in a fixed or using statement declaration"); yyVal = null; } break; case 825: #line 5337 "cs-parser.jay" { /**/ } break; case 826: #line 5341 "cs-parser.jay" { yyVal = new Lock ((Expression) yyVals[-3+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-5+yyTop])); } break; case 827: #line 5348 "cs-parser.jay" { start_block (lexer.Location); Block assign_block = current_block; var de = (Tuple<FullNamedExpression, List<object>>) yyVals[-1+yyTop]; Location l = GetLocation (yyVals[-3+yyTop]); var vars = new Stack<Tuple<LocalVariableReference, Expression>> (); foreach (VariableDeclaration decl in de.Item2) { LocalInfo vi = current_block.AddVariable (de.Item1, decl.identifier, decl.Location); if (vi == null) continue; vi.SetReadOnlyContext (LocalInfo.ReadOnlyContext.Using); Expression expr = decl.GetInitializer (de.Item1); if (expr == null) { Report.Error (210, l, "You must provide an initializer in a fixed or using statement declaration"); continue; } LocalVariableReference var; /* Get a writable reference to this read-only variable.*/ var = new LocalVariableReference (assign_block, decl.identifier, l, vi, false); /* This is so that it is not a warning on using variables*/ vi.Used = true; vars.Push (new Tuple<LocalVariableReference, Expression> (var, expr)); /* Assign a = new SimpleAssign (var, expr, decl.Location);*/ /* assign_block.AddStatement (new StatementExpression (a));*/ } /* Note: the $$ here refers to the value of this code block and not of the LHS non-terminal.*/ /* It can be referred to as $5 below.*/ yyVal = vars; } break; case 828: #line 5387 "cs-parser.jay" { Statement stmt = (Statement) yyVals[0+yyTop]; var vars = (Stack<Tuple<LocalVariableReference, Expression>>) yyVals[-1+yyTop]; Location l = GetLocation (yyVals[-5+yyTop]); while (vars.Count > 0) { var de = vars.Pop (); stmt = new Using (de.Item1, de.Item2, stmt, l); } current_block.AddStatement (stmt); yyVal = end_block (lexer.Location); } break; case 829: #line 5400 "cs-parser.jay" { start_block (lexer.Location); } break; case 830: #line 5404 "cs-parser.jay" { current_block.AddStatement (new UsingTemporary ((Expression) yyVals[-3+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-5+yyTop]))); yyVal = end_block (lexer.Location); } break; case 831: #line 5415 "cs-parser.jay" { lexer.query_parsing = false; Linq.AQueryClause from = yyVals[-1+yyTop] as Linq.AQueryClause; from.Tail.Next = (Linq.AQueryClause)yyVals[0+yyTop]; yyVal = from; current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; } break; case 832: #line 5427 "cs-parser.jay" { Linq.AQueryClause from = yyVals[-1+yyTop] as Linq.AQueryClause; from.Tail.Next = (Linq.AQueryClause)yyVals[0+yyTop]; yyVal = from; current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; } break; case 833: #line 5438 "cs-parser.jay" { lexer.query_parsing = false; yyVal = yyVals[-1+yyTop]; current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; } break; case 834: #line 5445 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; } break; case 835: #line 5454 "cs-parser.jay" { yyVal = new Linq.QueryExpression (current_block, new Linq.QueryStartClause ((Expression)yyVals[0+yyTop])); var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; current_block = new Linq.QueryBlock (compiler, current_block, new SimpleMemberName (lt.Value, lt.Location), GetLocation (yyVals[-3+yyTop])); } break; case 836: #line 5460 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; yyVal = new Linq.QueryExpression (current_block, new Linq.Cast ((FullNamedExpression)yyVals[-3+yyTop], (Expression)yyVals[0+yyTop])); current_block = new Linq.QueryBlock (compiler, current_block, new SimpleMemberName (lt.Value, lt.Location), GetLocation (yyVals[-4+yyTop])); } break; case 837: #line 5469 "cs-parser.jay" { yyVal = new Linq.QueryExpression (current_block, new Linq.QueryStartClause ((Expression)yyVals[0+yyTop])); var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; current_block = new Linq.QueryBlock (compiler, current_block, new SimpleMemberName (lt.Value, lt.Location), GetLocation (yyVals[-3+yyTop])); } break; case 838: #line 5475 "cs-parser.jay" { yyVal = new Linq.QueryExpression (current_block, new Linq.Cast ((FullNamedExpression)yyVals[-3+yyTop], (Expression)yyVals[0+yyTop])); var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop]; current_block = new Linq.QueryBlock (compiler, current_block, new SimpleMemberName (lt.Value, lt.Location), GetLocation (yyVals[-4+yyTop])); } break; case 839: #line 5484 "cs-parser.jay" { current_block = new Linq.QueryBlock (compiler, current_block, GetLocation (yyVals[-2+yyTop])); } break; case 840: #line 5488 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; var sn = new SimpleMemberName (lt.Value, lt.Location); yyVal = new Linq.SelectMany (current_block.Toplevel, sn, (Expression)yyVals[0+yyTop]); current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; ((Linq.QueryBlock)current_block).AddTransparentParameter (compiler, sn); } break; case 841: #line 5499 "cs-parser.jay" { current_block = new Linq.QueryBlock (compiler, current_block, GetLocation (yyVals[-3+yyTop])); } break; case 842: #line 5503 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; var sn = new SimpleMemberName (lt.Value, lt.Location); FullNamedExpression type = (FullNamedExpression)yyVals[-4+yyTop]; yyVal = new Linq.SelectMany (current_block.Toplevel, sn, new Linq.Cast (type, (FullNamedExpression)yyVals[0+yyTop])); current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; ((Linq.QueryBlock)current_block).AddTransparentParameter (compiler, sn); } break; case 843: #line 5520 "cs-parser.jay" { Linq.AQueryClause head = (Linq.AQueryClause)yyVals[-1+yyTop]; if (yyVals[0+yyTop] != null) head.Next = (Linq.AQueryClause)yyVals[0+yyTop]; if (yyVals[-2+yyTop] != null) { Linq.AQueryClause clause = (Linq.AQueryClause)yyVals[-2+yyTop]; clause.Tail.Next = head; head = clause; } yyVal = head; } break; case 845: #line 5539 "cs-parser.jay" { current_block = new Linq.QueryBlock (compiler, current_block, lexer.Location); } break; case 846: #line 5543 "cs-parser.jay" { yyVal = new Linq.Select (current_block.Toplevel, (Expression)yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; } break; case 847: #line 5550 "cs-parser.jay" { if (linq_clause_blocks == null) linq_clause_blocks = new Stack<Block> (); current_block = new Linq.QueryBlock (compiler, current_block, lexer.Location); linq_clause_blocks.Push (current_block); } break; case 848: #line 5558 "cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; current_block = new Linq.QueryBlock (compiler, current_block, lexer.Location); } break; case 849: #line 5565 "cs-parser.jay" { yyVal = new Linq.GroupBy (current_block.Toplevel, (Expression)yyVals[-3+yyTop], (ToplevelBlock) linq_clause_blocks.Pop (), (Expression)yyVals[0+yyTop], GetLocation (yyVals[-5+yyTop])); current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; } break; case 853: #line 5581 "cs-parser.jay" { ((Linq.AQueryClause)yyVals[-1+yyTop]).Tail.Next = (Linq.AQueryClause)yyVals[0+yyTop]; yyVal = yyVals[-1+yyTop]; } break; case 859: #line 5597 "cs-parser.jay" { current_block = new Linq.QueryBlock (compiler, current_block, GetLocation (yyVals[-2+yyTop])); } break; case 860: #line 5601 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop]; var sn = new SimpleMemberName (lt.Value, lt.Location); yyVal = new Linq.Let (current_block.Toplevel, current_container, sn, (Expression)yyVals[0+yyTop]); current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; ((Linq.QueryBlock)current_block).AddTransparentParameter (compiler, sn); } break; case 861: #line 5615 "cs-parser.jay" { current_block = new Linq.QueryBlock (compiler, current_block, lexer.Location); } break; case 862: #line 5619 "cs-parser.jay" { yyVal = new Linq.Where (current_block.Toplevel, (BooleanExpression)yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; } break; case 863: #line 5629 "cs-parser.jay" { if (linq_clause_blocks == null) linq_clause_blocks = new Stack<Block> (); current_block = new Linq.QueryBlock (compiler, current_block, lexer.Location); linq_clause_blocks.Push (current_block); } break; case 864: #line 5637 "cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; current_block = new Linq.QueryBlock (compiler, current_block, lexer.Location); linq_clause_blocks.Push (current_block); } break; case 865: #line 5645 "cs-parser.jay" { current_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop])); current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; var lt = (Tokenizer.LocatedToken) yyVals[-7+yyTop]; current_block = new Linq.QueryBlock (compiler, current_block, new SimpleMemberName (lt.Value, lt.Location), lexer.Location); } break; case 866: #line 5654 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-10+yyTop]; var sn = new SimpleMemberName (lt.Value, lt.Location); SimpleMemberName sn2 = null; ToplevelBlock outer_selector = (ToplevelBlock) linq_clause_blocks.Pop (); ToplevelBlock block = (ToplevelBlock) linq_clause_blocks.Pop (); if (yyVals[0+yyTop] == null) { yyVal = new Linq.Join (block, sn, (Expression)yyVals[-7+yyTop], outer_selector, current_block.Toplevel, GetLocation (yyVals[-11+yyTop])); } else { var lt2 = (Tokenizer.LocatedToken) yyVals[0+yyTop]; sn2 = new SimpleMemberName (lt2.Value, lt2.Location); yyVal = new Linq.GroupJoin (block, sn, (Expression)yyVals[-7+yyTop], outer_selector, current_block.Toplevel, sn2, GetLocation (yyVals[-11+yyTop])); } current_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop])); current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; if (sn2 == null) ((Linq.QueryBlock)current_block).AddTransparentParameter (compiler, sn); else ((Linq.QueryBlock)current_block).AddTransparentParameter (compiler, sn2); } break; case 867: #line 5681 "cs-parser.jay" { if (linq_clause_blocks == null) linq_clause_blocks = new Stack<Block> (); current_block = new Linq.QueryBlock (compiler, current_block, lexer.Location); linq_clause_blocks.Push (current_block); } break; case 868: #line 5689 "cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; current_block = new Linq.QueryBlock (compiler, current_block, lexer.Location); linq_clause_blocks.Push (current_block); } break; case 869: #line 5697 "cs-parser.jay" { current_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop])); current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; var lt = (Tokenizer.LocatedToken) yyVals[-7+yyTop]; current_block = new Linq.QueryBlock (compiler, current_block, new SimpleMemberName (lt.Value, lt.Location), lexer.Location); } break; case 870: #line 5706 "cs-parser.jay" { var lt = (Tokenizer.LocatedToken) yyVals[-10+yyTop]; var sn = new SimpleMemberName (lt.Value, lt.Location); SimpleMemberName sn2 = null; ToplevelBlock outer_selector = (ToplevelBlock) linq_clause_blocks.Pop (); ToplevelBlock block = (ToplevelBlock) linq_clause_blocks.Pop (); Linq.Cast cast = new Linq.Cast ((FullNamedExpression)yyVals[-11+yyTop], (Expression)yyVals[-7+yyTop]); if (yyVals[0+yyTop] == null) { yyVal = new Linq.Join (block, sn, cast, outer_selector, current_block.Toplevel, GetLocation (yyVals[-12+yyTop])); } else { var lt2 = (Tokenizer.LocatedToken) yyVals[0+yyTop]; sn2 = new SimpleMemberName (lt2.Value, lt2.Location); yyVal = new Linq.GroupJoin (block, sn, cast, outer_selector, current_block.Toplevel, sn2, GetLocation (yyVals[-12+yyTop])); } current_block.AddStatement (new ContextualReturn ((Expression) yyVals[-1+yyTop])); current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; if (sn2 == null) ((Linq.QueryBlock)current_block).AddTransparentParameter (compiler, sn); else ((Linq.QueryBlock)current_block).AddTransparentParameter (compiler, sn2); } break; case 872: #line 5737 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 873: #line 5744 "cs-parser.jay" { current_block = new Linq.QueryBlock (compiler, current_block, lexer.Location); } break; case 874: #line 5748 "cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; yyVal = yyVals[0+yyTop]; } break; case 876: #line 5759 "cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; current_block = new Linq.QueryBlock (compiler, current_block, lexer.Location); } break; case 877: #line 5766 "cs-parser.jay" { ((Linq.AQueryClause)yyVals[-3+yyTop]).Next = (Linq.AQueryClause)yyVals[0+yyTop]; yyVal = yyVals[-3+yyTop]; } break; case 879: #line 5775 "cs-parser.jay" { current_block.SetEndLocation (lexer.Location); current_block = current_block.Parent; current_block = new Linq.QueryBlock (compiler, current_block, lexer.Location); } break; case 880: #line 5782 "cs-parser.jay" { ((Linq.AQueryClause)yyVals[-3+yyTop]).Tail.Next = (Linq.AQueryClause)yyVals[-1+yyTop]; yyVal = yyVals[-3+yyTop]; } break; case 881: #line 5790 "cs-parser.jay" { yyVal = new Linq.OrderByAscending (current_block.Toplevel, (Expression)yyVals[0+yyTop]); } break; case 882: #line 5794 "cs-parser.jay" { yyVal = new Linq.OrderByAscending (current_block.Toplevel, (Expression)yyVals[-1+yyTop]); } break; case 883: #line 5798 "cs-parser.jay" { yyVal = new Linq.OrderByDescending (current_block.Toplevel, (Expression)yyVals[-1+yyTop]); } break; case 884: #line 5805 "cs-parser.jay" { yyVal = new Linq.ThenByAscending (current_block.Toplevel, (Expression)yyVals[0+yyTop]); } break; case 885: #line 5809 "cs-parser.jay" { yyVal = new Linq.ThenByAscending (current_block.Toplevel, (Expression)yyVals[-1+yyTop]); } break; case 886: #line 5813 "cs-parser.jay" { yyVal = new Linq.ThenByDescending (current_block.Toplevel, (Expression)yyVals[-1+yyTop]); } break; case 888: #line 5822 "cs-parser.jay" { /* query continuation block is not linked with query block but with block*/ /* before. This means each query can use same range variable names for*/ /* different identifiers.*/ current_block.SetEndLocation (GetLocation (yyVals[-1+yyTop])); current_block = current_block.Parent; var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop]; current_block = new Linq.QueryBlock (compiler, current_block, new SimpleMemberName (lt.Value, lt.Location), GetLocation (yyVals[-1+yyTop])); } break; case 889: #line 5835 "cs-parser.jay" { yyVal = new Linq.QueryExpression (current_block, (Linq.AQueryClause)yyVals[0+yyTop]); } break; case 892: #line 5856 "cs-parser.jay" { Evaluator.LoadAliases (current_namespace); push_current_class (new Class (current_namespace, current_class, new MemberName ("Class" + class_count++), Modifiers.PUBLIC, null), null); var baseclass_list = new List<FullNamedExpression> (); baseclass_list.Add (new TypeExpression (Evaluator.InteractiveBaseClass, lexer.Location)); current_container.AddBasesForPart (current_class, baseclass_list); /* (ref object retval)*/ Parameter [] mpar = new Parameter [1]; mpar [0] = new Parameter (TypeManager.system_object_expr, "$retval", Parameter.Modifier.REF, null, Location.Null); ParametersCompiled pars = new ParametersCompiled (compiler, mpar); current_local_parameters = pars; Method method = new Method ( current_class, null, /* generic*/ TypeManager.system_void_expr, Modifiers.PUBLIC | Modifiers.STATIC, new MemberName ("Host"), pars, null /* attributes */); oob_stack.Push (method); ++lexer.parsing_block; start_block (lexer.Location); } break; case 893: #line 5886 "cs-parser.jay" { --lexer.parsing_block; Method method = (Method) oob_stack.Pop (); method.Block = (ToplevelBlock) end_block(lexer.Location); current_container.AddMethod (method); --lexer.parsing_declaration; InteractiveResult = pop_current_class (); current_local_parameters = null; } break; case 894: #line 5897 "cs-parser.jay" { Evaluator.LoadAliases (current_namespace); } 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' }
protected override void EmitBooleanExpression(BooleanExpression expression, bool isStatement = false) => Append(expression.Value ? "True" : "False");
public While (BooleanExpression bool_expr, Statement statement, Location l) { this.expr = bool_expr; Statement = statement; loc = l; }
protected virtual Expression VisitBoolean(BooleanExpression node) { Visit(node.Value); return(node); }
private WBooleanExpression ParseBooleanExpression(BooleanExpression bexpr) { if (bexpr == null) { return null; } switch (bexpr.GetType().Name) { case "BooleanBinaryExpression": { var oexpr = bexpr as BooleanBinaryExpression; var pexpr = new WBooleanBinaryExpression { FirstExpr = ParseBooleanExpression(oexpr.FirstExpression), SecondExpr = ParseBooleanExpression(oexpr.SecondExpression), BooleanExpressionType = oexpr.BinaryExpressionType, FirstTokenIndex = oexpr.FirstTokenIndex, LastTokenIndex = oexpr.LastTokenIndex, }; return pexpr; } case "BooleanComparisonExpression": { var oexpr = bexpr as BooleanComparisonExpression; var pexpr = new WBooleanComparisonExpression { ComparisonType = oexpr.ComparisonType, FirstExpr = ParseScalarExpression(oexpr.FirstExpression), SecondExpr = ParseScalarExpression(oexpr.SecondExpression), FirstTokenIndex = oexpr.FirstTokenIndex, LastTokenIndex = oexpr.LastTokenIndex, }; return pexpr; } case "BooleanIsNullExpression": { var oexpr = bexpr as BooleanIsNullExpression; var pexpr = new WBooleanIsNullExpression { IsNot = oexpr.IsNot, Expression = ParseScalarExpression(oexpr.Expression), FirstTokenIndex = oexpr.FirstTokenIndex, LastTokenIndex = oexpr.LastTokenIndex, }; return pexpr; } case "BooleanNotExpression": { var oexpr = bexpr as BooleanNotExpression; var pexpr = new WBooleanNotExpression { Expression = ParseBooleanExpression(oexpr.Expression), FirstTokenIndex = oexpr.FirstTokenIndex, LastTokenIndex = oexpr.LastTokenIndex, }; return pexpr; } case "BooleanParenthesisExpression": { var oexpr = bexpr as BooleanParenthesisExpression; var pexpr = new WBooleanParenthesisExpression { Expression = ParseBooleanExpression(oexpr.Expression), FirstTokenIndex = oexpr.FirstTokenIndex, LastTokenIndex = oexpr.LastTokenIndex, }; return pexpr; } case "BooleanTernaryExpression": { var oexpr = bexpr as BooleanTernaryExpression; var pexpr = new WBetweenExpression { FirstTokenIndex = oexpr.FirstTokenIndex, LastTokenIndex = oexpr.LastTokenIndex, }; switch (oexpr.TernaryExpressionType) { case BooleanTernaryExpressionType.Between: pexpr.NotDefined = false; break; case BooleanTernaryExpressionType.NotBetween: pexpr.NotDefined = true; break; default: throw new GraphViewException("Undefined tenary expression type"); } pexpr.FirstExpr = ParseScalarExpression(oexpr.FirstExpression); pexpr.SecondExpr = ParseScalarExpression(oexpr.SecondExpression); pexpr.ThirdExpr = ParseScalarExpression(oexpr.ThirdExpression); return pexpr; } case "ExistsPredicate": { var oexpr = bexpr as ExistsPredicate; var pexpr = new WExistsPredicate { FirstTokenIndex = oexpr.FirstTokenIndex, LastTokenIndex = oexpr.LastTokenIndex, Subquery = new WScalarSubquery { SubQueryExpr = ParseSelectQueryStatement(oexpr.Subquery.QueryExpression), FirstTokenIndex = oexpr.Subquery.FirstTokenIndex, LastTokenIndex = oexpr.Subquery.LastTokenIndex, } }; return pexpr; } case "InPredicate": { var oexpr = bexpr as InPredicate; var pexpr = new WInPredicate { Expression = ParseScalarExpression(oexpr.Expression), NotDefined = oexpr.NotDefined, FirstTokenIndex = oexpr.FirstTokenIndex, LastTokenIndex = oexpr.LastTokenIndex, }; if (oexpr.Subquery != null) { pexpr.Subquery = new WScalarSubquery { SubQueryExpr = ParseSelectQueryStatement(oexpr.Subquery.QueryExpression), FirstTokenIndex = oexpr.Subquery.FirstTokenIndex, LastTokenIndex = oexpr.Subquery.LastTokenIndex, }; } else { pexpr.Values = new List<WScalarExpression>(oexpr.Values.Count); foreach (var wexp in oexpr.Values.Select(ParseScalarExpression).Where(wexp => wexp != null)) { pexpr.Values.Add(wexp); } } return pexpr; } case "LikePredicate": { var oexpr = bexpr as LikePredicate; var pexpr = new WLikePredicate { EscapeExpr = ParseScalarExpression(oexpr.EscapeExpression), FirstExpr = ParseScalarExpression(oexpr.FirstExpression), SecondExpr = ParseScalarExpression(oexpr.SecondExpression), NotDefined = oexpr.NotDefined, FirstTokenIndex = oexpr.FirstTokenIndex, LastTokenIndex = oexpr.LastTokenIndex, }; return pexpr; } case "SubqueryComparisonPredicate": { var oexpr = bexpr as SubqueryComparisonPredicate; var pexpr = new WSubqueryComparisonPredicate { FirstTokenIndex = oexpr.FirstTokenIndex, LastTokenIndex = oexpr.LastTokenIndex, Subquery = new WScalarSubquery() { SubQueryExpr = ParseSelectQueryStatement(oexpr.Subquery.QueryExpression), FirstTokenIndex = oexpr.Subquery.FirstTokenIndex, LastTokenIndex = oexpr.Subquery.LastTokenIndex }, ComparisonType = oexpr.ComparisonType, Expression = ParseScalarExpression(oexpr.Expression), SubqueryComparisonType = oexpr.SubqueryComparisonPredicateType, }; return pexpr; } default: { return null; } } }
/// <summary> /// Updates the properties of this row /// </summary> private void UpdateProperties() { this.ModifiedOn = this.Thing.ModifiedOn; this.TopExpression = this.Thing.TopExpression; }
public List <Song> RandomSelect(BooleanExpression expression) { return(Shuffle(Select(expression))); }
public abstract UnaryExpression Create(BooleanExpression expression);
public MissileAction(BooleanExpression<Missile> eligibility, int _priority) { this.eligibility = eligibility; this._priority = _priority; }
private void CheckRewriteable(BooleanExpression search) { var bce = search as BooleanComparisonExpression; var haveIsNull = false; var haveLiteral = false; Literal literal = new BinaryLiteral(); var isNull = new FunctionCall(); if (bce.FirstExpression is FunctionCall) { var func = bce.FirstExpression as FunctionCall; if (func.FunctionName.Value.ToLower() == "isnull") { haveIsNull = true; isNull = func; } } if (bce.SecondExpression is FunctionCall) { var func = bce.SecondExpression as FunctionCall; if (func.FunctionName.Value.ToLower() == "isnull") { haveIsNull = true; isNull = func; } } if (bce.FirstExpression is Literal) { haveLiteral = true; literal = bce.FirstExpression as Literal; } if (bce.SecondExpression is Literal) { haveLiteral = true; literal = bce.SecondExpression as Literal; } if (haveLiteral && haveIsNull) { var firstParam = isNull.Parameters.FirstOrDefault(); if (!(firstParam is ColumnReferenceExpression)) { return; } var secondParam = isNull.Parameters.LastOrDefault(); if (secondParam is Literal) { if (secondParam.GetType() != literal.GetType()) { return; } var isSameLiteral = (secondParam as Literal).Value == literal.Value; var isEquals = bce.ComparisonType == BooleanComparisonType.Equals; if (isEquals && isSameLiteral) { BuildEqualsSameLiteral(search, firstParam, literal); return; } if (!isEquals && !isSameLiteral) { BuildNotEqualsNotSameLiteral(search, firstParam, literal); return; } if (!isEquals && isSameLiteral) { BuildNotEqualsIsSameLiteral(search, firstParam, literal); return; } if (isEquals && !isSameLiteral) { BuildIsEqualsIsNotSameLiteral(search, firstParam, literal); } } } }
public static IValueProvider GetResource <T>(object value, object defaultValue, Func <string, object> deserializer) { if (value == null) { return(new LiteralValue(defaultValue)); } if (value is string expression) { var boundExpression = BoundExpression.Parse(expression); switch (boundExpression.Resources.Count) { case 0: return(new LiteralValue( deserializer != null && boundExpression.StringFormat != null ? deserializer(boundExpression.UnescapedStringFormat()) : boundExpression.UnescapedStringFormat())); case 1 when boundExpression.StringFormat == null: return(new CoercedValueProvider <T>(boundExpression.Resources[0], defaultValue)); default: if (typeof(T) == typeof(bool)) { var expr = boundExpression.UnescapedStringFormat(); string converter = null; for (var i = expr.Length - 1; i >= 0; i--) { var c = expr[i]; if (c == '}') { var next = i > 0 ? expr[i - 1] : '\0'; if (next == '}') { i--; continue; } break; } if (c == '|') { var next = i > 0 ? expr[i - 1] : '\0'; if (next == '|') { // This will throw later anyway... break; } converter = expr.Substring(i + 1); expr = expr.Substring(0, i); break; } } var ast = BooleanExpression.Parse(expr); return(new MultiBooleanBinding(ast, boundExpression.Resources, converter)); } throw new ArgumentException( $"The expression '{expression}' is not a valid resource because it does not define a single value source.", nameof(value)); } } if (value is T) { return(new LiteralValue(value)); } throw new ArgumentException( $"The provided value must be a bound resource or a literal value of type '{typeof(T).FullName}'.", nameof(value)); }
public LocateFilterVisitor(BooleanExpression toFind) { _toFind = toFind; }
protected UnaryExpression(BooleanExpression expression) { Guard.NotNull(expression, nameof(expression)); Operand = expression; }
public override void ExplicitVisit(BooleanExpression node) { this.action(node); }
public virtual object Visit(BooleanExpression booleanExpression) { return(null); }
internal static bool IsBinaryExpression(this BooleanExpression expression) { return(expression is BooleanBinaryExpression); }
public void ProcessBooleanExpression(BooleanExpression be) { String beType = GetFragmentType(be); switch (beType) { case "BooleanComparisonExpression": var BoolComp = (BooleanComparisonExpression)be; ProcessScalarExpression(BoolComp.FirstExpression); ProcessScalarExpression(BoolComp.SecondExpression); break; case "BooleanBinaryExpression": var BoolExpression = (BooleanBinaryExpression)be; ProcessBooleanExpression(BoolExpression.FirstExpression); ProcessBooleanExpression(BoolExpression.SecondExpression); break; default: break; } }
public void visit(BooleanExpression that) { that.Type = new BooleanType(that.Position); }
void FabricateBodyStatement() { var cas = TypeManager.gen_interlocked_compare_exchange; if (cas == null) { var t = Module.PredefinedTypes.Interlocked.Resolve (Location); if (t == null) return; var p = new ParametersImported ( new[] { new ParameterData (null, Parameter.Modifier.REF), new ParameterData (null, Parameter.Modifier.NONE), new ParameterData (null, Parameter.Modifier.NONE) }, new[] { new TypeParameterSpec (0, null, SpecialConstraint.None, Variance.None, null), new TypeParameterSpec (0, null, SpecialConstraint.None, Variance.None, null), new TypeParameterSpec (0, null, SpecialConstraint.None, Variance.None, null), }, false); var filter = new MemberFilter ("CompareExchange", 1, MemberKind.Method, p, null); cas = TypeManager.gen_interlocked_compare_exchange = TypeManager.GetPredefinedMethod (t, filter, Location); } // // Delegate obj1 = backing_field // do { // Delegate obj2 = obj1; // obj1 = Interlocked.CompareExchange (ref backing_field, Delegate.Combine|Remove(obj2, value), obj1); // } while (obj1 != obj2) // var field_info = ((EventField) method).backing_field; FieldExpr f_expr = new FieldExpr (field_info, Location); if (!IsStatic) f_expr.InstanceExpression = new CompilerGeneratedThis (Parent.CurrentType, Location); var obj1 = LocalVariable.CreateCompilerGenerated (field_info.MemberType, block, Location); var obj2 = LocalVariable.CreateCompilerGenerated (field_info.MemberType, block, Location); block.AddStatement (new StatementExpression (new SimpleAssign (new LocalVariableReference (obj1, Location), f_expr))); var cond = new BooleanExpression (new Binary (Binary.Operator.Inequality, new LocalVariableReference (obj1, Location), new LocalVariableReference (obj2, Location), Location)); var body = new ExplicitBlock (block, Location, Location); block.AddStatement (new Do (body, cond, Location)); body.AddStatement (new StatementExpression ( new SimpleAssign (new LocalVariableReference (obj2, Location), new LocalVariableReference (obj1, Location)))); var args_oper = new Arguments (2); args_oper.Add (new Argument (new LocalVariableReference (obj2, Location))); args_oper.Add (new Argument (block.GetParameterReference (0, Location))); var args = new Arguments (3); args.Add (new Argument (f_expr, Argument.AType.Ref)); args.Add (new Argument (new Cast ( new TypeExpression (field_info.MemberType, Location), new Invocation (MethodGroupExpr.CreatePredefined (Operation, Operation.DeclaringType, Location), args_oper), Location))); args.Add (new Argument (new LocalVariableReference (obj1, Location))); body.AddStatement (new StatementExpression (new SimpleAssign ( new LocalVariableReference (obj1, Location), new Invocation (MethodGroupExpr.CreatePredefined (cas, cas.DeclaringType, Location), args)))); }
private Declaration[] CreateStandardEnvironment(bool insert = false) { List <Declaration> result = new List <Declaration>(); // signal that the following symbols are part of the standard library Position position = new Position("(library)", 0, 0); Declaration declaration; Expression expression; // enter the predefined constant 'maxint' into the symbol table expression = new IntegerExpression(position, int.MaxValue); declaration = new ConstantDeclaration(position, "maxint", new IntegerType(position), expression); result.Add(declaration); // enter the predefined constants 'false' and 'true' into the symbol table expression = new BooleanExpression(position, false); declaration = new ConstantDeclaration(position, "false", new BooleanType(position), expression); result.Add(declaration); expression = new BooleanExpression(position, true); declaration = new ConstantDeclaration(position, "true", new BooleanType(position), expression); result.Add(declaration); // enter the predefined operators into the symbol table // ... the \ operator declaration = new FunctionDeclaration( position, "\\", new BooleanType(position), new ParameterDeclaration[] { new ParameterDeclaration(position, "value", new BooleanType(position)) }, null // note: the code generator must handle these predefined functions so no body is defined ); result.Add(declaration); // ... all Triangle operators of the form Boolean x Boolean -> Boolean string[] boolean_and_boolean_to_boolean_operators = { "/\\", "\\/", "=", "\\=" }; foreach (string @operator in boolean_and_boolean_to_boolean_operators) { declaration = new FunctionDeclaration( position, @operator, new BooleanType(position), new ParameterDeclaration[] { new ParameterDeclaration(position, "first", new BooleanType(position)), new ParameterDeclaration(position, "other", new BooleanType(position)) }, null // note: the code generator must handle these predefined functions so no body is defined ); result.Add(declaration); } // ... all Triangle operators of the form Integer x Integer -> Integer string[] integer_and_integer_to_integer_operators = { "+", "-", "*", "/", "//" }; foreach (string @operator in integer_and_integer_to_integer_operators) { declaration = new FunctionDeclaration( position, @operator, new IntegerType(position), new ParameterDeclaration[] { new ParameterDeclaration(position, "first", new IntegerType(position)), new ParameterDeclaration(position, "other", new IntegerType(position)) }, null // note: the code generator must handle these predefined functions so no body is defined ); result.Add(declaration); } // ... all Triangle operators of the form Integer x Integer -> Boolean string[] integer_and_integer_to_boolean_operators = { "<", "<=", ">", ">=", "=", "\\=" }; foreach (string @operator in integer_and_integer_to_boolean_operators) { declaration = new FunctionDeclaration( position, @operator, new BooleanType(position), new ParameterDeclaration[] { new ParameterDeclaration(position, "first", new IntegerType(position)), new ParameterDeclaration(position, "other", new IntegerType(position)) }, null // note: the code generator must handle these predefined functions so no body is defined ); result.Add(declaration); } // enter the predefined functions (getint and putint) into the symbol table declaration = new FunctionDeclaration( position, "getint", new IntegerType(position), #if false new ParameterDeclaration[] { new ParameterDeclaration(position, "value", new IntegerType(position)) }, #else new ParameterDeclaration[0], #endif null // note: the code generator must handle these predefined functions so no body is defined ); result.Add(declaration); declaration = new FunctionDeclaration( position, "putint", new IntegerType(position), new ParameterDeclaration[] { new ParameterDeclaration(position, "value", new IntegerType(position)) }, null // note: the code generator must handle these predefined functions so no body is defined ); result.Add(declaration); return(result.ToArray()); }
public PartitionBuilder AddFilter(BooleanExpression booleanExpression) { //add the filter filters.Add(booleanExpression); return(this); }
public Coast(BooleanExpression<Missile> eligibility, int priority) : base(eligibility, priority) { }
public Do (Statement statement, BooleanExpression bool_expr, Location l) { expr = bool_expr; EmbeddedStatement = statement; loc = l; }
/// <summary> /// KzLib.SqlServer.TransactSql.ScriptDom.AddHavingBooleanExpressionVisitor をインスタンス化します。 /// </summary> /// <param name="findBooleanExpression">Having句のトップから、BooleanExpression に到達するまでの式</param> /// <param name="booleanExpression">追加する条件式</param> /// <param name="booleanBinaryExpressionType">追加された条件式を結合するための 論理演算の種類</param> public AddHavingBooleanExpressionVisitor(Expression <Func <Microsoft.SqlServer.TransactSql.ScriptDom.HavingClause, BooleanExpression> > findBooleanExpression, BooleanExpression booleanExpression, Microsoft.SqlServer.TransactSql.ScriptDom.BooleanBinaryExpressionType?booleanBinaryExpressionType) { FindBooleanExpression = findBooleanExpression; BooleanExpression = booleanExpression; BooleanBinaryExpressionType = booleanBinaryExpressionType; }
public For (Statement init_statement, BooleanExpression test, Statement increment, Statement statement, Location l) { InitStatement = init_statement; Test = test; Increment = increment; Statement = statement; loc = l; }
/// <summary> /// KzLib.SqlServer.TransactSql.ScriptDom.AddHavingBooleanExpressionVisitor をインスタンス化します。 /// </summary> /// <param name="booleanExpression">追加する条件式</param> /// <param name="booleanBinaryExpressionType">追加された条件式を結合するための 論理演算の種類</param> public AddHavingBooleanExpressionVisitor(BooleanExpression booleanExpression, Microsoft.SqlServer.TransactSql.ScriptDom.BooleanBinaryExpressionType?booleanBinaryExpressionType) { FindBooleanExpression = w => w.SearchCondition; BooleanExpression = booleanExpression; BooleanBinaryExpressionType = booleanBinaryExpressionType; }
/** 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; //t 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; //t if (debug != null) //t debug.lex(yyState, yyToken, yyname(yyToken), yyLex.value()); } if ((yyN = yySindex[yyState]) != 0 && ((yyN += yyToken) >= 0) && (yyN < yyTable.Length) && (yyCheck[yyN] == yyToken)) { //t if (debug != null) //t 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)); //t 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) { //t if (debug != null) //t debug.shift(yyStates[yyTop], yyTable[yyN], 3); yyState = yyTable[yyN]; yyVal = yyLex.value(); goto continue_yyLoop; } //t if (debug != null) debug.pop(yyStates[yyTop]); } while (-- yyTop >= 0); //t if (debug != null) debug.reject(); throw new yyParser.yyException("irrecoverable syntax error"); case 3: if (yyToken == 0) { //t if (debug != null) debug.reject(); throw new yyParser.yyException("irrecoverable syntax error at end-of-file"); } //t if (debug != null) //t debug.discard(yyState, yyToken, yyname(yyToken), //t yyLex.value()); yyToken = -1; goto continue_yyDiscarded; // leave stack alone } } int yyV = yyTop + 1-yyLen[yyN]; //t if (debug != null) //t 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 1: #line 386 "cs-parser.jay" { Lexer.check_incorrect_doc_comment (); } break; case 2: #line 387 "cs-parser.jay" { Lexer.CompleteOnEOF = false; } break; case 6: case_6(); break; case 7: #line 406 "cs-parser.jay" { module.AddAttributes ((Attributes) yyVals[0+yyTop], current_namespace); } break; case 8: case_8(); break; case 13: case_13(); break; case 14: #line 451 "cs-parser.jay" { Error_SyntaxError (yyToken); } break; case 17: case_17(); break; case 18: case_18(); break; case 19: case_19(); break; case 20: case_20(); break; case 21: case_21(); break; case 22: case_22(); break; case 23: case_23(); break; case 24: case_24(); break; case 27: case_27(); break; case 28: case_28(); break; case 29: case_29(); break; case 30: case_30(); break; case 43: case_43(); break; case 44: #line 635 "cs-parser.jay" { current_namespace.DeclarationFound = true; } break; case 45: case_45(); break; case 53: case_53(); break; case 54: case_54(); break; case 55: case_55(); break; case 56: case_56(); break; case 57: case_57(); break; case 58: case_58(); break; case 59: case_59(); break; case 60: case_60(); break; case 61: case_61(); break; case 62: case_62(); break; case 63: #line 770 "cs-parser.jay" { yyVal = "event"; savedCloseLocation = GetLocation (yyVals[0+yyTop]); } break; case 64: #line 771 "cs-parser.jay" { yyVal = "return"; savedCloseLocation = GetLocation (yyVals[0+yyTop]); } break; case 65: #line 778 "cs-parser.jay" { yyVal = new List<Attribute> (4) { (Attribute) yyVals[0+yyTop] }; } break; case 66: case_66(); break; case 67: #line 795 "cs-parser.jay" { ++lexer.parsing_block; } break; case 68: case_68(); break; case 70: #line 823 "cs-parser.jay" { yyVal = null; HadAttributeParens = false; } break; case 71: case_71(); break; case 72: #line 835 "cs-parser.jay" { yyVal = null; } break; case 73: case_73(); break; case 74: case_74(); break; case 75: case_75(); break; case 76: case_76(); break; case 77: #line 879 "cs-parser.jay" { yyVal = new Argument ((Expression) yyVals[0+yyTop]); } break; case 79: case_79(); break; case 80: #line 892 "cs-parser.jay" { ++lexer.parsing_block; } break; case 81: case_81(); break; case 82: case_82(); break; case 83: #line 918 "cs-parser.jay" { yyVal = null; } break; case 84: #line 922 "cs-parser.jay" { yyVal = Argument.AType.Ref; } break; case 85: #line 926 "cs-parser.jay" { yyVal = Argument.AType.Out; } break; case 88: #line 938 "cs-parser.jay" { lexer.parsing_modifiers = true; } break; case 89: #line 942 "cs-parser.jay" { lexer.parsing_modifiers = true; } break; case 102: case_102(); break; case 103: #line 973 "cs-parser.jay" { } break; case 104: case_104(); break; case 105: case_105(); break; case 106: case_106(); break; case 107: case_107(); break; case 108: case_108(); break; case 109: #line 1017 "cs-parser.jay" { Error_SyntaxError (yyToken); } break; case 110: case_110(); break; case 111: case_111(); break; case 112: case_112(); break; case 115: #line 1066 "cs-parser.jay" { current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 116: #line 1070 "cs-parser.jay" { current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 117: case_117(); break; case 118: #line 1086 "cs-parser.jay" { ++lexer.parsing_block; } break; case 119: case_119(); break; case 120: case_120(); break; case 123: case_123(); break; case 124: case_124(); break; case 125: case_125(); break; case 126: case_126(); break; case 127: #line 1165 "cs-parser.jay" { report.Error (1641, GetLocation (yyVals[-1+yyTop]), "A fixed size buffer field must have the array size specifier after the field name"); } break; case 129: case_129(); break; case 130: case_130(); break; case 133: #line 1195 "cs-parser.jay" { current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 134: #line 1199 "cs-parser.jay" { current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 135: case_135(); break; case 136: #line 1212 "cs-parser.jay" { ++lexer.parsing_block; } break; case 137: case_137(); break; case 140: #line 1231 "cs-parser.jay" { current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 141: #line 1235 "cs-parser.jay" { current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 142: case_142(); break; case 143: #line 1251 "cs-parser.jay" { ++lexer.parsing_block; } break; case 144: case_144(); break; case 145: case_145(); break; case 148: case_148(); break; case 149: case_149(); break; case 150: case_150(); break; case 151: #line 1319 "cs-parser.jay" { valid_param_mod = ParameterModifierType.All; } break; case 152: case_152(); break; case 153: case_153(); break; case 154: #line 1358 "cs-parser.jay" { lexer.parsing_generic_declaration = true; } break; case 155: case_155(); break; case 156: #line 1368 "cs-parser.jay" { lexer.ConstraintsParsing = true; } break; case 157: case_157(); break; case 158: case_158(); break; case 159: case_159(); break; case 161: #line 1441 "cs-parser.jay" { savedLocation = GetLocation (yyVals[0+yyTop]); yyVal = null; } break; case 162: #line 1445 "cs-parser.jay" { yyVal = ParametersCompiled.EmptyReadOnlyParameters; } break; case 164: case_164(); break; case 165: case_165(); break; case 166: case_166(); break; case 167: case_167(); break; case 168: case_168(); break; case 169: case_169(); break; case 170: case_170(); break; case 171: #line 1517 "cs-parser.jay" { yyVal = new ParametersCompiled (new Parameter[] { (Parameter) yyVals[0+yyTop] } ); } break; case 172: #line 1521 "cs-parser.jay" { yyVal = new ParametersCompiled (new Parameter [] { new ArglistParameter (GetLocation (yyVals[0+yyTop])) }, true); } break; case 173: case_173(); break; case 174: case_174(); break; case 175: case_175(); break; case 176: case_176(); break; case 177: case_177(); break; case 178: case_178(); break; case 179: case_179(); break; case 180: #line 1602 "cs-parser.jay" { ++lexer.parsing_block; } break; case 181: case_181(); break; case 182: #line 1643 "cs-parser.jay" { yyVal = Parameter.Modifier.NONE; } break; case 184: #line 1651 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 185: case_185(); break; case 186: case_186(); break; case 187: case_187(); break; case 188: case_188(); break; case 189: case_189(); break; case 190: case_190(); break; case 191: case_191(); break; case 192: case_192(); break; case 193: case_193(); break; case 194: #line 1745 "cs-parser.jay" { Error_DuplicateParameterModifier (GetLocation (yyVals[-1+yyTop]), Parameter.Modifier.PARAMS); } break; case 195: case_195(); break; case 196: case_196(); break; case 197: case_197(); break; case 198: case_198(); break; case 199: case_199(); break; case 200: #line 1799 "cs-parser.jay" { valid_param_mod = ParameterModifierType.Params | ParameterModifierType.DefaultValue; } break; case 201: case_201(); break; case 202: #line 1828 "cs-parser.jay" { lexer.PropertyParsing = false; } break; case 203: case_203(); break; case 208: case_208(); break; case 209: case_209(); break; case 210: case_210(); break; case 211: case_211(); break; case 212: case_212(); break; case 214: case_214(); break; case 215: case_215(); break; case 216: #line 1976 "cs-parser.jay" { } break; case 217: case_217(); break; case 218: case_218(); break; case 219: case_219(); break; case 220: case_220(); break; case 221: #line 2016 "cs-parser.jay" { Error_SyntaxError (yyToken); } break; case 224: #line 2028 "cs-parser.jay" { lexer.parsing_modifiers = true; } break; case 225: #line 2032 "cs-parser.jay" { lexer.parsing_modifiers = true; } break; case 226: #line 2039 "cs-parser.jay" { report.Error (525, GetLocation (yyVals[0+yyTop]), "Interfaces cannot contain fields or constants"); } break; case 227: #line 2043 "cs-parser.jay" { report.Error (525, GetLocation (yyVals[0+yyTop]), "Interfaces cannot contain fields or constants"); } break; case 232: #line 2051 "cs-parser.jay" { report.Error (567, GetLocation (yyVals[0+yyTop]), "Interfaces cannot contain operators"); } break; case 233: #line 2055 "cs-parser.jay" { report.Error (526, GetLocation (yyVals[0+yyTop]), "Interfaces cannot contain contructors"); } break; case 234: #line 2059 "cs-parser.jay" { report.Error (524, GetLocation (yyVals[0+yyTop]), "Interfaces cannot declare classes, structs, interfaces, delegates, or enumerations"); } break; case 235: #line 2065 "cs-parser.jay" { } break; case 236: case_236(); break; case 238: #line 2098 "cs-parser.jay" { savedLocation = GetLocation (yyVals[0+yyTop]); yyVal = null; } break; case 240: case_240(); break; case 241: #line 2114 "cs-parser.jay" { valid_param_mod = ParameterModifierType.DefaultValue; } break; case 242: case_242(); break; case 244: #line 2160 "cs-parser.jay" { yyVal = Operator.OpType.LogicalNot; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 245: #line 2161 "cs-parser.jay" { yyVal = Operator.OpType.OnesComplement; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 246: #line 2162 "cs-parser.jay" { yyVal = Operator.OpType.Increment; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 247: #line 2163 "cs-parser.jay" { yyVal = Operator.OpType.Decrement; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 248: #line 2164 "cs-parser.jay" { yyVal = Operator.OpType.True; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 249: #line 2165 "cs-parser.jay" { yyVal = Operator.OpType.False; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 250: #line 2167 "cs-parser.jay" { yyVal = Operator.OpType.Addition; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 251: #line 2168 "cs-parser.jay" { yyVal = Operator.OpType.Subtraction; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 252: #line 2170 "cs-parser.jay" { yyVal = Operator.OpType.Multiply; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 253: #line 2171 "cs-parser.jay" { yyVal = Operator.OpType.Division; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 254: #line 2172 "cs-parser.jay" { yyVal = Operator.OpType.Modulus; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 255: #line 2173 "cs-parser.jay" { yyVal = Operator.OpType.BitwiseAnd; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 256: #line 2174 "cs-parser.jay" { yyVal = Operator.OpType.BitwiseOr; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 257: #line 2175 "cs-parser.jay" { yyVal = Operator.OpType.ExclusiveOr; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 258: #line 2176 "cs-parser.jay" { yyVal = Operator.OpType.LeftShift; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 259: #line 2177 "cs-parser.jay" { yyVal = Operator.OpType.RightShift; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 260: #line 2178 "cs-parser.jay" { yyVal = Operator.OpType.Equality; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 261: #line 2179 "cs-parser.jay" { yyVal = Operator.OpType.Inequality; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 262: #line 2180 "cs-parser.jay" { yyVal = Operator.OpType.GreaterThan; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 263: #line 2181 "cs-parser.jay" { yyVal = Operator.OpType.LessThan; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 264: #line 2182 "cs-parser.jay" { yyVal = Operator.OpType.GreaterThanOrEqual; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 265: #line 2183 "cs-parser.jay" { yyVal = Operator.OpType.LessThanOrEqual; savedOperatorLocation = GetLocation (yyVals[0+yyTop]); } break; case 266: #line 2190 "cs-parser.jay" { valid_param_mod = ParameterModifierType.DefaultValue; } break; case 267: case_267(); break; case 268: #line 2213 "cs-parser.jay" { valid_param_mod = ParameterModifierType.DefaultValue; } break; case 269: case_269(); break; case 270: case_270(); break; case 271: case_271(); break; case 272: case_272(); break; case 273: case_273(); break; case 274: case_274(); break; case 275: case_275(); break; case 277: #line 2323 "cs-parser.jay" { current_block = null; yyVal = null; } break; case 280: #line 2335 "cs-parser.jay" { ++lexer.parsing_block; } break; case 281: case_281(); break; case 282: #line 2345 "cs-parser.jay" { ++lexer.parsing_block; } break; case 283: case_283(); break; case 284: case_284(); break; case 285: case_285(); break; case 286: case_286(); break; case 287: case_287(); break; case 288: case_288(); break; case 289: case_289(); break; case 290: case_290(); break; case 291: case_291(); break; case 292: case_292(); break; case 293: case_293(); break; case 295: #line 2472 "cs-parser.jay" { ++lexer.parsing_block; } break; case 296: case_296(); break; case 299: #line 2490 "cs-parser.jay" { current_event_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 300: #line 2494 "cs-parser.jay" { current_event_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]); } break; case 301: case_301(); break; case 302: #line 2507 "cs-parser.jay" { ++lexer.parsing_block; } break; case 303: case_303(); break; case 304: case_304(); break; case 305: #line 2532 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 308: case_308(); break; case 309: case_309(); break; case 310: case_310(); break; case 311: case_311(); break; case 312: case_312(); break; case 313: case_313(); break; case 314: case_314(); break; case 315: case_315(); break; case 317: case_317(); break; case 318: case_318(); break; case 319: case_319(); break; case 320: case_320(); break; case 321: case_321(); break; case 322: case_322(); break; case 324: case_324(); break; case 325: case_325(); break; case 328: #line 2718 "cs-parser.jay" { lbag.AppendToMember (current_container, GetLocation (yyVals[0+yyTop])); } break; case 330: case_330(); break; case 331: case_331(); break; case 332: case_332(); break; case 333: case_333(); break; case 334: case_334(); break; case 336: #line 2792 "cs-parser.jay" { valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out | ParameterModifierType.Params | ParameterModifierType.DefaultValue; } break; case 337: case_337(); break; case 338: #line 2811 "cs-parser.jay" { lexer.ConstraintsParsing = false; } break; case 339: case_339(); break; case 341: case_341(); break; case 343: case_343(); break; case 345: case_345(); break; case 346: case_346(); break; case 348: case_348(); break; case 349: case_349(); break; case 350: case_350(); break; case 351: case_351(); break; case 352: #line 2917 "cs-parser.jay" { lexer.parsing_generic_declaration = true; } break; case 353: case_353(); break; case 354: case_354(); break; case 356: case_356(); break; case 357: case_357(); break; case 358: case_358(); break; case 359: case_359(); break; case 360: case_360(); break; case 361: case_361(); break; case 363: case_363(); break; case 364: case_364(); break; case 365: case_365(); break; case 366: case_366(); break; case 367: case_367(); break; case 369: #line 3042 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[0+yyTop])); } break; case 370: #line 3049 "cs-parser.jay" { lexer.parsing_generic_declaration = true; } break; case 372: case_372(); break; case 374: case_374(); break; case 376: case_376(); break; case 378: #line 3087 "cs-parser.jay" { yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; case 379: case_379(); break; case 380: #line 3106 "cs-parser.jay" { yyVal = new ComposedCast ((ATypeNameExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; case 381: case_381(); break; case 382: #line 3115 "cs-parser.jay" { yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; case 383: #line 3119 "cs-parser.jay" { yyVal = new ComposedCast (new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[-1+yyTop])), (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; case 384: case_384(); break; case 385: case_385(); break; case 386: case_386(); break; case 387: #line 3153 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Object, GetLocation (yyVals[0+yyTop])); } break; case 388: #line 3154 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.String, GetLocation (yyVals[0+yyTop])); } break; case 389: #line 3155 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Bool, GetLocation (yyVals[0+yyTop])); } break; case 390: #line 3156 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Decimal, GetLocation (yyVals[0+yyTop])); } break; case 391: #line 3157 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Float, GetLocation (yyVals[0+yyTop])); } break; case 392: #line 3158 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Double, GetLocation (yyVals[0+yyTop])); } break; case 394: #line 3163 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.SByte, GetLocation (yyVals[0+yyTop])); } break; case 395: #line 3164 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Byte, GetLocation (yyVals[0+yyTop])); } break; case 396: #line 3165 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Short, GetLocation (yyVals[0+yyTop])); } break; case 397: #line 3166 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.UShort, GetLocation (yyVals[0+yyTop])); } break; case 398: #line 3167 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Int, GetLocation (yyVals[0+yyTop])); } break; case 399: #line 3168 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.UInt, GetLocation (yyVals[0+yyTop])); } break; case 400: #line 3169 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Long, GetLocation (yyVals[0+yyTop])); } break; case 401: #line 3170 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.ULong, GetLocation (yyVals[0+yyTop])); } break; case 402: #line 3171 "cs-parser.jay" { yyVal = new TypeExpression (compiler.BuiltinTypes.Char, GetLocation (yyVals[0+yyTop])); } break; case 423: case_423(); break; case 424: case_424(); break; case 428: #line 3218 "cs-parser.jay" { yyVal = new NullLiteral (GetLocation (yyVals[0+yyTop])); } break; case 429: #line 3222 "cs-parser.jay" { yyVal = new BoolLiteral (compiler.BuiltinTypes, true, GetLocation (yyVals[0+yyTop])); } break; case 430: #line 3223 "cs-parser.jay" { yyVal = new BoolLiteral (compiler.BuiltinTypes, false, GetLocation (yyVals[0+yyTop])); } break; case 435: case_435(); break; case 436: #line 3256 "cs-parser.jay" { yyVal = new ParenthesizedExpression ((Expression) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop])); } break; case 437: case_437(); break; case 438: case_438(); break; case 439: case_439(); break; case 440: case_440(); break; case 441: #line 3288 "cs-parser.jay" { yyVal = new CompletionMemberAccess ((Expression) yyVals[-2+yyTop], null,GetLocation (yyVals[0+yyTop])); } break; case 442: case_442(); break; case 443: #line 3296 "cs-parser.jay" { yyVal = new CompletionMemberAccess ((Expression) yyVals[-2+yyTop], null, lexer.Location); } break; case 444: case_444(); break; case 445: case_445(); break; case 446: case_446(); break; case 447: case_447(); break; case 448: #line 3326 "cs-parser.jay" { yyVal = null; } break; case 450: case_450(); break; case 451: case_451(); break; case 452: #line 3348 "cs-parser.jay" { yyVal = null; } break; case 453: #line 3352 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 454: case_454(); break; case 455: case_455(); break; case 456: case_456(); break; case 457: case_457(); break; case 458: case_458(); break; case 459: #line 3391 "cs-parser.jay" { yyVal = new CompletionElementInitializer (null, GetLocation (yyVals[0+yyTop])); } break; case 460: case_460(); break; case 461: case_461(); break; case 462: case_462(); break; case 465: #line 3422 "cs-parser.jay" { yyVal = null; } break; case 467: case_467(); break; case 468: case_468(); break; case 469: case_469(); break; case 470: case_470(); break; case 471: case_471(); break; case 472: #line 3476 "cs-parser.jay" { yyVal = new Argument ((Expression) yyVals[0+yyTop]); } break; case 476: case_476(); break; case 477: case_477(); break; case 478: case_478(); break; case 479: case_479(); break; case 481: case_481(); break; case 482: case_482(); break; case 483: case_483(); break; case 484: case_484(); break; case 485: case_485(); break; case 486: case_486(); break; case 487: case_487(); break; case 488: #line 3569 "cs-parser.jay" { yyVal = new Argument ((Expression) yyVals[0+yyTop]); } break; case 490: #line 3577 "cs-parser.jay" { yyVal = new This (GetLocation (yyVals[0+yyTop])); } break; case 491: case_491(); break; case 492: case_492(); break; case 493: #line 3597 "cs-parser.jay" { yyVal = new UnaryMutator (UnaryMutator.Mode.PostIncrement, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop])); } break; case 494: #line 3604 "cs-parser.jay" { yyVal = new UnaryMutator (UnaryMutator.Mode.PostDecrement, (Expression) yyVals[-1+yyTop], GetLocation (yyVals[0+yyTop])); } break; case 495: case_495(); break; case 496: case_496(); break; case 497: case_497(); break; case 498: case_498(); break; case 499: case_499(); break; case 500: case_500(); break; case 501: case_501(); break; case 502: #line 3671 "cs-parser.jay" { ++lexer.parsing_type; } break; case 503: case_503(); break; case 504: case_504(); break; case 507: #line 3698 "cs-parser.jay" { yyVal = null; } break; case 509: case_509(); break; case 510: case_510(); break; case 511: case_511(); break; case 512: case_512(); break; case 513: case_513(); break; case 514: case_514(); break; case 518: case_518(); break; case 519: case_519(); break; case 520: case_520(); break; case 521: #line 3776 "cs-parser.jay" { yyVal = 2; } break; case 522: #line 3780 "cs-parser.jay" { yyVal = ((int) yyVals[-1+yyTop]) + 1; } break; case 523: #line 3787 "cs-parser.jay" { yyVal = null; } break; case 524: #line 3791 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 525: case_525(); break; case 526: case_526(); break; case 527: case_527(); break; case 528: case_528(); break; case 529: #line 3835 "cs-parser.jay" { lexer.TypeOfParsing = true; } break; case 530: case_530(); break; case 533: case_533(); break; case 534: case_534(); break; case 535: case_535(); break; case 536: case_536(); break; case 537: case_537(); break; case 538: case_538(); break; case 539: case_539(); break; case 540: case_540(); break; case 541: case_541(); break; case 542: case_542(); break; case 543: case_543(); break; case 544: case_544(); break; case 545: case_545(); break; case 546: case_546(); break; case 547: case_547(); break; case 548: #line 3978 "cs-parser.jay" { start_anonymous (false, (ParametersCompiled) yyVals[0+yyTop], false, GetLocation (yyVals[-1+yyTop])); } break; case 549: case_549(); break; case 550: #line 3991 "cs-parser.jay" { start_anonymous (false, (ParametersCompiled) yyVals[0+yyTop], true, GetLocation (yyVals[-2+yyTop])); } break; case 551: case_551(); break; case 552: #line 4008 "cs-parser.jay" { yyVal = ParametersCompiled.Undefined; } break; case 554: #line 4016 "cs-parser.jay" { valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; } break; case 555: case_555(); break; case 556: case_556(); break; case 558: #line 4042 "cs-parser.jay" { yyVal = new Unary (Unary.Operator.LogicalNot, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 559: #line 4046 "cs-parser.jay" { yyVal = new Unary (Unary.Operator.OnesComplement, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 560: case_560(); break; case 561: case_561(); break; case 562: case_562(); break; case 563: case_563(); break; case 564: case_564(); break; case 565: case_565(); break; case 567: #line 4107 "cs-parser.jay" { yyVal = new Unary (Unary.Operator.UnaryPlus, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 568: #line 4111 "cs-parser.jay" { yyVal = new Unary (Unary.Operator.UnaryNegation, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 569: #line 4115 "cs-parser.jay" { yyVal = new UnaryMutator (UnaryMutator.Mode.PreIncrement, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 570: #line 4119 "cs-parser.jay" { yyVal = new UnaryMutator (UnaryMutator.Mode.PreDecrement, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 571: #line 4123 "cs-parser.jay" { yyVal = new Indirection ((Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 572: #line 4127 "cs-parser.jay" { yyVal = new Unary (Unary.Operator.AddressOf, (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 573: case_573(); break; case 574: case_574(); break; case 575: case_575(); break; case 576: case_576(); break; case 577: case_577(); break; case 578: case_578(); break; case 580: case_580(); break; case 581: case_581(); break; case 582: case_582(); break; case 583: case_583(); break; case 584: case_584(); break; case 585: case_585(); break; case 587: case_587(); break; case 588: case_588(); break; case 589: #line 4221 "cs-parser.jay" { yyVal = new As ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 590: #line 4225 "cs-parser.jay" { yyVal = new Is ((Expression) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 591: case_591(); break; case 592: case_592(); break; case 593: case_593(); break; case 594: case_594(); break; case 596: case_596(); break; case 597: case_597(); break; case 598: case_598(); break; case 599: case_599(); break; case 601: case_601(); break; case 602: case_602(); break; case 603: case_603(); break; case 604: case_604(); break; case 605: case_605(); break; case 606: case_606(); break; case 607: case_607(); break; case 608: case_608(); break; case 610: case_610(); break; case 611: case_611(); break; case 612: case_612(); break; case 613: case_613(); break; case 615: case_615(); break; case 616: case_616(); break; case 618: case_618(); break; case 619: case_619(); break; case 621: case_621(); break; case 622: case_622(); break; case 624: case_624(); break; case 625: case_625(); break; case 627: case_627(); break; case 628: case_628(); break; case 630: case_630(); break; case 632: case_632(); break; case 633: case_633(); break; case 634: case_634(); break; case 635: case_635(); break; case 636: case_636(); break; case 637: case_637(); break; case 638: case_638(); break; case 639: case_639(); break; case 640: case_640(); break; case 641: case_641(); break; case 642: case_642(); break; case 643: case_643(); break; case 644: case_644(); break; case 645: case_645(); break; case 646: case_646(); break; case 647: case_647(); break; case 648: case_648(); break; case 649: case_649(); break; case 650: case_650(); break; case 651: case_651(); break; case 652: case_652(); break; case 653: #line 4591 "cs-parser.jay" { yyVal = ParametersCompiled.EmptyReadOnlyParameters; } break; case 654: case_654(); break; case 655: #line 4602 "cs-parser.jay" { start_block (Location.Null); } break; case 656: case_656(); break; case 658: case_658(); break; case 660: case_660(); break; case 661: case_661(); break; case 662: case_662(); break; case 663: case_663(); break; case 664: case_664(); break; case 665: case_665(); break; case 666: case_666(); break; case 667: #line 4669 "cs-parser.jay" { valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; } break; case 668: case_668(); break; case 669: case_669(); break; case 670: #line 4683 "cs-parser.jay" { valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; } break; case 671: case_671(); break; case 672: case_672(); break; case 678: #line 4708 "cs-parser.jay" { yyVal = new ArglistAccess (GetLocation (yyVals[0+yyTop])); } break; case 679: case_679(); break; case 680: case_680(); break; case 681: case_681(); break; case 683: #line 4737 "cs-parser.jay" { yyVal = new BooleanExpression ((Expression) yyVals[0+yyTop]); } break; case 684: #line 4749 "cs-parser.jay" { } break; case 685: case_685(); break; case 686: case_686(); break; case 687: case_687(); break; case 688: case_688(); break; case 689: #line 4796 "cs-parser.jay" { yyVal = null; } break; case 690: #line 4798 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; StoreModifierLocation (Modifiers.PARTIAL, GetLocation (yyVals[0+yyTop])); } break; case 691: case_691(); break; case 692: #line 4811 "cs-parser.jay" { lexer.parsing_modifiers = false; } break; case 694: case_694(); break; case 695: case_695(); break; case 696: case_696(); break; case 697: case_697(); break; case 698: case_698(); break; case 699: case_699(); break; case 700: case_700(); break; case 701: case_701(); break; case 702: case_702(); break; case 703: case_703(); break; case 704: case_704(); break; case 705: case_705(); break; case 706: case_706(); break; case 707: case_707(); break; case 708: case_708(); break; case 709: case_709(); break; case 711: case_711(); break; case 712: case_712(); break; case 714: #line 4937 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 715: case_715(); break; case 716: case_716(); break; case 717: case_717(); break; case 718: case_718(); break; case 719: case_719(); break; case 720: case_720(); break; case 721: case_721(); break; case 722: case_722(); break; case 723: #line 5030 "cs-parser.jay" { yyVal = new SpecialContraintExpr (SpecialConstraint.Class, GetLocation (yyVals[0+yyTop])); } break; case 724: #line 5034 "cs-parser.jay" { yyVal = new SpecialContraintExpr (SpecialConstraint.Struct, GetLocation (yyVals[0+yyTop])); } break; case 725: #line 5041 "cs-parser.jay" { yyVal = Variance.None; } break; case 726: case_726(); break; case 727: case_727(); break; case 728: case_728(); break; case 729: case_729(); break; case 730: #line 5086 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 731: case_731(); break; case 732: case_732(); break; case 733: case_733(); break; case 734: case_734(); break; case 735: case_735(); break; case 736: case_736(); break; case 737: case_737(); break; case 742: #line 5148 "cs-parser.jay" { current_block.AddStatement ((Statement) yyVals[0+yyTop]); } break; case 743: #line 5152 "cs-parser.jay" { current_block.AddStatement ((Statement) yyVals[0+yyTop]); } break; case 745: case_745(); break; case 746: case_746(); break; case 749: #line 5186 "cs-parser.jay" { current_block.AddStatement ((Statement) yyVals[0+yyTop]); } break; case 750: #line 5190 "cs-parser.jay" { current_block.AddStatement ((Statement) yyVals[0+yyTop]); } break; case 779: case_779(); break; case 780: case_780(); break; case 781: case_781(); break; case 782: case_782(); break; case 783: case_783(); break; case 786: case_786(); break; case 787: case_787(); break; case 788: case_788(); break; case 789: case_789(); break; case 790: #line 5334 "cs-parser.jay" { yyVal = new ComposedCast ((FullNamedExpression) yyVals[-1+yyTop], (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; case 791: #line 5338 "cs-parser.jay" { yyVal = new ComposedCast (new TypeExpression (compiler.BuiltinTypes.Void, GetLocation (yyVals[-1+yyTop])), (ComposedTypeSpecifier) yyVals[0+yyTop]); } break; case 792: case_792(); break; case 794: case_794(); break; case 795: #line 5359 "cs-parser.jay" { yyVal = ComposedTypeSpecifier.CreatePointer (GetLocation (yyVals[0+yyTop])); } break; case 797: #line 5367 "cs-parser.jay" { yyVal = Error_AwaitAsIdentifier (yyVals[0+yyTop]); } break; case 798: case_798(); break; case 799: case_799(); break; case 800: case_800(); break; case 801: case_801(); break; case 803: case_803(); break; case 805: case_805(); break; case 806: case_806(); break; case 810: case_810(); break; case 813: case_813(); break; case 814: case_814(); break; case 815: #line 5481 "cs-parser.jay" { report.Error (145, lexer.Location, "A const field requires a value to be provided"); } break; case 816: case_816(); break; case 821: case_821(); break; case 823: case_823(); break; case 824: case_824(); break; case 825: case_825(); break; case 826: #line 5531 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; case 827: case_827(); break; case 828: #line 5541 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; case 829: #line 5542 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; case 830: case_830(); break; case 831: case_831(); break; case 832: case_832(); break; case 835: case_835(); break; case 836: case_836(); break; case 837: case_837(); break; case 838: #line 5617 "cs-parser.jay" { start_block (GetLocation (yyVals[0+yyTop])); } break; case 839: case_839(); break; case 840: case_840(); break; case 841: #line 5637 "cs-parser.jay" { report.Warning (1522, 1, current_block.StartLocation, "Empty switch block"); } break; case 845: #line 5647 "cs-parser.jay" { Error_SyntaxError (yyToken); } break; case 847: case_847(); break; case 848: #line 5664 "cs-parser.jay" { current_block.AddStatement ((Statement) yyVals[0+yyTop]); } break; case 849: case_849(); break; case 850: case_850(); break; case 851: #line 5681 "cs-parser.jay" { yyVal = new SwitchLabel (null, GetLocation (yyVals[0+yyTop])); } break; case 856: case_856(); break; case 857: case_857(); break; case 858: case_858(); break; case 859: case_859(); break; case 860: case_860(); break; case 861: case_861(); break; case 862: #line 5742 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 863: case_863(); break; case 864: #line 5757 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 865: case_865(); break; case 866: case_866(); break; case 867: #line 5778 "cs-parser.jay" { yyVal = yyVals[0+yyTop]; } break; case 868: case_868(); break; case 869: case_869(); break; case 870: case_870(); break; case 871: #line 5812 "cs-parser.jay" { yyVal = new EmptyStatement (lexer.Location); } break; case 873: case_873(); break; case 874: case_874(); break; case 876: #line 5836 "cs-parser.jay" { yyVal = null; } break; case 878: #line 5841 "cs-parser.jay" { yyVal = new EmptyStatement (lexer.Location); } break; case 882: case_882(); break; case 883: case_883(); break; case 884: case_884(); break; case 885: case_885(); break; case 886: case_886(); break; case 887: case_887(); break; case 888: case_888(); break; case 895: case_895(); break; case 896: case_896(); break; case 897: case_897(); break; case 898: case_898(); break; case 899: case_899(); break; case 900: case_900(); break; case 901: case_901(); break; case 902: case_902(); break; case 903: case_903(); break; case 904: case_904(); break; case 905: case_905(); break; case 906: case_906(); break; case 907: case_907(); break; case 908: case_908(); break; case 911: #line 6082 "cs-parser.jay" { yyVal = new TryCatch ((Block) yyVals[-1+yyTop], (List<Catch>) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop]), false); } break; case 912: case_912(); break; case 913: case_913(); break; case 914: case_914(); break; case 915: case_915(); break; case 916: case_916(); break; case 919: #line 6131 "cs-parser.jay" { yyVal = new Catch ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 920: case_920(); break; case 921: #line 6150 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; case 922: case_922(); break; case 923: case_923(); break; case 924: #line 6191 "cs-parser.jay" { yyVal = new Checked ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 925: #line 6198 "cs-parser.jay" { yyVal = new Unchecked ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop])); } break; case 926: case_926(); break; case 927: #line 6208 "cs-parser.jay" { yyVal = new Unsafe ((Block) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop])); } break; case 928: case_928(); break; case 929: case_929(); break; case 930: case_930(); break; case 931: case_931(); break; case 932: case_932(); break; case 933: case_933(); break; case 934: case_934(); break; case 935: case_935(); break; case 936: case_936(); break; case 937: case_937(); break; case 939: case_939(); break; case 940: #line 6313 "cs-parser.jay" { Error_MissingInitializer (lexer.Location); } break; case 941: case_941(); break; case 942: case_942(); break; case 943: case_943(); break; case 944: case_944(); break; case 945: case_945(); break; case 946: case_946(); break; case 947: case_947(); break; case 948: case_948(); break; case 949: case_949(); break; case 950: #line 6418 "cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); } break; case 951: case_951(); break; case 952: #line 6434 "cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); } break; case 953: case_953(); break; case 954: case_954(); break; case 955: case_955(); break; case 957: case_957(); break; case 958: case_958(); break; case 959: #line 6498 "cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); } break; case 960: case_960(); break; case 961: case_961(); break; case 962: case_962(); break; case 963: case_963(); break; case 964: #line 6537 "cs-parser.jay" { yyVal = new object[] { yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]) }; } break; case 965: case_965(); break; case 967: case_967(); break; case 973: #line 6566 "cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); } break; case 974: case_974(); break; case 975: #line 6585 "cs-parser.jay" { current_block = new Linq.QueryBlock (current_block, lexer.Location); } break; case 976: case_976(); break; case 977: case_977(); break; case 978: case_978(); break; case 979: case_979(); break; case 980: case_980(); break; case 981: case_981(); break; case 982: case_982(); break; case 983: case_983(); break; case 984: case_984(); break; case 986: case_986(); break; case 987: case_987(); break; case 988: case_988(); break; case 990: case_990(); break; case 991: case_991(); break; case 993: case_993(); break; case 994: case_994(); break; case 995: #line 6786 "cs-parser.jay" { yyVal = new Linq.OrderByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[0+yyTop]); } break; case 996: case_996(); break; case 997: case_997(); break; case 998: #line 6803 "cs-parser.jay" { yyVal = new Linq.ThenByAscending ((Linq.QueryBlock) current_block, (Expression)yyVals[0+yyTop]); } break; case 999: case_999(); break; case 1000: case_1000(); break; case 1002: case_1002(); break; case 1003: case_1003(); break; case 1006: case_1006(); break; case 1007: case_1007(); break; case 1015: #line 6925 "cs-parser.jay" { module.DocumentationBuilder.ParsedName = (MemberName) yyVals[0+yyTop]; } break; case 1016: #line 6932 "cs-parser.jay" { module.DocumentationBuilder.ParsedParameters = (List<DocumentationParameter>)yyVals[0+yyTop]; } break; case 1017: case_1017(); break; case 1018: case_1018(); break; case 1019: #line 6949 "cs-parser.jay" { yyVal = new MemberName ((MemberName) yyVals[-2+yyTop], MemberCache.IndexerNameAlias, Location.Null); } break; case 1020: #line 6953 "cs-parser.jay" { valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; } break; case 1021: case_1021(); break; case 1022: case_1022(); break; case 1023: case_1023(); break; case 1024: case_1024(); break; case 1026: #line 6989 "cs-parser.jay" { yyVal = new MemberName (((MemberName) yyVals[-2+yyTop]), (MemberName) yyVals[0+yyTop]); } break; case 1028: #line 6997 "cs-parser.jay" { valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out; } break; case 1029: #line 7001 "cs-parser.jay" { yyVal = yyVals[-1+yyTop]; } break; case 1030: #line 7008 "cs-parser.jay" { yyVal = new List<DocumentationParameter> (0); } break; case 1032: case_1032(); break; case 1033: case_1033(); break; case 1034: case_1034(); break; #line default } yyTop -= yyLen[yyN]; yyState = yyStates[yyTop]; int yyM = yyLhs[yyN]; if (yyState == 0 && yyM == 0) { //t if (debug != null) debug.shift(0, yyFinal); yyState = yyFinal; if (yyToken < 0) { yyToken = yyLex.advance() ? yyLex.token() : 0; //t if (debug != null) //t debug.lex(yyState, yyToken,yyname(yyToken), yyLex.value()); } if (yyToken == 0) { //t 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]; //t 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' } }
public abstract void ConstructBooleanExpression(BooleanExpression node);
void FabricateBodyStatement () { // // Delegate obj1 = backing_field // do { // Delegate obj2 = obj1; // obj1 = Interlocked.CompareExchange (ref backing_field, Delegate.Combine|Remove(obj2, value), obj1); // } while ((object)obj1 != (object)obj2) // var field_info = ((EventField) method).backing_field; FieldExpr f_expr = new FieldExpr (field_info, Location); if (!IsStatic) f_expr.InstanceExpression = new CompilerGeneratedThis (Parent.CurrentType, Location); var obj1 = LocalVariable.CreateCompilerGenerated (field_info.MemberType, block, Location); var obj2 = LocalVariable.CreateCompilerGenerated (field_info.MemberType, block, Location); block.AddStatement (new StatementExpression (new SimpleAssign (new LocalVariableReference (obj1, Location), f_expr))); var cond = new BooleanExpression (new Binary (Binary.Operator.Inequality, new Cast (new TypeExpression (Module.Compiler.BuiltinTypes.Object, Location), new LocalVariableReference (obj1, Location), Location), new Cast (new TypeExpression (Module.Compiler.BuiltinTypes.Object, Location), new LocalVariableReference (obj2, Location), Location))); var body = new ExplicitBlock (block, Location, Location); block.AddStatement (new Do (body, cond, Location, Location)); body.AddStatement (new StatementExpression ( new SimpleAssign (new LocalVariableReference (obj2, Location), new LocalVariableReference (obj1, Location)))); var args_oper = new Arguments (2); args_oper.Add (new Argument (new LocalVariableReference (obj2, Location))); args_oper.Add (new Argument (block.GetParameterReference (0, Location))); var op_method = GetOperation (Location); var args = new Arguments (3); args.Add (new Argument (f_expr, Argument.AType.Ref)); args.Add (new Argument (new Cast ( new TypeExpression (field_info.MemberType, Location), new Invocation (MethodGroupExpr.CreatePredefined (op_method, op_method.DeclaringType, Location), args_oper), Location))); args.Add (new Argument (new LocalVariableReference (obj1, Location))); var cas = Module.PredefinedMembers.InterlockedCompareExchange_T.Resolve (Location); if (cas == null) return; body.AddStatement (new StatementExpression (new SimpleAssign ( new LocalVariableReference (obj1, Location), new Invocation (MethodGroupExpr.CreatePredefined (cas, cas.DeclaringType, Location), args)))); }
/// <summary> /// Add an Expression row view model to the list of <see cref="BooleanExpression"/> /// </summary> /// <param name="expression"> /// The <see cref="Expression"/> that is to be added /// </param> private IBooleanExpressionRowViewModel <BooleanExpression> AddExpressionRowViewModel(BooleanExpression expression) { var orExpression = expression as OrExpression; if (orExpression != null) { return(new OrExpressionRowViewModel(orExpression, this.Session, this)); } var notExpression = expression as NotExpression; if (notExpression != null) { return(new NotExpressionRowViewModel(notExpression, this.Session, this)); } var andExpression = expression as AndExpression; if (andExpression != null) { return(new AndExpressionRowViewModel(andExpression, this.Session, this)); } var exclusiveOrExpression = expression as ExclusiveOrExpression; if (exclusiveOrExpression != null) { return(new ExclusiveOrExpressionRowViewModel(exclusiveOrExpression, this.Session, this)); } var relationalExpression = expression as RelationalExpression; if (relationalExpression != null) { return(new RelationalExpressionRowViewModel(relationalExpression, this.Session, this)); } throw new Exception("No BooleanExpression to return"); }
public Where (QueryBlock block, BooleanExpression expr, Location loc) : base (block, expr, loc) { }
public IEnumerable <Song> Select(BooleanExpression expression) { return(songs.Where(x => expression.Evaluate(x.EvaluationContext))); }