diff --git a/src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs b/src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs index fa85931b30..0afbbe0aa7 100644 --- a/src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs +++ b/src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs @@ -823,70 +823,70 @@ Modifiers m) { lexer.NextToken(); #line 997 "cs.ATG" - m.Add(Modifier.New); + m.Add(Modifier.New, t.Location); break; } case 96: { lexer.NextToken(); #line 998 "cs.ATG" - m.Add(Modifier.Public); + m.Add(Modifier.Public, t.Location); break; } case 95: { lexer.NextToken(); #line 999 "cs.ATG" - m.Add(Modifier.Protected); + m.Add(Modifier.Protected, t.Location); break; } case 82: { lexer.NextToken(); #line 1000 "cs.ATG" - m.Add(Modifier.Internal); + m.Add(Modifier.Internal, t.Location); break; } case 94: { lexer.NextToken(); #line 1001 "cs.ATG" - m.Add(Modifier.Private); + m.Add(Modifier.Private, t.Location); break; } case 117: { lexer.NextToken(); #line 1002 "cs.ATG" - m.Add(Modifier.Unsafe); + m.Add(Modifier.Unsafe, t.Location); break; } case 47: { lexer.NextToken(); #line 1003 "cs.ATG" - m.Add(Modifier.Abstract); + m.Add(Modifier.Abstract, t.Location); break; } case 101: { lexer.NextToken(); #line 1004 "cs.ATG" - m.Add(Modifier.Sealed); + m.Add(Modifier.Sealed, t.Location); break; } case 105: { lexer.NextToken(); #line 1005 "cs.ATG" - m.Add(Modifier.Static); + m.Add(Modifier.Static, t.Location); break; } case 1: { lexer.NextToken(); #line 1006 "cs.ATG" - if (t.val == "partial") { m.Add(Modifier.Partial); } + if (t.val == "partial") { m.Add(Modifier.Partial, t.Location); } break; } default: SynErr(128); break; @@ -915,7 +915,7 @@ Modifiers m, List attributes) { templates = newType.Templates; compilationUnit.AddChild(newType); compilationUnit.BlockStart(newType); - newType.StartLocation = t.Location; + newType.StartLocation = m.GetDeclarationLocation(t.Location); newType.Type = Types.Class; @@ -962,7 +962,7 @@ templates); #line 735 "cs.ATG" TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); templates = newType.Templates; - newType.StartLocation = t.Location; + newType.StartLocation = m.GetDeclarationLocation(t.Location); compilationUnit.AddChild(newType); compilationUnit.BlockStart(newType); newType.Type = Types.Struct; @@ -1008,7 +1008,7 @@ templates); templates = newType.Templates; compilationUnit.AddChild(newType); compilationUnit.BlockStart(newType); - newType.StartLocation = t.Location; + newType.StartLocation = m.GetDeclarationLocation(t.Location); newType.Type = Types.Interface; Expect(1); @@ -1051,7 +1051,7 @@ templates); TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); compilationUnit.AddChild(newType); compilationUnit.BlockStart(newType); - newType.StartLocation = t.Location; + newType.StartLocation = m.GetDeclarationLocation(t.Location); newType.Type = Types.Enum; Expect(1); @@ -1082,7 +1082,7 @@ out name); #line 794 "cs.ATG" DelegateDeclaration delegateDeclr = new DelegateDeclaration(m.Modifier, attributes); templates = delegateDeclr.Templates; - delegateDeclr.StartLocation = t.Location; + delegateDeclr.StartLocation = m.GetDeclarationLocation(t.Location); if ( #line 798 "cs.ATG" @@ -1677,98 +1677,98 @@ Modifiers m) { lexer.NextToken(); #line 1032 "cs.ATG" - m.Add(Modifier.Abstract); + m.Add(Modifier.Abstract, t.Location); break; } case 69: { lexer.NextToken(); #line 1033 "cs.ATG" - m.Add(Modifier.Extern); + m.Add(Modifier.Extern, t.Location); break; } case 82: { lexer.NextToken(); #line 1034 "cs.ATG" - m.Add(Modifier.Internal); + m.Add(Modifier.Internal, t.Location); break; } case 87: { lexer.NextToken(); #line 1035 "cs.ATG" - m.Add(Modifier.New); + m.Add(Modifier.New, t.Location); break; } case 92: { lexer.NextToken(); #line 1036 "cs.ATG" - m.Add(Modifier.Override); + m.Add(Modifier.Override, t.Location); break; } case 94: { lexer.NextToken(); #line 1037 "cs.ATG" - m.Add(Modifier.Private); + m.Add(Modifier.Private, t.Location); break; } case 95: { lexer.NextToken(); #line 1038 "cs.ATG" - m.Add(Modifier.Protected); + m.Add(Modifier.Protected, t.Location); break; } case 96: { lexer.NextToken(); #line 1039 "cs.ATG" - m.Add(Modifier.Public); + m.Add(Modifier.Public, t.Location); break; } case 97: { lexer.NextToken(); #line 1040 "cs.ATG" - m.Add(Modifier.Readonly); + m.Add(Modifier.Readonly, t.Location); break; } case 101: { lexer.NextToken(); #line 1041 "cs.ATG" - m.Add(Modifier.Sealed); + m.Add(Modifier.Sealed, t.Location); break; } case 105: { lexer.NextToken(); #line 1042 "cs.ATG" - m.Add(Modifier.Static); + m.Add(Modifier.Static, t.Location); break; } case 117: { lexer.NextToken(); #line 1043 "cs.ATG" - m.Add(Modifier.Unsafe); + m.Add(Modifier.Unsafe, t.Location); break; } case 120: { lexer.NextToken(); #line 1044 "cs.ATG" - m.Add(Modifier.Virtual); + m.Add(Modifier.Virtual, t.Location); break; } case 122: { lexer.NextToken(); #line 1045 "cs.ATG" - m.Add(Modifier.Volatile); + m.Add(Modifier.Volatile, t.Location); break; } default: SynErr(137); break; @@ -1795,7 +1795,7 @@ m, attributes); #line 1283 "cs.ATG" DestructorDeclaration d = new DestructorDeclaration(t.val, m.Modifier, attributes); d.Modifier = m.Modifier; - d.StartLocation = startPos; + d.StartLocation = m.GetDeclarationLocation(startPos); Expect(19); Expect(20); @@ -1845,7 +1845,7 @@ out type); #line 1061 "cs.ATG" FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier | Modifier.Const); - fd.StartLocation = startPos; + fd.StartLocation = m.GetDeclarationLocation(startPos); VariableDeclaration f = new VariableDeclaration(t.val); fd.Fields.Add(f); @@ -1908,7 +1908,7 @@ p); new TypeReference("void"), p, attributes); - methodDeclaration.StartLocation = startPos; + methodDeclaration.StartLocation = m.GetDeclarationLocation(startPos); methodDeclaration.EndLocation = t.EndLocation; methodDeclaration.Templates = templates; compilationUnit.AddChild(methodDeclaration); @@ -2170,7 +2170,7 @@ IsVarDecl()) { #line 1195 "cs.ATG" m.Check(Modifier.Fields); FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier); - fd.StartLocation = startPos; + fd.StartLocation = m.GetDeclarationLocation(startPos); VariableDeclarator( #line 1199 "cs.ATG" @@ -2250,7 +2250,7 @@ p); type, p, attributes); - methodDeclaration.StartLocation = startPos; + methodDeclaration.StartLocation = m.GetDeclarationLocation(startPos); methodDeclaration.EndLocation = t.EndLocation; methodDeclaration.Templates = templates; compilationUnit.AddChild(methodDeclaration); @@ -2277,7 +2277,7 @@ out stmt); #line 1240 "cs.ATG" PropertyDeclaration pDecl = new PropertyDeclaration(qualident, type, m.Modifier, attributes); - pDecl.StartLocation = startPos; + pDecl.StartLocation = m.GetDeclarationLocation(startPos); pDecl.EndLocation = qualIdentEndLocation; pDecl.BodyStart = t.Location; PropertyGetRegion getRegion; @@ -2309,7 +2309,7 @@ p); #line 1259 "cs.ATG" IndexerDeclaration indexer = new IndexerDeclaration(type, p, m.Modifier, attributes); - indexer.StartLocation = startPos; + indexer.StartLocation = m.GetDeclarationLocation(startPos); indexer.EndLocation = t.EndLocation; indexer.NamespaceName = qualident; PropertyGetRegion getRegion; diff --git a/src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG b/src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG index 45a9706dee..c3fded6cec 100644 --- a/src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG +++ b/src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG @@ -713,7 +713,7 @@ TypeDecl attributes> templates = newType.Templates; compilationUnit.AddChild(newType); compilationUnit.BlockStart(newType); - newType.StartLocation = t.Location; + newType.StartLocation = m.GetDeclarationLocation(t.Location); newType.Type = Types.Class; .) @@ -734,7 +734,7 @@ TypeDecl attributes> | /*--- struct declaration: */ (. m.Check(Modifier.StructsInterfacesEnumsDelegates); .) ( "struct" (. TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); templates = newType.Templates; - newType.StartLocation = t.Location; + newType.StartLocation = m.GetDeclarationLocation(t.Location); compilationUnit.AddChild(newType); compilationUnit.BlockStart(newType); newType.Type = Types.Struct; @@ -759,7 +759,7 @@ TypeDecl attributes> templates = newType.Templates; compilationUnit.AddChild(newType); compilationUnit.BlockStart(newType); - newType.StartLocation = t.Location; + newType.StartLocation = m.GetDeclarationLocation(t.Location); newType.Type = Types.Interface; .) ident (. newType.Name = t.val; .) @@ -780,7 +780,7 @@ TypeDecl attributes> "enum" (. TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); compilationUnit.AddChild(newType); compilationUnit.BlockStart(newType); - newType.StartLocation = t.Location; + newType.StartLocation = m.GetDeclarationLocation(t.Location); newType.Type = Types.Enum; .) ident (. newType.Name = t.val; .) @@ -793,7 +793,7 @@ TypeDecl attributes> | /*--- delegate declaration: */ "delegate" (. DelegateDeclaration delegateDeclr = new DelegateDeclaration(m.Modifier, attributes); templates = delegateDeclr.Templates; - delegateDeclr.StartLocation = t.Location; + delegateDeclr.StartLocation = m.GetDeclarationLocation(t.Location); .) ( IF (NotVoidPointer()) "void" (. delegateDeclr.ReturnType = new TypeReference("void", 0, null); .) | Type (. delegateDeclr.ReturnType = type; .) @@ -994,16 +994,16 @@ ParameterArray TypeModifier = - "new" (. m.Add(Modifier.New); .) - | "public" (. m.Add(Modifier.Public); .) - | "protected" (. m.Add(Modifier.Protected); .) - | "internal" (. m.Add(Modifier.Internal); .) - | "private" (. m.Add(Modifier.Private); .) - | "unsafe" (. m.Add(Modifier.Unsafe); .) - | "abstract" (. m.Add(Modifier.Abstract); .) - | "sealed" (. m.Add(Modifier.Sealed); .) - | "static" (. m.Add(Modifier.Static); .) - | ident (. if (t.val == "partial") { m.Add(Modifier.Partial); } .) + "new" (. m.Add(Modifier.New, t.Location); .) + | "public" (. m.Add(Modifier.Public, t.Location); .) + | "protected" (. m.Add(Modifier.Protected, t.Location); .) + | "internal" (. m.Add(Modifier.Internal, t.Location); .) + | "private" (. m.Add(Modifier.Private, t.Location); .) + | "unsafe" (. m.Add(Modifier.Unsafe, t.Location); .) + | "abstract" (. m.Add(Modifier.Abstract, t.Location); .) + | "sealed" (. m.Add(Modifier.Sealed, t.Location); .) + | "static" (. m.Add(Modifier.Static, t.Location); .) + | ident (. if (t.val == "partial") { m.Add(Modifier.Partial, t.Location); } .) . ClassType @@ -1029,20 +1029,20 @@ IntegralType (. name = ""; .) MemberModifier = - "abstract" (. m.Add(Modifier.Abstract); .) - | "extern" (. m.Add(Modifier.Extern); .) - | "internal" (. m.Add(Modifier.Internal); .) - | "new" (. m.Add(Modifier.New); .) - | "override" (. m.Add(Modifier.Override); .) - | "private" (. m.Add(Modifier.Private); .) - | "protected" (. m.Add(Modifier.Protected); .) - | "public" (. m.Add(Modifier.Public); .) - | "readonly" (. m.Add(Modifier.Readonly); .) - | "sealed" (. m.Add(Modifier.Sealed); .) - | "static" (. m.Add(Modifier.Static); .) - | "unsafe" (. m.Add(Modifier.Unsafe); .) - | "virtual" (. m.Add(Modifier.Virtual); .) - | "volatile" (. m.Add(Modifier.Volatile); .) + "abstract" (. m.Add(Modifier.Abstract, t.Location); .) + | "extern" (. m.Add(Modifier.Extern, t.Location); .) + | "internal" (. m.Add(Modifier.Internal, t.Location); .) + | "new" (. m.Add(Modifier.New, t.Location); .) + | "override" (. m.Add(Modifier.Override, t.Location); .) + | "private" (. m.Add(Modifier.Private, t.Location); .) + | "protected" (. m.Add(Modifier.Protected, t.Location); .) + | "public" (. m.Add(Modifier.Public, t.Location); .) + | "readonly" (. m.Add(Modifier.Readonly, t.Location); .) + | "sealed" (. m.Add(Modifier.Sealed, t.Location); .) + | "static" (. m.Add(Modifier.Static, t.Location); .) + | "unsafe" (. m.Add(Modifier.Unsafe, t.Location); .) + | "virtual" (. m.Add(Modifier.Virtual, t.Location); .) + | "volatile" (. m.Add(Modifier.Volatile, t.Location); .) . StructMemberDecl attributes> @@ -1059,7 +1059,7 @@ StructMemberDecl attributes> /*--- constant declaration: */ (. m.Check(Modifier.Constants); .) "const" (.Point startPos = t.Location; .) Type ident (. FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier | Modifier.Const); - fd.StartLocation = startPos; + fd.StartLocation = m.GetDeclarationLocation(startPos); VariableDeclaration f = new VariableDeclaration(t.val); fd.Fields.Add(f); .) @@ -1083,7 +1083,7 @@ StructMemberDecl attributes> new TypeReference("void"), p, attributes); - methodDeclaration.StartLocation = startPos; + methodDeclaration.StartLocation = m.GetDeclarationLocation(startPos); methodDeclaration.EndLocation = t.EndLocation; methodDeclaration.Templates = templates; compilationUnit.AddChild(methodDeclaration); @@ -1194,7 +1194,7 @@ StructMemberDecl attributes> /*--- field declaration: */ | IF (IsVarDecl()) (. m.Check(Modifier.Fields); FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier); - fd.StartLocation = startPos; + fd.StartLocation = m.GetDeclarationLocation(startPos); .) VariableDeclarator { "," VariableDeclarator } @@ -1228,7 +1228,7 @@ StructMemberDecl attributes> type, p, attributes); - methodDeclaration.StartLocation = startPos; + methodDeclaration.StartLocation = m.GetDeclarationLocation(startPos); methodDeclaration.EndLocation = t.EndLocation; methodDeclaration.Templates = templates; compilationUnit.AddChild(methodDeclaration); @@ -1238,7 +1238,7 @@ StructMemberDecl attributes> /*--- property declaration: */ | "{" (. PropertyDeclaration pDecl = new PropertyDeclaration(qualident, type, m.Modifier, attributes); - pDecl.StartLocation = startPos; + pDecl.StartLocation = m.GetDeclarationLocation(startPos); pDecl.EndLocation = qualIdentEndLocation; pDecl.BodyStart = t.Location; PropertyGetRegion getRegion; @@ -1257,7 +1257,7 @@ StructMemberDecl attributes> | (. m.Check(Modifier.Indexers); .) "." "this" "[" FormalParameterList

"]" (. IndexerDeclaration indexer = new IndexerDeclaration(type, p, m.Modifier, attributes); - indexer.StartLocation = startPos; + indexer.StartLocation = m.GetDeclarationLocation(startPos); indexer.EndLocation = t.EndLocation; indexer.NamespaceName = qualident; PropertyGetRegion getRegion; @@ -1282,7 +1282,7 @@ ClassMemberDecl attributes> | /*--- destructor declaration: */ (. m.Check(Modifier.Destructors); Point startPos = t.Location; .) "~" ident (. DestructorDeclaration d = new DestructorDeclaration(t.val, m.Modifier, attributes); d.Modifier = m.Modifier; - d.StartLocation = startPos; + d.StartLocation = m.GetDeclarationLocation(startPos); .) "(" ")" (. d.EndLocation = t.EndLocation; .) ( Block | ";" ) (. d.Body = (BlockStatement)stmt; diff --git a/src/Libraries/NRefactory/Project/Src/Parser/Modifiers.cs b/src/Libraries/NRefactory/Project/Src/Parser/Modifiers.cs index 6d796c65bd..e3554b9344 100644 --- a/src/Libraries/NRefactory/Project/Src/Parser/Modifiers.cs +++ b/src/Libraries/NRefactory/Project/Src/Parser/Modifiers.cs @@ -6,12 +6,14 @@ // using ICSharpCode.NRefactory.Parser.AST; +using System.Drawing; namespace ICSharpCode.NRefactory.Parser { internal class Modifiers { Modifier cur; + Point location = new Point(-1, -1); public Modifier Modifier { get { @@ -19,6 +21,23 @@ namespace ICSharpCode.NRefactory.Parser } } + public Point GetDeclarationLocation(Point keywordLocation) + { + if(location.X == -1 && location.Y == -1) { + return keywordLocation; + } + return location; + } + + public Point Location { + get { + return location; + } + set { + location = value; + } + } + public bool isNone { get { return cur == Modifier.None; } } public bool Contains(Modifier m) @@ -26,8 +45,12 @@ namespace ICSharpCode.NRefactory.Parser return ((cur & m) != 0); } - public void Add(Modifier m) + public void Add(Modifier m, Point tokenLocation) { + if(location.X == -1 && location.Y == -1) { + location = tokenLocation; + } + if ((cur & m) == 0) { cur |= m; } else { @@ -37,7 +60,7 @@ namespace ICSharpCode.NRefactory.Parser public void Add(Modifiers m) { - Add(m.cur); + Add(m.cur, m.Location); } public void Check(Modifier allowed) diff --git a/src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs b/src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs index 4d52dec29a..95a848b5e9 100644 --- a/src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs +++ b/src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs @@ -350,7 +350,7 @@ out u); void GlobalAttributeSection() { -#line 2007 "VBNET.ATG" +#line 2005 "VBNET.ATG" Point startPos = t.Location; Expect(26); if (la.kind == 48) { @@ -359,20 +359,20 @@ out u); lexer.NextToken(); } else SynErr(204); -#line 2009 "VBNET.ATG" +#line 2007 "VBNET.ATG" string attributeTarget = t.val.ToLower(); List attributes = new List(); ASTAttribute attribute; Expect(13); Attribute( -#line 2013 "VBNET.ATG" +#line 2011 "VBNET.ATG" out attribute); -#line 2013 "VBNET.ATG" +#line 2011 "VBNET.ATG" attributes.Add(attribute); while ( -#line 2014 "VBNET.ATG" +#line 2012 "VBNET.ATG" NotFinalComma()) { if (la.kind == 12) { lexer.NextToken(); @@ -384,10 +384,10 @@ NotFinalComma()) { Expect(13); } Attribute( -#line 2014 "VBNET.ATG" +#line 2012 "VBNET.ATG" out attribute); -#line 2014 "VBNET.ATG" +#line 2012 "VBNET.ATG" attributes.Add(attribute); } if (la.kind == 12) { @@ -396,7 +396,7 @@ out attribute); Expect(25); EndOfStmt(); -#line 2019 "VBNET.ATG" +#line 2017 "VBNET.ATG" AttributeSection section = new AttributeSection(attributeTarget, attributes); section.StartLocation = startPos; section.EndLocation = t.EndLocation; @@ -528,30 +528,30 @@ out qualident); } void Qualident( -#line 2731 "VBNET.ATG" +#line 2729 "VBNET.ATG" out string qualident) { -#line 2733 "VBNET.ATG" +#line 2731 "VBNET.ATG" string name; qualidentBuilder.Length = 0; Identifier(); -#line 2737 "VBNET.ATG" +#line 2735 "VBNET.ATG" qualidentBuilder.Append(t.val); while ( -#line 2738 "VBNET.ATG" +#line 2736 "VBNET.ATG" DotAndIdentOrKw()) { Expect(10); IdentifierOrKeyword( -#line 2738 "VBNET.ATG" +#line 2736 "VBNET.ATG" out name); -#line 2738 "VBNET.ATG" +#line 2736 "VBNET.ATG" qualidentBuilder.Append('.'); qualidentBuilder.Append(name); } -#line 2740 "VBNET.ATG" +#line 2738 "VBNET.ATG" qualident = qualidentBuilder.ToString(); } @@ -565,35 +565,35 @@ out name); } void AttributeSection( -#line 2077 "VBNET.ATG" +#line 2075 "VBNET.ATG" out AttributeSection section) { -#line 2079 "VBNET.ATG" +#line 2077 "VBNET.ATG" string attributeTarget = "";List attributes = new List(); ASTAttribute attribute; Expect(26); -#line 2083 "VBNET.ATG" +#line 2081 "VBNET.ATG" Point startPos = t.Location; if ( -#line 2084 "VBNET.ATG" +#line 2082 "VBNET.ATG" IsLocalAttrTarget()) { if (la.kind == 92) { lexer.NextToken(); -#line 2085 "VBNET.ATG" +#line 2083 "VBNET.ATG" attributeTarget = "event"; } else if (la.kind == 154) { lexer.NextToken(); -#line 2086 "VBNET.ATG" +#line 2084 "VBNET.ATG" attributeTarget = "return"; } else { Identifier(); -#line 2089 "VBNET.ATG" +#line 2087 "VBNET.ATG" string val = t.val.ToLower(); if (val != "field" || val != "method" || val != "module" || val != "param" || @@ -606,20 +606,20 @@ IsLocalAttrTarget()) { Expect(13); } Attribute( -#line 2099 "VBNET.ATG" +#line 2097 "VBNET.ATG" out attribute); -#line 2099 "VBNET.ATG" +#line 2097 "VBNET.ATG" attributes.Add(attribute); while ( -#line 2100 "VBNET.ATG" +#line 2098 "VBNET.ATG" NotFinalComma()) { Expect(12); Attribute( -#line 2100 "VBNET.ATG" +#line 2098 "VBNET.ATG" out attribute); -#line 2100 "VBNET.ATG" +#line 2098 "VBNET.ATG" attributes.Add(attribute); } if (la.kind == 12) { @@ -627,7 +627,7 @@ out attribute); } Expect(25); -#line 2104 "VBNET.ATG" +#line 2102 "VBNET.ATG" section = new AttributeSection(attributeTarget, attributes); section.StartLocation = startPos; section.EndLocation = t.EndLocation; @@ -635,63 +635,63 @@ out attribute); } void TypeModifier( -#line 2940 "VBNET.ATG" +#line 2938 "VBNET.ATG" Modifiers m) { switch (la.kind) { case 148: { lexer.NextToken(); -#line 2941 "VBNET.ATG" - m.Add(Modifier.Public); +#line 2939 "VBNET.ATG" + m.Add(Modifier.Public, t.Location); break; } case 147: { lexer.NextToken(); -#line 2942 "VBNET.ATG" - m.Add(Modifier.Protected); +#line 2940 "VBNET.ATG" + m.Add(Modifier.Protected, t.Location); break; } case 98: { lexer.NextToken(); -#line 2943 "VBNET.ATG" - m.Add(Modifier.Internal); +#line 2941 "VBNET.ATG" + m.Add(Modifier.Internal, t.Location); break; } case 145: { lexer.NextToken(); -#line 2944 "VBNET.ATG" - m.Add(Modifier.Private); +#line 2942 "VBNET.ATG" + m.Add(Modifier.Private, t.Location); break; } case 158: { lexer.NextToken(); -#line 2945 "VBNET.ATG" - m.Add(Modifier.Static); +#line 2943 "VBNET.ATG" + m.Add(Modifier.Static, t.Location); break; } case 157: { lexer.NextToken(); -#line 2946 "VBNET.ATG" - m.Add(Modifier.New); +#line 2944 "VBNET.ATG" + m.Add(Modifier.New, t.Location); break; } case 121: { lexer.NextToken(); -#line 2947 "VBNET.ATG" - m.Add(Modifier.Abstract); +#line 2945 "VBNET.ATG" + m.Add(Modifier.Abstract, t.Location); break; } case 130: { lexer.NextToken(); -#line 2948 "VBNET.ATG" - m.Add(Modifier.Sealed); +#line 2946 "VBNET.ATG" + m.Add(Modifier.Sealed, t.Location); break; } default: SynErr(210); break; @@ -716,7 +716,7 @@ Modifiers m, List attributes) { lexer.NextToken(); #line 599 "VBNET.ATG" - m.Add(Modifier.Partial); + m.Add(Modifier.Partial, t.Location); } Expect(66); @@ -769,7 +769,7 @@ newType); TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); compilationUnit.AddChild(newType); compilationUnit.BlockStart(newType); - newType.StartLocation = t.Location; + newType.StartLocation = m.GetDeclarationLocation(t.Location); newType.Type = Types.Module; Identifier(); @@ -794,31 +794,30 @@ newType); TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); compilationUnit.AddChild(newType); compilationUnit.BlockStart(newType); - newType.StartLocation = t.Location; - System.Console.WriteLine("XXX " + t.Location.ToString()); + newType.StartLocation = m.GetDeclarationLocation(t.Location); newType.Type = Types.Struct; Identifier(); -#line 642 "VBNET.ATG" +#line 641 "VBNET.ATG" newType.Name = t.val; TypeParameterList( -#line 643 "VBNET.ATG" +#line 642 "VBNET.ATG" newType.Templates); Expect(1); while (la.kind == 106) { TypeImplementsClause( -#line 644 "VBNET.ATG" +#line 643 "VBNET.ATG" out baseInterfaces); -#line 644 "VBNET.ATG" +#line 643 "VBNET.ATG" newType.BaseTypes.AddRange(baseInterfaces); } StructureBody( -#line 645 "VBNET.ATG" +#line 644 "VBNET.ATG" newType); -#line 647 "VBNET.ATG" +#line 646 "VBNET.ATG" compilationUnit.BlockEnd(); break; @@ -826,11 +825,10 @@ newType); case 89: { lexer.NextToken(); -#line 652 "VBNET.ATG" +#line 651 "VBNET.ATG" m.Check(Modifier.VBEnums); TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); - newType.StartLocation = t.Location; - + newType.StartLocation = m.GetDeclarationLocation(t.Location); compilationUnit.AddChild(newType); compilationUnit.BlockStart(newType); @@ -838,23 +836,23 @@ newType); Identifier(); -#line 661 "VBNET.ATG" +#line 659 "VBNET.ATG" newType.Name = t.val; if (la.kind == 47) { lexer.NextToken(); PrimitiveTypeName( -#line 662 "VBNET.ATG" +#line 660 "VBNET.ATG" out name); -#line 662 "VBNET.ATG" +#line 660 "VBNET.ATG" newType.BaseTypes.Add(new TypeReference(name)); } Expect(1); EnumBody( -#line 664 "VBNET.ATG" +#line 662 "VBNET.ATG" newType); -#line 666 "VBNET.ATG" +#line 664 "VBNET.ATG" compilationUnit.BlockEnd(); break; @@ -862,35 +860,35 @@ newType); case 111: { lexer.NextToken(); -#line 671 "VBNET.ATG" +#line 669 "VBNET.ATG" m.Check(Modifier.VBInterfacs); TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); - newType.StartLocation = t.Location; + newType.StartLocation = m.GetDeclarationLocation(t.Location); compilationUnit.AddChild(newType); compilationUnit.BlockStart(newType); newType.Type = Types.Interface; Identifier(); -#line 678 "VBNET.ATG" +#line 676 "VBNET.ATG" newType.Name = t.val; TypeParameterList( -#line 679 "VBNET.ATG" +#line 677 "VBNET.ATG" newType.Templates); EndOfStmt(); while (la.kind == 109) { InterfaceBase( -#line 680 "VBNET.ATG" +#line 678 "VBNET.ATG" out baseInterfaces); -#line 680 "VBNET.ATG" +#line 678 "VBNET.ATG" newType.BaseTypes.AddRange(baseInterfaces); } InterfaceBody( -#line 681 "VBNET.ATG" +#line 679 "VBNET.ATG" newType); -#line 683 "VBNET.ATG" +#line 681 "VBNET.ATG" compilationUnit.BlockEnd(); break; @@ -898,74 +896,74 @@ newType); case 79: { lexer.NextToken(); -#line 688 "VBNET.ATG" +#line 686 "VBNET.ATG" m.Check(Modifier.VBDelegates); DelegateDeclaration delegateDeclr = new DelegateDeclaration(m.Modifier, attributes); delegateDeclr.ReturnType = new TypeReference("", "System.Void"); - delegateDeclr.StartLocation = t.Location; + delegateDeclr.StartLocation = m.GetDeclarationLocation(t.Location); List p = new List(); if (la.kind == 167) { lexer.NextToken(); Identifier(); -#line 695 "VBNET.ATG" +#line 693 "VBNET.ATG" delegateDeclr.Name = t.val; TypeParameterList( -#line 696 "VBNET.ATG" +#line 694 "VBNET.ATG" delegateDeclr.Templates); if (la.kind == 23) { lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 697 "VBNET.ATG" +#line 695 "VBNET.ATG" p); } Expect(24); -#line 697 "VBNET.ATG" +#line 695 "VBNET.ATG" delegateDeclr.Parameters = p; } } else if (la.kind == 99) { lexer.NextToken(); Identifier(); -#line 699 "VBNET.ATG" +#line 697 "VBNET.ATG" delegateDeclr.Name = t.val; TypeParameterList( -#line 700 "VBNET.ATG" +#line 698 "VBNET.ATG" delegateDeclr.Templates); if (la.kind == 23) { lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 701 "VBNET.ATG" +#line 699 "VBNET.ATG" p); } Expect(24); -#line 701 "VBNET.ATG" +#line 699 "VBNET.ATG" delegateDeclr.Parameters = p; } if (la.kind == 47) { lexer.NextToken(); -#line 702 "VBNET.ATG" +#line 700 "VBNET.ATG" TypeReference type; TypeName( -#line 702 "VBNET.ATG" +#line 700 "VBNET.ATG" out type); -#line 702 "VBNET.ATG" +#line 700 "VBNET.ATG" delegateDeclr.ReturnType = type; } } else SynErr(211); -#line 704 "VBNET.ATG" +#line 702 "VBNET.ATG" delegateDeclr.EndLocation = t.EndLocation; Expect(1); -#line 707 "VBNET.ATG" +#line 705 "VBNET.ATG" compilationUnit.AddChild(delegateDeclr); break; @@ -1058,19 +1056,19 @@ out constraint); } void TypeName( -#line 1927 "VBNET.ATG" +#line 1925 "VBNET.ATG" out TypeReference typeref) { -#line 1928 "VBNET.ATG" +#line 1926 "VBNET.ATG" ArrayList rank = null; typeref = null; NonArrayTypeName( -#line 1930 "VBNET.ATG" +#line 1928 "VBNET.ATG" out typeref); ArrayTypeModifiers( -#line 1931 "VBNET.ATG" +#line 1929 "VBNET.ATG" out rank); -#line 1933 "VBNET.ATG" +#line 1931 "VBNET.ATG" if (rank != null && typeref != null) { typeref.RankSpecifier = (int[])rank.ToArray(typeof(int)); } @@ -1078,267 +1076,267 @@ out rank); } void ClassBaseType( -#line 884 "VBNET.ATG" +#line 882 "VBNET.ATG" out TypeReference typeRef) { -#line 886 "VBNET.ATG" +#line 884 "VBNET.ATG" typeRef = null; Expect(109); TypeName( -#line 889 "VBNET.ATG" +#line 887 "VBNET.ATG" out typeRef); EndOfStmt(); } void TypeImplementsClause( -#line 1580 "VBNET.ATG" +#line 1578 "VBNET.ATG" out List baseInterfaces) { -#line 1582 "VBNET.ATG" +#line 1580 "VBNET.ATG" baseInterfaces = new List(); TypeReference type = null; Expect(106); TypeName( -#line 1585 "VBNET.ATG" +#line 1583 "VBNET.ATG" out type); -#line 1587 "VBNET.ATG" +#line 1585 "VBNET.ATG" baseInterfaces.Add(type); while (la.kind == 12) { lexer.NextToken(); TypeName( -#line 1590 "VBNET.ATG" +#line 1588 "VBNET.ATG" out type); -#line 1591 "VBNET.ATG" +#line 1589 "VBNET.ATG" baseInterfaces.Add(type); } EndOfStmt(); } void ClassBody( -#line 717 "VBNET.ATG" +#line 715 "VBNET.ATG" TypeDeclaration newType) { -#line 718 "VBNET.ATG" +#line 716 "VBNET.ATG" AttributeSection section; while (StartOf(6)) { -#line 720 "VBNET.ATG" +#line 718 "VBNET.ATG" List attributes = new List(); Modifiers m = new Modifiers(); while (la.kind == 26) { AttributeSection( -#line 723 "VBNET.ATG" +#line 721 "VBNET.ATG" out section); -#line 723 "VBNET.ATG" +#line 721 "VBNET.ATG" attributes.Add(section); } while (StartOf(7)) { MemberModifier( -#line 724 "VBNET.ATG" +#line 722 "VBNET.ATG" m); } ClassMemberDecl( -#line 725 "VBNET.ATG" +#line 723 "VBNET.ATG" m, attributes); } Expect(87); Expect(66); -#line 727 "VBNET.ATG" +#line 725 "VBNET.ATG" newType.EndLocation = t.EndLocation; Expect(1); } void ModuleBody( -#line 746 "VBNET.ATG" +#line 744 "VBNET.ATG" TypeDeclaration newType) { -#line 747 "VBNET.ATG" +#line 745 "VBNET.ATG" AttributeSection section; while (StartOf(6)) { -#line 749 "VBNET.ATG" +#line 747 "VBNET.ATG" List attributes = new List(); Modifiers m = new Modifiers(); while (la.kind == 26) { AttributeSection( -#line 752 "VBNET.ATG" +#line 750 "VBNET.ATG" out section); -#line 752 "VBNET.ATG" +#line 750 "VBNET.ATG" attributes.Add(section); } while (StartOf(7)) { MemberModifier( -#line 753 "VBNET.ATG" +#line 751 "VBNET.ATG" m); } ClassMemberDecl( -#line 754 "VBNET.ATG" +#line 752 "VBNET.ATG" m, attributes); } Expect(87); Expect(120); -#line 756 "VBNET.ATG" +#line 754 "VBNET.ATG" newType.EndLocation = t.EndLocation; Expect(1); } void StructureBody( -#line 731 "VBNET.ATG" +#line 729 "VBNET.ATG" TypeDeclaration newType) { -#line 732 "VBNET.ATG" +#line 730 "VBNET.ATG" AttributeSection section; while (StartOf(6)) { -#line 734 "VBNET.ATG" +#line 732 "VBNET.ATG" List attributes = new List(); Modifiers m = new Modifiers(); while (la.kind == 26) { AttributeSection( -#line 737 "VBNET.ATG" +#line 735 "VBNET.ATG" out section); -#line 737 "VBNET.ATG" +#line 735 "VBNET.ATG" attributes.Add(section); } while (StartOf(7)) { MemberModifier( -#line 738 "VBNET.ATG" +#line 736 "VBNET.ATG" m); } StructureMemberDecl( -#line 739 "VBNET.ATG" +#line 737 "VBNET.ATG" m, attributes); } Expect(87); Expect(166); -#line 741 "VBNET.ATG" +#line 739 "VBNET.ATG" newType.EndLocation = t.EndLocation; Expect(1); } void PrimitiveTypeName( -#line 2913 "VBNET.ATG" +#line 2911 "VBNET.ATG" out string type) { -#line 2914 "VBNET.ATG" +#line 2912 "VBNET.ATG" type = String.Empty; switch (la.kind) { case 51: { lexer.NextToken(); -#line 2915 "VBNET.ATG" +#line 2913 "VBNET.ATG" type = "Boolean"; break; } case 75: { lexer.NextToken(); -#line 2916 "VBNET.ATG" +#line 2914 "VBNET.ATG" type = "Date"; break; } case 64: { lexer.NextToken(); -#line 2917 "VBNET.ATG" +#line 2915 "VBNET.ATG" type = "Char"; break; } case 165: { lexer.NextToken(); -#line 2918 "VBNET.ATG" +#line 2916 "VBNET.ATG" type = "String"; break; } case 76: { lexer.NextToken(); -#line 2919 "VBNET.ATG" +#line 2917 "VBNET.ATG" type = "Decimal"; break; } case 53: { lexer.NextToken(); -#line 2920 "VBNET.ATG" +#line 2918 "VBNET.ATG" type = "Byte"; break; } case 159: { lexer.NextToken(); -#line 2921 "VBNET.ATG" +#line 2919 "VBNET.ATG" type = "Short"; break; } case 110: { lexer.NextToken(); -#line 2922 "VBNET.ATG" +#line 2920 "VBNET.ATG" type = "Integer"; break; } case 116: { lexer.NextToken(); -#line 2923 "VBNET.ATG" +#line 2921 "VBNET.ATG" type = "Long"; break; } case 160: { lexer.NextToken(); -#line 2924 "VBNET.ATG" +#line 2922 "VBNET.ATG" type = "Single"; break; } case 83: { lexer.NextToken(); -#line 2925 "VBNET.ATG" +#line 2923 "VBNET.ATG" type = "Double"; break; } case 191: { lexer.NextToken(); -#line 2926 "VBNET.ATG" +#line 2924 "VBNET.ATG" type = "UInteger"; break; } case 192: { lexer.NextToken(); -#line 2927 "VBNET.ATG" +#line 2925 "VBNET.ATG" type = "ULong"; break; } case 193: { lexer.NextToken(); -#line 2928 "VBNET.ATG" +#line 2926 "VBNET.ATG" type = "UShort"; break; } case 190: { lexer.NextToken(); -#line 2929 "VBNET.ATG" +#line 2927 "VBNET.ATG" type = "SByte"; break; } @@ -1347,56 +1345,56 @@ out string type) { } void EnumBody( -#line 760 "VBNET.ATG" +#line 758 "VBNET.ATG" TypeDeclaration newType) { -#line 761 "VBNET.ATG" +#line 759 "VBNET.ATG" FieldDeclaration f; while (StartOf(8)) { EnumMemberDecl( -#line 763 "VBNET.ATG" +#line 761 "VBNET.ATG" out f); -#line 763 "VBNET.ATG" +#line 761 "VBNET.ATG" compilationUnit.AddChild(f); } Expect(87); Expect(89); -#line 765 "VBNET.ATG" +#line 763 "VBNET.ATG" newType.EndLocation = t.EndLocation; Expect(1); } void InterfaceBase( -#line 1565 "VBNET.ATG" +#line 1563 "VBNET.ATG" out List bases) { -#line 1567 "VBNET.ATG" +#line 1565 "VBNET.ATG" TypeReference type; bases = new List(); Expect(109); TypeName( -#line 1571 "VBNET.ATG" +#line 1569 "VBNET.ATG" out type); -#line 1571 "VBNET.ATG" +#line 1569 "VBNET.ATG" bases.Add(type); while (la.kind == 12) { lexer.NextToken(); TypeName( -#line 1574 "VBNET.ATG" +#line 1572 "VBNET.ATG" out type); -#line 1574 "VBNET.ATG" +#line 1572 "VBNET.ATG" bases.Add(type); } Expect(1); } void InterfaceBody( -#line 769 "VBNET.ATG" +#line 767 "VBNET.ATG" TypeDeclaration newType) { while (StartOf(9)) { InterfaceMemberDecl(); @@ -1404,33 +1402,33 @@ TypeDeclaration newType) { Expect(87); Expect(111); -#line 771 "VBNET.ATG" +#line 769 "VBNET.ATG" newType.EndLocation = t.EndLocation; Expect(1); } void FormalParameterList( -#line 2111 "VBNET.ATG" +#line 2109 "VBNET.ATG" List parameter) { -#line 2113 "VBNET.ATG" +#line 2111 "VBNET.ATG" ParameterDeclarationExpression p; AttributeSection section; List attributes = new List(); while (la.kind == 26) { AttributeSection( -#line 2117 "VBNET.ATG" +#line 2115 "VBNET.ATG" out section); -#line 2117 "VBNET.ATG" +#line 2115 "VBNET.ATG" attributes.Add(section); } FormalParameter( -#line 2119 "VBNET.ATG" +#line 2117 "VBNET.ATG" out p); -#line 2121 "VBNET.ATG" +#line 2119 "VBNET.ATG" bool paramsFound = false; p.Attributes = attributes; parameter.Add(p); @@ -1438,167 +1436,167 @@ out p); while (la.kind == 12) { lexer.NextToken(); -#line 2126 "VBNET.ATG" +#line 2124 "VBNET.ATG" if (paramsFound) Error("params array must be at end of parameter list"); while (la.kind == 26) { AttributeSection( -#line 2127 "VBNET.ATG" +#line 2125 "VBNET.ATG" out section); -#line 2127 "VBNET.ATG" +#line 2125 "VBNET.ATG" attributes.Add(section); } FormalParameter( -#line 2129 "VBNET.ATG" +#line 2127 "VBNET.ATG" out p); -#line 2129 "VBNET.ATG" +#line 2127 "VBNET.ATG" p.Attributes = attributes; parameter.Add(p); } } void MemberModifier( -#line 2951 "VBNET.ATG" +#line 2949 "VBNET.ATG" Modifiers m) { switch (la.kind) { case 121: { lexer.NextToken(); -#line 2952 "VBNET.ATG" - m.Add(Modifier.Abstract); +#line 2950 "VBNET.ATG" + m.Add(Modifier.Abstract, t.Location); break; } case 78: { lexer.NextToken(); -#line 2953 "VBNET.ATG" - m.Add(Modifier.Default); +#line 2951 "VBNET.ATG" + m.Add(Modifier.Default, t.Location); break; } case 98: { lexer.NextToken(); -#line 2954 "VBNET.ATG" - m.Add(Modifier.Internal); +#line 2952 "VBNET.ATG" + m.Add(Modifier.Internal, t.Location); break; } case 157: { lexer.NextToken(); -#line 2955 "VBNET.ATG" - m.Add(Modifier.New); +#line 2953 "VBNET.ATG" + m.Add(Modifier.New, t.Location); break; } case 142: { lexer.NextToken(); -#line 2956 "VBNET.ATG" - m.Add(Modifier.Override); +#line 2954 "VBNET.ATG" + m.Add(Modifier.Override, t.Location); break; } case 122: { lexer.NextToken(); -#line 2957 "VBNET.ATG" - m.Add(Modifier.Abstract); +#line 2955 "VBNET.ATG" + m.Add(Modifier.Abstract, t.Location); break; } case 145: { lexer.NextToken(); -#line 2958 "VBNET.ATG" - m.Add(Modifier.Private); +#line 2956 "VBNET.ATG" + m.Add(Modifier.Private, t.Location); break; } case 147: { lexer.NextToken(); -#line 2959 "VBNET.ATG" - m.Add(Modifier.Protected); +#line 2957 "VBNET.ATG" + m.Add(Modifier.Protected, t.Location); break; } case 148: { lexer.NextToken(); -#line 2960 "VBNET.ATG" - m.Add(Modifier.Public); +#line 2958 "VBNET.ATG" + m.Add(Modifier.Public, t.Location); break; } case 130: { lexer.NextToken(); -#line 2961 "VBNET.ATG" - m.Add(Modifier.Sealed); +#line 2959 "VBNET.ATG" + m.Add(Modifier.Sealed, t.Location); break; } case 131: { lexer.NextToken(); -#line 2962 "VBNET.ATG" - m.Add(Modifier.Sealed); +#line 2960 "VBNET.ATG" + m.Add(Modifier.Sealed, t.Location); break; } case 158: { lexer.NextToken(); -#line 2963 "VBNET.ATG" - m.Add(Modifier.Static); +#line 2961 "VBNET.ATG" + m.Add(Modifier.Static, t.Location); break; } case 140: { lexer.NextToken(); -#line 2964 "VBNET.ATG" - m.Add(Modifier.Virtual); +#line 2962 "VBNET.ATG" + m.Add(Modifier.Virtual, t.Location); break; } case 139: { lexer.NextToken(); -#line 2965 "VBNET.ATG" - m.Add(Modifier.Overloads); +#line 2963 "VBNET.ATG" + m.Add(Modifier.Overloads, t.Location); break; } case 150: { lexer.NextToken(); -#line 2966 "VBNET.ATG" +#line 2964 "VBNET.ATG" break; } case 184: { lexer.NextToken(); -#line 2967 "VBNET.ATG" +#line 2965 "VBNET.ATG" break; } case 183: { lexer.NextToken(); -#line 2968 "VBNET.ATG" - m.Add(Modifier.WithEvents); +#line 2966 "VBNET.ATG" + m.Add(Modifier.WithEvents, t.Location); break; } case 80: { lexer.NextToken(); -#line 2969 "VBNET.ATG" - m.Add(Modifier.Dim); +#line 2967 "VBNET.ATG" + m.Add(Modifier.Dim, t.Location); break; } case 198: { lexer.NextToken(); -#line 2970 "VBNET.ATG" - m.Add(Modifier.Widening); +#line 2968 "VBNET.ATG" + m.Add(Modifier.Widening, t.Location); break; } case 197: { lexer.NextToken(); -#line 2971 "VBNET.ATG" - m.Add(Modifier.Narrowing); +#line 2969 "VBNET.ATG" + m.Add(Modifier.Narrowing, t.Location); break; } default: SynErr(215); break; @@ -1606,18 +1604,18 @@ Modifiers m) { } void ClassMemberDecl( -#line 880 "VBNET.ATG" +#line 878 "VBNET.ATG" Modifiers m, List attributes) { StructureMemberDecl( -#line 881 "VBNET.ATG" +#line 879 "VBNET.ATG" m, attributes); } void StructureMemberDecl( -#line 894 "VBNET.ATG" +#line 892 "VBNET.ATG" Modifiers m, List attributes) { -#line 896 "VBNET.ATG" +#line 894 "VBNET.ATG" TypeReference type = null; List p = new List(); Statement stmt = null; @@ -1627,36 +1625,36 @@ Modifiers m, List attributes) { switch (la.kind) { case 66: case 79: case 89: case 111: case 120: case 166: case 199: { NonModuleDeclaration( -#line 902 "VBNET.ATG" +#line 900 "VBNET.ATG" m, attributes); break; } case 167: { lexer.NextToken(); -#line 906 "VBNET.ATG" +#line 904 "VBNET.ATG" Point startPos = t.Location; if (StartOf(10)) { -#line 910 "VBNET.ATG" +#line 908 "VBNET.ATG" string name = String.Empty; MethodDeclaration methodDeclaration; ArrayList handlesClause = null; ArrayList implementsClause = null; Identifier(); -#line 915 "VBNET.ATG" +#line 913 "VBNET.ATG" name = t.val; m.Check(Modifier.VBMethods); TypeParameterList( -#line 918 "VBNET.ATG" +#line 916 "VBNET.ATG" templates); if (la.kind == 23) { lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 919 "VBNET.ATG" +#line 917 "VBNET.ATG" p); } Expect(24); @@ -1664,25 +1662,25 @@ p); if (la.kind == 104 || la.kind == 106) { if (la.kind == 106) { ImplementsClause( -#line 922 "VBNET.ATG" +#line 920 "VBNET.ATG" out implementsClause); } else { HandlesClause( -#line 924 "VBNET.ATG" +#line 922 "VBNET.ATG" out handlesClause); } } -#line 927 "VBNET.ATG" +#line 925 "VBNET.ATG" Point endLocation = t.EndLocation; Expect(1); if ( -#line 931 "VBNET.ATG" +#line 929 "VBNET.ATG" IsMustOverride(m)) { -#line 933 "VBNET.ATG" +#line 931 "VBNET.ATG" methodDeclaration = new MethodDeclaration(name, m.Modifier, null, p, attributes); - methodDeclaration.StartLocation = startPos; + methodDeclaration.StartLocation = m.GetDeclarationLocation(startPos); methodDeclaration.EndLocation = endLocation; methodDeclaration.TypeReference = new TypeReference("", "System.Void"); @@ -1694,9 +1692,9 @@ IsMustOverride(m)) { } else if (StartOf(11)) { -#line 946 "VBNET.ATG" +#line 944 "VBNET.ATG" methodDeclaration = new MethodDeclaration(name, m.Modifier, null, p, attributes); - methodDeclaration.StartLocation = startPos; + methodDeclaration.StartLocation = m.GetDeclarationLocation(startPos); methodDeclaration.EndLocation = endLocation; methodDeclaration.TypeReference = new TypeReference("", "System.Void"); @@ -1708,17 +1706,17 @@ IsMustOverride(m)) { compilationUnit.BlockStart(methodDeclaration); Block( -#line 958 "VBNET.ATG" +#line 956 "VBNET.ATG" out stmt); -#line 960 "VBNET.ATG" +#line 958 "VBNET.ATG" compilationUnit.BlockEnd(); methodDeclaration.Body = (BlockStatement)stmt; Expect(87); Expect(167); -#line 963 "VBNET.ATG" +#line 961 "VBNET.ATG" methodDeclaration.Body.EndLocation = t.EndLocation; Expect(1); } else SynErr(216); @@ -1728,31 +1726,31 @@ out stmt); lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 966 "VBNET.ATG" +#line 964 "VBNET.ATG" p); } Expect(24); } -#line 967 "VBNET.ATG" +#line 965 "VBNET.ATG" m.Check(Modifier.Constructors); -#line 968 "VBNET.ATG" +#line 966 "VBNET.ATG" Point constructorEndLocation = t.EndLocation; Expect(1); Block( -#line 970 "VBNET.ATG" +#line 968 "VBNET.ATG" out stmt); Expect(87); Expect(167); -#line 971 "VBNET.ATG" +#line 969 "VBNET.ATG" Point endLocation = t.EndLocation; Expect(1); -#line 973 "VBNET.ATG" +#line 971 "VBNET.ATG" ConstructorDeclaration cd = new ConstructorDeclaration("New", m.Modifier, p, attributes); - cd.StartLocation = startPos; + cd.StartLocation = m.GetDeclarationLocation(startPos); cd.EndLocation = constructorEndLocation; cd.Body = (BlockStatement)stmt; cd.Body.EndLocation = endLocation; @@ -1764,7 +1762,7 @@ out stmt); case 99: { lexer.NextToken(); -#line 985 "VBNET.ATG" +#line 983 "VBNET.ATG" m.Check(Modifier.VBMethods); string name = String.Empty; Point startPos = t.Location; @@ -1773,16 +1771,16 @@ out stmt); Identifier(); -#line 991 "VBNET.ATG" +#line 989 "VBNET.ATG" name = t.val; TypeParameterList( -#line 992 "VBNET.ATG" +#line 990 "VBNET.ATG" templates); if (la.kind == 23) { lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 993 "VBNET.ATG" +#line 991 "VBNET.ATG" p); } Expect(24); @@ -1791,15 +1789,15 @@ p); lexer.NextToken(); while (la.kind == 26) { AttributeSection( -#line 994 "VBNET.ATG" +#line 992 "VBNET.ATG" out returnTypeAttributeSection); } TypeName( -#line 994 "VBNET.ATG" +#line 992 "VBNET.ATG" out type); } -#line 996 "VBNET.ATG" +#line 994 "VBNET.ATG" if(type == null) { type = new TypeReference("System.Object"); } @@ -1807,22 +1805,22 @@ out type); if (la.kind == 104 || la.kind == 106) { if (la.kind == 106) { ImplementsClause( -#line 1002 "VBNET.ATG" +#line 1000 "VBNET.ATG" out implementsClause); } else { HandlesClause( -#line 1004 "VBNET.ATG" +#line 1002 "VBNET.ATG" out handlesClause); } } Expect(1); if ( -#line 1010 "VBNET.ATG" +#line 1008 "VBNET.ATG" IsMustOverride(m)) { -#line 1012 "VBNET.ATG" +#line 1010 "VBNET.ATG" methodDeclaration = new MethodDeclaration(name, m.Modifier, type, p, attributes); - methodDeclaration.StartLocation = startPos; + methodDeclaration.StartLocation = m.GetDeclarationLocation(startPos); methodDeclaration.EndLocation = t.EndLocation; methodDeclaration.HandlesClause = handlesClause; @@ -1833,9 +1831,9 @@ IsMustOverride(m)) { } else if (StartOf(11)) { -#line 1024 "VBNET.ATG" +#line 1022 "VBNET.ATG" methodDeclaration = new MethodDeclaration(name, m.Modifier, type, p, attributes); - methodDeclaration.StartLocation = startPos; + methodDeclaration.StartLocation = m.GetDeclarationLocation(startPos); methodDeclaration.EndLocation = t.EndLocation; methodDeclaration.Templates = templates; @@ -1847,17 +1845,17 @@ IsMustOverride(m)) { compilationUnit.BlockStart(methodDeclaration); Block( -#line 1036 "VBNET.ATG" +#line 1034 "VBNET.ATG" out stmt); -#line 1038 "VBNET.ATG" +#line 1036 "VBNET.ATG" compilationUnit.BlockEnd(); methodDeclaration.Body = (BlockStatement)stmt; Expect(87); Expect(99); -#line 1043 "VBNET.ATG" +#line 1041 "VBNET.ATG" methodDeclaration.Body.StartLocation = methodDeclaration.EndLocation; methodDeclaration.Body.EndLocation = t.EndLocation; @@ -1868,7 +1866,7 @@ out stmt); case 77: { lexer.NextToken(); -#line 1052 "VBNET.ATG" +#line 1050 "VBNET.ATG" m.Check(Modifier.VBExternalMethods); Point startPos = t.Location; CharsetModifier charsetModifer = CharsetModifier.None; @@ -1878,41 +1876,41 @@ out stmt); if (StartOf(12)) { Charset( -#line 1059 "VBNET.ATG" +#line 1057 "VBNET.ATG" out charsetModifer); } if (la.kind == 167) { lexer.NextToken(); Identifier(); -#line 1062 "VBNET.ATG" +#line 1060 "VBNET.ATG" name = t.val; Expect(114); Expect(3); -#line 1063 "VBNET.ATG" +#line 1061 "VBNET.ATG" library = t.val.ToString(); if (la.kind == 43) { lexer.NextToken(); Expect(3); -#line 1064 "VBNET.ATG" +#line 1062 "VBNET.ATG" alias = t.val.ToString(); } if (la.kind == 23) { lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 1065 "VBNET.ATG" +#line 1063 "VBNET.ATG" p); } Expect(24); } Expect(1); -#line 1068 "VBNET.ATG" +#line 1066 "VBNET.ATG" DeclareDeclaration declareDeclaration = new DeclareDeclaration(name, m.Modifier, null, p, attributes, library, alias, charsetModifer); - declareDeclaration.StartLocation = startPos; + declareDeclaration.StartLocation = m.GetDeclarationLocation(startPos); declareDeclaration.EndLocation = t.EndLocation; compilationUnit.AddChild(declareDeclaration); @@ -1920,25 +1918,25 @@ p); lexer.NextToken(); Identifier(); -#line 1075 "VBNET.ATG" +#line 1073 "VBNET.ATG" name = t.val; Expect(114); Expect(3); -#line 1076 "VBNET.ATG" +#line 1074 "VBNET.ATG" library = t.val; if (la.kind == 43) { lexer.NextToken(); Expect(3); -#line 1077 "VBNET.ATG" +#line 1075 "VBNET.ATG" alias = t.val; } if (la.kind == 23) { lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 1078 "VBNET.ATG" +#line 1076 "VBNET.ATG" p); } Expect(24); @@ -1946,14 +1944,14 @@ p); if (la.kind == 47) { lexer.NextToken(); TypeName( -#line 1079 "VBNET.ATG" +#line 1077 "VBNET.ATG" out type); } Expect(1); -#line 1082 "VBNET.ATG" +#line 1080 "VBNET.ATG" DeclareDeclaration declareDeclaration = new DeclareDeclaration(name, m.Modifier, type, p, attributes, library, alias, charsetModifer); - declareDeclaration.StartLocation = startPos; + declareDeclaration.StartLocation = m.GetDeclarationLocation(startPos); declareDeclaration.EndLocation = t.EndLocation; compilationUnit.AddChild(declareDeclaration); @@ -1963,7 +1961,7 @@ out type); case 92: { lexer.NextToken(); -#line 1092 "VBNET.ATG" +#line 1090 "VBNET.ATG" m.Check(Modifier.VBEvents); Point startPos = t.Location; EventDeclaration eventDeclaration; @@ -1971,19 +1969,19 @@ out type); Identifier(); -#line 1097 "VBNET.ATG" +#line 1095 "VBNET.ATG" name= t.val; if (la.kind == 47) { lexer.NextToken(); TypeName( -#line 1099 "VBNET.ATG" +#line 1097 "VBNET.ATG" out type); } else if (la.kind == 1 || la.kind == 23 || la.kind == 106) { if (la.kind == 23) { lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 1101 "VBNET.ATG" +#line 1099 "VBNET.ATG" p); } Expect(24); @@ -1991,13 +1989,13 @@ p); } else SynErr(220); if (la.kind == 106) { ImplementsClause( -#line 1103 "VBNET.ATG" +#line 1101 "VBNET.ATG" out implementsClause); } -#line 1105 "VBNET.ATG" +#line 1103 "VBNET.ATG" eventDeclaration = new EventDeclaration(type, m.Modifier, p, attributes, name, implementsClause); - eventDeclaration.StartLocation = startPos; + eventDeclaration.StartLocation = m.GetDeclarationLocation(startPos); eventDeclaration.EndLocation = t.EndLocation; compilationUnit.AddChild(eventDeclaration); @@ -2006,26 +2004,26 @@ out implementsClause); } case 2: case 50: case 69: case 169: { -#line 1112 "VBNET.ATG" +#line 1110 "VBNET.ATG" Point startPos = t.Location; -#line 1114 "VBNET.ATG" +#line 1112 "VBNET.ATG" m.Check(Modifier.Fields); FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier); - fd.StartLocation = startPos; + fd.StartLocation = m.GetDeclarationLocation(startPos); VariableDeclarator( -#line 1118 "VBNET.ATG" +#line 1116 "VBNET.ATG" variableDeclarators); while (la.kind == 12) { lexer.NextToken(); VariableDeclarator( -#line 1119 "VBNET.ATG" +#line 1117 "VBNET.ATG" variableDeclarators); } Expect(1); -#line 1122 "VBNET.ATG" +#line 1120 "VBNET.ATG" fd.EndLocation = t.EndLocation; fd.Fields = variableDeclarators; compilationUnit.AddChild(fd); @@ -2034,35 +2032,35 @@ variableDeclarators); } case 70: { -#line 1127 "VBNET.ATG" +#line 1125 "VBNET.ATG" m.Check(Modifier.Fields); lexer.NextToken(); -#line 1128 "VBNET.ATG" - m.Add(Modifier.Const); +#line 1126 "VBNET.ATG" + m.Add(Modifier.Const, t.Location); -#line 1130 "VBNET.ATG" +#line 1128 "VBNET.ATG" FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier); - fd.StartLocation = t.Location; + fd.StartLocation = m.GetDeclarationLocation(t.Location); List constantDeclarators = new List(); ConstantDeclarator( -#line 1134 "VBNET.ATG" +#line 1132 "VBNET.ATG" constantDeclarators); while (la.kind == 12) { lexer.NextToken(); ConstantDeclarator( -#line 1135 "VBNET.ATG" +#line 1133 "VBNET.ATG" constantDeclarators); } -#line 1137 "VBNET.ATG" +#line 1135 "VBNET.ATG" fd.Fields = constantDeclarators; fd.EndLocation = t.Location; Expect(1); -#line 1142 "VBNET.ATG" +#line 1140 "VBNET.ATG" fd.EndLocation = t.EndLocation; compilationUnit.AddChild(fd); @@ -2071,20 +2069,20 @@ constantDeclarators); case 146: { lexer.NextToken(); -#line 1148 "VBNET.ATG" +#line 1146 "VBNET.ATG" m.Check(Modifier.VBProperties); Point startPos = t.Location; ArrayList implementsClause = null; Identifier(); -#line 1152 "VBNET.ATG" +#line 1150 "VBNET.ATG" string propertyName = t.val; if (la.kind == 23) { lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 1153 "VBNET.ATG" +#line 1151 "VBNET.ATG" p); } Expect(24); @@ -2092,28 +2090,28 @@ p); if (la.kind == 47) { lexer.NextToken(); TypeName( -#line 1154 "VBNET.ATG" +#line 1152 "VBNET.ATG" out type); } -#line 1156 "VBNET.ATG" +#line 1154 "VBNET.ATG" if(type == null) { type = new TypeReference("System.Object"); } if (la.kind == 106) { ImplementsClause( -#line 1160 "VBNET.ATG" +#line 1158 "VBNET.ATG" out implementsClause); } Expect(1); if ( -#line 1164 "VBNET.ATG" +#line 1162 "VBNET.ATG" IsMustOverride(m)) { -#line 1166 "VBNET.ATG" +#line 1164 "VBNET.ATG" PropertyDeclaration pDecl = new PropertyDeclaration(propertyName, type, m.Modifier, attributes); - pDecl.StartLocation = startPos; + pDecl.StartLocation = m.GetDeclarationLocation(startPos); pDecl.EndLocation = t.Location; pDecl.TypeReference = type; pDecl.ImplementsClause = implementsClause; @@ -2122,9 +2120,9 @@ IsMustOverride(m)) { } else if (la.kind == 26 || la.kind == 100 || la.kind == 156) { -#line 1176 "VBNET.ATG" +#line 1174 "VBNET.ATG" PropertyDeclaration pDecl = new PropertyDeclaration(propertyName, type, m.Modifier, attributes); - pDecl.StartLocation = startPos; + pDecl.StartLocation = m.GetDeclarationLocation(startPos); pDecl.EndLocation = t.Location; pDecl.BodyStart = t.Location; pDecl.TypeReference = type; @@ -2134,13 +2132,13 @@ IsMustOverride(m)) { PropertySetRegion setRegion; AccessorDecls( -#line 1186 "VBNET.ATG" +#line 1184 "VBNET.ATG" out getRegion, out setRegion); Expect(87); Expect(146); Expect(1); -#line 1190 "VBNET.ATG" +#line 1188 "VBNET.ATG" pDecl.GetRegion = getRegion; pDecl.SetRegion = setRegion; pDecl.BodyEnd = t.EndLocation; @@ -2152,11 +2150,11 @@ out getRegion, out setRegion); case 200: { lexer.NextToken(); -#line 1197 "VBNET.ATG" +#line 1195 "VBNET.ATG" Point startPos = t.Location; Expect(92); -#line 1199 "VBNET.ATG" +#line 1197 "VBNET.ATG" m.Check(Modifier.VBCustomEvents); EventAddRemoveRegion eventAccessorDeclaration; EventAddRemoveRegion addHandlerAccessorDeclaration = null; @@ -2166,24 +2164,24 @@ out getRegion, out setRegion); Identifier(); -#line 1206 "VBNET.ATG" +#line 1204 "VBNET.ATG" string customEventName = t.val; Expect(47); TypeName( -#line 1207 "VBNET.ATG" +#line 1205 "VBNET.ATG" out type); if (la.kind == 106) { ImplementsClause( -#line 1208 "VBNET.ATG" +#line 1206 "VBNET.ATG" out implementsClause); } Expect(1); while (StartOf(13)) { EventAccessorDeclaration( -#line 1211 "VBNET.ATG" +#line 1209 "VBNET.ATG" out eventAccessorDeclaration); -#line 1213 "VBNET.ATG" +#line 1211 "VBNET.ATG" if(eventAccessorDeclaration is EventAddRegion) { addHandlerAccessorDeclaration = eventAccessorDeclaration; @@ -2202,7 +2200,7 @@ out eventAccessorDeclaration); Expect(92); Expect(1); -#line 1229 "VBNET.ATG" +#line 1227 "VBNET.ATG" if(addHandlerAccessorDeclaration == null) { Error("Need to provide AddHandler accessor."); @@ -2219,7 +2217,7 @@ out eventAccessorDeclaration); } EventDeclaration decl = new EventDeclaration(type, customEventName, m.Modifier, attributes); - decl.StartLocation = startPos; + decl.StartLocation = m.GetDeclarationLocation(startPos); decl.EndLocation = t.EndLocation; compilationUnit.AddChild(decl); @@ -2228,7 +2226,7 @@ out eventAccessorDeclaration); case 187: { lexer.NextToken(); -#line 1252 "VBNET.ATG" +#line 1250 "VBNET.ATG" m.Check(Modifier.VBOperators); Point startPos = t.Location; TypeReference returnType = NullTypeReference.Instance; @@ -2240,7 +2238,7 @@ out eventAccessorDeclaration); List returnTypeAttributes = new List(); OverloadableOperator( -#line 1262 "VBNET.ATG" +#line 1260 "VBNET.ATG" out operatorType); Expect(23); if (la.kind == 54) { @@ -2248,16 +2246,16 @@ out operatorType); } Identifier(); -#line 1263 "VBNET.ATG" +#line 1261 "VBNET.ATG" operandName = t.val; if (la.kind == 47) { lexer.NextToken(); TypeName( -#line 1264 "VBNET.ATG" +#line 1262 "VBNET.ATG" out operandType); } -#line 1265 "VBNET.ATG" +#line 1263 "VBNET.ATG" parameters.Add(new ParameterDeclarationExpression(operandType, operandName, ParamModifier.In)); while (la.kind == 12) { lexer.NextToken(); @@ -2266,16 +2264,16 @@ out operandType); } Identifier(); -#line 1269 "VBNET.ATG" +#line 1267 "VBNET.ATG" operandName = t.val; if (la.kind == 47) { lexer.NextToken(); TypeName( -#line 1270 "VBNET.ATG" +#line 1268 "VBNET.ATG" out operandType); } -#line 1271 "VBNET.ATG" +#line 1269 "VBNET.ATG" parameters.Add(new ParameterDeclarationExpression(operandType, operandName, ParamModifier.In)); } Expect(24); @@ -2283,25 +2281,25 @@ out operandType); lexer.NextToken(); while (la.kind == 26) { AttributeSection( -#line 1274 "VBNET.ATG" +#line 1272 "VBNET.ATG" out section); -#line 1274 "VBNET.ATG" +#line 1272 "VBNET.ATG" returnTypeAttributes.Add(section); } TypeName( -#line 1274 "VBNET.ATG" +#line 1272 "VBNET.ATG" out returnType); Expect(1); } Block( -#line 1275 "VBNET.ATG" +#line 1273 "VBNET.ATG" out stmt); Expect(87); Expect(187); Expect(1); -#line 1277 "VBNET.ATG" +#line 1275 "VBNET.ATG" OperatorDeclaration operatorDeclaration = new OperatorDeclaration(m.Modifier, attributes, parameters, @@ -2311,7 +2309,7 @@ out stmt); operatorDeclaration.ConvertToType = returnType; operatorDeclaration.ReturnTypeAttributes = returnTypeAttributes; operatorDeclaration.Body = (BlockStatement)stmt; - operatorDeclaration.StartLocation = startPos; + operatorDeclaration.StartLocation = m.GetDeclarationLocation(startPos); operatorDeclaration.EndLocation = t.EndLocation; compilationUnit.AddChild(operatorDeclaration); @@ -2322,25 +2320,25 @@ out stmt); } void EnumMemberDecl( -#line 862 "VBNET.ATG" +#line 860 "VBNET.ATG" out FieldDeclaration f) { -#line 864 "VBNET.ATG" +#line 862 "VBNET.ATG" Expression expr = null;List attributes = new List(); AttributeSection section = null; VariableDeclaration varDecl = null; while (la.kind == 26) { AttributeSection( -#line 868 "VBNET.ATG" +#line 866 "VBNET.ATG" out section); -#line 868 "VBNET.ATG" +#line 866 "VBNET.ATG" attributes.Add(section); } Identifier(); -#line 871 "VBNET.ATG" +#line 869 "VBNET.ATG" f = new FieldDeclaration(attributes); varDecl = new VariableDeclaration(t.val); f.Fields.Add(varDecl); @@ -2349,10 +2347,10 @@ out section); if (la.kind == 11) { lexer.NextToken(); Expr( -#line 876 "VBNET.ATG" +#line 874 "VBNET.ATG" out expr); -#line 876 "VBNET.ATG" +#line 874 "VBNET.ATG" varDecl.Initializer = expr; } Expect(1); @@ -2360,7 +2358,7 @@ out expr); void InterfaceMemberDecl() { -#line 781 "VBNET.ATG" +#line 779 "VBNET.ATG" TypeReference type =null; List p = new List(); List templates = new List(); @@ -2372,31 +2370,31 @@ out expr); if (StartOf(14)) { while (la.kind == 26) { AttributeSection( -#line 789 "VBNET.ATG" +#line 787 "VBNET.ATG" out section); -#line 789 "VBNET.ATG" +#line 787 "VBNET.ATG" attributes.Add(section); } while (StartOf(7)) { MemberModifier( -#line 793 "VBNET.ATG" +#line 791 "VBNET.ATG" mod); } if (la.kind == 92) { lexer.NextToken(); -#line 796 "VBNET.ATG" +#line 794 "VBNET.ATG" mod.Check(Modifier.VBInterfaceEvents); Identifier(); -#line 797 "VBNET.ATG" +#line 795 "VBNET.ATG" name = t.val; if (la.kind == 23) { lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 798 "VBNET.ATG" +#line 796 "VBNET.ATG" p); } Expect(24); @@ -2404,12 +2402,12 @@ p); if (la.kind == 47) { lexer.NextToken(); TypeName( -#line 799 "VBNET.ATG" +#line 797 "VBNET.ATG" out type); } Expect(1); -#line 802 "VBNET.ATG" +#line 800 "VBNET.ATG" EventDeclaration ed = new EventDeclaration(type, mod.Modifier, p, attributes, name, null); compilationUnit.AddChild(ed); ed.EndLocation = t.EndLocation; @@ -2417,27 +2415,27 @@ out type); } else if (la.kind == 167) { lexer.NextToken(); -#line 808 "VBNET.ATG" +#line 806 "VBNET.ATG" mod.Check(Modifier.VBInterfaceMethods); Identifier(); -#line 809 "VBNET.ATG" +#line 807 "VBNET.ATG" name = t.val; TypeParameterList( -#line 810 "VBNET.ATG" +#line 808 "VBNET.ATG" templates); if (la.kind == 23) { lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 811 "VBNET.ATG" +#line 809 "VBNET.ATG" p); } Expect(24); } Expect(1); -#line 814 "VBNET.ATG" +#line 812 "VBNET.ATG" MethodDeclaration md = new MethodDeclaration(name, mod.Modifier, null, p, attributes); md.TypeReference = new TypeReference("", "System.Void"); md.EndLocation = t.EndLocation; @@ -2447,20 +2445,20 @@ p); } else if (la.kind == 99) { lexer.NextToken(); -#line 822 "VBNET.ATG" +#line 820 "VBNET.ATG" mod.Check(Modifier.VBInterfaceMethods); Identifier(); -#line 823 "VBNET.ATG" +#line 821 "VBNET.ATG" name = t.val; TypeParameterList( -#line 824 "VBNET.ATG" +#line 822 "VBNET.ATG" templates); if (la.kind == 23) { lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 825 "VBNET.ATG" +#line 823 "VBNET.ATG" p); } Expect(24); @@ -2469,15 +2467,15 @@ p); lexer.NextToken(); while (la.kind == 26) { AttributeSection( -#line 826 "VBNET.ATG" +#line 824 "VBNET.ATG" out returnTypeAttributeSection); } TypeName( -#line 826 "VBNET.ATG" +#line 824 "VBNET.ATG" out type); } -#line 828 "VBNET.ATG" +#line 826 "VBNET.ATG" if(type == null) { type = new TypeReference("System.Object"); } @@ -2491,17 +2489,17 @@ out type); } else if (la.kind == 146) { lexer.NextToken(); -#line 840 "VBNET.ATG" +#line 838 "VBNET.ATG" mod.Check(Modifier.VBInterfaceProperties); Identifier(); -#line 841 "VBNET.ATG" +#line 839 "VBNET.ATG" name = t.val; if (la.kind == 23) { lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 842 "VBNET.ATG" +#line 840 "VBNET.ATG" p); } Expect(24); @@ -2509,18 +2507,18 @@ p); if (la.kind == 47) { lexer.NextToken(); TypeName( -#line 843 "VBNET.ATG" +#line 841 "VBNET.ATG" out type); } -#line 845 "VBNET.ATG" +#line 843 "VBNET.ATG" if(type == null) { type = new TypeReference("System.Object"); } Expect(1); -#line 851 "VBNET.ATG" +#line 849 "VBNET.ATG" PropertyDeclaration pd = new PropertyDeclaration(name, type, mod.Modifier, attributes); pd.Parameters = p; pd.EndLocation = t.EndLocation; @@ -2529,24 +2527,24 @@ out type); } else SynErr(223); } else if (StartOf(15)) { NonModuleDeclaration( -#line 858 "VBNET.ATG" +#line 856 "VBNET.ATG" mod, attributes); } else SynErr(224); } void Expr( -#line 1619 "VBNET.ATG" +#line 1617 "VBNET.ATG" out Expression expr) { ConditionalOrExpr( -#line 1621 "VBNET.ATG" +#line 1619 "VBNET.ATG" out expr); } void ImplementsClause( -#line 1597 "VBNET.ATG" +#line 1595 "VBNET.ATG" out ArrayList baseInterfaces) { -#line 1599 "VBNET.ATG" +#line 1597 "VBNET.ATG" baseInterfaces = new ArrayList(); string typename = String.Empty; string first; @@ -2554,76 +2552,76 @@ out ArrayList baseInterfaces) { Expect(106); Identifier(); -#line 1603 "VBNET.ATG" +#line 1601 "VBNET.ATG" first = t.val; Expect(10); Qualident( -#line 1603 "VBNET.ATG" +#line 1601 "VBNET.ATG" out typename); -#line 1603 "VBNET.ATG" +#line 1601 "VBNET.ATG" baseInterfaces.Add(first + "." + typename); while (la.kind == 12) { lexer.NextToken(); Identifier(); -#line 1604 "VBNET.ATG" +#line 1602 "VBNET.ATG" first = t.val; Expect(10); Qualident( -#line 1604 "VBNET.ATG" +#line 1602 "VBNET.ATG" out typename); -#line 1604 "VBNET.ATG" +#line 1602 "VBNET.ATG" baseInterfaces.Add(first + "." + typename); } } void HandlesClause( -#line 1555 "VBNET.ATG" +#line 1553 "VBNET.ATG" out ArrayList handlesClause) { -#line 1557 "VBNET.ATG" +#line 1555 "VBNET.ATG" handlesClause = new ArrayList(); string name; Expect(104); EventMemberSpecifier( -#line 1560 "VBNET.ATG" +#line 1558 "VBNET.ATG" out name); -#line 1560 "VBNET.ATG" +#line 1558 "VBNET.ATG" handlesClause.Add(name); while (la.kind == 12) { lexer.NextToken(); EventMemberSpecifier( -#line 1561 "VBNET.ATG" +#line 1559 "VBNET.ATG" out name); -#line 1561 "VBNET.ATG" +#line 1559 "VBNET.ATG" handlesClause.Add(name); } } void Block( -#line 2167 "VBNET.ATG" +#line 2165 "VBNET.ATG" out Statement stmt) { -#line 2170 "VBNET.ATG" +#line 2168 "VBNET.ATG" BlockStatement blockStmt = new BlockStatement(); blockStmt.StartLocation = t.Location; compilationUnit.BlockStart(blockStmt); while (StartOf(16) || -#line 2175 "VBNET.ATG" +#line 2173 "VBNET.ATG" IsEndStmtAhead()) { if ( -#line 2175 "VBNET.ATG" +#line 2173 "VBNET.ATG" IsEndStmtAhead()) { Expect(87); EndOfStmt(); -#line 2175 "VBNET.ATG" +#line 2173 "VBNET.ATG" compilationUnit.AddChild(new EndStatement()); } else { Statement(); @@ -2631,7 +2629,7 @@ IsEndStmtAhead()) { } } -#line 2181 "VBNET.ATG" +#line 2179 "VBNET.ATG" stmt = blockStmt; blockStmt.EndLocation = t.EndLocation; compilationUnit.BlockEnd(); @@ -2639,65 +2637,65 @@ IsEndStmtAhead()) { } void Charset( -#line 1547 "VBNET.ATG" +#line 1545 "VBNET.ATG" out CharsetModifier charsetModifier) { -#line 1548 "VBNET.ATG" +#line 1546 "VBNET.ATG" charsetModifier = CharsetModifier.None; if (la.kind == 99 || la.kind == 167) { } else if (la.kind == 46) { lexer.NextToken(); -#line 1549 "VBNET.ATG" +#line 1547 "VBNET.ATG" charsetModifier = CharsetModifier.ANSI; } else if (la.kind == 49) { lexer.NextToken(); -#line 1550 "VBNET.ATG" +#line 1548 "VBNET.ATG" charsetModifier = CharsetModifier.Auto; } else if (la.kind == 176) { lexer.NextToken(); -#line 1551 "VBNET.ATG" +#line 1549 "VBNET.ATG" charsetModifier = CharsetModifier.Unicode; } else SynErr(225); } void VariableDeclarator( -#line 1465 "VBNET.ATG" +#line 1463 "VBNET.ATG" List fieldDeclaration) { -#line 1467 "VBNET.ATG" +#line 1465 "VBNET.ATG" Expression expr = null; TypeReference type = null;ArrayList rank = null;ArrayList dimension = null; Identifier(); -#line 1470 "VBNET.ATG" +#line 1468 "VBNET.ATG" string name = t.val; if ( -#line 1471 "VBNET.ATG" +#line 1469 "VBNET.ATG" IsDims()) { ArrayNameModifier( -#line 1471 "VBNET.ATG" +#line 1469 "VBNET.ATG" out rank); } if ( -#line 1472 "VBNET.ATG" +#line 1470 "VBNET.ATG" IsSize()) { ArrayInitializationModifier( -#line 1472 "VBNET.ATG" +#line 1470 "VBNET.ATG" out dimension); } if ( -#line 1474 "VBNET.ATG" +#line 1472 "VBNET.ATG" IsObjectCreation()) { Expect(47); ObjectCreateExpression( -#line 1474 "VBNET.ATG" +#line 1472 "VBNET.ATG" out expr); -#line 1476 "VBNET.ATG" +#line 1474 "VBNET.ATG" if (expr is ObjectCreateExpression) { type = ((ObjectCreateExpression)expr).CreateType; } else { @@ -2708,11 +2706,11 @@ out expr); if (la.kind == 47) { lexer.NextToken(); TypeName( -#line 1483 "VBNET.ATG" +#line 1481 "VBNET.ATG" out type); } -#line 1485 "VBNET.ATG" +#line 1483 "VBNET.ATG" if (type != null && rank != null) { if(type.RankSpecifier != null) { Error("array rank only allowed one time"); @@ -2724,40 +2722,40 @@ out type); if (la.kind == 11) { lexer.NextToken(); VariableInitializer( -#line 1493 "VBNET.ATG" +#line 1491 "VBNET.ATG" out expr); } } else SynErr(226); -#line 1495 "VBNET.ATG" +#line 1493 "VBNET.ATG" fieldDeclaration.Add(new VariableDeclaration(name, expr, type)); } void ConstantDeclarator( -#line 1448 "VBNET.ATG" +#line 1446 "VBNET.ATG" List constantDeclaration) { -#line 1450 "VBNET.ATG" +#line 1448 "VBNET.ATG" Expression expr = null; TypeReference type = null; string name = String.Empty; Identifier(); -#line 1454 "VBNET.ATG" +#line 1452 "VBNET.ATG" name = t.val; if (la.kind == 47) { lexer.NextToken(); TypeName( -#line 1455 "VBNET.ATG" +#line 1453 "VBNET.ATG" out type); } Expect(11); Expr( -#line 1456 "VBNET.ATG" +#line 1454 "VBNET.ATG" out expr); -#line 1458 "VBNET.ATG" +#line 1456 "VBNET.ATG" VariableDeclaration f = new VariableDeclaration(name, expr); f.TypeReference = type; constantDeclaration.Add(f); @@ -2765,10 +2763,10 @@ out expr); } void AccessorDecls( -#line 1392 "VBNET.ATG" +#line 1390 "VBNET.ATG" out PropertyGetRegion getBlock, out PropertySetRegion setBlock) { -#line 1394 "VBNET.ATG" +#line 1392 "VBNET.ATG" List attributes = new List(); AttributeSection section; getBlock = null; @@ -2776,60 +2774,60 @@ out PropertyGetRegion getBlock, out PropertySetRegion setBlock) { while (la.kind == 26) { AttributeSection( -#line 1399 "VBNET.ATG" +#line 1397 "VBNET.ATG" out section); -#line 1399 "VBNET.ATG" +#line 1397 "VBNET.ATG" attributes.Add(section); } if (la.kind == 100) { GetAccessorDecl( -#line 1401 "VBNET.ATG" +#line 1399 "VBNET.ATG" out getBlock, attributes); if (la.kind == 26 || la.kind == 156) { -#line 1403 "VBNET.ATG" +#line 1401 "VBNET.ATG" attributes = new List(); while (la.kind == 26) { AttributeSection( -#line 1404 "VBNET.ATG" +#line 1402 "VBNET.ATG" out section); -#line 1404 "VBNET.ATG" +#line 1402 "VBNET.ATG" attributes.Add(section); } SetAccessorDecl( -#line 1405 "VBNET.ATG" +#line 1403 "VBNET.ATG" out setBlock, attributes); } } else if (la.kind == 156) { SetAccessorDecl( -#line 1408 "VBNET.ATG" +#line 1406 "VBNET.ATG" out setBlock, attributes); if (la.kind == 26 || la.kind == 100) { -#line 1410 "VBNET.ATG" +#line 1408 "VBNET.ATG" attributes = new List(); while (la.kind == 26) { AttributeSection( -#line 1411 "VBNET.ATG" +#line 1409 "VBNET.ATG" out section); -#line 1411 "VBNET.ATG" +#line 1409 "VBNET.ATG" attributes.Add(section); } GetAccessorDecl( -#line 1412 "VBNET.ATG" +#line 1410 "VBNET.ATG" out getBlock, attributes); } } else SynErr(227); } void EventAccessorDeclaration( -#line 1355 "VBNET.ATG" +#line 1353 "VBNET.ATG" out EventAddRemoveRegion eventAccessorDeclaration) { -#line 1357 "VBNET.ATG" +#line 1355 "VBNET.ATG" Statement stmt = null; List p = new List(); AttributeSection section; @@ -2838,10 +2836,10 @@ out EventAddRemoveRegion eventAccessorDeclaration) { while (la.kind == 26) { AttributeSection( -#line 1363 "VBNET.ATG" +#line 1361 "VBNET.ATG" out section); -#line 1363 "VBNET.ATG" +#line 1361 "VBNET.ATG" attributes.Add(section); } if (la.kind == 41) { @@ -2850,20 +2848,20 @@ out section); lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 1365 "VBNET.ATG" +#line 1363 "VBNET.ATG" p); } Expect(24); } Expect(1); Block( -#line 1366 "VBNET.ATG" +#line 1364 "VBNET.ATG" out stmt); Expect(87); Expect(41); Expect(1); -#line 1368 "VBNET.ATG" +#line 1366 "VBNET.ATG" eventAccessorDeclaration = new EventAddRegion(attributes); eventAccessorDeclaration.Block = (BlockStatement)stmt; eventAccessorDeclaration.Parameters = p; @@ -2874,20 +2872,20 @@ out stmt); lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 1373 "VBNET.ATG" +#line 1371 "VBNET.ATG" p); } Expect(24); } Expect(1); Block( -#line 1374 "VBNET.ATG" +#line 1372 "VBNET.ATG" out stmt); Expect(87); Expect(152); Expect(1); -#line 1376 "VBNET.ATG" +#line 1374 "VBNET.ATG" eventAccessorDeclaration = new EventRemoveRegion(attributes); eventAccessorDeclaration.Block = (BlockStatement)stmt; eventAccessorDeclaration.Parameters = p; @@ -2898,20 +2896,20 @@ out stmt); lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 1381 "VBNET.ATG" +#line 1379 "VBNET.ATG" p); } Expect(24); } Expect(1); Block( -#line 1382 "VBNET.ATG" +#line 1380 "VBNET.ATG" out stmt); Expect(87); Expect(149); Expect(1); -#line 1384 "VBNET.ATG" +#line 1382 "VBNET.ATG" eventAccessorDeclaration = new EventRaiseRegion(attributes); eventAccessorDeclaration.Block = (BlockStatement)stmt; eventAccessorDeclaration.Parameters = p; @@ -2920,163 +2918,163 @@ out stmt); } void OverloadableOperator( -#line 1292 "VBNET.ATG" +#line 1290 "VBNET.ATG" out OverloadableOperatorType operatorType) { -#line 1293 "VBNET.ATG" +#line 1291 "VBNET.ATG" operatorType = OverloadableOperatorType.None; switch (la.kind) { case 14: { lexer.NextToken(); -#line 1295 "VBNET.ATG" +#line 1293 "VBNET.ATG" operatorType = OverloadableOperatorType.Add; break; } case 15: { lexer.NextToken(); -#line 1297 "VBNET.ATG" +#line 1295 "VBNET.ATG" operatorType = OverloadableOperatorType.Subtract; break; } case 16: { lexer.NextToken(); -#line 1299 "VBNET.ATG" +#line 1297 "VBNET.ATG" operatorType = OverloadableOperatorType.Multiply; break; } case 17: { lexer.NextToken(); -#line 1301 "VBNET.ATG" +#line 1299 "VBNET.ATG" operatorType = OverloadableOperatorType.Divide; break; } case 18: { lexer.NextToken(); -#line 1303 "VBNET.ATG" +#line 1301 "VBNET.ATG" operatorType = OverloadableOperatorType.DivideInteger; break; } case 19: { lexer.NextToken(); -#line 1305 "VBNET.ATG" +#line 1303 "VBNET.ATG" operatorType = OverloadableOperatorType.Concat; break; } case 115: { lexer.NextToken(); -#line 1307 "VBNET.ATG" +#line 1305 "VBNET.ATG" operatorType = OverloadableOperatorType.Like; break; } case 119: { lexer.NextToken(); -#line 1309 "VBNET.ATG" +#line 1307 "VBNET.ATG" operatorType = OverloadableOperatorType.Modulus; break; } case 44: { lexer.NextToken(); -#line 1311 "VBNET.ATG" +#line 1309 "VBNET.ATG" operatorType = OverloadableOperatorType.BitwiseAnd; break; } case 137: { lexer.NextToken(); -#line 1313 "VBNET.ATG" +#line 1311 "VBNET.ATG" operatorType = OverloadableOperatorType.BitwiseOr; break; } case 185: { lexer.NextToken(); -#line 1315 "VBNET.ATG" +#line 1313 "VBNET.ATG" operatorType = OverloadableOperatorType.ExclusiveOr; break; } case 20: { lexer.NextToken(); -#line 1317 "VBNET.ATG" +#line 1315 "VBNET.ATG" operatorType = OverloadableOperatorType.Power; break; } case 30: { lexer.NextToken(); -#line 1319 "VBNET.ATG" +#line 1317 "VBNET.ATG" operatorType = OverloadableOperatorType.ShiftLeft; break; } case 31: { lexer.NextToken(); -#line 1321 "VBNET.ATG" +#line 1319 "VBNET.ATG" operatorType = OverloadableOperatorType.ShiftRight; break; } case 11: { lexer.NextToken(); -#line 1323 "VBNET.ATG" +#line 1321 "VBNET.ATG" operatorType = OverloadableOperatorType.Equality; break; } case 27: { lexer.NextToken(); -#line 1325 "VBNET.ATG" +#line 1323 "VBNET.ATG" operatorType = OverloadableOperatorType.InEquality; break; } case 26: { lexer.NextToken(); -#line 1327 "VBNET.ATG" +#line 1325 "VBNET.ATG" operatorType = OverloadableOperatorType.LessThan; break; } case 29: { lexer.NextToken(); -#line 1329 "VBNET.ATG" +#line 1327 "VBNET.ATG" operatorType = OverloadableOperatorType.LessThanOrEqual; break; } case 25: { lexer.NextToken(); -#line 1331 "VBNET.ATG" +#line 1329 "VBNET.ATG" operatorType = OverloadableOperatorType.GreaterThan; break; } case 28: { lexer.NextToken(); -#line 1333 "VBNET.ATG" +#line 1331 "VBNET.ATG" operatorType = OverloadableOperatorType.GreaterThanOrEqual; break; } case 74: { lexer.NextToken(); -#line 1335 "VBNET.ATG" +#line 1333 "VBNET.ATG" operatorType = OverloadableOperatorType.CType; break; } case 2: case 50: case 69: case 169: { Identifier(); -#line 1339 "VBNET.ATG" +#line 1337 "VBNET.ATG" string opName = t.val; switch(opName.ToLower()) { @@ -3098,18 +3096,18 @@ out OverloadableOperatorType operatorType) { } void GetAccessorDecl( -#line 1418 "VBNET.ATG" +#line 1416 "VBNET.ATG" out PropertyGetRegion getBlock, List attributes) { -#line 1419 "VBNET.ATG" +#line 1417 "VBNET.ATG" Statement stmt = null; Expect(100); Expect(1); Block( -#line 1422 "VBNET.ATG" +#line 1420 "VBNET.ATG" out stmt); -#line 1424 "VBNET.ATG" +#line 1422 "VBNET.ATG" getBlock = new PropertyGetRegion((BlockStatement)stmt, attributes); Expect(87); @@ -3118,10 +3116,10 @@ out stmt); } void SetAccessorDecl( -#line 1431 "VBNET.ATG" +#line 1429 "VBNET.ATG" out PropertySetRegion setBlock, List attributes) { -#line 1433 "VBNET.ATG" +#line 1431 "VBNET.ATG" Statement stmt = null; List p = new List(); Expect(156); @@ -3129,17 +3127,17 @@ out PropertySetRegion setBlock, List attributes) { lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 1436 "VBNET.ATG" +#line 1434 "VBNET.ATG" p); } Expect(24); } Expect(1); Block( -#line 1438 "VBNET.ATG" +#line 1436 "VBNET.ATG" out stmt); -#line 1440 "VBNET.ATG" +#line 1438 "VBNET.ATG" setBlock = new PropertySetRegion((BlockStatement)stmt, attributes); setBlock.Parameters = p; @@ -3149,36 +3147,36 @@ out stmt); } void ArrayNameModifier( -#line 1959 "VBNET.ATG" +#line 1957 "VBNET.ATG" out ArrayList arrayModifiers) { -#line 1961 "VBNET.ATG" +#line 1959 "VBNET.ATG" arrayModifiers = null; ArrayTypeModifiers( -#line 1963 "VBNET.ATG" +#line 1961 "VBNET.ATG" out arrayModifiers); } void ArrayInitializationModifier( -#line 1499 "VBNET.ATG" +#line 1497 "VBNET.ATG" out ArrayList arrayModifiers) { -#line 1501 "VBNET.ATG" +#line 1499 "VBNET.ATG" arrayModifiers = null; Expect(23); InitializationRankList( -#line 1503 "VBNET.ATG" +#line 1501 "VBNET.ATG" out arrayModifiers); Expect(24); } void ObjectCreateExpression( -#line 1875 "VBNET.ATG" +#line 1873 "VBNET.ATG" out Expression oce) { -#line 1877 "VBNET.ATG" +#line 1875 "VBNET.ATG" TypeReference type = null; Expression initializer = null; ArrayList arguments = null; @@ -3186,24 +3184,24 @@ out Expression oce) { Expect(126); NonArrayTypeName( -#line 1882 "VBNET.ATG" +#line 1880 "VBNET.ATG" out type); if (la.kind == 23) { lexer.NextToken(); if (StartOf(18)) { ArgumentList( -#line 1883 "VBNET.ATG" +#line 1881 "VBNET.ATG" out arguments); } Expect(24); } if (la.kind == 21) { ArrayInitializer( -#line 1884 "VBNET.ATG" +#line 1882 "VBNET.ATG" out initializer); } -#line 1886 "VBNET.ATG" +#line 1884 "VBNET.ATG" if (initializer == null) { oce = new ObjectCreateExpression(type, arguments); } else { @@ -3215,98 +3213,98 @@ out initializer); } void VariableInitializer( -#line 1519 "VBNET.ATG" +#line 1517 "VBNET.ATG" out Expression initializerExpression) { -#line 1521 "VBNET.ATG" +#line 1519 "VBNET.ATG" initializerExpression = null; if (StartOf(19)) { Expr( -#line 1523 "VBNET.ATG" +#line 1521 "VBNET.ATG" out initializerExpression); } else if (la.kind == 21) { ArrayInitializer( -#line 1524 "VBNET.ATG" +#line 1522 "VBNET.ATG" out initializerExpression); } else SynErr(230); } void InitializationRankList( -#line 1507 "VBNET.ATG" +#line 1505 "VBNET.ATG" out ArrayList rank) { -#line 1509 "VBNET.ATG" +#line 1507 "VBNET.ATG" rank = null; Expression expr = null; Expr( -#line 1512 "VBNET.ATG" +#line 1510 "VBNET.ATG" out expr); -#line 1512 "VBNET.ATG" +#line 1510 "VBNET.ATG" rank = new ArrayList(); if (expr != null) { rank.Add(expr); } while (la.kind == 12) { lexer.NextToken(); Expr( -#line 1514 "VBNET.ATG" +#line 1512 "VBNET.ATG" out expr); -#line 1514 "VBNET.ATG" +#line 1512 "VBNET.ATG" if (expr != null) { rank.Add(expr); } } } void ArrayInitializer( -#line 1528 "VBNET.ATG" +#line 1526 "VBNET.ATG" out Expression outExpr) { -#line 1530 "VBNET.ATG" +#line 1528 "VBNET.ATG" Expression expr = null; ArrayInitializerExpression initializer = new ArrayInitializerExpression(); Expect(21); if (StartOf(20)) { VariableInitializer( -#line 1535 "VBNET.ATG" +#line 1533 "VBNET.ATG" out expr); -#line 1537 "VBNET.ATG" +#line 1535 "VBNET.ATG" if (expr != null) { initializer.CreateExpressions.Add(expr); } while ( -#line 1540 "VBNET.ATG" +#line 1538 "VBNET.ATG" NotFinalComma()) { Expect(12); VariableInitializer( -#line 1540 "VBNET.ATG" +#line 1538 "VBNET.ATG" out expr); -#line 1541 "VBNET.ATG" +#line 1539 "VBNET.ATG" if (expr != null) { initializer.CreateExpressions.Add(expr); } } } Expect(22); -#line 1544 "VBNET.ATG" +#line 1542 "VBNET.ATG" outExpr = initializer; } void EventMemberSpecifier( -#line 1607 "VBNET.ATG" +#line 1605 "VBNET.ATG" out string name) { -#line 1608 "VBNET.ATG" +#line 1606 "VBNET.ATG" string type; name = String.Empty; if (StartOf(10)) { Identifier(); -#line 1609 "VBNET.ATG" +#line 1607 "VBNET.ATG" type = t.val; Expect(10); Identifier(); -#line 1611 "VBNET.ATG" +#line 1609 "VBNET.ATG" name = type + "." + t.val; } else if (la.kind == 123) { lexer.NextToken(); @@ -3314,42 +3312,42 @@ out string name) { if (StartOf(10)) { Identifier(); -#line 1614 "VBNET.ATG" +#line 1612 "VBNET.ATG" name = "MyBase." + t.val; } else if (la.kind == 91) { lexer.NextToken(); -#line 1615 "VBNET.ATG" +#line 1613 "VBNET.ATG" name = "MyBase.Error"; } else SynErr(231); } else SynErr(232); } void ConditionalOrExpr( -#line 1754 "VBNET.ATG" +#line 1752 "VBNET.ATG" out Expression outExpr) { -#line 1755 "VBNET.ATG" +#line 1753 "VBNET.ATG" Expression expr; ConditionalAndExpr( -#line 1756 "VBNET.ATG" +#line 1754 "VBNET.ATG" out outExpr); while (la.kind == 138) { lexer.NextToken(); ConditionalAndExpr( -#line 1756 "VBNET.ATG" +#line 1754 "VBNET.ATG" out expr); -#line 1756 "VBNET.ATG" +#line 1754 "VBNET.ATG" outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.LogicalOr, expr); } } void UnaryExpr( -#line 1628 "VBNET.ATG" +#line 1626 "VBNET.ATG" out Expression uExpr) { -#line 1630 "VBNET.ATG" +#line 1628 "VBNET.ATG" Expression expr; UnaryOperatorType uop = UnaryOperatorType.None; bool isUOp = false; @@ -3358,25 +3356,25 @@ out Expression uExpr) { if (la.kind == 14) { lexer.NextToken(); -#line 1634 "VBNET.ATG" +#line 1632 "VBNET.ATG" uop = UnaryOperatorType.Plus; isUOp = true; } else if (la.kind == 15) { lexer.NextToken(); -#line 1635 "VBNET.ATG" +#line 1633 "VBNET.ATG" uop = UnaryOperatorType.Minus; isUOp = true; } else { lexer.NextToken(); -#line 1637 "VBNET.ATG" +#line 1635 "VBNET.ATG" uop = UnaryOperatorType.Star; isUOp = true; } } SimpleExpr( -#line 1639 "VBNET.ATG" +#line 1637 "VBNET.ATG" out expr); -#line 1641 "VBNET.ATG" +#line 1639 "VBNET.ATG" if (isUOp) { uExpr = new UnaryOperatorExpression(expr, uop); } else { @@ -3386,139 +3384,139 @@ out expr); } void SimpleExpr( -#line 1664 "VBNET.ATG" +#line 1662 "VBNET.ATG" out Expression pexpr) { -#line 1666 "VBNET.ATG" +#line 1664 "VBNET.ATG" Expression expr; TypeReference type = null; string name = String.Empty; pexpr = null; if (StartOf(21) || -#line 1695 "VBNET.ATG" +#line 1693 "VBNET.ATG" la.kind == Tokens.Global) { if (la.kind == 3) { lexer.NextToken(); -#line 1674 "VBNET.ATG" +#line 1672 "VBNET.ATG" pexpr = new PrimitiveExpression(t.literalValue, t.val); } else if (la.kind == 4) { lexer.NextToken(); -#line 1675 "VBNET.ATG" +#line 1673 "VBNET.ATG" pexpr = new PrimitiveExpression(t.literalValue, t.val); } else if (la.kind == 7) { lexer.NextToken(); -#line 1676 "VBNET.ATG" +#line 1674 "VBNET.ATG" pexpr = new PrimitiveExpression(t.literalValue, t.val); } else if (la.kind == 6) { lexer.NextToken(); -#line 1677 "VBNET.ATG" +#line 1675 "VBNET.ATG" pexpr = new PrimitiveExpression(t.literalValue, t.val); } else if (la.kind == 5) { lexer.NextToken(); -#line 1678 "VBNET.ATG" +#line 1676 "VBNET.ATG" pexpr = new PrimitiveExpression(t.literalValue, t.val); } else if (la.kind == 9) { lexer.NextToken(); -#line 1679 "VBNET.ATG" +#line 1677 "VBNET.ATG" pexpr = new PrimitiveExpression(t.literalValue, t.val); } else if (la.kind == 8) { lexer.NextToken(); -#line 1680 "VBNET.ATG" +#line 1678 "VBNET.ATG" pexpr = new PrimitiveExpression(t.literalValue, t.val); } else if (la.kind == 173) { lexer.NextToken(); -#line 1682 "VBNET.ATG" +#line 1680 "VBNET.ATG" pexpr = new PrimitiveExpression(true, "true"); } else if (la.kind == 95) { lexer.NextToken(); -#line 1683 "VBNET.ATG" +#line 1681 "VBNET.ATG" pexpr = new PrimitiveExpression(false, "false"); } else if (la.kind == 129) { lexer.NextToken(); -#line 1684 "VBNET.ATG" +#line 1682 "VBNET.ATG" pexpr = new PrimitiveExpression(null, "null"); } else if (la.kind == 23) { lexer.NextToken(); Expr( -#line 1685 "VBNET.ATG" +#line 1683 "VBNET.ATG" out expr); Expect(24); -#line 1685 "VBNET.ATG" +#line 1683 "VBNET.ATG" pexpr = new ParenthesizedExpression(expr); } else if (StartOf(10)) { Identifier(); -#line 1686 "VBNET.ATG" +#line 1684 "VBNET.ATG" pexpr = new IdentifierExpression(t.val); } else if (StartOf(22)) { -#line 1687 "VBNET.ATG" +#line 1685 "VBNET.ATG" string val = String.Empty; PrimitiveTypeName( -#line 1687 "VBNET.ATG" +#line 1685 "VBNET.ATG" out val); Expect(10); -#line 1688 "VBNET.ATG" +#line 1686 "VBNET.ATG" t.val = ""; Identifier(); -#line 1688 "VBNET.ATG" +#line 1686 "VBNET.ATG" pexpr = new FieldReferenceExpression(new TypeReferenceExpression(val), t.val); } else if (la.kind == 118) { lexer.NextToken(); -#line 1689 "VBNET.ATG" +#line 1687 "VBNET.ATG" pexpr = new ThisReferenceExpression(); } else if (la.kind == 123 || la.kind == 124) { -#line 1690 "VBNET.ATG" +#line 1688 "VBNET.ATG" Expression retExpr = null; if (la.kind == 123) { lexer.NextToken(); -#line 1691 "VBNET.ATG" +#line 1689 "VBNET.ATG" retExpr = new BaseReferenceExpression(); } else if (la.kind == 124) { lexer.NextToken(); -#line 1692 "VBNET.ATG" +#line 1690 "VBNET.ATG" retExpr = new ClassReferenceExpression(); } else SynErr(233); Expect(10); IdentifierOrKeyword( -#line 1694 "VBNET.ATG" +#line 1692 "VBNET.ATG" out name); -#line 1694 "VBNET.ATG" +#line 1692 "VBNET.ATG" pexpr = new FieldReferenceExpression(retExpr, name); } else if ( -#line 1695 "VBNET.ATG" +#line 1693 "VBNET.ATG" la.kind == Tokens.Global) { TypeName( -#line 1695 "VBNET.ATG" +#line 1693 "VBNET.ATG" out type); -#line 1695 "VBNET.ATG" +#line 1693 "VBNET.ATG" pexpr = new TypeReferenceExpression(type); } else if (la.kind == 126) { ObjectCreateExpression( -#line 1696 "VBNET.ATG" +#line 1694 "VBNET.ATG" out expr); -#line 1696 "VBNET.ATG" +#line 1694 "VBNET.ATG" pexpr = expr; } else if (la.kind == 74 || la.kind == 81) { if (la.kind == 81) { @@ -3528,166 +3526,166 @@ out expr); } else SynErr(234); Expect(23); Expr( -#line 1697 "VBNET.ATG" +#line 1695 "VBNET.ATG" out expr); Expect(12); TypeName( -#line 1697 "VBNET.ATG" +#line 1695 "VBNET.ATG" out type); Expect(24); -#line 1697 "VBNET.ATG" +#line 1695 "VBNET.ATG" pexpr = new CastExpression(type, expr); } else if (la.kind == 195) { lexer.NextToken(); Expect(23); Expr( -#line 1698 "VBNET.ATG" +#line 1696 "VBNET.ATG" out expr); Expect(12); TypeName( -#line 1698 "VBNET.ATG" +#line 1696 "VBNET.ATG" out type); Expect(24); -#line 1698 "VBNET.ATG" +#line 1696 "VBNET.ATG" pexpr = new BinaryOperatorExpression(expr, BinaryOperatorType.AsCast, new TypeReferenceExpression(type)); } else if (StartOf(23)) { CastTarget( -#line 1699 "VBNET.ATG" +#line 1697 "VBNET.ATG" out type); Expect(23); Expr( -#line 1699 "VBNET.ATG" +#line 1697 "VBNET.ATG" out expr); Expect(24); -#line 1699 "VBNET.ATG" +#line 1697 "VBNET.ATG" pexpr = new CastExpression(type, expr, true); } else if (la.kind == 42) { lexer.NextToken(); Expr( -#line 1700 "VBNET.ATG" +#line 1698 "VBNET.ATG" out expr); -#line 1700 "VBNET.ATG" +#line 1698 "VBNET.ATG" pexpr = new AddressOfExpression(expr); } else if (la.kind == 101) { lexer.NextToken(); Expect(23); TypeName( -#line 1701 "VBNET.ATG" +#line 1699 "VBNET.ATG" out type); Expect(24); -#line 1701 "VBNET.ATG" +#line 1699 "VBNET.ATG" pexpr = new TypeOfExpression(type); } else { lexer.NextToken(); SimpleExpr( -#line 1702 "VBNET.ATG" +#line 1700 "VBNET.ATG" out expr); Expect(112); TypeName( -#line 1702 "VBNET.ATG" +#line 1700 "VBNET.ATG" out type); -#line 1702 "VBNET.ATG" +#line 1700 "VBNET.ATG" pexpr = new TypeOfIsExpression(expr, type); } while (la.kind == 10 || la.kind == 23) { if (la.kind == 10) { lexer.NextToken(); IdentifierOrKeyword( -#line 1705 "VBNET.ATG" +#line 1703 "VBNET.ATG" out name); -#line 1705 "VBNET.ATG" +#line 1703 "VBNET.ATG" pexpr = new FieldReferenceExpression(pexpr, name); } else { lexer.NextToken(); -#line 1706 "VBNET.ATG" +#line 1704 "VBNET.ATG" ArrayList parameters = new ArrayList(); if (StartOf(24)) { if (StartOf(19)) { Argument( -#line 1708 "VBNET.ATG" +#line 1706 "VBNET.ATG" out expr); -#line 1708 "VBNET.ATG" +#line 1706 "VBNET.ATG" if (expr != null) { parameters.Add(expr); } } while (la.kind == 12) { lexer.NextToken(); if (StartOf(19)) { Argument( -#line 1711 "VBNET.ATG" +#line 1709 "VBNET.ATG" out expr); -#line 1711 "VBNET.ATG" +#line 1709 "VBNET.ATG" if (expr != null) { parameters.Add(expr); } } } } Expect(24); -#line 1714 "VBNET.ATG" +#line 1712 "VBNET.ATG" pexpr = new InvocationExpression(pexpr, parameters); } } } else if (la.kind == 10) { lexer.NextToken(); IdentifierOrKeyword( -#line 1718 "VBNET.ATG" +#line 1716 "VBNET.ATG" out name); -#line 1718 "VBNET.ATG" +#line 1716 "VBNET.ATG" pexpr = new FieldReferenceExpression(pexpr, name); while (la.kind == 10 || la.kind == 23) { if (la.kind == 10) { lexer.NextToken(); IdentifierOrKeyword( -#line 1720 "VBNET.ATG" +#line 1718 "VBNET.ATG" out name); -#line 1720 "VBNET.ATG" +#line 1718 "VBNET.ATG" pexpr = new FieldReferenceExpression(pexpr, name); } else { lexer.NextToken(); -#line 1721 "VBNET.ATG" +#line 1719 "VBNET.ATG" ArrayList parameters = new ArrayList(); if (StartOf(24)) { -#line 1723 "VBNET.ATG" +#line 1721 "VBNET.ATG" expr = null; if (StartOf(19)) { Argument( -#line 1723 "VBNET.ATG" +#line 1721 "VBNET.ATG" out expr); } -#line 1723 "VBNET.ATG" +#line 1721 "VBNET.ATG" if (expr != null) { parameters.Add(expr); } while (la.kind == 12) { lexer.NextToken(); -#line 1725 "VBNET.ATG" +#line 1723 "VBNET.ATG" expr = null; if (StartOf(19)) { Argument( -#line 1726 "VBNET.ATG" +#line 1724 "VBNET.ATG" out expr); } -#line 1726 "VBNET.ATG" +#line 1724 "VBNET.ATG" if (expr != null) { parameters.Add(expr); } } } Expect(24); -#line 1729 "VBNET.ATG" +#line 1727 "VBNET.ATG" pexpr = new InvocationExpression(pexpr, parameters); } } @@ -3695,79 +3693,79 @@ out expr); } void AssignmentOperator( -#line 1649 "VBNET.ATG" +#line 1647 "VBNET.ATG" out AssignmentOperatorType op) { -#line 1650 "VBNET.ATG" +#line 1648 "VBNET.ATG" op = AssignmentOperatorType.None; switch (la.kind) { case 11: { lexer.NextToken(); -#line 1651 "VBNET.ATG" +#line 1649 "VBNET.ATG" op = AssignmentOperatorType.Assign; break; } case 40: { lexer.NextToken(); -#line 1652 "VBNET.ATG" +#line 1650 "VBNET.ATG" op = AssignmentOperatorType.ConcatString; break; } case 32: { lexer.NextToken(); -#line 1653 "VBNET.ATG" +#line 1651 "VBNET.ATG" op = AssignmentOperatorType.Add; break; } case 34: { lexer.NextToken(); -#line 1654 "VBNET.ATG" +#line 1652 "VBNET.ATG" op = AssignmentOperatorType.Subtract; break; } case 35: { lexer.NextToken(); -#line 1655 "VBNET.ATG" +#line 1653 "VBNET.ATG" op = AssignmentOperatorType.Multiply; break; } case 36: { lexer.NextToken(); -#line 1656 "VBNET.ATG" +#line 1654 "VBNET.ATG" op = AssignmentOperatorType.Divide; break; } case 37: { lexer.NextToken(); -#line 1657 "VBNET.ATG" +#line 1655 "VBNET.ATG" op = AssignmentOperatorType.DivideInteger; break; } case 33: { lexer.NextToken(); -#line 1658 "VBNET.ATG" +#line 1656 "VBNET.ATG" op = AssignmentOperatorType.Power; break; } case 38: { lexer.NextToken(); -#line 1659 "VBNET.ATG" +#line 1657 "VBNET.ATG" op = AssignmentOperatorType.ShiftLeft; break; } case 39: { lexer.NextToken(); -#line 1660 "VBNET.ATG" +#line 1658 "VBNET.ATG" op = AssignmentOperatorType.ShiftRight; break; } @@ -3776,1074 +3774,1074 @@ out AssignmentOperatorType op) { } void IdentifierOrKeyword( -#line 2752 "VBNET.ATG" +#line 2750 "VBNET.ATG" out string name) { -#line 2754 "VBNET.ATG" +#line 2752 "VBNET.ATG" name = String.Empty; switch (la.kind) { case 2: case 50: case 69: case 169: { Identifier(); -#line 2757 "VBNET.ATG" +#line 2755 "VBNET.ATG" name = t.val; break; } case 41: { lexer.NextToken(); -#line 2758 "VBNET.ATG" +#line 2756 "VBNET.ATG" name = t.val; break; } case 42: { lexer.NextToken(); -#line 2759 "VBNET.ATG" +#line 2757 "VBNET.ATG" name = t.val; break; } case 43: { lexer.NextToken(); -#line 2760 "VBNET.ATG" +#line 2758 "VBNET.ATG" name = t.val; break; } case 44: { lexer.NextToken(); -#line 2761 "VBNET.ATG" +#line 2759 "VBNET.ATG" name = t.val; break; } case 45: { lexer.NextToken(); -#line 2762 "VBNET.ATG" +#line 2760 "VBNET.ATG" name = t.val; break; } case 46: { lexer.NextToken(); -#line 2763 "VBNET.ATG" +#line 2761 "VBNET.ATG" name = t.val; break; } case 47: { lexer.NextToken(); -#line 2764 "VBNET.ATG" +#line 2762 "VBNET.ATG" name = t.val; break; } case 48: { lexer.NextToken(); -#line 2765 "VBNET.ATG" +#line 2763 "VBNET.ATG" name = t.val; break; } case 49: { lexer.NextToken(); -#line 2766 "VBNET.ATG" +#line 2764 "VBNET.ATG" name = t.val; break; } case 51: { lexer.NextToken(); -#line 2767 "VBNET.ATG" +#line 2765 "VBNET.ATG" name = t.val; break; } case 52: { lexer.NextToken(); -#line 2768 "VBNET.ATG" +#line 2766 "VBNET.ATG" name = t.val; break; } case 53: { lexer.NextToken(); -#line 2769 "VBNET.ATG" +#line 2767 "VBNET.ATG" name = t.val; break; } case 54: { lexer.NextToken(); -#line 2770 "VBNET.ATG" +#line 2768 "VBNET.ATG" name = t.val; break; } case 55: { lexer.NextToken(); -#line 2771 "VBNET.ATG" +#line 2769 "VBNET.ATG" name = t.val; break; } case 56: { lexer.NextToken(); -#line 2772 "VBNET.ATG" +#line 2770 "VBNET.ATG" name = t.val; break; } case 57: { lexer.NextToken(); -#line 2773 "VBNET.ATG" +#line 2771 "VBNET.ATG" name = t.val; break; } case 58: { lexer.NextToken(); -#line 2774 "VBNET.ATG" +#line 2772 "VBNET.ATG" name = t.val; break; } case 59: { lexer.NextToken(); -#line 2775 "VBNET.ATG" +#line 2773 "VBNET.ATG" name = t.val; break; } case 60: { lexer.NextToken(); -#line 2776 "VBNET.ATG" +#line 2774 "VBNET.ATG" name = t.val; break; } case 61: { lexer.NextToken(); -#line 2777 "VBNET.ATG" +#line 2775 "VBNET.ATG" name = t.val; break; } case 62: { lexer.NextToken(); -#line 2778 "VBNET.ATG" +#line 2776 "VBNET.ATG" name = t.val; break; } case 63: { lexer.NextToken(); -#line 2779 "VBNET.ATG" +#line 2777 "VBNET.ATG" name = t.val; break; } case 64: { lexer.NextToken(); -#line 2780 "VBNET.ATG" +#line 2778 "VBNET.ATG" name = t.val; break; } case 65: { lexer.NextToken(); -#line 2781 "VBNET.ATG" +#line 2779 "VBNET.ATG" name = t.val; break; } case 66: { lexer.NextToken(); -#line 2782 "VBNET.ATG" +#line 2780 "VBNET.ATG" name = t.val; break; } case 67: { lexer.NextToken(); -#line 2783 "VBNET.ATG" +#line 2781 "VBNET.ATG" name = t.val; break; } case 68: { lexer.NextToken(); -#line 2784 "VBNET.ATG" +#line 2782 "VBNET.ATG" name = t.val; break; } case 70: { lexer.NextToken(); -#line 2785 "VBNET.ATG" +#line 2783 "VBNET.ATG" name = t.val; break; } case 71: { lexer.NextToken(); -#line 2786 "VBNET.ATG" +#line 2784 "VBNET.ATG" name = t.val; break; } case 72: { lexer.NextToken(); -#line 2787 "VBNET.ATG" +#line 2785 "VBNET.ATG" name = t.val; break; } case 73: { lexer.NextToken(); -#line 2788 "VBNET.ATG" +#line 2786 "VBNET.ATG" name = t.val; break; } case 74: { lexer.NextToken(); -#line 2789 "VBNET.ATG" +#line 2787 "VBNET.ATG" name = t.val; break; } case 75: { lexer.NextToken(); -#line 2790 "VBNET.ATG" +#line 2788 "VBNET.ATG" name = t.val; break; } case 76: { lexer.NextToken(); -#line 2791 "VBNET.ATG" +#line 2789 "VBNET.ATG" name = t.val; break; } case 77: { lexer.NextToken(); -#line 2792 "VBNET.ATG" +#line 2790 "VBNET.ATG" name = t.val; break; } case 78: { lexer.NextToken(); -#line 2793 "VBNET.ATG" +#line 2791 "VBNET.ATG" name = t.val; break; } case 79: { lexer.NextToken(); -#line 2794 "VBNET.ATG" +#line 2792 "VBNET.ATG" name = t.val; break; } case 80: { lexer.NextToken(); -#line 2795 "VBNET.ATG" +#line 2793 "VBNET.ATG" name = t.val; break; } case 81: { lexer.NextToken(); -#line 2796 "VBNET.ATG" +#line 2794 "VBNET.ATG" name = t.val; break; } case 82: { lexer.NextToken(); -#line 2797 "VBNET.ATG" +#line 2795 "VBNET.ATG" name = t.val; break; } case 83: { lexer.NextToken(); -#line 2798 "VBNET.ATG" +#line 2796 "VBNET.ATG" name = t.val; break; } case 84: { lexer.NextToken(); -#line 2799 "VBNET.ATG" +#line 2797 "VBNET.ATG" name = t.val; break; } case 85: { lexer.NextToken(); -#line 2800 "VBNET.ATG" +#line 2798 "VBNET.ATG" name = t.val; break; } case 86: { lexer.NextToken(); -#line 2801 "VBNET.ATG" +#line 2799 "VBNET.ATG" name = t.val; break; } case 87: { lexer.NextToken(); -#line 2802 "VBNET.ATG" +#line 2800 "VBNET.ATG" name = t.val; break; } case 88: { lexer.NextToken(); -#line 2803 "VBNET.ATG" +#line 2801 "VBNET.ATG" name = t.val; break; } case 89: { lexer.NextToken(); -#line 2804 "VBNET.ATG" +#line 2802 "VBNET.ATG" name = t.val; break; } case 90: { lexer.NextToken(); -#line 2805 "VBNET.ATG" +#line 2803 "VBNET.ATG" name = t.val; break; } case 91: { lexer.NextToken(); -#line 2806 "VBNET.ATG" +#line 2804 "VBNET.ATG" name = t.val; break; } case 92: { lexer.NextToken(); -#line 2807 "VBNET.ATG" +#line 2805 "VBNET.ATG" name = t.val; break; } case 93: { lexer.NextToken(); -#line 2808 "VBNET.ATG" +#line 2806 "VBNET.ATG" name = t.val; break; } case 94: { lexer.NextToken(); -#line 2809 "VBNET.ATG" +#line 2807 "VBNET.ATG" name = t.val; break; } case 95: { lexer.NextToken(); -#line 2810 "VBNET.ATG" +#line 2808 "VBNET.ATG" name = t.val; break; } case 96: { lexer.NextToken(); -#line 2811 "VBNET.ATG" +#line 2809 "VBNET.ATG" name = t.val; break; } case 97: { lexer.NextToken(); -#line 2812 "VBNET.ATG" +#line 2810 "VBNET.ATG" name = t.val; break; } case 98: { lexer.NextToken(); -#line 2813 "VBNET.ATG" +#line 2811 "VBNET.ATG" name = t.val; break; } case 99: { lexer.NextToken(); -#line 2814 "VBNET.ATG" +#line 2812 "VBNET.ATG" name = t.val; break; } case 100: { lexer.NextToken(); -#line 2815 "VBNET.ATG" +#line 2813 "VBNET.ATG" name = t.val; break; } case 101: { lexer.NextToken(); -#line 2816 "VBNET.ATG" +#line 2814 "VBNET.ATG" name = t.val; break; } case 102: { lexer.NextToken(); -#line 2817 "VBNET.ATG" +#line 2815 "VBNET.ATG" name = t.val; break; } case 103: { lexer.NextToken(); -#line 2818 "VBNET.ATG" +#line 2816 "VBNET.ATG" name = t.val; break; } case 104: { lexer.NextToken(); -#line 2819 "VBNET.ATG" +#line 2817 "VBNET.ATG" name = t.val; break; } case 105: { lexer.NextToken(); -#line 2820 "VBNET.ATG" +#line 2818 "VBNET.ATG" name = t.val; break; } case 106: { lexer.NextToken(); -#line 2821 "VBNET.ATG" +#line 2819 "VBNET.ATG" name = t.val; break; } case 107: { lexer.NextToken(); -#line 2822 "VBNET.ATG" +#line 2820 "VBNET.ATG" name = t.val; break; } case 108: { lexer.NextToken(); -#line 2823 "VBNET.ATG" +#line 2821 "VBNET.ATG" name = t.val; break; } case 109: { lexer.NextToken(); -#line 2824 "VBNET.ATG" +#line 2822 "VBNET.ATG" name = t.val; break; } case 110: { lexer.NextToken(); -#line 2825 "VBNET.ATG" +#line 2823 "VBNET.ATG" name = t.val; break; } case 111: { lexer.NextToken(); -#line 2826 "VBNET.ATG" +#line 2824 "VBNET.ATG" name = t.val; break; } case 112: { lexer.NextToken(); -#line 2827 "VBNET.ATG" +#line 2825 "VBNET.ATG" name = t.val; break; } case 113: { lexer.NextToken(); -#line 2828 "VBNET.ATG" +#line 2826 "VBNET.ATG" name = t.val; break; } case 114: { lexer.NextToken(); -#line 2829 "VBNET.ATG" +#line 2827 "VBNET.ATG" name = t.val; break; } case 115: { lexer.NextToken(); -#line 2830 "VBNET.ATG" +#line 2828 "VBNET.ATG" name = t.val; break; } case 116: { lexer.NextToken(); -#line 2831 "VBNET.ATG" +#line 2829 "VBNET.ATG" name = t.val; break; } case 117: { lexer.NextToken(); -#line 2832 "VBNET.ATG" +#line 2830 "VBNET.ATG" name = t.val; break; } case 118: { lexer.NextToken(); -#line 2833 "VBNET.ATG" +#line 2831 "VBNET.ATG" name = t.val; break; } case 119: { lexer.NextToken(); -#line 2834 "VBNET.ATG" +#line 2832 "VBNET.ATG" name = t.val; break; } case 120: { lexer.NextToken(); -#line 2835 "VBNET.ATG" +#line 2833 "VBNET.ATG" name = t.val; break; } case 121: { lexer.NextToken(); -#line 2836 "VBNET.ATG" +#line 2834 "VBNET.ATG" name = t.val; break; } case 122: { lexer.NextToken(); -#line 2837 "VBNET.ATG" +#line 2835 "VBNET.ATG" name = t.val; break; } case 123: { lexer.NextToken(); -#line 2838 "VBNET.ATG" +#line 2836 "VBNET.ATG" name = t.val; break; } case 124: { lexer.NextToken(); -#line 2839 "VBNET.ATG" +#line 2837 "VBNET.ATG" name = t.val; break; } case 125: { lexer.NextToken(); -#line 2840 "VBNET.ATG" +#line 2838 "VBNET.ATG" name = t.val; break; } case 126: { lexer.NextToken(); -#line 2841 "VBNET.ATG" +#line 2839 "VBNET.ATG" name = t.val; break; } case 127: { lexer.NextToken(); -#line 2842 "VBNET.ATG" +#line 2840 "VBNET.ATG" name = t.val; break; } case 128: { lexer.NextToken(); -#line 2843 "VBNET.ATG" +#line 2841 "VBNET.ATG" name = t.val; break; } case 129: { lexer.NextToken(); -#line 2844 "VBNET.ATG" +#line 2842 "VBNET.ATG" name = t.val; break; } case 130: { lexer.NextToken(); -#line 2845 "VBNET.ATG" +#line 2843 "VBNET.ATG" name = t.val; break; } case 131: { lexer.NextToken(); -#line 2846 "VBNET.ATG" +#line 2844 "VBNET.ATG" name = t.val; break; } case 132: { lexer.NextToken(); -#line 2847 "VBNET.ATG" +#line 2845 "VBNET.ATG" name = t.val; break; } case 134: { lexer.NextToken(); -#line 2848 "VBNET.ATG" +#line 2846 "VBNET.ATG" name = t.val; break; } case 135: { lexer.NextToken(); -#line 2849 "VBNET.ATG" +#line 2847 "VBNET.ATG" name = t.val; break; } case 136: { lexer.NextToken(); -#line 2850 "VBNET.ATG" +#line 2848 "VBNET.ATG" name = t.val; break; } case 137: { lexer.NextToken(); -#line 2851 "VBNET.ATG" +#line 2849 "VBNET.ATG" name = t.val; break; } case 138: { lexer.NextToken(); -#line 2852 "VBNET.ATG" +#line 2850 "VBNET.ATG" name = t.val; break; } case 139: { lexer.NextToken(); -#line 2853 "VBNET.ATG" +#line 2851 "VBNET.ATG" name = t.val; break; } case 140: { lexer.NextToken(); -#line 2854 "VBNET.ATG" +#line 2852 "VBNET.ATG" name = t.val; break; } case 142: { lexer.NextToken(); -#line 2855 "VBNET.ATG" +#line 2853 "VBNET.ATG" name = t.val; break; } case 143: { lexer.NextToken(); -#line 2856 "VBNET.ATG" +#line 2854 "VBNET.ATG" name = t.val; break; } case 144: { lexer.NextToken(); -#line 2857 "VBNET.ATG" +#line 2855 "VBNET.ATG" name = t.val; break; } case 145: { lexer.NextToken(); -#line 2858 "VBNET.ATG" +#line 2856 "VBNET.ATG" name = t.val; break; } case 146: { lexer.NextToken(); -#line 2859 "VBNET.ATG" +#line 2857 "VBNET.ATG" name = t.val; break; } case 147: { lexer.NextToken(); -#line 2860 "VBNET.ATG" +#line 2858 "VBNET.ATG" name = t.val; break; } case 148: { lexer.NextToken(); -#line 2861 "VBNET.ATG" +#line 2859 "VBNET.ATG" name = t.val; break; } case 149: { lexer.NextToken(); -#line 2862 "VBNET.ATG" +#line 2860 "VBNET.ATG" name = t.val; break; } case 150: { lexer.NextToken(); -#line 2863 "VBNET.ATG" +#line 2861 "VBNET.ATG" name = t.val; break; } case 151: { lexer.NextToken(); -#line 2864 "VBNET.ATG" +#line 2862 "VBNET.ATG" name = t.val; break; } case 152: { lexer.NextToken(); -#line 2865 "VBNET.ATG" +#line 2863 "VBNET.ATG" name = t.val; break; } case 153: { lexer.NextToken(); -#line 2866 "VBNET.ATG" +#line 2864 "VBNET.ATG" name = t.val; break; } case 154: { lexer.NextToken(); -#line 2867 "VBNET.ATG" +#line 2865 "VBNET.ATG" name = t.val; break; } case 155: { lexer.NextToken(); -#line 2868 "VBNET.ATG" +#line 2866 "VBNET.ATG" name = t.val; break; } case 156: { lexer.NextToken(); -#line 2869 "VBNET.ATG" +#line 2867 "VBNET.ATG" name = t.val; break; } case 157: { lexer.NextToken(); -#line 2870 "VBNET.ATG" +#line 2868 "VBNET.ATG" name = t.val; break; } case 158: { lexer.NextToken(); -#line 2871 "VBNET.ATG" +#line 2869 "VBNET.ATG" name = t.val; break; } case 159: { lexer.NextToken(); -#line 2872 "VBNET.ATG" +#line 2870 "VBNET.ATG" name = t.val; break; } case 160: { lexer.NextToken(); -#line 2873 "VBNET.ATG" +#line 2871 "VBNET.ATG" name = t.val; break; } case 161: { lexer.NextToken(); -#line 2874 "VBNET.ATG" +#line 2872 "VBNET.ATG" name = t.val; break; } case 162: { lexer.NextToken(); -#line 2875 "VBNET.ATG" +#line 2873 "VBNET.ATG" name = t.val; break; } case 163: { lexer.NextToken(); -#line 2876 "VBNET.ATG" +#line 2874 "VBNET.ATG" name = t.val; break; } case 165: { lexer.NextToken(); -#line 2877 "VBNET.ATG" +#line 2875 "VBNET.ATG" name = t.val; break; } case 166: { lexer.NextToken(); -#line 2878 "VBNET.ATG" +#line 2876 "VBNET.ATG" name = t.val; break; } case 167: { lexer.NextToken(); -#line 2879 "VBNET.ATG" +#line 2877 "VBNET.ATG" name = t.val; break; } case 168: { lexer.NextToken(); -#line 2880 "VBNET.ATG" +#line 2878 "VBNET.ATG" name = t.val; break; } case 170: { lexer.NextToken(); -#line 2881 "VBNET.ATG" +#line 2879 "VBNET.ATG" name = t.val; break; } case 171: { lexer.NextToken(); -#line 2882 "VBNET.ATG" +#line 2880 "VBNET.ATG" name = t.val; break; } case 172: { lexer.NextToken(); -#line 2883 "VBNET.ATG" +#line 2881 "VBNET.ATG" name = t.val; break; } case 173: { lexer.NextToken(); -#line 2884 "VBNET.ATG" +#line 2882 "VBNET.ATG" name = t.val; break; } case 174: { lexer.NextToken(); -#line 2885 "VBNET.ATG" +#line 2883 "VBNET.ATG" name = t.val; break; } case 175: { lexer.NextToken(); -#line 2886 "VBNET.ATG" +#line 2884 "VBNET.ATG" name = t.val; break; } case 176: { lexer.NextToken(); -#line 2887 "VBNET.ATG" +#line 2885 "VBNET.ATG" name = t.val; break; } case 177: { lexer.NextToken(); -#line 2888 "VBNET.ATG" +#line 2886 "VBNET.ATG" name = t.val; break; } case 178: { lexer.NextToken(); -#line 2889 "VBNET.ATG" +#line 2887 "VBNET.ATG" name = t.val; break; } case 179: { lexer.NextToken(); -#line 2890 "VBNET.ATG" +#line 2888 "VBNET.ATG" name = t.val; break; } case 180: { lexer.NextToken(); -#line 2891 "VBNET.ATG" +#line 2889 "VBNET.ATG" name = t.val; break; } case 181: { lexer.NextToken(); -#line 2892 "VBNET.ATG" +#line 2890 "VBNET.ATG" name = t.val; break; } case 182: { lexer.NextToken(); -#line 2893 "VBNET.ATG" +#line 2891 "VBNET.ATG" name = t.val; break; } case 183: { lexer.NextToken(); -#line 2894 "VBNET.ATG" +#line 2892 "VBNET.ATG" name = t.val; break; } case 184: { lexer.NextToken(); -#line 2895 "VBNET.ATG" +#line 2893 "VBNET.ATG" name = t.val; break; } case 185: { lexer.NextToken(); -#line 2896 "VBNET.ATG" +#line 2894 "VBNET.ATG" name = t.val; break; } case 186: { lexer.NextToken(); -#line 2897 "VBNET.ATG" +#line 2895 "VBNET.ATG" name = t.val; break; } case 187: { lexer.NextToken(); -#line 2898 "VBNET.ATG" +#line 2896 "VBNET.ATG" name = t.val; break; } case 188: { lexer.NextToken(); -#line 2899 "VBNET.ATG" +#line 2897 "VBNET.ATG" name = t.val; break; } case 189: { lexer.NextToken(); -#line 2900 "VBNET.ATG" +#line 2898 "VBNET.ATG" name = t.val; break; } case 190: { lexer.NextToken(); -#line 2901 "VBNET.ATG" +#line 2899 "VBNET.ATG" name = t.val; break; } case 191: { lexer.NextToken(); -#line 2902 "VBNET.ATG" +#line 2900 "VBNET.ATG" name = t.val; break; } case 192: { lexer.NextToken(); -#line 2903 "VBNET.ATG" +#line 2901 "VBNET.ATG" name = t.val; break; } case 193: { lexer.NextToken(); -#line 2904 "VBNET.ATG" +#line 2902 "VBNET.ATG" name = t.val; break; } case 196: { lexer.NextToken(); -#line 2905 "VBNET.ATG" +#line 2903 "VBNET.ATG" name = t.val; break; } case 197: { lexer.NextToken(); -#line 2906 "VBNET.ATG" +#line 2904 "VBNET.ATG" name = t.val; break; } case 198: { lexer.NextToken(); -#line 2907 "VBNET.ATG" +#line 2905 "VBNET.ATG" name = t.val; break; } case 199: { lexer.NextToken(); -#line 2908 "VBNET.ATG" +#line 2906 "VBNET.ATG" name = t.val; break; } @@ -4852,94 +4850,94 @@ out string name) { } void CastTarget( -#line 1736 "VBNET.ATG" +#line 1734 "VBNET.ATG" out TypeReference type) { -#line 1738 "VBNET.ATG" +#line 1736 "VBNET.ATG" type = null; switch (la.kind) { case 58: { lexer.NextToken(); -#line 1740 "VBNET.ATG" +#line 1738 "VBNET.ATG" type = new TypeReference("System.Boolean"); break; } case 59: { lexer.NextToken(); -#line 1741 "VBNET.ATG" +#line 1739 "VBNET.ATG" type = new TypeReference("System.Byte"); break; } case 60: { lexer.NextToken(); -#line 1742 "VBNET.ATG" +#line 1740 "VBNET.ATG" type = new TypeReference("System.Char"); break; } case 61: { lexer.NextToken(); -#line 1743 "VBNET.ATG" +#line 1741 "VBNET.ATG" type = new TypeReference("System.DateTime"); break; } case 63: { lexer.NextToken(); -#line 1744 "VBNET.ATG" +#line 1742 "VBNET.ATG" type = new TypeReference("System.Decimal"); break; } case 62: { lexer.NextToken(); -#line 1745 "VBNET.ATG" +#line 1743 "VBNET.ATG" type = new TypeReference("System.Double"); break; } case 65: { lexer.NextToken(); -#line 1746 "VBNET.ATG" +#line 1744 "VBNET.ATG" type = new TypeReference("System.Int32"); break; } case 67: { lexer.NextToken(); -#line 1747 "VBNET.ATG" +#line 1745 "VBNET.ATG" type = new TypeReference("System.Int64"); break; } case 68: { lexer.NextToken(); -#line 1748 "VBNET.ATG" +#line 1746 "VBNET.ATG" type = new TypeReference("System.Object"); break; } case 71: { lexer.NextToken(); -#line 1749 "VBNET.ATG" +#line 1747 "VBNET.ATG" type = new TypeReference("System.Int16"); break; } case 72: { lexer.NextToken(); -#line 1750 "VBNET.ATG" +#line 1748 "VBNET.ATG" type = new TypeReference("System.Single"); break; } case 73: { lexer.NextToken(); -#line 1751 "VBNET.ATG" +#line 1749 "VBNET.ATG" type = new TypeReference("System.String"); break; } @@ -4948,465 +4946,465 @@ out TypeReference type) { } void Argument( -#line 1912 "VBNET.ATG" +#line 1910 "VBNET.ATG" out Expression argumentexpr) { -#line 1914 "VBNET.ATG" +#line 1912 "VBNET.ATG" Expression expr; argumentexpr = null; string name; if ( -#line 1918 "VBNET.ATG" +#line 1916 "VBNET.ATG" IsNamedAssign()) { Identifier(); -#line 1918 "VBNET.ATG" +#line 1916 "VBNET.ATG" name = t.val; Expect(13); Expect(11); Expr( -#line 1918 "VBNET.ATG" +#line 1916 "VBNET.ATG" out expr); -#line 1920 "VBNET.ATG" +#line 1918 "VBNET.ATG" argumentexpr = new NamedArgumentExpression(name, expr); } else if (StartOf(19)) { Expr( -#line 1923 "VBNET.ATG" +#line 1921 "VBNET.ATG" out argumentexpr); } else SynErr(239); } void ConditionalAndExpr( -#line 1759 "VBNET.ATG" +#line 1757 "VBNET.ATG" out Expression outExpr) { -#line 1760 "VBNET.ATG" +#line 1758 "VBNET.ATG" Expression expr; InclusiveOrExpr( -#line 1761 "VBNET.ATG" +#line 1759 "VBNET.ATG" out outExpr); while (la.kind == 45) { lexer.NextToken(); InclusiveOrExpr( -#line 1761 "VBNET.ATG" +#line 1759 "VBNET.ATG" out expr); -#line 1761 "VBNET.ATG" +#line 1759 "VBNET.ATG" outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.LogicalAnd, expr); } } void InclusiveOrExpr( -#line 1764 "VBNET.ATG" +#line 1762 "VBNET.ATG" out Expression outExpr) { -#line 1765 "VBNET.ATG" +#line 1763 "VBNET.ATG" Expression expr; ExclusiveOrExpr( -#line 1766 "VBNET.ATG" +#line 1764 "VBNET.ATG" out outExpr); while (la.kind == 185) { lexer.NextToken(); ExclusiveOrExpr( -#line 1766 "VBNET.ATG" +#line 1764 "VBNET.ATG" out expr); -#line 1766 "VBNET.ATG" +#line 1764 "VBNET.ATG" outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.ExclusiveOr, expr); } } void ExclusiveOrExpr( -#line 1769 "VBNET.ATG" +#line 1767 "VBNET.ATG" out Expression outExpr) { -#line 1770 "VBNET.ATG" +#line 1768 "VBNET.ATG" Expression expr; AndExpr( -#line 1771 "VBNET.ATG" +#line 1769 "VBNET.ATG" out outExpr); while (la.kind == 137) { lexer.NextToken(); AndExpr( -#line 1771 "VBNET.ATG" +#line 1769 "VBNET.ATG" out expr); -#line 1771 "VBNET.ATG" +#line 1769 "VBNET.ATG" outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.BitwiseOr, expr); } } void AndExpr( -#line 1774 "VBNET.ATG" +#line 1772 "VBNET.ATG" out Expression outExpr) { -#line 1775 "VBNET.ATG" +#line 1773 "VBNET.ATG" Expression expr; NotExpr( -#line 1776 "VBNET.ATG" +#line 1774 "VBNET.ATG" out outExpr); while (la.kind == 44) { lexer.NextToken(); NotExpr( -#line 1776 "VBNET.ATG" +#line 1774 "VBNET.ATG" out expr); -#line 1776 "VBNET.ATG" +#line 1774 "VBNET.ATG" outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.BitwiseAnd, expr); } } void NotExpr( -#line 1779 "VBNET.ATG" +#line 1777 "VBNET.ATG" out Expression outExpr) { -#line 1780 "VBNET.ATG" +#line 1778 "VBNET.ATG" UnaryOperatorType uop = UnaryOperatorType.None; while (la.kind == 128) { lexer.NextToken(); -#line 1781 "VBNET.ATG" +#line 1779 "VBNET.ATG" uop = UnaryOperatorType.Not; } EqualityExpr( -#line 1782 "VBNET.ATG" +#line 1780 "VBNET.ATG" out outExpr); -#line 1783 "VBNET.ATG" +#line 1781 "VBNET.ATG" if (uop != UnaryOperatorType.None) outExpr = new UnaryOperatorExpression(outExpr, uop); } void EqualityExpr( -#line 1788 "VBNET.ATG" +#line 1786 "VBNET.ATG" out Expression outExpr) { -#line 1790 "VBNET.ATG" +#line 1788 "VBNET.ATG" Expression expr; BinaryOperatorType op = BinaryOperatorType.None; RelationalExpr( -#line 1793 "VBNET.ATG" +#line 1791 "VBNET.ATG" out outExpr); while (la.kind == 11 || la.kind == 27 || la.kind == 115) { if (la.kind == 27) { lexer.NextToken(); -#line 1796 "VBNET.ATG" +#line 1794 "VBNET.ATG" op = BinaryOperatorType.InEquality; } else if (la.kind == 11) { lexer.NextToken(); -#line 1797 "VBNET.ATG" +#line 1795 "VBNET.ATG" op = BinaryOperatorType.Equality; } else { lexer.NextToken(); -#line 1798 "VBNET.ATG" +#line 1796 "VBNET.ATG" op = BinaryOperatorType.Like; } RelationalExpr( -#line 1800 "VBNET.ATG" +#line 1798 "VBNET.ATG" out expr); -#line 1800 "VBNET.ATG" +#line 1798 "VBNET.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr); } } void RelationalExpr( -#line 1804 "VBNET.ATG" +#line 1802 "VBNET.ATG" out Expression outExpr) { -#line 1806 "VBNET.ATG" +#line 1804 "VBNET.ATG" Expression expr; BinaryOperatorType op = BinaryOperatorType.None; ShiftExpr( -#line 1809 "VBNET.ATG" +#line 1807 "VBNET.ATG" out outExpr); while (StartOf(25)) { if (StartOf(26)) { if (la.kind == 26) { lexer.NextToken(); -#line 1812 "VBNET.ATG" +#line 1810 "VBNET.ATG" op = BinaryOperatorType.LessThan; } else if (la.kind == 25) { lexer.NextToken(); -#line 1813 "VBNET.ATG" +#line 1811 "VBNET.ATG" op = BinaryOperatorType.GreaterThan; } else if (la.kind == 29) { lexer.NextToken(); -#line 1814 "VBNET.ATG" +#line 1812 "VBNET.ATG" op = BinaryOperatorType.LessThanOrEqual; } else if (la.kind == 28) { lexer.NextToken(); -#line 1815 "VBNET.ATG" +#line 1813 "VBNET.ATG" op = BinaryOperatorType.GreaterThanOrEqual; } else SynErr(240); ShiftExpr( -#line 1817 "VBNET.ATG" +#line 1815 "VBNET.ATG" out expr); -#line 1817 "VBNET.ATG" +#line 1815 "VBNET.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr); } else { if (la.kind == 112) { lexer.NextToken(); -#line 1820 "VBNET.ATG" +#line 1818 "VBNET.ATG" op = BinaryOperatorType.ReferenceEquality; } else if (la.kind == 189) { lexer.NextToken(); -#line 1821 "VBNET.ATG" +#line 1819 "VBNET.ATG" op = BinaryOperatorType.ReferenceInequality; } else SynErr(241); Expr( -#line 1822 "VBNET.ATG" +#line 1820 "VBNET.ATG" out expr); -#line 1822 "VBNET.ATG" +#line 1820 "VBNET.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr); } } } void ShiftExpr( -#line 1826 "VBNET.ATG" +#line 1824 "VBNET.ATG" out Expression outExpr) { -#line 1828 "VBNET.ATG" +#line 1826 "VBNET.ATG" Expression expr; BinaryOperatorType op = BinaryOperatorType.None; AdditiveExpr( -#line 1831 "VBNET.ATG" +#line 1829 "VBNET.ATG" out outExpr); while (la.kind == 30 || la.kind == 31) { if (la.kind == 30) { lexer.NextToken(); -#line 1834 "VBNET.ATG" +#line 1832 "VBNET.ATG" op = BinaryOperatorType.ShiftLeft; } else { lexer.NextToken(); -#line 1835 "VBNET.ATG" +#line 1833 "VBNET.ATG" op = BinaryOperatorType.ShiftRight; } AdditiveExpr( -#line 1837 "VBNET.ATG" +#line 1835 "VBNET.ATG" out expr); -#line 1837 "VBNET.ATG" +#line 1835 "VBNET.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr); } } void AdditiveExpr( -#line 1841 "VBNET.ATG" +#line 1839 "VBNET.ATG" out Expression outExpr) { -#line 1843 "VBNET.ATG" +#line 1841 "VBNET.ATG" Expression expr; BinaryOperatorType op = BinaryOperatorType.None; MultiplicativeExpr( -#line 1846 "VBNET.ATG" +#line 1844 "VBNET.ATG" out outExpr); while (la.kind == 14 || la.kind == 15 || la.kind == 19) { if (la.kind == 14) { lexer.NextToken(); -#line 1849 "VBNET.ATG" +#line 1847 "VBNET.ATG" op = BinaryOperatorType.Add; } else if (la.kind == 15) { lexer.NextToken(); -#line 1850 "VBNET.ATG" +#line 1848 "VBNET.ATG" op = BinaryOperatorType.Subtract; } else { lexer.NextToken(); -#line 1851 "VBNET.ATG" +#line 1849 "VBNET.ATG" op = BinaryOperatorType.Concat; } MultiplicativeExpr( -#line 1853 "VBNET.ATG" +#line 1851 "VBNET.ATG" out expr); -#line 1853 "VBNET.ATG" +#line 1851 "VBNET.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr); } } void MultiplicativeExpr( -#line 1857 "VBNET.ATG" +#line 1855 "VBNET.ATG" out Expression outExpr) { -#line 1859 "VBNET.ATG" +#line 1857 "VBNET.ATG" Expression expr; BinaryOperatorType op = BinaryOperatorType.None; UnaryExpr( -#line 1862 "VBNET.ATG" +#line 1860 "VBNET.ATG" out outExpr); while (StartOf(27)) { if (la.kind == 16) { lexer.NextToken(); -#line 1865 "VBNET.ATG" +#line 1863 "VBNET.ATG" op = BinaryOperatorType.Multiply; } else if (la.kind == 17) { lexer.NextToken(); -#line 1866 "VBNET.ATG" +#line 1864 "VBNET.ATG" op = BinaryOperatorType.Divide; } else if (la.kind == 18) { lexer.NextToken(); -#line 1867 "VBNET.ATG" +#line 1865 "VBNET.ATG" op = BinaryOperatorType.DivideInteger; } else if (la.kind == 119) { lexer.NextToken(); -#line 1868 "VBNET.ATG" +#line 1866 "VBNET.ATG" op = BinaryOperatorType.Modulus; } else { lexer.NextToken(); -#line 1869 "VBNET.ATG" +#line 1867 "VBNET.ATG" op = BinaryOperatorType.Power; } UnaryExpr( -#line 1871 "VBNET.ATG" +#line 1869 "VBNET.ATG" out expr); -#line 1871 "VBNET.ATG" +#line 1869 "VBNET.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr); } } void NonArrayTypeName( -#line 1940 "VBNET.ATG" +#line 1938 "VBNET.ATG" out TypeReference typeref) { -#line 1942 "VBNET.ATG" +#line 1940 "VBNET.ATG" string name; typeref = null; if (StartOf(10)) { Qualident( -#line 1945 "VBNET.ATG" +#line 1943 "VBNET.ATG" out name); -#line 1945 "VBNET.ATG" +#line 1943 "VBNET.ATG" typeref = new TypeReference(name); if ( -#line 1946 "VBNET.ATG" +#line 1944 "VBNET.ATG" la.kind == Tokens.OpenParenthesis && Peek(1).kind == Tokens.Of) { lexer.NextToken(); Expect(196); TypeArgumentList( -#line 1947 "VBNET.ATG" +#line 1945 "VBNET.ATG" typeref.GenericTypes); Expect(24); } } else if (la.kind == 132) { lexer.NextToken(); -#line 1949 "VBNET.ATG" +#line 1947 "VBNET.ATG" typeref = new TypeReference("System.Object"); } else if (la.kind == 194) { lexer.NextToken(); Expect(10); Qualident( -#line 1950 "VBNET.ATG" +#line 1948 "VBNET.ATG" out name); -#line 1951 "VBNET.ATG" +#line 1949 "VBNET.ATG" typeref = new TypeReference(name); typeref.IsGlobal = true; if ( -#line 1952 "VBNET.ATG" +#line 1950 "VBNET.ATG" la.kind == Tokens.OpenParenthesis && Peek(1).kind == Tokens.Of) { lexer.NextToken(); Expect(196); TypeArgumentList( -#line 1953 "VBNET.ATG" +#line 1951 "VBNET.ATG" typeref.GenericTypes); Expect(24); } } else if (StartOf(22)) { PrimitiveTypeName( -#line 1955 "VBNET.ATG" +#line 1953 "VBNET.ATG" out name); -#line 1955 "VBNET.ATG" +#line 1953 "VBNET.ATG" typeref = new TypeReference(name); } else SynErr(242); } void ArgumentList( -#line 1897 "VBNET.ATG" +#line 1895 "VBNET.ATG" out ArrayList arguments) { -#line 1899 "VBNET.ATG" +#line 1897 "VBNET.ATG" arguments = new ArrayList(); Expression expr = null; if (StartOf(19)) { Argument( -#line 1903 "VBNET.ATG" +#line 1901 "VBNET.ATG" out expr); -#line 1903 "VBNET.ATG" +#line 1901 "VBNET.ATG" if (expr != null) { arguments.Add(expr); } while (la.kind == 12) { lexer.NextToken(); Argument( -#line 1906 "VBNET.ATG" +#line 1904 "VBNET.ATG" out expr); -#line 1906 "VBNET.ATG" +#line 1904 "VBNET.ATG" if (expr != null) { arguments.Add(expr); } } } } void ArrayTypeModifiers( -#line 1968 "VBNET.ATG" +#line 1966 "VBNET.ATG" out ArrayList arrayModifiers) { -#line 1970 "VBNET.ATG" +#line 1968 "VBNET.ATG" arrayModifiers = new ArrayList(); int i = 0; while ( -#line 1973 "VBNET.ATG" +#line 1971 "VBNET.ATG" IsDims()) { Expect(23); if (la.kind == 12 || la.kind == 24) { RankList( -#line 1975 "VBNET.ATG" +#line 1973 "VBNET.ATG" out i); } -#line 1977 "VBNET.ATG" +#line 1975 "VBNET.ATG" arrayModifiers.Add(i); Expect(24); } -#line 1982 "VBNET.ATG" +#line 1980 "VBNET.ATG" if(arrayModifiers.Count == 0) { arrayModifiers = null; } @@ -5414,89 +5412,89 @@ out i); } void TypeArgumentList( -#line 1995 "VBNET.ATG" +#line 1993 "VBNET.ATG" List typeArguments) { -#line 1997 "VBNET.ATG" +#line 1995 "VBNET.ATG" TypeReference typeref; TypeName( -#line 1999 "VBNET.ATG" +#line 1997 "VBNET.ATG" out typeref); -#line 1999 "VBNET.ATG" +#line 1997 "VBNET.ATG" if (typeref != null) typeArguments.Add(typeref); while (la.kind == 12) { lexer.NextToken(); TypeName( -#line 2002 "VBNET.ATG" +#line 2000 "VBNET.ATG" out typeref); -#line 2002 "VBNET.ATG" +#line 2000 "VBNET.ATG" if (typeref != null) typeArguments.Add(typeref); } } void RankList( -#line 1989 "VBNET.ATG" +#line 1987 "VBNET.ATG" out int i) { -#line 1990 "VBNET.ATG" +#line 1988 "VBNET.ATG" i = 0; while (la.kind == 12) { lexer.NextToken(); -#line 1991 "VBNET.ATG" +#line 1989 "VBNET.ATG" ++i; } } void Attribute( -#line 2027 "VBNET.ATG" +#line 2025 "VBNET.ATG" out ICSharpCode.NRefactory.Parser.AST.Attribute attribute) { -#line 2028 "VBNET.ATG" +#line 2026 "VBNET.ATG" string name; Qualident( -#line 2029 "VBNET.ATG" +#line 2027 "VBNET.ATG" out name); -#line 2030 "VBNET.ATG" +#line 2028 "VBNET.ATG" List positional = new List(); List named = new List(); if (la.kind == 23) { AttributeArguments( -#line 2033 "VBNET.ATG" +#line 2031 "VBNET.ATG" positional, named); } -#line 2035 "VBNET.ATG" +#line 2033 "VBNET.ATG" attribute = new ICSharpCode.NRefactory.Parser.AST.Attribute(name, positional, named); } void AttributeArguments( -#line 2040 "VBNET.ATG" +#line 2038 "VBNET.ATG" List positional, List named) { -#line 2042 "VBNET.ATG" +#line 2040 "VBNET.ATG" bool nameFound = false; string name = ""; Expression expr; Expect(23); if ( -#line 2048 "VBNET.ATG" +#line 2046 "VBNET.ATG" IsNotClosingParenthesis()) { if ( -#line 2050 "VBNET.ATG" +#line 2048 "VBNET.ATG" IsNamedAssign()) { -#line 2050 "VBNET.ATG" +#line 2048 "VBNET.ATG" nameFound = true; IdentifierOrKeyword( -#line 2051 "VBNET.ATG" +#line 2049 "VBNET.ATG" out name); if (la.kind == 13) { lexer.NextToken(); @@ -5504,10 +5502,10 @@ out name); Expect(11); } Expr( -#line 2053 "VBNET.ATG" +#line 2051 "VBNET.ATG" out expr); -#line 2055 "VBNET.ATG" +#line 2053 "VBNET.ATG" if (expr != null) { if(name == "") positional.Add(expr); else { named.Add(new NamedArgumentExpression(name, expr)); name = ""; } } @@ -5515,13 +5513,13 @@ out expr); while (la.kind == 12) { lexer.NextToken(); if ( -#line 2062 "VBNET.ATG" +#line 2060 "VBNET.ATG" IsNamedAssign()) { -#line 2062 "VBNET.ATG" +#line 2060 "VBNET.ATG" nameFound = true; IdentifierOrKeyword( -#line 2063 "VBNET.ATG" +#line 2061 "VBNET.ATG" out name); if (la.kind == 13) { lexer.NextToken(); @@ -5529,14 +5527,14 @@ out name); Expect(11); } else if (StartOf(19)) { -#line 2065 "VBNET.ATG" +#line 2063 "VBNET.ATG" if (nameFound) Error("no positional argument after named argument"); } else SynErr(243); Expr( -#line 2066 "VBNET.ATG" +#line 2064 "VBNET.ATG" out expr); -#line 2066 "VBNET.ATG" +#line 2064 "VBNET.ATG" if (expr != null) { if(name == "") positional.Add(expr); else { named.Add(new NamedArgumentExpression(name, expr)); name = ""; } } @@ -5547,10 +5545,10 @@ out expr); } void FormalParameter( -#line 2135 "VBNET.ATG" +#line 2133 "VBNET.ATG" out ParameterDeclarationExpression p) { -#line 2137 "VBNET.ATG" +#line 2135 "VBNET.ATG" TypeReference type = null; ParamModifiers mod = new ParamModifiers(this); Expression expr = null; @@ -5558,28 +5556,28 @@ out ParameterDeclarationExpression p) { while (StartOf(28)) { ParameterModifier( -#line 2142 "VBNET.ATG" +#line 2140 "VBNET.ATG" mod); } Identifier(); -#line 2143 "VBNET.ATG" +#line 2141 "VBNET.ATG" string parameterName = t.val; if ( -#line 2144 "VBNET.ATG" +#line 2142 "VBNET.ATG" IsDims()) { ArrayTypeModifiers( -#line 2144 "VBNET.ATG" +#line 2142 "VBNET.ATG" out arrayModifiers); } if (la.kind == 47) { lexer.NextToken(); TypeName( -#line 2145 "VBNET.ATG" +#line 2143 "VBNET.ATG" out type); } -#line 2147 "VBNET.ATG" +#line 2145 "VBNET.ATG" if(type != null) { if (arrayModifiers != null) { if (type.RankSpecifier != null) { @@ -5595,45 +5593,45 @@ out type); if (la.kind == 11) { lexer.NextToken(); Expr( -#line 2159 "VBNET.ATG" +#line 2157 "VBNET.ATG" out expr); } -#line 2161 "VBNET.ATG" +#line 2159 "VBNET.ATG" mod.Check(); p = new ParameterDeclarationExpression(type, parameterName, mod.Modifier, expr); } void ParameterModifier( -#line 2933 "VBNET.ATG" +#line 2931 "VBNET.ATG" ParamModifiers m) { if (la.kind == 54) { lexer.NextToken(); -#line 2934 "VBNET.ATG" +#line 2932 "VBNET.ATG" m.Add(ParamModifier.In); } else if (la.kind == 52) { lexer.NextToken(); -#line 2935 "VBNET.ATG" +#line 2933 "VBNET.ATG" m.Add(ParamModifier.Ref); } else if (la.kind == 136) { lexer.NextToken(); -#line 2936 "VBNET.ATG" +#line 2934 "VBNET.ATG" m.Add(ParamModifier.Optional); } else if (la.kind == 143) { lexer.NextToken(); -#line 2937 "VBNET.ATG" +#line 2935 "VBNET.ATG" m.Add(ParamModifier.Params); } else SynErr(244); } void Statement() { -#line 2189 "VBNET.ATG" +#line 2187 "VBNET.ATG" Statement stmt = null; Point startPos = la.Location; string label = String.Empty; @@ -5641,34 +5639,34 @@ ParamModifiers m) { if (la.kind == 1 || la.kind == 13) { } else if ( -#line 2195 "VBNET.ATG" +#line 2193 "VBNET.ATG" IsLabel()) { LabelName( -#line 2195 "VBNET.ATG" +#line 2193 "VBNET.ATG" out label); -#line 2197 "VBNET.ATG" +#line 2195 "VBNET.ATG" compilationUnit.AddChild(new LabelStatement(t.val)); Expect(13); Statement(); } else if (StartOf(29)) { EmbeddedStatement( -#line 2200 "VBNET.ATG" +#line 2198 "VBNET.ATG" out stmt); -#line 2200 "VBNET.ATG" +#line 2198 "VBNET.ATG" compilationUnit.AddChild(stmt); } else if (StartOf(30)) { LocalDeclarationStatement( -#line 2201 "VBNET.ATG" +#line 2199 "VBNET.ATG" out stmt); -#line 2201 "VBNET.ATG" +#line 2199 "VBNET.ATG" compilationUnit.AddChild(stmt); } else SynErr(245); -#line 2204 "VBNET.ATG" +#line 2202 "VBNET.ATG" if (stmt != null) { stmt.StartLocation = startPos; stmt.EndLocation = t.Location; @@ -5677,30 +5675,30 @@ out stmt); } void LabelName( -#line 2585 "VBNET.ATG" +#line 2583 "VBNET.ATG" out string name) { -#line 2587 "VBNET.ATG" +#line 2585 "VBNET.ATG" name = String.Empty; if (StartOf(10)) { Identifier(); -#line 2589 "VBNET.ATG" +#line 2587 "VBNET.ATG" name = t.val; } else if (la.kind == 5) { lexer.NextToken(); -#line 2590 "VBNET.ATG" +#line 2588 "VBNET.ATG" name = t.val; } else SynErr(246); } void EmbeddedStatement( -#line 2243 "VBNET.ATG" +#line 2241 "VBNET.ATG" out Statement statement) { -#line 2245 "VBNET.ATG" +#line 2243 "VBNET.ATG" Statement embeddedStatement = null; statement = null; Expression expr = null; @@ -5710,103 +5708,103 @@ out Statement statement) { case 93: { lexer.NextToken(); -#line 2250 "VBNET.ATG" +#line 2248 "VBNET.ATG" ExitType exitType = ExitType.None; switch (la.kind) { case 167: { lexer.NextToken(); -#line 2252 "VBNET.ATG" +#line 2250 "VBNET.ATG" exitType = ExitType.Sub; break; } case 99: { lexer.NextToken(); -#line 2254 "VBNET.ATG" +#line 2252 "VBNET.ATG" exitType = ExitType.Function; break; } case 146: { lexer.NextToken(); -#line 2256 "VBNET.ATG" +#line 2254 "VBNET.ATG" exitType = ExitType.Property; break; } case 82: { lexer.NextToken(); -#line 2258 "VBNET.ATG" +#line 2256 "VBNET.ATG" exitType = ExitType.Do; break; } case 97: { lexer.NextToken(); -#line 2260 "VBNET.ATG" +#line 2258 "VBNET.ATG" exitType = ExitType.For; break; } case 174: { lexer.NextToken(); -#line 2262 "VBNET.ATG" +#line 2260 "VBNET.ATG" exitType = ExitType.Try; break; } case 181: { lexer.NextToken(); -#line 2264 "VBNET.ATG" +#line 2262 "VBNET.ATG" exitType = ExitType.While; break; } case 155: { lexer.NextToken(); -#line 2266 "VBNET.ATG" +#line 2264 "VBNET.ATG" exitType = ExitType.Select; break; } default: SynErr(247); break; } -#line 2268 "VBNET.ATG" +#line 2266 "VBNET.ATG" statement = new ExitStatement(exitType); break; } case 174: { TryStatement( -#line 2269 "VBNET.ATG" +#line 2267 "VBNET.ATG" out statement); break; } case 186: { lexer.NextToken(); -#line 2270 "VBNET.ATG" +#line 2268 "VBNET.ATG" ContinueType continueType = ContinueType.None; if (la.kind == 82 || la.kind == 97 || la.kind == 181) { if (la.kind == 82) { lexer.NextToken(); -#line 2270 "VBNET.ATG" +#line 2268 "VBNET.ATG" continueType = ContinueType.Do; } else if (la.kind == 97) { lexer.NextToken(); -#line 2270 "VBNET.ATG" +#line 2268 "VBNET.ATG" continueType = ContinueType.For; } else { lexer.NextToken(); -#line 2270 "VBNET.ATG" +#line 2268 "VBNET.ATG" continueType = ContinueType.While; } } -#line 2270 "VBNET.ATG" +#line 2268 "VBNET.ATG" statement = new ContinueStatement(continueType); break; } @@ -5814,11 +5812,11 @@ out statement); lexer.NextToken(); if (StartOf(19)) { Expr( -#line 2272 "VBNET.ATG" +#line 2270 "VBNET.ATG" out expr); } -#line 2272 "VBNET.ATG" +#line 2270 "VBNET.ATG" statement = new ThrowStatement(expr); break; } @@ -5826,27 +5824,27 @@ out expr); lexer.NextToken(); if (StartOf(19)) { Expr( -#line 2274 "VBNET.ATG" +#line 2272 "VBNET.ATG" out expr); } -#line 2274 "VBNET.ATG" +#line 2272 "VBNET.ATG" statement = new ReturnStatement(expr); break; } case 168: { lexer.NextToken(); Expr( -#line 2276 "VBNET.ATG" +#line 2274 "VBNET.ATG" out expr); EndOfStmt(); Block( -#line 2276 "VBNET.ATG" +#line 2274 "VBNET.ATG" out embeddedStatement); Expect(87); Expect(168); -#line 2277 "VBNET.ATG" +#line 2275 "VBNET.ATG" statement = new LockStatement(expr, embeddedStatement); break; } @@ -5854,42 +5852,42 @@ out embeddedStatement); lexer.NextToken(); Identifier(); -#line 2279 "VBNET.ATG" +#line 2277 "VBNET.ATG" name = t.val; if (la.kind == 23) { lexer.NextToken(); if (StartOf(18)) { ArgumentList( -#line 2280 "VBNET.ATG" +#line 2278 "VBNET.ATG" out p); } Expect(24); } -#line 2281 "VBNET.ATG" +#line 2279 "VBNET.ATG" statement = new RaiseEventStatement(name, p); break; } case 182: { WithStatement( -#line 2283 "VBNET.ATG" +#line 2281 "VBNET.ATG" out statement); break; } case 41: { lexer.NextToken(); -#line 2285 "VBNET.ATG" +#line 2283 "VBNET.ATG" Expression handlerExpr = null; Expr( -#line 2286 "VBNET.ATG" +#line 2284 "VBNET.ATG" out expr); Expect(12); Expr( -#line 2286 "VBNET.ATG" +#line 2284 "VBNET.ATG" out handlerExpr); -#line 2288 "VBNET.ATG" +#line 2286 "VBNET.ATG" statement = new AddHandlerStatement(expr, handlerExpr); break; @@ -5897,17 +5895,17 @@ out handlerExpr); case 152: { lexer.NextToken(); -#line 2291 "VBNET.ATG" +#line 2289 "VBNET.ATG" Expression handlerExpr = null; Expr( -#line 2292 "VBNET.ATG" +#line 2290 "VBNET.ATG" out expr); Expect(12); Expr( -#line 2292 "VBNET.ATG" +#line 2290 "VBNET.ATG" out handlerExpr); -#line 2294 "VBNET.ATG" +#line 2292 "VBNET.ATG" statement = new RemoveHandlerStatement(expr, handlerExpr); break; @@ -5915,16 +5913,16 @@ out handlerExpr); case 181: { lexer.NextToken(); Expr( -#line 2297 "VBNET.ATG" +#line 2295 "VBNET.ATG" out expr); EndOfStmt(); Block( -#line 2298 "VBNET.ATG" +#line 2296 "VBNET.ATG" out embeddedStatement); Expect(87); Expect(181); -#line 2300 "VBNET.ATG" +#line 2298 "VBNET.ATG" statement = new DoLoopStatement(expr, embeddedStatement, ConditionType.While, ConditionPosition.Start); break; @@ -5932,23 +5930,23 @@ out embeddedStatement); case 82: { lexer.NextToken(); -#line 2305 "VBNET.ATG" +#line 2303 "VBNET.ATG" ConditionType conditionType = ConditionType.None; if (la.kind == 177 || la.kind == 181) { WhileOrUntil( -#line 2308 "VBNET.ATG" +#line 2306 "VBNET.ATG" out conditionType); Expr( -#line 2308 "VBNET.ATG" +#line 2306 "VBNET.ATG" out expr); EndOfStmt(); Block( -#line 2309 "VBNET.ATG" +#line 2307 "VBNET.ATG" out embeddedStatement); Expect(117); -#line 2312 "VBNET.ATG" +#line 2310 "VBNET.ATG" statement = new DoLoopStatement(expr, embeddedStatement, conditionType == ConditionType.While ? ConditionType.DoWhile : conditionType, @@ -5957,19 +5955,19 @@ out embeddedStatement); } else if (la.kind == 1 || la.kind == 13) { EndOfStmt(); Block( -#line 2319 "VBNET.ATG" +#line 2317 "VBNET.ATG" out embeddedStatement); Expect(117); if (la.kind == 177 || la.kind == 181) { WhileOrUntil( -#line 2320 "VBNET.ATG" +#line 2318 "VBNET.ATG" out conditionType); Expr( -#line 2320 "VBNET.ATG" +#line 2318 "VBNET.ATG" out expr); } -#line 2322 "VBNET.ATG" +#line 2320 "VBNET.ATG" statement = new DoLoopStatement(expr, embeddedStatement, conditionType, ConditionPosition.End); } else SynErr(248); @@ -5978,7 +5976,7 @@ out expr); case 97: { lexer.NextToken(); -#line 2327 "VBNET.ATG" +#line 2325 "VBNET.ATG" Expression group = null; TypeReference typeReference; string typeName; @@ -5987,24 +5985,24 @@ out expr); if (la.kind == 84) { lexer.NextToken(); LoopControlVariable( -#line 2334 "VBNET.ATG" +#line 2332 "VBNET.ATG" out typeReference, out typeName); Expect(108); Expr( -#line 2335 "VBNET.ATG" +#line 2333 "VBNET.ATG" out group); EndOfStmt(); Block( -#line 2336 "VBNET.ATG" +#line 2334 "VBNET.ATG" out embeddedStatement); Expect(127); if (StartOf(19)) { Expr( -#line 2337 "VBNET.ATG" +#line 2335 "VBNET.ATG" out expr); } -#line 2339 "VBNET.ATG" +#line 2337 "VBNET.ATG" statement = new ForeachStatement(typeReference, typeName, group, @@ -6016,53 +6014,53 @@ out expr); } else if (StartOf(10)) { -#line 2350 "VBNET.ATG" +#line 2348 "VBNET.ATG" Expression start = null; Expression end = null; Expression step = null; Expression nextExpr = null;ArrayList nextExpressions = null; LoopControlVariable( -#line 2355 "VBNET.ATG" +#line 2353 "VBNET.ATG" out typeReference, out typeName); Expect(11); Expr( -#line 2356 "VBNET.ATG" +#line 2354 "VBNET.ATG" out start); Expect(172); Expr( -#line 2356 "VBNET.ATG" +#line 2354 "VBNET.ATG" out end); if (la.kind == 162) { lexer.NextToken(); Expr( -#line 2356 "VBNET.ATG" +#line 2354 "VBNET.ATG" out step); } EndOfStmt(); Block( -#line 2357 "VBNET.ATG" +#line 2355 "VBNET.ATG" out embeddedStatement); Expect(127); if (StartOf(19)) { Expr( -#line 2360 "VBNET.ATG" +#line 2358 "VBNET.ATG" out nextExpr); -#line 2360 "VBNET.ATG" +#line 2358 "VBNET.ATG" nextExpressions = new ArrayList(); nextExpressions.Add(nextExpr); while (la.kind == 12) { lexer.NextToken(); Expr( -#line 2361 "VBNET.ATG" +#line 2359 "VBNET.ATG" out nextExpr); -#line 2361 "VBNET.ATG" +#line 2359 "VBNET.ATG" nextExpressions.Add(nextExpr); } } -#line 2364 "VBNET.ATG" +#line 2362 "VBNET.ATG" statement = new ForNextStatement(typeReference, typeName, start, end, step, embeddedStatement, nextExpressions); } else SynErr(249); @@ -6071,29 +6069,29 @@ out nextExpr); case 91: { lexer.NextToken(); Expr( -#line 2368 "VBNET.ATG" +#line 2366 "VBNET.ATG" out expr); -#line 2368 "VBNET.ATG" +#line 2366 "VBNET.ATG" statement = new ErrorStatement(expr); break; } case 151: { lexer.NextToken(); -#line 2370 "VBNET.ATG" +#line 2368 "VBNET.ATG" Expression redimclause = null; bool isPreserve = false; if (la.kind == 144) { lexer.NextToken(); -#line 2370 "VBNET.ATG" +#line 2368 "VBNET.ATG" isPreserve = true; } Expr( -#line 2371 "VBNET.ATG" +#line 2369 "VBNET.ATG" out redimclause); -#line 2373 "VBNET.ATG" +#line 2371 "VBNET.ATG" ReDimStatement reDimStatement = new ReDimStatement(isPreserve); statement = reDimStatement; reDimStatement.ReDimClauses.Add(redimclause as InvocationExpression); @@ -6101,10 +6099,10 @@ out redimclause); while (la.kind == 12) { lexer.NextToken(); Expr( -#line 2377 "VBNET.ATG" +#line 2375 "VBNET.ATG" out redimclause); -#line 2377 "VBNET.ATG" +#line 2375 "VBNET.ATG" reDimStatement.ReDimClauses.Add(redimclause as InvocationExpression); } break; @@ -6112,10 +6110,10 @@ out redimclause); case 90: { lexer.NextToken(); Expr( -#line 2380 "VBNET.ATG" +#line 2378 "VBNET.ATG" out expr); -#line 2381 "VBNET.ATG" +#line 2379 "VBNET.ATG" ArrayList arrays = new ArrayList(); if (expr != null) { arrays.Add(expr);} EraseStatement eraseStatement = new EraseStatement(arrays); @@ -6124,53 +6122,53 @@ out expr); while (la.kind == 12) { lexer.NextToken(); Expr( -#line 2386 "VBNET.ATG" +#line 2384 "VBNET.ATG" out expr); -#line 2386 "VBNET.ATG" +#line 2384 "VBNET.ATG" if (expr != null) { arrays.Add(expr); } } -#line 2387 "VBNET.ATG" +#line 2385 "VBNET.ATG" statement = eraseStatement; break; } case 163: { lexer.NextToken(); -#line 2389 "VBNET.ATG" +#line 2387 "VBNET.ATG" statement = new StopStatement(); break; } case 105: { lexer.NextToken(); Expr( -#line 2391 "VBNET.ATG" +#line 2389 "VBNET.ATG" out expr); if (la.kind == 170) { lexer.NextToken(); } if ( -#line 2393 "VBNET.ATG" +#line 2391 "VBNET.ATG" IsEndStmtAhead()) { Expect(87); -#line 2393 "VBNET.ATG" +#line 2391 "VBNET.ATG" statement = new IfElseStatement(expr, new EndStatement()); } else if (la.kind == 1 || la.kind == 13) { EndOfStmt(); Block( -#line 2396 "VBNET.ATG" +#line 2394 "VBNET.ATG" out embeddedStatement); -#line 2398 "VBNET.ATG" +#line 2396 "VBNET.ATG" IfElseStatement ifStatement = new IfElseStatement(expr, embeddedStatement); while (la.kind == 86 || -#line 2402 "VBNET.ATG" +#line 2400 "VBNET.ATG" IsElseIf()) { if ( -#line 2402 "VBNET.ATG" +#line 2400 "VBNET.ATG" IsElseIf()) { Expect(85); Expect(105); @@ -6178,20 +6176,20 @@ IsElseIf()) { lexer.NextToken(); } -#line 2405 "VBNET.ATG" +#line 2403 "VBNET.ATG" Expression condition = null; Statement block = null; Expr( -#line 2406 "VBNET.ATG" +#line 2404 "VBNET.ATG" out condition); if (la.kind == 170) { lexer.NextToken(); } EndOfStmt(); Block( -#line 2407 "VBNET.ATG" +#line 2405 "VBNET.ATG" out block); -#line 2409 "VBNET.ATG" +#line 2407 "VBNET.ATG" ifStatement.ElseIfSections.Add(new ElseIfSection(condition, block)); } @@ -6199,59 +6197,59 @@ out block); lexer.NextToken(); EndOfStmt(); Block( -#line 2414 "VBNET.ATG" +#line 2412 "VBNET.ATG" out embeddedStatement); -#line 2416 "VBNET.ATG" +#line 2414 "VBNET.ATG" ifStatement.FalseStatement.Add(embeddedStatement); } Expect(87); Expect(105); -#line 2420 "VBNET.ATG" +#line 2418 "VBNET.ATG" statement = ifStatement; } else if (StartOf(29)) { EmbeddedStatement( -#line 2423 "VBNET.ATG" +#line 2421 "VBNET.ATG" out embeddedStatement); -#line 2425 "VBNET.ATG" +#line 2423 "VBNET.ATG" IfElseStatement ifStatement = new IfElseStatement(expr, embeddedStatement); while (la.kind == 13) { lexer.NextToken(); EmbeddedStatement( -#line 2427 "VBNET.ATG" +#line 2425 "VBNET.ATG" out embeddedStatement); -#line 2427 "VBNET.ATG" +#line 2425 "VBNET.ATG" ifStatement.TrueStatement.Add(embeddedStatement); } if (la.kind == 85) { lexer.NextToken(); if (StartOf(29)) { EmbeddedStatement( -#line 2429 "VBNET.ATG" +#line 2427 "VBNET.ATG" out embeddedStatement); } -#line 2431 "VBNET.ATG" +#line 2429 "VBNET.ATG" ifStatement.FalseStatement.Add(embeddedStatement); while (la.kind == 13) { lexer.NextToken(); EmbeddedStatement( -#line 2434 "VBNET.ATG" +#line 2432 "VBNET.ATG" out embeddedStatement); -#line 2435 "VBNET.ATG" +#line 2433 "VBNET.ATG" ifStatement.FalseStatement.Add(embeddedStatement); } } -#line 2438 "VBNET.ATG" +#line 2436 "VBNET.ATG" statement = ifStatement; } else SynErr(250); break; @@ -6262,43 +6260,43 @@ out embeddedStatement); lexer.NextToken(); } Expr( -#line 2441 "VBNET.ATG" +#line 2439 "VBNET.ATG" out expr); EndOfStmt(); -#line 2442 "VBNET.ATG" +#line 2440 "VBNET.ATG" ArrayList selectSections = new ArrayList(); Statement block = null; while (la.kind == 56) { -#line 2446 "VBNET.ATG" +#line 2444 "VBNET.ATG" ArrayList caseClauses = null; lexer.NextToken(); CaseClauses( -#line 2447 "VBNET.ATG" +#line 2445 "VBNET.ATG" out caseClauses); if ( -#line 2447 "VBNET.ATG" +#line 2445 "VBNET.ATG" IsNotStatementSeparator()) { lexer.NextToken(); } EndOfStmt(); -#line 2449 "VBNET.ATG" +#line 2447 "VBNET.ATG" SwitchSection selectSection = new SwitchSection(caseClauses); Block( -#line 2451 "VBNET.ATG" +#line 2449 "VBNET.ATG" out block); -#line 2453 "VBNET.ATG" +#line 2451 "VBNET.ATG" selectSection.Children = block.Children; selectSections.Add(selectSection); } -#line 2457 "VBNET.ATG" +#line 2455 "VBNET.ATG" statement = new SwitchStatement(expr, selectSections); Expect(87); Expect(155); @@ -6306,43 +6304,43 @@ out block); } case 134: { -#line 2459 "VBNET.ATG" +#line 2457 "VBNET.ATG" OnErrorStatement onErrorStatement = null; OnErrorStatement( -#line 2460 "VBNET.ATG" +#line 2458 "VBNET.ATG" out onErrorStatement); -#line 2460 "VBNET.ATG" +#line 2458 "VBNET.ATG" statement = onErrorStatement; break; } case 103: { -#line 2461 "VBNET.ATG" +#line 2459 "VBNET.ATG" GotoStatement goToStatement = null; GotoStatement( -#line 2462 "VBNET.ATG" +#line 2460 "VBNET.ATG" out goToStatement); -#line 2462 "VBNET.ATG" +#line 2460 "VBNET.ATG" statement = goToStatement; break; } case 153: { -#line 2463 "VBNET.ATG" +#line 2461 "VBNET.ATG" ResumeStatement resumeStatement = null; ResumeStatement( -#line 2464 "VBNET.ATG" +#line 2462 "VBNET.ATG" out resumeStatement); -#line 2464 "VBNET.ATG" +#line 2462 "VBNET.ATG" statement = resumeStatement; break; } case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 14: case 15: case 16: case 23: case 42: case 50: case 51: case 53: case 58: case 59: case 60: case 61: case 62: case 63: case 64: case 65: case 67: case 68: case 69: case 71: case 72: case 73: case 74: case 75: case 76: case 81: case 83: case 95: case 101: case 110: case 116: case 118: case 123: case 124: case 126: case 129: case 159: case 160: case 165: case 169: case 173: case 175: case 190: case 191: case 192: case 193: case 195: { -#line 2467 "VBNET.ATG" +#line 2465 "VBNET.ATG" Expression val = null; AssignmentOperatorType op; @@ -6350,25 +6348,25 @@ out resumeStatement); la.kind == Tokens.Not || la.kind == Tokens.Times; UnaryExpr( -#line 2473 "VBNET.ATG" +#line 2471 "VBNET.ATG" out expr); if (StartOf(31)) { AssignmentOperator( -#line 2475 "VBNET.ATG" +#line 2473 "VBNET.ATG" out op); Expr( -#line 2475 "VBNET.ATG" +#line 2473 "VBNET.ATG" out val); -#line 2475 "VBNET.ATG" +#line 2473 "VBNET.ATG" expr = new AssignmentExpression(expr, op, val); } else if (la.kind == 1 || la.kind == 13 || la.kind == 85) { -#line 2476 "VBNET.ATG" +#line 2474 "VBNET.ATG" if (mustBeAssignment) Error("error in assignment."); } else SynErr(251); -#line 2479 "VBNET.ATG" +#line 2477 "VBNET.ATG" // a field reference expression that stands alone is a // invocation expression without parantheses and arguments if(expr is FieldReferenceExpression || expr is IdentifierExpression) { @@ -6381,10 +6379,10 @@ out val); case 55: { lexer.NextToken(); UnaryExpr( -#line 2486 "VBNET.ATG" +#line 2484 "VBNET.ATG" out expr); -#line 2486 "VBNET.ATG" +#line 2484 "VBNET.ATG" statement = new StatementExpression(expr); break; } @@ -6392,7 +6390,7 @@ out expr); lexer.NextToken(); Identifier(); -#line 2488 "VBNET.ATG" +#line 2486 "VBNET.ATG" string resourcename = t.val, typeName; Statement resourceAquisition = null, block = null; @@ -6400,45 +6398,45 @@ out expr); if (la.kind == 126) { lexer.NextToken(); Qualident( -#line 2492 "VBNET.ATG" +#line 2490 "VBNET.ATG" out typeName); -#line 2492 "VBNET.ATG" +#line 2490 "VBNET.ATG" ArrayList initializer = null; if (la.kind == 23) { lexer.NextToken(); if (StartOf(18)) { ArgumentList( -#line 2492 "VBNET.ATG" +#line 2490 "VBNET.ATG" out initializer); } Expect(24); } -#line 2494 "VBNET.ATG" +#line 2492 "VBNET.ATG" resourceAquisition = new LocalVariableDeclaration(new VariableDeclaration(resourcename, new ArrayInitializerExpression(initializer), new TypeReference(typeName))); } else if (StartOf(10)) { Qualident( -#line 2497 "VBNET.ATG" +#line 2495 "VBNET.ATG" out typeName); Expect(11); Expr( -#line 2497 "VBNET.ATG" +#line 2495 "VBNET.ATG" out expr); -#line 2499 "VBNET.ATG" +#line 2497 "VBNET.ATG" resourceAquisition = new LocalVariableDeclaration(new VariableDeclaration(resourcename, expr, new TypeReference(typeName))); } else SynErr(252); Block( -#line 2502 "VBNET.ATG" +#line 2500 "VBNET.ATG" out block); Expect(87); Expect(188); -#line 2504 "VBNET.ATG" +#line 2502 "VBNET.ATG" statement = new UsingStatement(resourceAquisition, block); break; } @@ -6447,10 +6445,10 @@ out block); } void LocalDeclarationStatement( -#line 2212 "VBNET.ATG" +#line 2210 "VBNET.ATG" out Statement statement) { -#line 2214 "VBNET.ATG" +#line 2212 "VBNET.ATG" Modifiers m = new Modifiers(); LocalVariableDeclaration localVariableDeclaration; bool dimfound = false; @@ -6459,22 +6457,22 @@ out Statement statement) { if (la.kind == 70) { lexer.NextToken(); -#line 2220 "VBNET.ATG" - m.Add(Modifier.Const); +#line 2218 "VBNET.ATG" + m.Add(Modifier.Const, t.Location); } else if (la.kind == 161) { lexer.NextToken(); -#line 2221 "VBNET.ATG" - m.Add(Modifier.Static); +#line 2219 "VBNET.ATG" + m.Add(Modifier.Static, t.Location); } else { lexer.NextToken(); -#line 2222 "VBNET.ATG" +#line 2220 "VBNET.ATG" dimfound = true; } } -#line 2225 "VBNET.ATG" +#line 2223 "VBNET.ATG" if(dimfound && (m.Modifier & Modifier.Const) != 0) { Error("Dim is not allowed on constants."); } @@ -6487,137 +6485,137 @@ out Statement statement) { localVariableDeclaration.StartLocation = t.Location; VariableDeclarator( -#line 2236 "VBNET.ATG" +#line 2234 "VBNET.ATG" localVariableDeclaration.Variables); while (la.kind == 12) { lexer.NextToken(); VariableDeclarator( -#line 2237 "VBNET.ATG" +#line 2235 "VBNET.ATG" localVariableDeclaration.Variables); } -#line 2239 "VBNET.ATG" +#line 2237 "VBNET.ATG" statement = localVariableDeclaration; } void TryStatement( -#line 2697 "VBNET.ATG" +#line 2695 "VBNET.ATG" out Statement tryStatement) { -#line 2699 "VBNET.ATG" +#line 2697 "VBNET.ATG" Statement blockStmt = null, finallyStmt = null;ArrayList catchClauses = null; Expect(174); EndOfStmt(); Block( -#line 2702 "VBNET.ATG" +#line 2700 "VBNET.ATG" out blockStmt); if (la.kind == 57 || la.kind == 87 || la.kind == 96) { CatchClauses( -#line 2703 "VBNET.ATG" +#line 2701 "VBNET.ATG" out catchClauses); } if (la.kind == 96) { lexer.NextToken(); EndOfStmt(); Block( -#line 2704 "VBNET.ATG" +#line 2702 "VBNET.ATG" out finallyStmt); } Expect(87); Expect(174); -#line 2707 "VBNET.ATG" +#line 2705 "VBNET.ATG" tryStatement = new TryCatchStatement(blockStmt, catchClauses, finallyStmt); } void WithStatement( -#line 2675 "VBNET.ATG" +#line 2673 "VBNET.ATG" out Statement withStatement) { -#line 2677 "VBNET.ATG" +#line 2675 "VBNET.ATG" Statement blockStmt = null; Expression expr = null; Expect(182); -#line 2680 "VBNET.ATG" +#line 2678 "VBNET.ATG" Point start = t.Location; Expr( -#line 2681 "VBNET.ATG" +#line 2679 "VBNET.ATG" out expr); EndOfStmt(); -#line 2683 "VBNET.ATG" +#line 2681 "VBNET.ATG" withStatement = new WithStatement(expr); withStatement.StartLocation = start; withStatements.Push(withStatement); Block( -#line 2687 "VBNET.ATG" +#line 2685 "VBNET.ATG" out blockStmt); -#line 2689 "VBNET.ATG" +#line 2687 "VBNET.ATG" ((WithStatement)withStatement).Body = (BlockStatement)blockStmt; withStatements.Pop(); Expect(87); Expect(182); -#line 2693 "VBNET.ATG" +#line 2691 "VBNET.ATG" withStatement.EndLocation = t.Location; } void WhileOrUntil( -#line 2668 "VBNET.ATG" +#line 2666 "VBNET.ATG" out ConditionType conditionType) { -#line 2669 "VBNET.ATG" +#line 2667 "VBNET.ATG" conditionType = ConditionType.None; if (la.kind == 181) { lexer.NextToken(); -#line 2670 "VBNET.ATG" +#line 2668 "VBNET.ATG" conditionType = ConditionType.While; } else if (la.kind == 177) { lexer.NextToken(); -#line 2671 "VBNET.ATG" +#line 2669 "VBNET.ATG" conditionType = ConditionType.Until; } else SynErr(254); } void LoopControlVariable( -#line 2509 "VBNET.ATG" +#line 2507 "VBNET.ATG" out TypeReference type, out string name) { -#line 2510 "VBNET.ATG" +#line 2508 "VBNET.ATG" ArrayList arrayModifiers = null; type = null; Qualident( -#line 2514 "VBNET.ATG" +#line 2512 "VBNET.ATG" out name); if ( -#line 2515 "VBNET.ATG" +#line 2513 "VBNET.ATG" IsDims()) { ArrayTypeModifiers( -#line 2515 "VBNET.ATG" +#line 2513 "VBNET.ATG" out arrayModifiers); } if (la.kind == 47) { lexer.NextToken(); TypeName( -#line 2516 "VBNET.ATG" +#line 2514 "VBNET.ATG" out type); -#line 2516 "VBNET.ATG" +#line 2514 "VBNET.ATG" if (name.IndexOf('.') > 0) { Error("No type def for 'for each' member indexer allowed."); } } -#line 2518 "VBNET.ATG" +#line 2516 "VBNET.ATG" if (type != null) { if(type.RankSpecifier != null && arrayModifiers != null) { Error("array rank only allowed one time"); @@ -6635,48 +6633,48 @@ out type); } void CaseClauses( -#line 2628 "VBNET.ATG" +#line 2626 "VBNET.ATG" out ArrayList caseClauses) { -#line 2630 "VBNET.ATG" +#line 2628 "VBNET.ATG" caseClauses = new ArrayList(); CaseLabel caseClause = null; CaseClause( -#line 2633 "VBNET.ATG" +#line 2631 "VBNET.ATG" out caseClause); -#line 2633 "VBNET.ATG" +#line 2631 "VBNET.ATG" caseClauses.Add(caseClause); while (la.kind == 12) { lexer.NextToken(); CaseClause( -#line 2634 "VBNET.ATG" +#line 2632 "VBNET.ATG" out caseClause); -#line 2634 "VBNET.ATG" +#line 2632 "VBNET.ATG" caseClauses.Add(caseClause); } } void OnErrorStatement( -#line 2535 "VBNET.ATG" +#line 2533 "VBNET.ATG" out OnErrorStatement stmt) { -#line 2537 "VBNET.ATG" +#line 2535 "VBNET.ATG" stmt = null; GotoStatement goToStatement = null; Expect(134); Expect(91); if ( -#line 2543 "VBNET.ATG" +#line 2541 "VBNET.ATG" IsNegativeLabelName()) { Expect(103); Expect(15); Expect(5); -#line 2545 "VBNET.ATG" +#line 2543 "VBNET.ATG" long intLabel = Int64.Parse(t.val); if(intLabel != 1) { Error("invalid label in on error statement."); @@ -6685,10 +6683,10 @@ IsNegativeLabelName()) { } else if (la.kind == 103) { GotoStatement( -#line 2551 "VBNET.ATG" +#line 2549 "VBNET.ATG" out goToStatement); -#line 2553 "VBNET.ATG" +#line 2551 "VBNET.ATG" string val = goToStatement.Label; // if value is numeric, make sure that is 0 @@ -6705,63 +6703,63 @@ out goToStatement); lexer.NextToken(); Expect(127); -#line 2567 "VBNET.ATG" +#line 2565 "VBNET.ATG" stmt = new OnErrorStatement(new ResumeStatement(true)); } else SynErr(255); } void GotoStatement( -#line 2573 "VBNET.ATG" +#line 2571 "VBNET.ATG" out ICSharpCode.NRefactory.Parser.AST.GotoStatement goToStatement) { -#line 2575 "VBNET.ATG" +#line 2573 "VBNET.ATG" string label = String.Empty; Expect(103); LabelName( -#line 2578 "VBNET.ATG" +#line 2576 "VBNET.ATG" out label); -#line 2580 "VBNET.ATG" +#line 2578 "VBNET.ATG" goToStatement = new ICSharpCode.NRefactory.Parser.AST.GotoStatement(label); } void ResumeStatement( -#line 2617 "VBNET.ATG" +#line 2615 "VBNET.ATG" out ResumeStatement resumeStatement) { -#line 2619 "VBNET.ATG" +#line 2617 "VBNET.ATG" resumeStatement = null; string label = String.Empty; if ( -#line 2622 "VBNET.ATG" +#line 2620 "VBNET.ATG" IsResumeNext()) { Expect(153); Expect(127); -#line 2623 "VBNET.ATG" +#line 2621 "VBNET.ATG" resumeStatement = new ResumeStatement(true); } else if (la.kind == 153) { lexer.NextToken(); if (StartOf(32)) { LabelName( -#line 2624 "VBNET.ATG" +#line 2622 "VBNET.ATG" out label); } -#line 2624 "VBNET.ATG" +#line 2622 "VBNET.ATG" resumeStatement = new ResumeStatement(label); } else SynErr(256); } void CaseClause( -#line 2638 "VBNET.ATG" +#line 2636 "VBNET.ATG" out CaseLabel caseClause) { -#line 2640 "VBNET.ATG" +#line 2638 "VBNET.ATG" Expression expr = null; Expression sexpr = null; BinaryOperatorType op = BinaryOperatorType.None; @@ -6770,7 +6768,7 @@ out CaseLabel caseClause) { if (la.kind == 85) { lexer.NextToken(); -#line 2646 "VBNET.ATG" +#line 2644 "VBNET.ATG" caseClause = new CaseLabel(); } else if (StartOf(33)) { if (la.kind == 112) { @@ -6780,76 +6778,76 @@ out CaseLabel caseClause) { case 26: { lexer.NextToken(); -#line 2650 "VBNET.ATG" +#line 2648 "VBNET.ATG" op = BinaryOperatorType.LessThan; break; } case 25: { lexer.NextToken(); -#line 2651 "VBNET.ATG" +#line 2649 "VBNET.ATG" op = BinaryOperatorType.GreaterThan; break; } case 29: { lexer.NextToken(); -#line 2652 "VBNET.ATG" +#line 2650 "VBNET.ATG" op = BinaryOperatorType.LessThanOrEqual; break; } case 28: { lexer.NextToken(); -#line 2653 "VBNET.ATG" +#line 2651 "VBNET.ATG" op = BinaryOperatorType.GreaterThanOrEqual; break; } case 11: { lexer.NextToken(); -#line 2654 "VBNET.ATG" +#line 2652 "VBNET.ATG" op = BinaryOperatorType.Equality; break; } case 27: { lexer.NextToken(); -#line 2655 "VBNET.ATG" +#line 2653 "VBNET.ATG" op = BinaryOperatorType.InEquality; break; } default: SynErr(257); break; } Expr( -#line 2657 "VBNET.ATG" +#line 2655 "VBNET.ATG" out expr); -#line 2659 "VBNET.ATG" +#line 2657 "VBNET.ATG" caseClause = new CaseLabel(op, expr); } else if (StartOf(19)) { Expr( -#line 2661 "VBNET.ATG" +#line 2659 "VBNET.ATG" out expr); if (la.kind == 172) { lexer.NextToken(); Expr( -#line 2661 "VBNET.ATG" +#line 2659 "VBNET.ATG" out sexpr); } -#line 2663 "VBNET.ATG" +#line 2661 "VBNET.ATG" caseClause = new CaseLabel(expr, sexpr); } else SynErr(258); } void CatchClauses( -#line 2712 "VBNET.ATG" +#line 2710 "VBNET.ATG" out ArrayList catchClauses) { -#line 2714 "VBNET.ATG" +#line 2712 "VBNET.ATG" catchClauses = new ArrayList(); TypeReference type = null; Statement blockStmt = null; @@ -6861,27 +6859,27 @@ out ArrayList catchClauses) { if (StartOf(10)) { Identifier(); -#line 2722 "VBNET.ATG" +#line 2720 "VBNET.ATG" name = t.val; if (la.kind == 47) { lexer.NextToken(); TypeName( -#line 2722 "VBNET.ATG" +#line 2720 "VBNET.ATG" out type); } } if (la.kind == 180) { lexer.NextToken(); Expr( -#line 2723 "VBNET.ATG" +#line 2721 "VBNET.ATG" out expr); } EndOfStmt(); Block( -#line 2725 "VBNET.ATG" +#line 2723 "VBNET.ATG" out blockStmt); -#line 2726 "VBNET.ATG" +#line 2724 "VBNET.ATG" catchClauses.Add(new CatchClause(type, name, blockStmt, expr)); } } diff --git a/src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG b/src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG index 447fce54be..07550b5c38 100644 --- a/src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG +++ b/src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG @@ -596,7 +596,7 @@ NonModuleDeclaration attributes> .) = (. m.Check(Modifier.Classes); .) /* Spec, 7.5 */ - ["Partial" (. m.Add(Modifier.Partial); .)] + ["Partial" (. m.Add(Modifier.Partial, t.Location); .)] "Class" (. TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); newType.StartLocation = t.Location; @@ -620,7 +620,7 @@ NonModuleDeclaration attributes> TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); compilationUnit.AddChild(newType); compilationUnit.BlockStart(newType); - newType.StartLocation = t.Location; + newType.StartLocation = m.GetDeclarationLocation(t.Location); newType.Type = Types.Module; .) Identifier (. newType.Name = t.val; .) @@ -635,8 +635,7 @@ NonModuleDeclaration attributes> TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); compilationUnit.AddChild(newType); compilationUnit.BlockStart(newType); - newType.StartLocation = t.Location; - System.Console.WriteLine("XXX " + t.Location.ToString()); + newType.StartLocation = m.GetDeclarationLocation(t.Location); newType.Type = Types.Struct; .) Identifier (. newType.Name = t.val; .) @@ -651,8 +650,7 @@ NonModuleDeclaration attributes> (. m.Check(Modifier.VBEnums); TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); - newType.StartLocation = t.Location; - + newType.StartLocation = m.GetDeclarationLocation(t.Location); compilationUnit.AddChild(newType); compilationUnit.BlockStart(newType); @@ -670,7 +668,7 @@ NonModuleDeclaration attributes> (. m.Check(Modifier.VBInterfacs); TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); - newType.StartLocation = t.Location; + newType.StartLocation = m.GetDeclarationLocation(t.Location); compilationUnit.AddChild(newType); compilationUnit.BlockStart(newType); newType.Type = Types.Interface; @@ -688,7 +686,7 @@ NonModuleDeclaration attributes> m.Check(Modifier.VBDelegates); DelegateDeclaration delegateDeclr = new DelegateDeclaration(m.Modifier, attributes); delegateDeclr.ReturnType = new TypeReference("", "System.Void"); - delegateDeclr.StartLocation = t.Location; + delegateDeclr.StartLocation = m.GetDeclarationLocation(t.Location); List p = new List(); .) ( @@ -931,7 +929,7 @@ StructureMemberDecl attributes> IF(IsMustOverride(m)) (. methodDeclaration = new MethodDeclaration(name, m.Modifier, null, p, attributes); - methodDeclaration.StartLocation = startPos; + methodDeclaration.StartLocation = m.GetDeclarationLocation(startPos); methodDeclaration.EndLocation = endLocation; methodDeclaration.TypeReference = new TypeReference("", "System.Void"); @@ -944,7 +942,7 @@ StructureMemberDecl attributes> | (. methodDeclaration = new MethodDeclaration(name, m.Modifier, null, p, attributes); - methodDeclaration.StartLocation = startPos; + methodDeclaration.StartLocation = m.GetDeclarationLocation(startPos); methodDeclaration.EndLocation = endLocation; methodDeclaration.TypeReference = new TypeReference("", "System.Void"); @@ -971,7 +969,7 @@ StructureMemberDecl attributes> "End" "Sub" (. Point endLocation = t.EndLocation; .) EOL (. ConstructorDeclaration cd = new ConstructorDeclaration("New", m.Modifier, p, attributes); - cd.StartLocation = startPos; + cd.StartLocation = m.GetDeclarationLocation(startPos); cd.EndLocation = constructorEndLocation; cd.Body = (BlockStatement)stmt; cd.Body.EndLocation = endLocation; @@ -1010,7 +1008,7 @@ StructureMemberDecl attributes> IF(IsMustOverride(m)) (. methodDeclaration = new MethodDeclaration(name, m.Modifier, type, p, attributes); - methodDeclaration.StartLocation = startPos; + methodDeclaration.StartLocation = m.GetDeclarationLocation(startPos); methodDeclaration.EndLocation = t.EndLocation; methodDeclaration.HandlesClause = handlesClause; @@ -1022,7 +1020,7 @@ StructureMemberDecl attributes> | (. methodDeclaration = new MethodDeclaration(name, m.Modifier, type, p, attributes); - methodDeclaration.StartLocation = startPos; + methodDeclaration.StartLocation = m.GetDeclarationLocation(startPos); methodDeclaration.EndLocation = t.EndLocation; methodDeclaration.Templates = templates; @@ -1066,7 +1064,7 @@ StructureMemberDecl attributes> EOL (. DeclareDeclaration declareDeclaration = new DeclareDeclaration(name, m.Modifier, null, p, attributes, library, alias, charsetModifer); - declareDeclaration.StartLocation = startPos; + declareDeclaration.StartLocation = m.GetDeclarationLocation(startPos); declareDeclaration.EndLocation = t.EndLocation; compilationUnit.AddChild(declareDeclaration); .) @@ -1080,7 +1078,7 @@ StructureMemberDecl attributes> EOL (. DeclareDeclaration declareDeclaration = new DeclareDeclaration(name, m.Modifier, type, p, attributes, library, alias, charsetModifer); - declareDeclaration.StartLocation = startPos; + declareDeclaration.StartLocation = m.GetDeclarationLocation(startPos); declareDeclaration.EndLocation = t.EndLocation; compilationUnit.AddChild(declareDeclaration); .) @@ -1103,7 +1101,7 @@ StructureMemberDecl attributes> [ ImplementsClause ] (. eventDeclaration = new EventDeclaration(type, m.Modifier, p, attributes, name, implementsClause); - eventDeclaration.StartLocation = startPos; + eventDeclaration.StartLocation = m.GetDeclarationLocation(startPos); eventDeclaration.EndLocation = t.EndLocation; compilationUnit.AddChild(eventDeclaration); .) @@ -1113,7 +1111,7 @@ StructureMemberDecl attributes> (. m.Check(Modifier.Fields); FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier); - fd.StartLocation = startPos; + fd.StartLocation = m.GetDeclarationLocation(startPos); .) VariableDeclarator { "," VariableDeclarator } @@ -1125,10 +1123,10 @@ StructureMemberDecl attributes> .) | /* 9.4 */ (. m.Check(Modifier.Fields); .) - "Const" (. m.Add(Modifier.Const); .) + "Const" (. m.Add(Modifier.Const, t.Location); .) (. FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier); - fd.StartLocation = t.Location; + fd.StartLocation = m.GetDeclarationLocation(t.Location); List constantDeclarators = new List(); .) ConstantDeclarator @@ -1164,7 +1162,7 @@ StructureMemberDecl attributes> IF(IsMustOverride(m)) (. PropertyDeclaration pDecl = new PropertyDeclaration(propertyName, type, m.Modifier, attributes); - pDecl.StartLocation = startPos; + pDecl.StartLocation = m.GetDeclarationLocation(startPos); pDecl.EndLocation = t.Location; pDecl.TypeReference = type; pDecl.ImplementsClause = implementsClause; @@ -1174,7 +1172,7 @@ StructureMemberDecl attributes> | (. PropertyDeclaration pDecl = new PropertyDeclaration(propertyName, type, m.Modifier, attributes); - pDecl.StartLocation = startPos; + pDecl.StartLocation = m.GetDeclarationLocation(startPos); pDecl.EndLocation = t.Location; pDecl.BodyStart = t.Location; pDecl.TypeReference = type; @@ -1242,7 +1240,7 @@ StructureMemberDecl attributes> } EventDeclaration decl = new EventDeclaration(type, customEventName, m.Modifier, attributes); - decl.StartLocation = startPos; + decl.StartLocation = m.GetDeclarationLocation(startPos); decl.EndLocation = t.EndLocation; compilationUnit.AddChild(decl); .) @@ -1283,7 +1281,7 @@ StructureMemberDecl attributes> operatorDeclaration.ConvertToType = returnType; operatorDeclaration.ReturnTypeAttributes = returnTypeAttributes; operatorDeclaration.Body = (BlockStatement)stmt; - operatorDeclaration.StartLocation = startPos; + operatorDeclaration.StartLocation = m.GetDeclarationLocation(startPos); operatorDeclaration.EndLocation = t.EndLocation; compilationUnit.AddChild(operatorDeclaration); .) @@ -2217,8 +2215,8 @@ LocalDeclarationStatement .) = /* this differs from the spec: dim static x compiles with vbc. */ { - "Const" (. m.Add(Modifier.Const); .) - | "Static" (. m.Add(Modifier.Static); .) + "Const" (. m.Add(Modifier.Const, t.Location); .) + | "Static" (. m.Add(Modifier.Static, t.Location); .) | "Dim" (. dimfound = true; .) } (. @@ -2938,37 +2936,37 @@ ParameterModifier . TypeModifier - = "Public" (. m.Add(Modifier.Public); .) - | "Protected" (. m.Add(Modifier.Protected); .) - | "Friend" (. m.Add(Modifier.Internal); .) - | "Private" (. m.Add(Modifier.Private); .) - | "Shared" (. m.Add(Modifier.Static); .) - | "Shadows" (. m.Add(Modifier.New); .) - | "MustInherit" (. m.Add(Modifier.Abstract); .) - | "NotInheritable" (. m.Add(Modifier.Sealed); .) + = "Public" (. m.Add(Modifier.Public, t.Location); .) + | "Protected" (. m.Add(Modifier.Protected, t.Location); .) + | "Friend" (. m.Add(Modifier.Internal, t.Location); .) + | "Private" (. m.Add(Modifier.Private, t.Location); .) + | "Shared" (. m.Add(Modifier.Static, t.Location); .) + | "Shadows" (. m.Add(Modifier.New, t.Location); .) + | "MustInherit" (. m.Add(Modifier.Abstract, t.Location); .) + | "NotInheritable" (. m.Add(Modifier.Sealed, t.Location); .) . MemberModifier = - "MustInherit" (.m.Add(Modifier.Abstract);.) - |"Default" (.m.Add(Modifier.Default);.) - |"Friend" (.m.Add(Modifier.Internal);.) - |"Shadows" (.m.Add(Modifier.New);.) - |"Overrides" (.m.Add(Modifier.Override);.) - |"MustOverride" (.m.Add(Modifier.Abstract);.) - |"Private" (.m.Add(Modifier.Private);.) - |"Protected" (.m.Add(Modifier.Protected);.) - |"Public" (.m.Add(Modifier.Public);.) - |"NotInheritable" (.m.Add(Modifier.Sealed);.) - |"NotOverridable" (.m.Add(Modifier.Sealed);.) - |"Shared" (.m.Add(Modifier.Static);.) - |"Overridable" (.m.Add(Modifier.Virtual);.) - |"Overloads" (.m.Add(Modifier.Overloads);.) + "MustInherit" (.m.Add(Modifier.Abstract, t.Location);.) + |"Default" (.m.Add(Modifier.Default, t.Location);.) + |"Friend" (.m.Add(Modifier.Internal, t.Location);.) + |"Shadows" (.m.Add(Modifier.New, t.Location);.) + |"Overrides" (.m.Add(Modifier.Override, t.Location);.) + |"MustOverride" (.m.Add(Modifier.Abstract, t.Location);.) + |"Private" (.m.Add(Modifier.Private, t.Location);.) + |"Protected" (.m.Add(Modifier.Protected, t.Location);.) + |"Public" (.m.Add(Modifier.Public, t.Location);.) + |"NotInheritable" (.m.Add(Modifier.Sealed, t.Location);.) + |"NotOverridable" (.m.Add(Modifier.Sealed, t.Location);.) + |"Shared" (.m.Add(Modifier.Static, t.Location);.) + |"Overridable" (.m.Add(Modifier.Virtual, t.Location);.) + |"Overloads" (.m.Add(Modifier.Overloads, t.Location);.) | "ReadOnly" (. /* m.Add(Modifier.ReadOnly); */ .) | "WriteOnly" (. /* m.Add(Modifier.WriteOnly); */ .) - | "WithEvents" (.m.Add(Modifier.WithEvents);.) - | "Dim" (.m.Add(Modifier.Dim);.) - | "Widening" (.m.Add(Modifier.Widening);.) - | "Narrowing" (.m.Add(Modifier.Narrowing);.) + | "WithEvents" (.m.Add(Modifier.WithEvents, t.Location);.) + | "Dim" (.m.Add(Modifier.Dim, t.Location);.) + | "Widening" (.m.Add(Modifier.Widening, t.Location);.) + | "Narrowing" (.m.Add(Modifier.Narrowing, t.Location);.) . END VBNET.