void ScriptMember() { Modifiers m = new Modifiers(this); string id; if (IsFieldDecl()) { Expect(36); Field(m); while (la.kind == 42) { Get(); Field(m); } Expect(65); } else if (la.kind == 20) { Get(); Qualident(out id); m.Check(Modifier.propEvntMeths); Expect(53); if (StartOf(1)) { FormalParams(); } Expect(64); if (la.kind == 51) { Block(); } else if (la.kind == 65) { Get(); } else SynErr(83); } else SynErr(84); }
void Field(Modifiers m) { Expect(1); if (la.kind == 40) { Get(); m.Check(Modifier.fields); Init(); BindingObject.Ident = t.val; } }
void ParseTypeDeclaration(Modifiers m) { TypeKind dummy; if (StartOf(5)) { if (la.kind == 1) { Get(); if (!"partial".Equals(t.val)) { Error("partial expected, found: " + t.val); } } if (la.kind == 16) { m.Check(classesMod); Get(); Expect(1); if (la.kind == 101) { ParseTypeParameterList(); } if (la.kind == 87) { ParseClassBase(); } while (la.kind == 1) { ParseTypeParameterConstraintsClause(); } ParseClassBody(); if (la.kind == 116) { Get(); } } else if (la.kind == 66) { m.Check(nonClassTypesMod); Get(); Expect(1); if (la.kind == 101) { ParseTypeParameterList(); } if (la.kind == 87) { Get(); ParseTypeName(); while (la.kind == 88) { Get(); ParseTypeName(); } } while (la.kind == 1) { ParseTypeParameterConstraintsClause(); } ParseStructBody(); if (la.kind == 116) { Get(); } } else if (la.kind == 40) { m.Check(nonClassTypesMod); Get(); Expect(1); if (la.kind == 101) { ParseTypeParameterList(); } if (la.kind == 87) { Get(); ParseTypeName(); while (la.kind == 88) { Get(); ParseTypeName(); } } while (la.kind == 1) { ParseTypeParameterConstraintsClause(); } Expect(97); while (StartOf(6)) { ParseInterfaceMemberDeclaration(); } Expect(113); if (la.kind == 116) { Get(); } } else SynErr(145); } else if (la.kind == 25) { m.Check(nonClassTypesMod); Get(); Expect(1); if (la.kind == 87) { Get(); ParseIntegralType(); } ParseEnumBody(); if (la.kind == 116) { Get(); } } else if (la.kind == 21) { m.Check(nonClassTypesMod); Get(); ParseType(out dummy, true); Expect(1); if (la.kind == 101) { ParseTypeParameterList(); } Expect(99); if (StartOf(7)) { ParseFormalParameterList(); } Expect(115); while (la.kind == 1) { ParseTypeParameterConstraintsClause(); } Expect(116); } else SynErr(146); }
/// <summary>Looks for 'private' before the given fragment. If found, it's also removed.</summary> /// <param name="fragment">The fragment to check before.</param> /// <param name="isPublic">True if private was not found.</param> public static void Handle(CodeFragment fragment, out bool isPublic) { isPublic = !Modifiers.Check(fragment.PreviousChild, "private"); }
void ParseStructMemberDeclaration(Modifiers m) { TypeKind type; int op; if (la.kind == 17) { m.Check(constantsMod); Get(); ParseType(out type, false); Expect(1); Expect(86); ParseExpression(); while (la.kind == 88) { Get(); Expect(1); Expect(86); ParseExpression(); } Expect(116); } else if (la.kind == 26) { m.Check(propEvntMethsMod); Get(); ParseType(out type, false); if (IsFieldDecl()) { ParseVariableDeclarators(m); Expect(116); } else if (la.kind == 1) { ParseTypeName(); Expect(97); ParseEventAccessorDeclarations(); Expect(113); } else SynErr(157); } else if (kindInContext(la.kind) == _ident && Peek(1).kind == _lpar) { m.Check(constructorsMod|staticConstrMod); Expect(1); Expect(99); if (StartOf(7)) { m.Check(constructorsMod); ParseFormalParameterList(); } Expect(115); if (la.kind == 87) { m.Check(constructorsMod); Get(); if (la.kind == 8) { Get(); } else if (la.kind == 68) { Get(); } else SynErr(158); Expect(99); if (StartOf(15)) { ParseArgument(); while (la.kind == 88) { Get(); ParseArgument(); } } Expect(115); } else if (la.kind == 97 || la.kind == 116) { } else SynErr(159); if (la.kind == 97) { ParseBlock(); } else if (la.kind == 116) { Get(); } else SynErr(160); } else if (la.kind == 31) { Get(); ParseType(out type, true); Expect(1); Expect(98); ParseExpression(); Expect(114); Expect(116); } else if (IsTypeDeclaration()) { ParseTypeDeclaration(m); } else if (StartOf(16)) { if ("partial".Equals(la.val)) { Expect(1); } ParseType(out type, true); if (la.kind == 49) { m.Check(operatorsMod); m.CheckMust(operatorsMustMod); if (type == TypeKind.@void) { Error("operator not allowed on void"); } Get(); ParseOverloadableOp(out op); Expect(99); ParseType(out type, false); Expect(1); if (la.kind == 88) { Get(); ParseType(out type, false); if ((op & binaryOp) == 0) Error("too many operands for unary operator"); Expect(1); } else if (la.kind == 115) { if ((op & unaryOp) == 0) Error("too few operands for binary operator"); } else SynErr(161); Expect(115); if (la.kind == 97) { ParseBlock(); } else if (la.kind == 116) { Get(); } else SynErr(162); } else if (IsFieldDecl()) { m.Check(fieldsMod); if (type == TypeKind.@void) { Error("field type must not be void"); } ParseVariableDeclarators(m); Expect(116); } else if (la.kind == 1) { ParseMemberName(); if (la.kind == 97) { m.Check(propEvntMethsMod); if (type == TypeKind.@void) { Error("property type must not be void"); } Get(); ParseAccessorDeclarations(m); Expect(113); } else if (la.kind == 91) { m.Check(indexersMod); if (type == TypeKind.@void) { Error("indexer type must not be void"); } Get(); Expect(68); Expect(98); ParseFormalParameterList(); Expect(114); Expect(97); ParseAccessorDeclarations(m); Expect(113); } else if (la.kind == 99 || la.kind == 101) { m.Check(propEvntMethsMod); if (la.kind == 101) { ParseTypeParameterList(); } Expect(99); if (StartOf(7)) { ParseFormalParameterList(); } Expect(115); while (la.kind == 1) { ParseTypeParameterConstraintsClause(); } if (la.kind == 97) { ParseBlock(); } else if (la.kind == 116) { Get(); } else SynErr(163); } else SynErr(164); } else if (la.kind == 68) { m.Check(indexersMod); if (type == TypeKind.@void) { Error("indexer type must not be void"); } Get(); Expect(98); ParseFormalParameterList(); Expect(114); Expect(97); ParseAccessorDeclarations(m); Expect(113); } else SynErr(165); } else if (la.kind == 27 || la.kind == 37) { m.Check(operatorsMod); m.CheckMust(operatorsMustMod); if (la.kind == 37) { Get(); } else { Get(); } Expect(49); ParseType(out type, false); if (type == TypeKind.@void) { Error("cast type must not be void"); } Expect(99); ParseType(out type, false); Expect(1); Expect(115); if (la.kind == 97) { ParseBlock(); } else if (la.kind == 116) { Get(); } else SynErr(166); } else SynErr(167); }
void ParseAccessorDeclarations(Modifiers m) { Modifiers am = new Modifiers(this); bool getFound = false, setFound = false; while (la.kind == 98) { ParseAttributes(); } ParseModifierList(am); am.Check(accessorsPossib1Mod, accessorsPossib2Mod); if (la.val.Equals("get")) { Expect(1); getFound = true; } else if (la.val.Equals("set")) { Expect(1); setFound = true; } else if (la.kind == 1) { Get(); Error("set or get expected"); } else SynErr(174); if (la.kind == 97) { ParseBlock(); } else if (la.kind == 116) { Get(); } else SynErr(175); if (StartOf(22)) { am = new Modifiers(this); while (la.kind == 98) { ParseAttributes(); } ParseModifierList(am); am.Check(accessorsPossib1Mod, accessorsPossib2Mod); if (la.val.Equals("get")) { Expect(1); if (getFound) Error("get already declared"); getFound = true; } else if (la.val.Equals("set")) { Expect(1); if (setFound) Error("set already declared"); setFound = true; } else if (la.kind == 1) { Get(); Error("set or get expected"); } else SynErr(176); if (la.kind == 97) { ParseBlock(); } else if (la.kind == 116) { Get(); } else SynErr(177); } }
private void ClassMemberDecl(Modifiers m, List<ICSharpCode.NRefactory.Parser.AST.AttributeSection> attributes) { ICSharpCode.NRefactory.Parser.AST.Statement stmt = null; if (this.StartOf(0x10)) { this.StructMemberDecl(m, attributes); } else if (this.la.kind == 0x1b) { m.Check(Modifier.Destructors); Point location = this.t.Location; base.lexer.NextToken(); base.Expect(1); DestructorDeclaration childNode = new DestructorDeclaration(this.t.val, m.Modifier, attributes); childNode.Modifier = m.Modifier; childNode.StartLocation = m.GetDeclarationLocation(location); base.Expect(20); base.Expect(0x15); childNode.EndLocation = this.t.EndLocation; if (this.la.kind == 0x10) { this.Block(out stmt); } else if (this.la.kind == 11) { base.lexer.NextToken(); } else { base.SynErr(0x8a); } childNode.Body = (BlockStatement) stmt; base.compilationUnit.AddChild(childNode); } else { base.SynErr(0x8b); } }
private void TypeDecl(Modifiers m, List<ICSharpCode.NRefactory.Parser.AST.AttributeSection> attributes) { List<TypeReference> list; List<TemplateDefinition> templates; List<ParameterDeclarationExpression> parameter = new List<ParameterDeclarationExpression>(); if (this.la.kind == 0x3a) { m.Check(Modifier.Classes); base.lexer.NextToken(); TypeDeclaration childNode = new TypeDeclaration(m.Modifier, attributes); templates = childNode.Templates; base.compilationUnit.AddChild(childNode); base.compilationUnit.BlockStart(childNode); childNode.StartLocation = m.GetDeclarationLocation(this.t.Location); childNode.Type = ICSharpCode.NRefactory.Parser.AST.ClassType.Class; base.Expect(1); childNode.Name = this.t.val; if (this.la.kind == 0x17) { this.TypeParameterList(templates); } if (this.la.kind == 9) { this.ClassBase(out list); childNode.BaseTypes = list; } while (this.IdentIsWhere()) { this.TypeParameterConstraintsClause(templates); } this.ClassBody(); if (this.la.kind == 11) { base.lexer.NextToken(); } childNode.EndLocation = this.t.Location; base.compilationUnit.BlockEnd(); } else if (this.StartOf(8)) { m.Check(Modifier.StructsInterfacesEnumsDelegates); if (this.la.kind == 0x6c) { base.lexer.NextToken(); TypeDeclaration declaration2 = new TypeDeclaration(m.Modifier, attributes); templates = declaration2.Templates; declaration2.StartLocation = m.GetDeclarationLocation(this.t.Location); base.compilationUnit.AddChild(declaration2); base.compilationUnit.BlockStart(declaration2); declaration2.Type = ICSharpCode.NRefactory.Parser.AST.ClassType.Struct; base.Expect(1); declaration2.Name = this.t.val; if (this.la.kind == 0x17) { this.TypeParameterList(templates); } if (this.la.kind == 9) { this.StructInterfaces(out list); declaration2.BaseTypes = list; } while (this.IdentIsWhere()) { this.TypeParameterConstraintsClause(templates); } this.StructBody(); if (this.la.kind == 11) { base.lexer.NextToken(); } declaration2.EndLocation = this.t.Location; base.compilationUnit.BlockEnd(); } else if (this.la.kind == 0x52) { base.lexer.NextToken(); TypeDeclaration declaration3 = new TypeDeclaration(m.Modifier, attributes); templates = declaration3.Templates; base.compilationUnit.AddChild(declaration3); base.compilationUnit.BlockStart(declaration3); declaration3.StartLocation = m.GetDeclarationLocation(this.t.Location); declaration3.Type = ICSharpCode.NRefactory.Parser.AST.ClassType.Interface; base.Expect(1); declaration3.Name = this.t.val; if (this.la.kind == 0x17) { this.TypeParameterList(templates); } if (this.la.kind == 9) { this.InterfaceBase(out list); declaration3.BaseTypes = list; } while (this.IdentIsWhere()) { this.TypeParameterConstraintsClause(templates); } this.InterfaceBody(); if (this.la.kind == 11) { base.lexer.NextToken(); } declaration3.EndLocation = this.t.Location; base.compilationUnit.BlockEnd(); } else if (this.la.kind == 0x43) { base.lexer.NextToken(); TypeDeclaration declaration4 = new TypeDeclaration(m.Modifier, attributes); base.compilationUnit.AddChild(declaration4); base.compilationUnit.BlockStart(declaration4); declaration4.StartLocation = m.GetDeclarationLocation(this.t.Location); declaration4.Type = ICSharpCode.NRefactory.Parser.AST.ClassType.Enum; base.Expect(1); declaration4.Name = this.t.val; if (this.la.kind == 9) { string str; base.lexer.NextToken(); this.IntegralType(out str); declaration4.BaseTypes.Add(new TypeReference(str)); } this.EnumBody(); if (this.la.kind == 11) { base.lexer.NextToken(); } declaration4.EndLocation = this.t.Location; base.compilationUnit.BlockEnd(); } else { base.lexer.NextToken(); DelegateDeclaration declaration5 = new DelegateDeclaration(m.Modifier, attributes); templates = declaration5.Templates; declaration5.StartLocation = m.GetDeclarationLocation(this.t.Location); if (this.NotVoidPointer()) { base.Expect(0x7a); declaration5.ReturnType = new TypeReference("void", 0, null); } else if (this.StartOf(9)) { TypeReference reference; this.Type(out reference); declaration5.ReturnType = reference; } else { base.SynErr(0x83); } base.Expect(1); declaration5.Name = this.t.val; if (this.la.kind == 0x17) { this.TypeParameterList(templates); } base.Expect(20); if (this.StartOf(10)) { this.FormalParameterList(parameter); declaration5.Parameters = parameter; } base.Expect(0x15); while (this.IdentIsWhere()) { this.TypeParameterConstraintsClause(templates); } base.Expect(11); declaration5.EndLocation = this.t.Location; base.compilationUnit.AddChild(declaration5); } } else { base.SynErr(0x84); } }
private void StructMemberDecl(Modifiers m, List<ICSharpCode.NRefactory.Parser.AST.AttributeSection> attributes) { string name = null; TypeReference reference; List<ParameterDeclarationExpression> parameter = new List<ParameterDeclarationExpression>(); ICSharpCode.NRefactory.Parser.AST.Statement stmt = null; List<VariableDeclaration> fieldDeclaration = new List<VariableDeclaration>(); List<TemplateDefinition> templates = new List<TemplateDefinition>(); TypeReference typeRef = null; if (this.la.kind == 0x3b) { Expression expression; m.Check(Modifier.VBInterfacs); base.lexer.NextToken(); Point location = this.t.Location; this.Type(out reference); base.Expect(1); FieldDeclaration childNode = new FieldDeclaration(attributes, reference, m.Modifier | Modifier.Const); childNode.StartLocation = m.GetDeclarationLocation(location); VariableDeclaration item = new VariableDeclaration(this.t.val); childNode.Fields.Add(item); base.Expect(3); this.Expr(out expression); item.Initializer = expression; while (this.la.kind == 14) { base.lexer.NextToken(); base.Expect(1); item = new VariableDeclaration(this.t.val); childNode.Fields.Add(item); base.Expect(3); this.Expr(out expression); item.Initializer = expression; } base.Expect(11); childNode.EndLocation = this.t.EndLocation; base.compilationUnit.AddChild(childNode); } else if (this.NotVoidPointer()) { m.Check(Modifier.PropertysEventsMethods); base.Expect(0x7a); Point keywordLocation = this.t.Location; if (this.IsExplicitInterfaceImplementation()) { this.TypeName(out typeRef, false); if ((this.la.kind != 15) || (this.Peek(1).kind != 110)) { name = TypeReference.StripLastIdentifierFromType(ref typeRef); } } else if (this.la.kind == 1) { base.lexer.NextToken(); name = this.t.val; } else { base.SynErr(140); } if (this.la.kind == 0x17) { this.TypeParameterList(templates); } base.Expect(20); if (this.StartOf(10)) { this.FormalParameterList(parameter); } base.Expect(0x15); MethodDeclaration declaration3 = new MethodDeclaration(name, m.Modifier, new TypeReference("void"), parameter, attributes); declaration3.StartLocation = m.GetDeclarationLocation(keywordLocation); declaration3.EndLocation = this.t.EndLocation; declaration3.Templates = templates; if (typeRef != null) { declaration3.InterfaceImplementations.Add(new InterfaceImplementation(typeRef, name)); } base.compilationUnit.AddChild(declaration3); base.compilationUnit.BlockStart(declaration3); while (this.IdentIsWhere()) { this.TypeParameterConstraintsClause(templates); } if (this.la.kind == 0x10) { this.Block(out stmt); } else if (this.la.kind == 11) { base.lexer.NextToken(); } else { base.SynErr(0x8d); } base.compilationUnit.BlockEnd(); declaration3.Body = (BlockStatement) stmt; } else if (this.la.kind == 0x44) { m.Check(Modifier.PropertysEventsMethods); base.lexer.NextToken(); EventDeclaration declaration4 = new EventDeclaration(null, null, m.Modifier, attributes, null); declaration4.StartLocation = this.t.Location; base.compilationUnit.AddChild(declaration4); base.compilationUnit.BlockStart(declaration4); EventAddRegion addBlock = null; EventRemoveRegion removeBlock = null; this.Type(out reference); declaration4.TypeReference = reference; if (this.IsExplicitInterfaceImplementation()) { this.TypeName(out typeRef, false); name = TypeReference.StripLastIdentifierFromType(ref typeRef); declaration4.InterfaceImplementations.Add(new InterfaceImplementation(typeRef, name)); } else if (this.la.kind == 1) { base.lexer.NextToken(); name = this.t.val; } else { base.SynErr(0x8e); } declaration4.Name = name; declaration4.EndLocation = this.t.EndLocation; if (this.la.kind == 0x10) { base.lexer.NextToken(); declaration4.BodyStart = this.t.Location; this.EventAccessorDecls(out addBlock, out removeBlock); base.Expect(0x11); declaration4.BodyEnd = this.t.EndLocation; } if (this.la.kind == 11) { base.lexer.NextToken(); } base.compilationUnit.BlockEnd(); declaration4.AddRegion = addBlock; declaration4.RemoveRegion = removeBlock; } else if (this.IdentAndLPar()) { m.Check(Modifier.StaticConstructors | Modifier.Visibility); base.Expect(1); string val = this.t.val; Point point3 = this.t.Location; base.Expect(20); if (this.StartOf(10)) { m.Check(Modifier.Constructors); this.FormalParameterList(parameter); } base.Expect(0x15); ICSharpCode.NRefactory.Parser.AST.ConstructorInitializer ci = null; if (this.la.kind == 9) { m.Check(Modifier.Constructors); this.ConstructorInitializer(out ci); } ConstructorDeclaration declaration5 = new ConstructorDeclaration(val, m.Modifier, parameter, ci, attributes); declaration5.StartLocation = point3; declaration5.EndLocation = this.t.EndLocation; if (this.la.kind == 0x10) { this.Block(out stmt); } else if (this.la.kind == 11) { base.lexer.NextToken(); } else { base.SynErr(0x8f); } declaration5.Body = (BlockStatement) stmt; base.compilationUnit.AddChild(declaration5); } else if ((this.la.kind == 0x45) || (this.la.kind == 0x4f)) { m.Check(Modifier.Operators); if (m.isNone) { this.Error("at least one modifier must be set"); } bool flag = true; Point empty = Point.Empty; if (this.la.kind == 0x4f) { base.lexer.NextToken(); empty = this.t.Location; } else { base.lexer.NextToken(); flag = false; empty = this.t.Location; } base.Expect(0x5b); this.Type(out reference); TypeReference typeReference = reference; base.Expect(20); this.Type(out reference); base.Expect(1); string parameterName = this.t.val; base.Expect(0x15); Point point5 = this.t.Location; if (this.la.kind == 0x10) { this.Block(out stmt); } else if (this.la.kind == 11) { base.lexer.NextToken(); stmt = null; } else { base.SynErr(0x90); } List<ParameterDeclarationExpression> parameters = new List<ParameterDeclarationExpression>(); parameters.Add(new ParameterDeclarationExpression(reference, parameterName)); OperatorDeclaration declaration6 = new OperatorDeclaration(m.Modifier, attributes, parameters, typeReference, flag ? ConversionType.Implicit : ConversionType.Explicit); declaration6.Body = (BlockStatement) stmt; declaration6.StartLocation = m.GetDeclarationLocation(empty); declaration6.EndLocation = point5; base.compilationUnit.AddChild(declaration6); } else if (this.StartOf(0x11)) { this.TypeDecl(m, attributes); } else if (this.StartOf(9)) { this.Type(out reference); Point point6 = this.t.Location; if (this.la.kind == 0x5b) { OverloadableOperatorType type; TypeReference reference4; m.Check(Modifier.Operators); if (m.isNone) { this.Error("at least one modifier must be set"); } base.lexer.NextToken(); this.OverloadableOperator(out type); TypeReference reference5 = null; string str4 = null; base.Expect(20); this.Type(out reference4); base.Expect(1); string str5 = this.t.val; if (this.la.kind == 14) { base.lexer.NextToken(); this.Type(out reference5); base.Expect(1); str4 = this.t.val; } else if (this.la.kind != 0x15) { base.SynErr(0x91); } Point point7 = this.t.Location; base.Expect(0x15); if (this.la.kind == 0x10) { this.Block(out stmt); } else if (this.la.kind == 11) { base.lexer.NextToken(); } else { base.SynErr(0x92); } List<ParameterDeclarationExpression> list5 = new List<ParameterDeclarationExpression>(); list5.Add(new ParameterDeclarationExpression(reference4, str5)); if (reference5 != null) { list5.Add(new ParameterDeclarationExpression(reference5, str4)); } OperatorDeclaration declaration7 = new OperatorDeclaration(m.Modifier, attributes, list5, reference, type); declaration7.Body = (BlockStatement) stmt; declaration7.StartLocation = m.GetDeclarationLocation(point6); declaration7.EndLocation = point7; base.compilationUnit.AddChild(declaration7); } else if (this.IsVarDecl()) { m.Check(Modifier.Fields); FieldDeclaration declaration8 = new FieldDeclaration(attributes, reference, m.Modifier); declaration8.StartLocation = m.GetDeclarationLocation(point6); this.VariableDeclarator(fieldDeclaration); while (this.la.kind == 14) { base.lexer.NextToken(); this.VariableDeclarator(fieldDeclaration); } base.Expect(11); declaration8.EndLocation = this.t.EndLocation; declaration8.Fields = fieldDeclaration; base.compilationUnit.AddChild(declaration8); } else if (this.la.kind == 110) { PropertyGetRegion region3; PropertySetRegion region4; m.Check(Modifier.Indexers); base.lexer.NextToken(); base.Expect(0x12); this.FormalParameterList(parameter); base.Expect(0x13); Point endLocation = this.t.EndLocation; base.Expect(0x10); IndexerDeclaration declaration9 = new IndexerDeclaration(reference, parameter, m.Modifier, attributes); declaration9.StartLocation = point6; declaration9.EndLocation = endLocation; declaration9.BodyStart = this.t.Location; this.AccessorDecls(out region3, out region4); base.Expect(0x11); declaration9.BodyEnd = this.t.EndLocation; declaration9.GetRegion = region3; declaration9.SetRegion = region4; base.compilationUnit.AddChild(declaration9); } else if (this.la.kind == 1) { if (this.IsExplicitInterfaceImplementation()) { this.TypeName(out typeRef, false); if ((this.la.kind != 15) || (this.Peek(1).kind != 110)) { name = TypeReference.StripLastIdentifierFromType(ref typeRef); } } else if (this.la.kind == 1) { base.lexer.NextToken(); name = this.t.val; } else { base.SynErr(0x93); } Point point9 = this.t.EndLocation; if (((this.la.kind == 0x10) || (this.la.kind == 20)) || (this.la.kind == 0x17)) { if ((this.la.kind == 20) || (this.la.kind == 0x17)) { m.Check(Modifier.PropertysEventsMethods); if (this.la.kind == 0x17) { this.TypeParameterList(templates); } base.Expect(20); if (this.StartOf(10)) { this.FormalParameterList(parameter); } base.Expect(0x15); MethodDeclaration declaration10 = new MethodDeclaration(name, m.Modifier, reference, parameter, attributes); if (typeRef != null) { declaration10.InterfaceImplementations.Add(new InterfaceImplementation(typeRef, name)); } declaration10.StartLocation = m.GetDeclarationLocation(point6); declaration10.EndLocation = this.t.EndLocation; declaration10.Templates = templates; base.compilationUnit.AddChild(declaration10); while (this.IdentIsWhere()) { this.TypeParameterConstraintsClause(templates); } if (this.la.kind == 0x10) { this.Block(out stmt); } else if (this.la.kind == 11) { base.lexer.NextToken(); } else { base.SynErr(0x94); } declaration10.Body = (BlockStatement) stmt; } else { PropertyGetRegion region5; PropertySetRegion region6; base.lexer.NextToken(); PropertyDeclaration declaration11 = new PropertyDeclaration(name, reference, m.Modifier, attributes); if (typeRef != null) { declaration11.InterfaceImplementations.Add(new InterfaceImplementation(typeRef, name)); } declaration11.StartLocation = m.GetDeclarationLocation(point6); declaration11.EndLocation = point9; declaration11.BodyStart = this.t.Location; this.AccessorDecls(out region5, out region6); base.Expect(0x11); declaration11.GetRegion = region5; declaration11.SetRegion = region6; declaration11.BodyEnd = this.t.EndLocation; base.compilationUnit.AddChild(declaration11); } } else if (this.la.kind == 15) { PropertyGetRegion region7; PropertySetRegion region8; m.Check(Modifier.Indexers); base.lexer.NextToken(); base.Expect(110); base.Expect(0x12); this.FormalParameterList(parameter); base.Expect(0x13); IndexerDeclaration declaration12 = new IndexerDeclaration(reference, parameter, m.Modifier, attributes); declaration12.StartLocation = m.GetDeclarationLocation(point6); declaration12.EndLocation = this.t.EndLocation; if (typeRef != null) { declaration12.InterfaceImplementations.Add(new InterfaceImplementation(typeRef, "this")); } base.Expect(0x10); Point point10 = this.t.Location; this.AccessorDecls(out region7, out region8); base.Expect(0x11); declaration12.BodyStart = point10; declaration12.BodyEnd = this.t.EndLocation; declaration12.GetRegion = region7; declaration12.SetRegion = region8; base.compilationUnit.AddChild(declaration12); } else { base.SynErr(0x95); } } else { base.SynErr(150); } } else { base.SynErr(0x97); } }