diff --git a/NRefactory.sln b/NRefactory.sln index 3f3b4c5fc5..d4487ce22c 100644 --- a/NRefactory.sln +++ b/NRefactory.sln @@ -12,11 +12,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "VB", "VB", "{61F5C042-086B- ProjectSection(SolutionItems) = postProject EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NRefactoryASTGenerator", "VB\NRefactoryASTGenerator\NRefactoryASTGenerator.csproj", "{B22522AA-B5BF-4A58-AC6D-D4B45805521F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.NRefactory.VB.Tests", "VB\Test\ICSharpCode.NRefactory.VB.Tests.csproj", "{870115DD-960A-4406-A6B9-600BCDC36A03}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.NRefactory.VB", "VB\Project\ICSharpCode.NRefactory.VB.csproj", "{7B82B671-419F-45F4-B778-D9286F996EFA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.NRefactory.VB.Tests", "VB\Test\ICSharpCode.NRefactory.VB.Tests.csproj", "{870115DD-960A-4406-A6B9-600BCDC36A03}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NRefactoryASTGenerator", "VB\NRefactoryASTGenerator\NRefactoryASTGenerator.csproj", "{B22522AA-B5BF-4A58-AC6D-D4B45805521F}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.NRefactory", "ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj", "{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}" EndProject @@ -64,8 +64,8 @@ Global {870115DD-960A-4406-A6B9-600BCDC36A03}.Release|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution - {870115DD-960A-4406-A6B9-600BCDC36A03} = {61F5C042-086B-45DD-999E-01B1A78A4619} - {7B82B671-419F-45F4-B778-D9286F996EFA} = {61F5C042-086B-45DD-999E-01B1A78A4619} {B22522AA-B5BF-4A58-AC6D-D4B45805521F} = {61F5C042-086B-45DD-999E-01B1A78A4619} + {7B82B671-419F-45F4-B778-D9286F996EFA} = {61F5C042-086B-45DD-999E-01B1A78A4619} + {870115DD-960A-4406-A6B9-600BCDC36A03} = {61F5C042-086B-45DD-999E-01B1A78A4619} EndGlobalSection EndGlobal diff --git a/VB/Project/Dom/Generated.cs b/VB/Project/Dom/Generated.cs index 554637ef53..0f7fc756f6 100644 --- a/VB/Project/Dom/Generated.cs +++ b/VB/Project/Dom/Generated.cs @@ -80,56 +80,6 @@ namespace ICSharpCode.NRefactory.VB.Dom { } } - public class AnonymousMethodExpression : Expression { - - List parameters; - - BlockStatement body; - - bool hasParameterList; - - public List Parameters { - get { - return parameters; - } - set { - parameters = value ?? new List(); - } - } - - public BlockStatement Body { - get { - return body; - } - set { - body = value ?? BlockStatement.Null; - if (!body.IsNull) body.Parent = this; - } - } - - public bool HasParameterList { - get { - return hasParameterList; - } - set { - hasParameterList = value; - } - } - - public AnonymousMethodExpression() { - parameters = new List(); - body = BlockStatement.Null; - } - - public override object AcceptVisitor(IAstVisitor visitor, object data) { - return visitor.VisitAnonymousMethodExpression(this, data); - } - - public override string ToString() { - return string.Format("[AnonymousMethodExpression Parameters={0} Body={1} HasParameterList={2}]", GetCollectionString(Parameters), Body, HasParameterList); - } - } - public class ArrayCreateExpression : Expression { TypeReference createType; @@ -2192,15 +2142,15 @@ namespace ICSharpCode.NRefactory.VB.Dom { if (trueStatement != null) trueStatement.Parent = this; } - public bool HasElseIfSections { + public bool HasElseStatements { get { - return elseIfSections.Count > 0; + return falseStatement.Count > 0; } } - public bool HasElseStatements { + public bool HasElseIfSections { get { - return falseStatement.Count > 0; + return elseIfSections.Count > 0; } } @@ -5083,15 +5033,15 @@ public UsingDeclaration(string @namespace, TypeReference alias) { usings = new L attributes = new List(); } - public bool NameIsExpression { + public bool IsExpression { get { - return !nameExpression.IsNull; + return !content.IsNull; } } - public bool IsExpression { + public bool NameIsExpression { get { - return !content.IsNull; + return !nameExpression.IsNull; } } diff --git a/VB/Project/IAstVisitor.cs b/VB/Project/IAstVisitor.cs index 7a9026836f..46c4e0a9d7 100644 --- a/VB/Project/IAstVisitor.cs +++ b/VB/Project/IAstVisitor.cs @@ -19,8 +19,6 @@ namespace ICSharpCode.NRefactory.VB { object VisitAddressOfExpression(AddressOfExpression addressOfExpression, object data); - object VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression, object data); - object VisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression, object data); object VisitAssignmentExpression(AssignmentExpression assignmentExpression, object data); diff --git a/VB/Project/ICSharpCode.NRefactory.VB.csproj b/VB/Project/ICSharpCode.NRefactory.VB.csproj index 3f755c84ec..941692cf55 100644 --- a/VB/Project/ICSharpCode.NRefactory.VB.csproj +++ b/VB/Project/ICSharpCode.NRefactory.VB.csproj @@ -85,16 +85,16 @@ - - - + + vb.atg + vb.atg - + @@ -123,7 +123,6 @@ - @@ -143,17 +142,13 @@ ExpressionFinder.atg - - - - - - + + vb.atg + ICSharpCode.NRefactory.VB.Parser CocoParserGenerator - \ No newline at end of file diff --git a/VB/Project/Parser/AbstractParser.cs b/VB/Project/Parser/AbstractParser.cs deleted file mode 100644 index 69996b298b..0000000000 --- a/VB/Project/Parser/AbstractParser.cs +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) - -using System; -using System.Collections.Generic; -using ICSharpCode.NRefactory.VB.Dom; - -namespace ICSharpCode.NRefactory.VB.Parser -{ - public abstract class AbstractParser : IParser - { - protected const int MinErrDist = 2; - protected const string ErrMsgFormat = "-- line {0} col {1}: {2}"; // 0=line, 1=column, 2=text - - - private Errors errors; - private ILexer lexer; - - protected int errDist = MinErrDist; - - [CLSCompliant(false)] - protected CompilationUnit compilationUnit; - - bool parseMethodContents = true; - - public bool ParseMethodBodies { - get { - return parseMethodContents; - } - set { - parseMethodContents = value; - } - } - - public ILexer Lexer { - get { - return lexer; - } - } - - public Errors Errors { - get { - return errors; - } - } - - public CompilationUnit CompilationUnit { - get { - return compilationUnit; - } - } - - internal AbstractParser(ILexer lexer) - { - this.errors = lexer.Errors; - this.lexer = lexer; - errors.SynErr = new ErrorCodeProc(SynErr); - } - - public abstract void Parse(); - - public abstract TypeReference ParseTypeReference (); - public abstract Expression ParseExpression(); - public abstract BlockStatement ParseBlock(); - public abstract List ParseTypeMembers(); - - protected abstract void SynErr(int line, int col, int errorNumber); - - protected void SynErr(int n) - { - if (errDist >= MinErrDist) { - errors.SynErr(lexer.LookAhead.line, lexer.LookAhead.col, n); - } - errDist = 0; - } - - protected void SemErr(string msg) - { - if (errDist >= MinErrDist) { - errors.Error(lexer.Token.line, lexer.Token.col, msg); - } - errDist = 0; - } - - protected void Expect(int n) - { - if (lexer.LookAhead.kind == n) { - lexer.NextToken(); - } else { - SynErr(n); - } - } - - #region System.IDisposable interface implementation - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")] - public void Dispose() - { - errors = null; - if (lexer != null) { - lexer.Dispose(); - } - lexer = null; - } - #endregion - } -} diff --git a/VB/Project/Parser/Frames/Parser.frame b/VB/Project/Parser/Frames/Parser.frame deleted file mode 100644 index 5602370fd6..0000000000 --- a/VB/Project/Parser/Frames/Parser.frame +++ /dev/null @@ -1,50 +0,0 @@ -/* - Parser.frame file for NRefactory. - */ -using System; -using System.Reflection; - --->namespace - --->tokens - -partial class Parser : AbstractParser -{ --->constants - const bool T = true; - const bool x = false; - --->declarations - -/* --->pragmas -*/ - --->productions - - void ParseRoot() - { --->parseRoot - } - - protected override void SynErr(int line, int col, int errorNumber) - { - string s; - switch (errorNumber) { --->errors - default: s = "error " + errorNumber; break; - } - this.Errors.Error(line, col, s); - } - - private bool StartOf(int s) - { - return set[s, lexer.LookAhead.kind]; - } - - static bool[,] set = { --->initialization - }; -} // end Parser - -$$$ diff --git a/VB/Project/Parser/Frames/Scanner.frame b/VB/Project/Parser/Frames/Scanner.frame deleted file mode 100644 index be14a4e655..0000000000 --- a/VB/Project/Parser/Frames/Scanner.frame +++ /dev/null @@ -1,202 +0,0 @@ -/*---------------------------------------------------------------------- -Compiler Generator Coco/R, -Copyright (c) 1990, 2004 Hanspeter Moessenboeck, University of Linz -extended by M. Loeberbauer & A. Woess, Univ. of Linz -with improvements by Pat Terry, Rhodes University - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License along -with this program; if not, write to the Free Software Foundation, Inc., -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -As an exception, it is allowed to write an extension of Coco/R that is -used as a plugin in non-free software. - -If not otherwise stated, any source code generated by Coco/R (other than -Coco/R itself) does not fall under the GNU General Public License. ------------------------------------------------------------------------*/ --->begin -using System; -using System.IO; -using System.Collections; -using System.Text; - --->namespace - -public class Token { - public int kind; // token kind - public int pos; // token position in the source text (starting at 0) - public int col; // token column (starting at 0) - public int line; // token line (starting at 1) - public string val; // token value - public Token next; // AW 2003-03-07 Tokens are kept in linked list -} - -public class Buffer { - public const char EOF = (char)256; - static byte[] buf; - static int bufLen; - static int pos; - // CHANGES by M.KRUEGER - public static int CountLines(int offset) - { - int line = 0; - for (int i = 0; i <= offset; ++i) { - if (buf[i] == '\n') { - ++line; - } - } - return line; - } - //EOC - public static void Fill (Stream s) { - bufLen = (int) s.Length; - buf = new byte[bufLen]; - s.Read(buf, 0, bufLen); - pos = 0; - } - - public static int Read () { - if (pos < bufLen) return buf[pos++]; - else return EOF; /* pdt */ - } - - public static int Peek () { - if (pos < bufLen) return buf[pos]; - else return EOF; /* pdt */ - } - - /* AW 2003-03-10 moved this from ParserGen.cs */ - public static string GetString (int beg, int end) { - StringBuilder s = new StringBuilder(64); - int oldPos = Buffer.Pos; - Buffer.Pos = beg; - while (beg < end) { s.Append((char)Buffer.Read()); beg++; } - Buffer.Pos = oldPos; - return s.ToString(); - } - - public static int Pos { - get { return pos; } - set { - if (value < 0) pos = 0; - else if (value >= bufLen) pos = bufLen; - else pos = value; - } - } -} - -public class Scanner { - const char EOL = '\n'; - const int eofSym = 0; /* pdt */ --->declarations - - static Token t; // current token - static char ch; // current input character - static int pos; // column number of current character - static int line; // line number of current character - static int lineStart; // start position of current line - static int oldEols; // EOLs that appeared in a comment; - static BitArray ignore; // set of characters to be ignored by the scanner - - static Token tokens; // the complete input token stream - static Token pt; // current peek token - - public static void Init (string fileName) { - FileStream s = null; - try { - s = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); - Init(s); - } catch (IOException) { - Console.WriteLine("--- Cannot open file {0}", fileName); - System.Environment.Exit(1); - } finally { - if (s != null) s.Close(); - } - } - - public static void Init (Stream s) { - Buffer.Fill(s); - pos = -1; line = 1; lineStart = 0; - oldEols = 0; - NextCh(); --->initialization - //--- AW: fill token list - tokens = new Token(); // first token is a dummy - Token node = tokens; - do { - node.next = NextToken(); - node = node.next; - } while (node.kind != eofSym); - node.next = node; - node.val = "EOF"; - t = pt = tokens; - } - - static void NextCh() { - if (oldEols > 0) { ch = EOL; oldEols--; } - else { - ch = (char)Buffer.Read(); pos++; - // replace isolated '\r' by '\n' in order to make - // eol handling uniform across Windows, Unix and Mac - if (ch == '\r' && Buffer.Peek() != '\n') ch = EOL; - if (ch == EOL) { line++; lineStart = pos + 1; } - } --->casing - } - --->comments - - static void CheckLiteral() { --->literals - } - - /* AW Scan() renamed to NextToken() */ - static Token NextToken() { - while (ignore[ch]) NextCh(); --->scan1 - t = new Token(); - t.pos = pos; t.col = pos - lineStart + 1; t.line = line; - int state = start[ch]; - StringBuilder buf = new StringBuilder(16); --->scan2 - - switch (state) { - case -1: { t.kind = eofSym; goto done; } // NextCh already done /* pdt */ - case 0: { t.kind = noSym; goto done; } // NextCh already done --->scan3 - } - done: - t.val = buf.ToString(); - return t; - } - - /* AW 2003-03-07 get the next token, move on and synch peek token with current */ - public static Token Scan () { - t = pt = t.next; - return t; - } - - /* AW 2003-03-07 get the next token, ignore pragmas */ - public static Token Peek () { - do { // skip pragmas while peeking - pt = pt.next; - } while (pt.kind > maxT); - return pt; - } - - /* AW 2003-03-11 to make sure peek start at current scan position */ - public static void ResetPeek () { pt = t; } - -} // end Scanner - -$$$ \ No newline at end of file diff --git a/VB/Project/Parser/Frames/SharpCoco.exe b/VB/Project/Parser/Frames/SharpCoco.exe deleted file mode 100644 index da33326feb..0000000000 Binary files a/VB/Project/Parser/Frames/SharpCoco.exe and /dev/null differ diff --git a/VB/Project/Parser/IParser.cs b/VB/Project/Parser/IParser.cs deleted file mode 100644 index 1492d8cff4..0000000000 --- a/VB/Project/Parser/IParser.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) -// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) - -using System; -using System.Collections.Generic; -using ICSharpCode.NRefactory.VB.Dom; - -namespace ICSharpCode.NRefactory.VB -{ - /// - /// Parser interface. - /// - public interface IParser : IDisposable - { - Parser.Errors Errors { - get; - } - - Parser.ILexer Lexer { - get; - } - - CompilationUnit CompilationUnit { - get; - } - - bool ParseMethodBodies { - get; set; - } - - void Parse(); - - Expression ParseExpression(); - TypeReference ParseTypeReference (); - BlockStatement ParseBlock(); - List ParseTypeMembers(); - } -} diff --git a/VB/Project/Parser/ParamModifierList.cs b/VB/Project/Parser/ParamModifierList.cs index b67107c771..6e6ed55c0b 100644 --- a/VB/Project/Parser/ParamModifierList.cs +++ b/VB/Project/Parser/ParamModifierList.cs @@ -8,7 +8,7 @@ namespace ICSharpCode.NRefactory.VB.Parser internal class ParamModifierList { ParameterModifiers cur; - Parser parser; + VBParser parser; public ParameterModifiers Modifier { get { @@ -16,7 +16,7 @@ namespace ICSharpCode.NRefactory.VB.Parser } } - public ParamModifierList(Parser parser) + public ParamModifierList(VBParser parser) { this.parser = parser; cur = ParameterModifiers.None; diff --git a/VB/Project/Parser/Parser.cs b/VB/Project/Parser/Parser.cs index 13c2b29717..5c1c4b0fa7 100644 --- a/VB/Project/Parser/Parser.cs +++ b/VB/Project/Parser/Parser.cs @@ -18,7 +18,7 @@ namespace ICSharpCode.NRefactory.VB.Parser { // Parser // ---------------------------------------------------------------------------- //! A Coco/R Parser -partial class Parser +partial class VBParser { public const int _EOF = 0; public const int _EOL = 1; @@ -3751,70 +3751,11 @@ partial class Parser Location startLocation = la.Location; if (la.kind == 120) { - Get(); - ExitType exitType = ExitType.None; - switch (la.kind) { - case 210: { - Get(); - exitType = ExitType.Sub; - break; - } - case 127: { - Get(); - exitType = ExitType.Function; - break; - } - case 186: { - Get(); - exitType = ExitType.Property; - break; - } - case 108: { - Get(); - exitType = ExitType.Do; - break; - } - case 124: { - Get(); - exitType = ExitType.For; - break; - } - case 218: { - Get(); - exitType = ExitType.Try; - break; - } - case 231: { - Get(); - exitType = ExitType.While; - break; - } - case 197: { - Get(); - exitType = ExitType.Select; - break; - } - default: SynErr(295); break; - } - statement = new ExitStatement(exitType); + ExitStatement(out statement); } else if (la.kind == 218) { TryStatement(out statement); } else if (la.kind == 89) { - Get(); - ContinueType continueType = ContinueType.None; - if (la.kind == 108 || la.kind == 124 || la.kind == 231) { - if (la.kind == 108) { - Get(); - continueType = ContinueType.Do; - } else if (la.kind == 124) { - Get(); - continueType = ContinueType.For; - } else { - Get(); - continueType = ContinueType.While; - } - } - statement = new ContinueStatement(continueType); + ContinueStatement(out statement); } else if (la.kind == 215) { Get(); if (StartOf(24)) { @@ -3900,7 +3841,7 @@ partial class Parser } statement = new DoLoopStatement(expr, embeddedStatement, conditionType, ConditionPosition.End); - } else SynErr(296); + } else SynErr(295); } else if (la.kind == 124) { Get(); Expression group = null; @@ -3974,7 +3915,7 @@ partial class Parser NextExpressions = nextExpressions }; - } else SynErr(297); + } else SynErr(296); } else if (la.kind == 118) { Get(); Expr(out expr); @@ -4074,7 +4015,7 @@ partial class Parser } } ifStatement.EndLocation = t.Location; statement = ifStatement; - } else SynErr(298); + } else SynErr(297); } else if (la.kind == 197) { Get(); if (la.kind == 74) { @@ -4136,7 +4077,7 @@ partial class Parser } else if (StartOf(47)) { if (mustBeAssignment) Error("error in assignment."); - } else SynErr(299); + } else SynErr(298); if(expr is MemberReferenceExpression || expr is IdentifierExpression) { Location endLocation = expr.EndLocation; expr = new InvocationExpression(expr); @@ -4166,12 +4107,12 @@ partial class Parser Expr(out expr); Block(out block); statement = new UsingStatement(new ExpressionStatement(expr), block); - } else SynErr(300); + } else SynErr(299); Expect(113); Expect(226); } else if (StartOf(48)) { LocalDeclarationStatement(out statement); - } else SynErr(301); + } else SynErr(300); if (statement != null) { statement.StartLocation = startLocation; statement.EndLocation = t.EndLocation; @@ -4189,7 +4130,7 @@ partial class Parser } else if (la.kind == 58) { AggregateQueryOperator(out aggregateClause); middleClauses.Add(aggregateClause); - } else SynErr(302); + } else SynErr(301); } void QueryOperator(List middleClauses) { @@ -4228,7 +4169,7 @@ partial class Parser } else if (la.kind == 133) { GroupByQueryOperator(out groupByClause); middleClauses.Add(groupByClause); - } else SynErr(303); + } else SynErr(302); } void FromQueryOperator(out QueryExpressionFromClause fromClause) { @@ -4328,7 +4269,7 @@ partial class Parser Get(); partitionClause.PartitionType = QueryExpressionPartitionType.SkipWhile; } - } else SynErr(304); + } else SynErr(303); Expr(out expr); partitionClause.Expression = expr; partitionClause.EndLocation = t.EndLocation; @@ -4531,7 +4472,7 @@ partial class Parser } else if (StartOf(24)) { Expr(out argumentexpr); - } else SynErr(305); + } else SynErr(304); } void QualIdentAndTypeArguments(out TypeReference typeref, bool canBeUnbound) { @@ -4549,7 +4490,7 @@ partial class Parser } } else if (StartOf(9)) { TypeArgumentList(typeref.GenericTypes); - } else SynErr(306); + } else SynErr(305); Expect(38); } } @@ -4595,7 +4536,7 @@ partial class Parser Get(); } else if (la.kind == 20) { Get(); - } else SynErr(307); + } else SynErr(306); } Expr(out expr); if (expr != null) { @@ -4612,10 +4553,10 @@ partial class Parser Get(); } else if (la.kind == 20) { Get(); - } else SynErr(308); + } else SynErr(307); } else if (StartOf(24)) { if (nameFound) Error("no positional argument after named argument"); - } else SynErr(309); + } else SynErr(308); Expr(out expr); if (expr != null) { if(name == "") positional.Add(expr); else { named.Add(new NamedArgumentExpression(name, expr) { StartLocation = startLocation, EndLocation = t.EndLocation }); name = ""; } @@ -4639,7 +4580,7 @@ partial class Parser } else if (la.kind == 182) { Get(); m.Add(ParameterModifiers.Params); - } else SynErr(310); + } else SynErr(309); } void Statement() { @@ -4656,7 +4597,7 @@ partial class Parser } else if (StartOf(1)) { EmbeddedStatement(out stmt); AddChild(stmt); - } else SynErr(311); + } else SynErr(310); if (stmt != null) { stmt.StartLocation = startPos; stmt.EndLocation = t.Location; @@ -4673,7 +4614,7 @@ partial class Parser } else if (la.kind == 5) { Get(); name = t.val; - } else SynErr(312); + } else SynErr(311); } void LocalDeclarationStatement(out Statement statement) { @@ -4713,6 +4654,55 @@ partial class Parser } + void ExitStatement(out Statement statement) { + Expect(120); + ExitType exitType = ExitType.None; + switch (la.kind) { + case 210: { + Get(); + exitType = ExitType.Sub; + break; + } + case 127: { + Get(); + exitType = ExitType.Function; + break; + } + case 186: { + Get(); + exitType = ExitType.Property; + break; + } + case 108: { + Get(); + exitType = ExitType.Do; + break; + } + case 124: { + Get(); + exitType = ExitType.For; + break; + } + case 218: { + Get(); + exitType = ExitType.Try; + break; + } + case 231: { + Get(); + exitType = ExitType.While; + break; + } + case 197: { + Get(); + exitType = ExitType.Select; + break; + } + default: SynErr(312); break; + } + statement = new ExitStatement(exitType); + } + void TryStatement(out Statement tryStatement) { Statement blockStmt = null, finallyStmt = null;List catchClauses = null; @@ -4733,6 +4723,24 @@ partial class Parser } + void ContinueStatement(out Statement statement) { + Expect(89); + ContinueType continueType = ContinueType.None; + if (la.kind == 108 || la.kind == 124 || la.kind == 231) { + if (la.kind == 108) { + Get(); + continueType = ContinueType.Do; + } else if (la.kind == 124) { + Get(); + continueType = ContinueType.For; + } else { + Get(); + continueType = ContinueType.While; + } + } + statement = new ContinueStatement(continueType); + } + void WithStatement(out Statement withStatement) { Statement blockStmt = null; Expression expr = null; @@ -5076,8 +5084,8 @@ partial class Parser new BitArray(new int[] {1048576, 3968, 0, 0, 65536, 0, 0, 0}) }; - - protected override void SynErr(int line, int col, int errorNumber) + + void SynErr(int line, int col, int errorNumber) { this.Errors.Error(line, col, GetMessage(errorNumber)); } @@ -5386,18 +5394,18 @@ partial class Parser case 298: return "invalid EmbeddedStatement"; case 299: return "invalid EmbeddedStatement"; case 300: return "invalid EmbeddedStatement"; - case 301: return "invalid EmbeddedStatement"; - case 302: return "invalid FromOrAggregateQueryOperator"; - case 303: return "invalid QueryOperator"; - case 304: return "invalid PartitionQueryOperator"; - case 305: return "invalid Argument"; - case 306: return "invalid QualIdentAndTypeArguments"; + case 301: return "invalid FromOrAggregateQueryOperator"; + case 302: return "invalid QueryOperator"; + case 303: return "invalid PartitionQueryOperator"; + case 304: return "invalid Argument"; + case 305: return "invalid QualIdentAndTypeArguments"; + case 306: return "invalid AttributeArguments"; case 307: return "invalid AttributeArguments"; case 308: return "invalid AttributeArguments"; - case 309: return "invalid AttributeArguments"; - case 310: return "invalid ParameterModifier"; - case 311: return "invalid Statement"; - case 312: return "invalid LabelName"; + case 309: return "invalid ParameterModifier"; + case 310: return "invalid Statement"; + case 311: return "invalid LabelName"; + case 312: return "invalid ExitStatement"; case 313: return "invalid WhileOrUntil"; case 314: return "invalid SingleLineStatementList"; case 315: return "invalid SingleLineStatementList"; diff --git a/VB/Project/Parser/Parser.frame b/VB/Project/Parser/Parser.frame new file mode 100644 index 0000000000..4abbfccef2 --- /dev/null +++ b/VB/Project/Parser/Parser.frame @@ -0,0 +1,119 @@ +/*---------------------------------------------------------------------------*\ + Compiler Generator Coco/R, + Copyright (c) 1990, 2004 Hanspeter Moessenboeck, University of Linz + extended by M. Loeberbauer & A. Woess, Univ. of Linz + with improvements by Pat Terry, Rhodes University +------------------------------------------------------------------------------- +License + This file is part of Compiler Generator Coco/R + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + As an exception, it is allowed to write an extension of Coco/R that is + used as a plugin in non-free software. + + If not otherwise stated, any source code generated by Coco/R (other than + Coco/R itself) does not fall under the GNU General Public License. + +About this file + This is a so-called 'frame' file that contains skeleton code for + generating a final Scanner/Parser code. + + The '-->TAG' text markers are used to delimit code chunks and typically + correspond to places where additional information is added by the + DFA or ParserGen code. + + All information prior to the first 'begin' text marker is discarded. + If the grammar contains a '[copy]' .. '[/copy]' section, its contents + will added instead. +\*---------------------------------------------------------------------------*/ +-->begin + +-->namespace + +// ---------------------------------------------------------------------------- +// Parser +// ---------------------------------------------------------------------------- +//! A Coco/R Parser +partial class VBParser +{ +-->constants + const bool T = true; + const bool x = false; + const int minErrDist = 2; + + public Errors errors; + + +-->declarations + + void Get () { + lexer.NextToken(); +-->pragmas + } + + bool StartOf (int s) { + return set[s].Get(la.kind); + } + + void ExpectWeak (int n, int follow) { + if (la.kind == n) Get(); + else { + SynErr(n); + while (!StartOf(follow)) Get(); + } + } + + + bool WeakSeparator(int n, int syFol, int repFol) { + int kind = la.kind; + if (kind == n) {Get(); return true;} + else if (StartOf(repFol)) {return false;} + else { + SynErr(n); + while (!(set[syFol].Get(kind) || set[repFol].Get(kind) || set[0].Get(kind))) { + Get(); + kind = la.kind; + } + return StartOf(syFol); + } + } + + +-->productions + + public void ParseRoot() { +-->parseRoot + } + + static readonly BitArray[] set = { +-->initialization + }; + + void SynErr(int line, int col, int errorNumber) + { + this.Errors.Error(line, col, GetMessage(errorNumber)); + } + + string GetMessage(int errorNumber) + { + switch (errorNumber) { + -->errors + default: return "error " + errorNumber; + } + } +} // end Parser + +$$$ diff --git a/VB/Project/Parser/VBNetParser.cs b/VB/Project/Parser/VBParser.cs similarity index 83% rename from VB/Project/Parser/VBNetParser.cs rename to VB/Project/Parser/VBParser.cs index 9bd24d5fc2..31849f28c0 100644 --- a/VB/Project/Parser/VBNetParser.cs +++ b/VB/Project/Parser/VBParser.cs @@ -12,13 +12,21 @@ using ICSharpCode.NRefactory.VB.Visitors; namespace ICSharpCode.NRefactory.VB.Parser { - internal sealed partial class Parser : AbstractParser + public partial class VBParser { Lexer lexer; Stack blockStack; + CompilationUnit compilationUnit; + int errDist = MinErrDist; + bool parseMethodContents = true; - public Parser(ILexer lexer) : base(lexer) + const int MinErrDist = 2; + const string ErrMsgFormat = "-- line {0} col {1}: {2}"; // 0=line, 1=column, 2=text + + public VBParser(ILexer lexer) { + this.errors = lexer.Errors; + errors.SynErr = new ErrorCodeProc(SynErr); this.lexer = (Lexer)lexer; this.blockStack = new Stack(); } @@ -42,7 +50,7 @@ namespace ICSharpCode.NRefactory.VB.Parser } } - private StringBuilder qualidentBuilder = new StringBuilder(); + StringBuilder qualidentBuilder = new StringBuilder(); Token t { @@ -78,19 +86,19 @@ namespace ICSharpCode.NRefactory.VB.Parser errDist = 0; } - public override void Parse() + public void Parse() { ParseRoot(); compilationUnit.AcceptVisitor(new SetParentVisitor(), null); } - public override TypeReference ParseTypeReference () + public TypeReference ParseTypeReference () { // TODO return null; } - public override Expression ParseExpression() + public Expression ParseExpression() { lexer.SetInitialContext(SnippetType.Expression); lexer.NextToken(); @@ -107,7 +115,7 @@ namespace ICSharpCode.NRefactory.VB.Parser return expr; } - public override BlockStatement ParseBlock() + public BlockStatement ParseBlock() { lexer.NextToken(); compilationUnit = new CompilationUnit(); @@ -127,9 +135,9 @@ namespace ICSharpCode.NRefactory.VB.Parser return st as BlockStatement; } - public override List ParseTypeMembers() + public List ParseTypeMembers() { - lexer.NextToken(); + lexer.NextToken(); TypeDeclaration newType = new TypeDeclaration(Modifiers.None, null); BlockStart(newType); ClassBody(newType); @@ -139,12 +147,6 @@ namespace ICSharpCode.NRefactory.VB.Parser return newType.Children; } - bool LeaveBlock() - { - int peek = Peek(1).kind; - return Tokens.BlockSucc[la.kind] && (la.kind != Tokens.End || peek == Tokens.EOL || peek == Tokens.Colon); - } - /* True, if "." is followed by an ident */ bool DotAndIdentOrKw () { int peek = Peek(1).kind; @@ -383,5 +385,71 @@ namespace ICSharpCode.NRefactory.VB.Parser item.Parent = parent; } } + + + + public bool ParseMethodBodies { + get { + return parseMethodContents; + } + set { + parseMethodContents = value; + } + } + + public ILexer Lexer { + get { + return lexer; + } + } + + public Errors Errors { + get { + return errors; + } + } + + public CompilationUnit CompilationUnit { + get { + return compilationUnit; + } + } + + void SynErr(int n) + { + if (errDist >= MinErrDist) { + errors.SynErr(lexer.LookAhead.line, lexer.LookAhead.col, n); + } + errDist = 0; + } + + void SemErr(string msg) + { + if (errDist >= MinErrDist) { + errors.Error(lexer.Token.line, lexer.Token.col, msg); + } + errDist = 0; + } + + void Expect(int n) + { + if (lexer.LookAhead.kind == n) { + lexer.NextToken(); + } else { + SynErr(n); + } + } + + #region System.IDisposable interface implementation + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")] + public void Dispose() + { + errors = null; + if (lexer != null) { + lexer.Dispose(); + } + lexer = null; + } + #endregion } } diff --git a/VB/Project/Parser/gen.bat b/VB/Project/Parser/gen.bat deleted file mode 100644 index 14fd7e11d0..0000000000 --- a/VB/Project/Parser/gen.bat +++ /dev/null @@ -1,14 +0,0 @@ -@echo off - -echo Generating with #Coco - -cd Frames - -copy ..\vbnet.atg -SharpCoco -namespace ICSharpCode.NRefactory.VB.Parser -trace FG vbnet.atg -move Parser.cs .. - -del vbnet.atg - -pause -cd .. \ No newline at end of file diff --git a/VB/Project/Parser/gen.sh b/VB/Project/Parser/gen.sh deleted file mode 100644 index 7eecd50dd6..0000000000 --- a/VB/Project/Parser/gen.sh +++ /dev/null @@ -1,18 +0,0 @@ -@echo off - -echo Generating with #Coco - -cd Frames - -cp ../CSharp/cs.ATG . -mono SharpCoco.exe -namespace ICSharpCode.NRefactory.Parser.CSharp cs.ATG -mv Parser.cs ../CSharp - -cp ../VBNet/VBNET.ATG . -mono SharpCoco.exe -trace GIPXA -namespace ICSharpCode.NRefactory.Parser.VB VBNET.ATG -mv Parser.cs ../VBNet - -rm cs.ATG -rm VBNET.ATG - -cd .. diff --git a/VB/Project/Parser/trace.txt b/VB/Project/Parser/trace.txt index fdffed2e3d..305afd1455 100644 --- a/VB/Project/Parser/trace.txt +++ b/VB/Project/Parser/trace.txt @@ -1961,682 +1961,684 @@ Graph nodes: 1955 nt VariableDecl -1956 89849 3058 1956 iter 1957 0 1954 3058 1957 sem 0 89895 0 -1958 t "Exit" 1959 3074 -1959 sem 1964 90208 0 -1960 t "Sub" 1961 3076 -1961 sem -1984 90266 0 -1962 t "Function" 1963 3078 -1963 sem -1984 90318 0 -1964 alt 1984 1965 1960 3076 -1965 alt -1984 1968 1962 3078 -1966 t "Property" 1967 3080 -1967 sem -1984 90375 0 -1968 alt -1984 1971 1966 3080 -1969 t "Do" 1970 3082 -1970 sem -1984 90427 0 -1971 alt -1984 1974 1969 3082 -1972 t "For" 1973 3084 -1973 sem -1984 90474 0 -1974 alt -1984 1977 1972 3084 -1975 t "Try" 1976 3086 -1976 sem -1984 90522 0 -1977 alt -1984 1980 1975 3086 -1978 t "While" 1979 3088 -1979 sem -1984 90572 0 -1980 alt -1984 1983 1978 3088 -1981 t "Select" 1982 3090 -1982 sem -1984 90624 0 -1983 alt -1984 0 1981 3090 -1984 sem -2251 90665 0 -1985 nt TryStatement -2251 90726 3093 -1986 alt 2251 1987 1958 3074 -1987 alt -2251 2001 1985 3093 -1988 t "Continue" 1989 3094 -1989 sem 1999 90759 0 -1990 t "Do" 1991 3094 -1991 sem -2000 90819 0 -1992 t "For" 1993 3094 -1993 sem -2000 90865 0 -1994 alt -2000 1995 1990 3094 -1995 alt -2000 1998 1992 3094 -1996 t "While" 1997 3094 -1997 sem -2000 90914 0 -1998 alt -2000 0 1996 3094 -1999 opt 2000 0 1994 3094 -2000 sem -2251 90956 0 -2001 alt -2251 2006 1988 3094 -2002 t "Throw" 2004 3096 -2003 nt Expr -2005 91045 3096 -2004 opt 2005 0 2003 3096 -2005 sem -2251 91063 0 -2006 alt -2251 2011 2002 3096 -2007 t "Return" 2009 3098 -2008 nt Expr -2010 91138 3098 -2009 opt 2010 0 2008 3098 -2010 sem -2251 91156 0 -2011 alt -2251 2019 2007 3098 -2012 t "SyncLock" 2013 3100 -2013 nt Expr 2014 91231 3100 -2014 nt EndOfStmt 2015 3100 -2015 nt Block 2016 91257 3100 -2016 t "End" 2017 3101 -2017 t "SyncLock" 2018 3101 -2018 sem -2251 91308 0 -2019 alt -2251 2029 2012 3100 -2020 t "RaiseEvent" 2021 3103 -2021 nt Identifier 2022 3103 -2022 sem 2027 91413 0 -2023 t "(" 2025 3104 -2024 nt ArgumentList -2026 91453 3104 -2025 opt 2026 0 2024 3104 -2026 t ")" -2028 3104 -2027 opt 2028 0 2023 3104 -2028 sem -2251 91476 0 -2029 alt -2251 2031 2020 3103 -2030 nt WithStatemen -2251 91558 3109 -2031 alt -2251 2038 2030 3109 -2032 t "AddHandler" 2033 3111 -2033 sem 2034 91608 0 -2034 nt Expr 2035 91649 3112 -2035 t "," 2036 3112 -2036 nt Expr 2037 91668 3112 -2037 sem -2251 91693 0 -2038 alt -2251 2045 2032 3111 -2039 t "RemoveHandl 2040 3117 -2040 sem 2041 91792 0 -2041 nt Expr 2042 91833 3118 -2042 t "," 2043 3118 -2043 nt Expr 2044 91852 3118 -2044 sem -2251 91877 0 -2045 alt -2251 2053 2039 3117 -2046 t "While" 2047 3123 -2047 nt Expr 2048 91973 3123 -2048 nt EndOfStmt 2049 3123 -2049 nt Block 2050 92001 3124 -2050 t "End" 2051 3124 -2051 t "While" 2052 3124 -2052 sem -2251 92046 0 -2053 alt -2251 2071 2046 3123 -2054 t "Do" 2055 3129 -2055 sem 2069 92187 0 -2056 nt WhileOrUntil 2057 92262 3134 -2057 nt Expr 2058 92286 3134 -2058 nt EndOfStmt 2059 3134 -2059 nt Block 2060 92315 3135 -2060 t "Loop" 2061 3136 -2061 sem -2251 92358 0 -2062 nt EndOfStmt 2063 3144 -2063 nt Block 2064 92663 3145 -2064 t "Loop" 2067 3146 -2065 nt WhileOrUntil 2066 92710 3146 -2066 nt Expr -2068 92734 3146 -2067 opt 2068 0 2065 3146 -2068 sem -2251 92755 0 -2069 alt -2251 2070 2056 3134 -2070 alt -2251 0 2062 3144 -2071 alt -2251 2111 2054 3129 -2072 t "For" 2073 3151 -2073 sem 2109 92880 0 -2074 t "Each" 2075 3159 -2075 nt LoopControlV 2076 93023 3159 -2076 t "In" 2077 3160 -2077 nt Expr 2078 93069 3160 -2078 nt EndOfStmt 2079 3160 -2079 nt Block 2080 93099 3161 -2080 t "Next" 2082 3162 -2081 nt Expr -2083 93139 3162 -2082 opt 2083 0 2081 3162 -2083 sem -2251 93161 0 -2084 sem 2089 93532 0 -2085 rslv 2086 3182 -2086 nt LoopControlV -2091 93793 3183 -2087 sem 2088 93838 0 -2088 nt SimpleExpr -2091 93895 3186 -2089 alt 2091 2090 2085 3182 -2090 alt -2091 0 2087 0 -2091 t "=" 2092 3188 -2092 nt Expr 2093 93930 3188 -2093 t "To" 2094 3188 -2094 nt Expr 2097 93951 3188 -2095 t "Step" 2096 3188 -2096 nt Expr -2098 93974 3188 -2097 opt 2098 0 2095 3188 -2098 nt EndOfStmt 2099 3189 -2099 nt Block 2100 94005 3189 -2100 t "Next" 2107 3190 -2101 nt Expr 2102 94052 3192 -2102 sem 2106 94078 0 -2103 t "," 2104 3197 -2104 nt Expr 2105 94178 3197 -2105 sem -2106 94195 0 -2106 iter -2108 0 2103 3197 -2107 opt 2108 0 2101 3191 -2108 sem -2251 94246 0 -2109 alt -2251 2110 2074 3159 -2110 alt -2251 0 2084 0 -2111 alt -2251 2115 2072 3151 -2112 t "Error" 2113 3213 -2113 nt Expr 2114 94585 3213 -2114 sem -2251 94602 0 -2115 alt -2251 2127 2112 3213 -2116 t "ReDim" 2117 3215 -2117 sem 2120 94674 0 -2118 t "Preserve" 2119 3215 -2119 sem -2121 94718 0 -2120 opt 2121 0 2118 3215 -2121 nt ReDimClause 2122 94756 3216 -2122 sem 2126 94774 0 -2123 t "," 2124 3222 -2124 nt ReDimClause 2125 94981 3222 -2125 sem -2126 94997 0 -2126 iter -2251 0 2123 3222 -2127 alt -2251 2136 2116 3215 -2128 t "Erase" 2129 3226 -2129 nt Expr 2130 95123 3227 -2130 sem 2134 95141 0 -2131 t "," 2132 3232 -2132 nt Expr 2133 95296 3232 -2133 sem -2134 95309 0 -2134 iter 2135 0 2131 3232 -2135 sem -2251 95399 0 -2136 alt -2251 2139 2128 3226 -2137 t "Stop" 2138 3235 -2138 sem -2251 95458 0 -2139 alt -2251 2183 2137 3235 -2140 rslv 2141 3237 -2141 t "If" 2142 3238 -2142 sem 2143 95550 0 -2143 nt Expr 2145 95597 3238 -2144 t "Then" -2181 3238 -2145 opt 2181 0 2144 3238 -2146 nt EndOfStmt 2147 3241 -2147 nt Block 2148 95675 3241 -2148 sem 2164 95708 0 -2149 rslv 2150 3249 -2150 t "Else" 2151 3249 -2151 sem 2152 95906 0 -2152 t "If" -2157 3249 -2153 t "ElseIf" 2154 3250 -2154 sem -2157 95960 0 -2155 alt 2157 2156 2149 3249 -2156 alt -2157 0 2153 3250 -2157 sem 2158 96002 0 -2158 nt Expr 2160 96067 3253 -2159 t "Then" -2161 3253 -2160 opt 2161 0 2159 3253 -2161 nt EndOfStmt 2162 3253 -2162 nt Block 2163 96112 3254 -2163 sem -2164 96135 0 -2164 iter 2170 0 2155 3247 -2165 t "Else" 2167 3264 -2166 nt EndOfStmt -2168 3264 -2167 opt 2168 0 2166 3264 -2168 nt Block 2169 96438 3265 -2169 sem -2171 96473 0 -2170 opt 2171 0 2165 3263 -2171 t "End" 2172 3269 -2172 t "If" 2173 3269 -2173 sem -2251 96557 0 -2174 sem 2175 96674 0 -2175 nt SingleLineSt 2179 96813 3279 -2176 t "Else" 2178 3281 -2177 nt SingleLineSt -2180 96886 3282 -2178 opt -2180 0 2177 3282 -2179 opt 2180 0 2176 3280 -2180 sem -2251 96927 0 -2181 alt -2251 2182 2146 3241 -2182 alt -2251 0 2174 0 -2183 alt -2251 2204 2140 3237 -2184 t "Select" 2186 3287 -2185 t "Case" -2187 3287 -2186 opt 2187 0 2185 3287 -2187 nt Expr 2188 97041 3287 -2188 nt EndOfStmt 2189 3287 -2189 sem 2200 97065 0 -2190 sem 2191 97170 0 -2191 t "Case" 2192 3293 -2192 nt CaseClauses 2195 97268 3293 -2193 rslv 2194 3293 -2194 t ":" -2196 3293 -2195 opt 2196 0 2193 3293 -2196 nt EndOfStmt 2197 3293 -2197 sem 2198 97343 0 -2198 nt Block 2199 97468 3298 -2199 sem -2200 97489 0 -2200 iter 2201 0 2190 3291 -2201 sem 2202 97634 0 -2202 t "End" 2203 3308 -2203 t "Select" -2251 3308 -2204 alt -2251 2208 2184 3287 -2205 sem 2206 97718 0 -2206 nt OnErrorState 2207 97782 3310 -2207 sem -2251 97807 0 -2208 alt -2251 2212 2205 0 -2209 sem 2210 97847 0 -2210 nt GotoStatemen 2211 97902 3312 -2211 sem -2251 97924 0 -2212 alt -2251 2216 2209 0 -2213 sem 2214 97961 0 -2214 nt ResumeStatem 2215 98022 3314 -2215 sem -2251 98046 0 -2216 alt -2251 2226 2213 0 -2217 sem 2218 98167 0 -2218 nt SimpleExpr 2223 98438 3324 -2219 nt AssignmentOp 2220 98475 3326 -2220 nt Expr 2221 98488 3326 -2221 sem -2225 98507 0 -2222 sem -2225 98642 0 -2223 alt 2225 2224 2219 3326 -2224 alt -2225 0 2222 0 -2225 sem -2251 98835 0 -2226 alt -2251 2230 2217 0 -2227 t "Call" 2228 3345 -2228 nt SimpleExpr 2229 99151 3345 -2229 sem -2251 99164 0 -2230 alt -2251 2248 2227 3345 -2231 t "Using" 2232 3346 -2232 sem 2244 99228 0 -2233 rslv 2234 3348 -2234 sem 2235 99292 0 -2235 nt VariableDecl 2238 99410 3350 -2236 t "," 2237 3351 -2237 nt VariableDecl -2238 99475 3352 -2238 iter 2239 0 2236 3351 -2239 nt Block 2240 99521 3354 -2240 sem -2246 99544 0 -2241 nt Expr 2242 99620 3358 -2242 nt Block 2243 99640 3359 -2243 sem -2246 99658 0 -2244 alt 2246 2245 2233 3348 -2245 alt -2246 0 2241 3358 -2246 t "End" 2247 3362 -2247 t "Using" -2251 3362 -2248 alt -2251 2250 2231 3346 -2249 nt LocalDeclara -2251 99783 3363 -2250 alt -2251 0 2249 3363 -2251 sem 0 99807 0 -2252 t "End" 2253 3378 -2253 sem -2257 100043 0 -2254 nt EmbeddedStat -2257 100168 3379 -2255 alt 2257 2256 2252 3378 -2256 alt -2257 0 2254 3379 -2257 sem 2267 100198 0 -2258 t ":" 2260 3381 -2259 t ":" -2260 3381 -2260 iter 2264 0 2259 3381 -2261 t "End" 2262 3382 -2262 sem -2266 100291 0 -2263 nt EmbeddedStat -2266 100417 3383 -2264 alt 2266 2265 2261 3382 -2265 alt -2266 0 2263 3383 -2266 sem -2267 100448 0 -2267 iter 0 0 2258 3381 -2268 nt Qualident 2271 100666 3394 -2269 rslv 2270 3395 -2270 nt ArrayTypeMod -2275 100712 3395 -2271 opt 2275 0 2269 3395 -2272 t "As" 2273 3396 -2273 nt TypeName 2274 100752 3396 -2274 sem -2276 100765 0 -2275 opt 2276 0 2272 3396 -2276 sem 0 100870 0 -2277 t "On" 2278 3416 -2278 t "Error" 2286 3416 -2279 rslv 2280 3418 -2280 t "GoTo" 2281 3418 -2281 t "-" 2282 3418 -2282 t LiteralInteg 2283 3418 -2283 sem -2292 101385 0 -2284 nt GotoStatemen 2285 101608 3426 -2285 sem -2292 101637 0 -2286 alt 2292 2287 2279 3418 -2287 alt -2292 2291 2284 3426 -2288 t "Resume" 2289 3440 -2289 t "Next" 2290 3440 -2290 sem -2292 101963 0 -2291 alt -2292 0 2288 3440 -2292 sem 0 102037 0 -2293 t "GoTo" 2294 3457 -2294 nt LabelName 2295 102310 3457 -2295 sem 0 102329 0 -2296 nt Identifier 2297 3471 -2297 sem -0 102551 0 -2298 t LiteralInteg 2299 3472 -2299 sem -0 102590 0 -2300 alt 0 2301 2296 3471 -2301 alt -0 0 2298 3472 -2302 nt SimpleNonInv 2303 102697 3478 -2303 nt ReDimClauseI 0 102729 3479 -2304 t "." 2305 3485 -2305 nt IdentifierOr 2306 102938 3485 -2306 sem -2312 102951 0 -2307 rslv 2308 3486 -2308 nt InvocationEx 2309 103164 3487 -2309 sem -2312 103184 0 -2310 alt -2312 2311 2304 3485 -2311 alt -2312 0 2307 3486 -2312 iter 2313 0 2310 3485 -2313 t "(" 2314 3493 -2314 nt NormalOrReDi 2315 103302 3494 -2315 t ")" 2316 3495 -2316 sem 0 103361 0 -2317 rslv 2318 3512 -2318 t "Resume" 2319 3513 -2319 t "Next" 2320 3513 -2320 sem -0 103874 0 -2321 t "Resume" 2323 3514 -2322 nt LabelName -2324 103947 3514 -2323 opt 2324 0 2322 3514 -2324 sem -0 103963 0 -2325 alt 0 2326 2317 3512 -2326 alt -0 0 2321 3514 -2327 nt CaseClause 2328 104177 3523 -2328 sem 2332 104196 0 -2329 t "," 2330 3524 -2330 nt CaseClause 2331 104275 3524 -2331 sem -2332 104294 0 -2332 iter 0 0 2329 3524 -2333 t "Else" 2334 3535 -2334 sem -0 104569 0 -2335 t "Is" -2341 3538 -2336 opt 2341 0 2335 3538 -2337 t "<" 2338 3540 -2338 sem -2355 104633 0 -2339 t ">" 2340 3541 -2340 sem -2355 104682 0 -2341 alt 2355 2342 2337 3540 -2342 alt -2355 2345 2339 3541 -2343 t "<=" 2344 3542 -2344 sem -2355 104735 0 -2345 alt -2355 2348 2343 3542 -2346 t ">=" 2347 3543 -2347 sem -2355 104792 0 -2348 alt -2355 2351 2346 3543 -2349 t "=" 2350 3544 -2350 sem -2355 104851 0 -2351 alt -2355 2354 2349 3544 -2352 t "<>" 2353 3545 -2353 sem -2355 104901 0 -2354 alt -2355 0 2352 3545 -2355 nt Expr 2356 104951 3547 -2356 sem -0 104969 0 -2357 alt 0 2358 2333 3535 -2358 alt -0 2364 2336 3538 -2359 nt Expr 2362 105021 3551 -2360 t "To" 2361 3551 -2361 nt Expr -2363 105043 3551 -2362 opt 2363 0 2360 3551 -2363 sem -0 105064 0 -2364 alt -0 0 2359 3551 -2365 t "While" 2366 3560 -2366 sem -0 105237 0 -2367 t "Until" 2368 3561 -2368 sem -0 105292 0 -2369 alt 0 2370 2365 3560 -2370 alt -0 0 2367 3561 -2371 t "With" 2372 3570 -2372 sem 2373 105476 0 -2373 nt Expr 2374 105515 3571 -2374 nt EndOfStmt 2375 3571 -2375 sem 2376 105543 0 -2376 nt Block 2377 105637 3576 +1958 nt ExitStatemen -2213 90206 3073 +1959 nt TryStatement -2213 90238 3074 +1960 alt 2213 1961 1958 3073 +1961 alt -2213 1963 1959 3074 +1962 nt ContinueStat -2213 90275 3075 +1963 alt -2213 1968 1962 3075 +1964 t "Throw" 1966 3077 +1965 nt Expr -1967 90327 3077 +1966 opt 1967 0 1965 3077 +1967 sem -2213 90345 0 +1968 alt -2213 1973 1964 3077 +1969 t "Return" 1971 3079 +1970 nt Expr -1972 90420 3079 +1971 opt 1972 0 1970 3079 +1972 sem -2213 90438 0 +1973 alt -2213 1981 1969 3079 +1974 t "SyncLock" 1975 3081 +1975 nt Expr 1976 90513 3081 +1976 nt EndOfStmt 1977 3081 +1977 nt Block 1978 90539 3081 +1978 t "End" 1979 3082 +1979 t "SyncLock" 1980 3082 +1980 sem -2213 90590 0 +1981 alt -2213 1991 1974 3081 +1982 t "RaiseEvent" 1983 3084 +1983 nt Identifier 1984 3084 +1984 sem 1989 90695 0 +1985 t "(" 1987 3085 +1986 nt ArgumentList -1988 90735 3085 +1987 opt 1988 0 1986 3085 +1988 t ")" -1990 3085 +1989 opt 1990 0 1985 3085 +1990 sem -2213 90758 0 +1991 alt -2213 1993 1982 3084 +1992 nt WithStatemen -2213 90840 3090 +1993 alt -2213 2000 1992 3090 +1994 t "AddHandler" 1995 3092 +1995 sem 1996 90890 0 +1996 nt Expr 1997 90931 3093 +1997 t "," 1998 3093 +1998 nt Expr 1999 90950 3093 +1999 sem -2213 90975 0 +2000 alt -2213 2007 1994 3092 +2001 t "RemoveHandl 2002 3098 +2002 sem 2003 91074 0 +2003 nt Expr 2004 91115 3099 +2004 t "," 2005 3099 +2005 nt Expr 2006 91134 3099 +2006 sem -2213 91159 0 +2007 alt -2213 2015 2001 3098 +2008 t "While" 2009 3104 +2009 nt Expr 2010 91255 3104 +2010 nt EndOfStmt 2011 3104 +2011 nt Block 2012 91283 3105 +2012 t "End" 2013 3105 +2013 t "While" 2014 3105 +2014 sem -2213 91328 0 +2015 alt -2213 2033 2008 3104 +2016 t "Do" 2017 3110 +2017 sem 2031 91469 0 +2018 nt WhileOrUntil 2019 91544 3115 +2019 nt Expr 2020 91568 3115 +2020 nt EndOfStmt 2021 3115 +2021 nt Block 2022 91597 3116 +2022 t "Loop" 2023 3117 +2023 sem -2213 91640 0 +2024 nt EndOfStmt 2025 3125 +2025 nt Block 2026 91945 3126 +2026 t "Loop" 2029 3127 +2027 nt WhileOrUntil 2028 91992 3127 +2028 nt Expr -2030 92016 3127 +2029 opt 2030 0 2027 3127 +2030 sem -2213 92037 0 +2031 alt -2213 2032 2018 3115 +2032 alt -2213 0 2024 3125 +2033 alt -2213 2073 2016 3110 +2034 t "For" 2035 3132 +2035 sem 2071 92162 0 +2036 t "Each" 2037 3140 +2037 nt LoopControlV 2038 92305 3140 +2038 t "In" 2039 3141 +2039 nt Expr 2040 92351 3141 +2040 nt EndOfStmt 2041 3141 +2041 nt Block 2042 92381 3142 +2042 t "Next" 2044 3143 +2043 nt Expr -2045 92421 3143 +2044 opt 2045 0 2043 3143 +2045 sem -2213 92443 0 +2046 sem 2051 92814 0 +2047 rslv 2048 3163 +2048 nt LoopControlV -2053 93075 3164 +2049 sem 2050 93120 0 +2050 nt SimpleExpr -2053 93177 3167 +2051 alt 2053 2052 2047 3163 +2052 alt -2053 0 2049 0 +2053 t "=" 2054 3169 +2054 nt Expr 2055 93212 3169 +2055 t "To" 2056 3169 +2056 nt Expr 2059 93233 3169 +2057 t "Step" 2058 3169 +2058 nt Expr -2060 93256 3169 +2059 opt 2060 0 2057 3169 +2060 nt EndOfStmt 2061 3170 +2061 nt Block 2062 93287 3170 +2062 t "Next" 2069 3171 +2063 nt Expr 2064 93334 3173 +2064 sem 2068 93360 0 +2065 t "," 2066 3178 +2066 nt Expr 2067 93460 3178 +2067 sem -2068 93477 0 +2068 iter -2070 0 2065 3178 +2069 opt 2070 0 2063 3172 +2070 sem -2213 93528 0 +2071 alt -2213 2072 2036 3140 +2072 alt -2213 0 2046 0 +2073 alt -2213 2077 2034 3132 +2074 t "Error" 2075 3194 +2075 nt Expr 2076 93867 3194 +2076 sem -2213 93884 0 +2077 alt -2213 2089 2074 3194 +2078 t "ReDim" 2079 3196 +2079 sem 2082 93956 0 +2080 t "Preserve" 2081 3196 +2081 sem -2083 94000 0 +2082 opt 2083 0 2080 3196 +2083 nt ReDimClause 2084 94038 3197 +2084 sem 2088 94056 0 +2085 t "," 2086 3203 +2086 nt ReDimClause 2087 94263 3203 +2087 sem -2088 94279 0 +2088 iter -2213 0 2085 3203 +2089 alt -2213 2098 2078 3196 +2090 t "Erase" 2091 3207 +2091 nt Expr 2092 94405 3208 +2092 sem 2096 94423 0 +2093 t "," 2094 3213 +2094 nt Expr 2095 94578 3213 +2095 sem -2096 94591 0 +2096 iter 2097 0 2093 3213 +2097 sem -2213 94681 0 +2098 alt -2213 2101 2090 3207 +2099 t "Stop" 2100 3216 +2100 sem -2213 94740 0 +2101 alt -2213 2145 2099 3216 +2102 rslv 2103 3218 +2103 t "If" 2104 3219 +2104 sem 2105 94832 0 +2105 nt Expr 2107 94879 3219 +2106 t "Then" -2143 3219 +2107 opt 2143 0 2106 3219 +2108 nt EndOfStmt 2109 3222 +2109 nt Block 2110 94957 3222 +2110 sem 2126 94990 0 +2111 rslv 2112 3230 +2112 t "Else" 2113 3230 +2113 sem 2114 95188 0 +2114 t "If" -2119 3230 +2115 t "ElseIf" 2116 3231 +2116 sem -2119 95242 0 +2117 alt 2119 2118 2111 3230 +2118 alt -2119 0 2115 3231 +2119 sem 2120 95284 0 +2120 nt Expr 2122 95349 3234 +2121 t "Then" -2123 3234 +2122 opt 2123 0 2121 3234 +2123 nt EndOfStmt 2124 3234 +2124 nt Block 2125 95394 3235 +2125 sem -2126 95417 0 +2126 iter 2132 0 2117 3228 +2127 t "Else" 2129 3245 +2128 nt EndOfStmt -2130 3245 +2129 opt 2130 0 2128 3245 +2130 nt Block 2131 95720 3246 +2131 sem -2133 95755 0 +2132 opt 2133 0 2127 3244 +2133 t "End" 2134 3250 +2134 t "If" 2135 3250 +2135 sem -2213 95839 0 +2136 sem 2137 95956 0 +2137 nt SingleLineSt 2141 96095 3260 +2138 t "Else" 2140 3262 +2139 nt SingleLineSt -2142 96168 3263 +2140 opt -2142 0 2139 3263 +2141 opt 2142 0 2138 3261 +2142 sem -2213 96209 0 +2143 alt -2213 2144 2108 3222 +2144 alt -2213 0 2136 0 +2145 alt -2213 2166 2102 3218 +2146 t "Select" 2148 3268 +2147 t "Case" -2149 3268 +2148 opt 2149 0 2147 3268 +2149 nt Expr 2150 96323 3268 +2150 nt EndOfStmt 2151 3268 +2151 sem 2162 96347 0 +2152 sem 2153 96452 0 +2153 t "Case" 2154 3274 +2154 nt CaseClauses 2157 96550 3274 +2155 rslv 2156 3274 +2156 t ":" -2158 3274 +2157 opt 2158 0 2155 3274 +2158 nt EndOfStmt 2159 3274 +2159 sem 2160 96625 0 +2160 nt Block 2161 96750 3279 +2161 sem -2162 96771 0 +2162 iter 2163 0 2152 3272 +2163 sem 2164 96916 0 +2164 t "End" 2165 3289 +2165 t "Select" -2213 3289 +2166 alt -2213 2170 2146 3268 +2167 sem 2168 97000 0 +2168 nt OnErrorState 2169 97064 3291 +2169 sem -2213 97089 0 +2170 alt -2213 2174 2167 0 +2171 sem 2172 97129 0 +2172 nt GotoStatemen 2173 97184 3293 +2173 sem -2213 97206 0 +2174 alt -2213 2178 2171 0 +2175 sem 2176 97243 0 +2176 nt ResumeStatem 2177 97304 3295 +2177 sem -2213 97328 0 +2178 alt -2213 2188 2175 0 +2179 sem 2180 97449 0 +2180 nt SimpleExpr 2185 97720 3305 +2181 nt AssignmentOp 2182 97757 3307 +2182 nt Expr 2183 97770 3307 +2183 sem -2187 97789 0 +2184 sem -2187 97924 0 +2185 alt 2187 2186 2181 3307 +2186 alt -2187 0 2184 0 +2187 sem -2213 98117 0 +2188 alt -2213 2192 2179 0 +2189 t "Call" 2190 3326 +2190 nt SimpleExpr 2191 98433 3326 +2191 sem -2213 98446 0 +2192 alt -2213 2210 2189 3326 +2193 t "Using" 2194 3327 +2194 sem 2206 98510 0 +2195 rslv 2196 3329 +2196 sem 2197 98574 0 +2197 nt VariableDecl 2200 98692 3331 +2198 t "," 2199 3332 +2199 nt VariableDecl -2200 98757 3333 +2200 iter 2201 0 2198 3332 +2201 nt Block 2202 98803 3335 +2202 sem -2208 98826 0 +2203 nt Expr 2204 98902 3339 +2204 nt Block 2205 98922 3340 +2205 sem -2208 98940 0 +2206 alt 2208 2207 2195 3329 +2207 alt -2208 0 2203 3339 +2208 t "End" 2209 3343 +2209 t "Using" -2213 3343 +2210 alt -2213 2212 2193 3327 +2211 nt LocalDeclara -2213 99065 3344 +2212 alt -2213 0 2211 3344 +2213 sem 0 99089 0 +2214 t "Exit" 2215 3355 +2215 sem 2220 99270 0 +2216 t "Sub" 2217 3356 +2217 sem -2240 99322 0 +2218 t "Function" 2219 3357 +2219 sem -2240 99368 0 +2220 alt 2240 2221 2216 3356 +2221 alt -2240 2224 2218 3357 +2222 t "Property" 2223 3358 +2223 sem -2240 99419 0 +2224 alt -2240 2227 2222 3358 +2225 t "Do" 2226 3359 +2226 sem -2240 99466 0 +2227 alt -2240 2230 2225 3359 +2228 t "For" 2229 3360 +2229 sem -2240 99507 0 +2230 alt -2240 2233 2228 3360 +2231 t "Try" 2232 3361 +2232 sem -2240 99549 0 +2233 alt -2240 2236 2231 3361 +2234 t "While" 2235 3362 +2235 sem -2240 99593 0 +2236 alt -2240 2239 2234 3362 +2237 t "Select" 2238 3363 +2238 sem -2240 99640 0 +2239 alt -2240 0 2237 3363 +2240 sem 0 99678 0 +2241 t "Continue" 2242 3368 +2242 sem 2252 99789 0 +2243 t "Do" 2244 3369 +2244 sem -2253 99851 0 +2245 t "For" 2246 3370 +2246 sem -2253 99899 0 +2247 alt -2253 2248 2243 3369 +2248 alt -2253 2251 2245 3370 +2249 t "While" 2250 3371 +2250 sem -2253 99950 0 +2251 alt -2253 0 2249 3371 +2252 opt 2253 0 2247 3369 +2253 sem 0 99995 0 +2254 t "End" 2255 3378 +2255 sem -2259 100160 0 +2256 nt EmbeddedStat -2259 100285 3379 +2257 alt 2259 2258 2254 3378 +2258 alt -2259 0 2256 3379 +2259 sem 2269 100315 0 +2260 t ":" 2262 3381 +2261 t ":" -2262 3381 +2262 iter 2266 0 2261 3381 +2263 t "End" 2264 3382 +2264 sem -2268 100408 0 +2265 nt EmbeddedStat -2268 100534 3383 +2266 alt 2268 2267 2263 3382 +2267 alt -2268 0 2265 3383 +2268 sem -2269 100565 0 +2269 iter 0 0 2260 3381 +2270 nt Qualident 2273 100783 3394 +2271 rslv 2272 3395 +2272 nt ArrayTypeMod -2277 100829 3395 +2273 opt 2277 0 2271 3395 +2274 t "As" 2275 3396 +2275 nt TypeName 2276 100869 3396 +2276 sem -2278 100882 0 +2277 opt 2278 0 2274 3396 +2278 sem 0 100987 0 +2279 t "On" 2280 3416 +2280 t "Error" 2288 3416 +2281 rslv 2282 3418 +2282 t "GoTo" 2283 3418 +2283 t "-" 2284 3418 +2284 t LiteralInteg 2285 3418 +2285 sem -2294 101502 0 +2286 nt GotoStatemen 2287 101725 3426 +2287 sem -2294 101754 0 +2288 alt 2294 2289 2281 3418 +2289 alt -2294 2293 2286 3426 +2290 t "Resume" 2291 3440 +2291 t "Next" 2292 3440 +2292 sem -2294 102080 0 +2293 alt -2294 0 2290 3440 +2294 sem 0 102154 0 +2295 t "GoTo" 2296 3457 +2296 nt LabelName 2297 102427 3457 +2297 sem 0 102446 0 +2298 nt Identifier 2299 3471 +2299 sem -0 102668 0 +2300 t LiteralInteg 2301 3472 +2301 sem -0 102707 0 +2302 alt 0 2303 2298 3471 +2303 alt -0 0 2300 3472 +2304 nt SimpleNonInv 2305 102814 3478 +2305 nt ReDimClauseI 0 102846 3479 +2306 t "." 2307 3485 +2307 nt IdentifierOr 2308 103055 3485 +2308 sem -2314 103068 0 +2309 rslv 2310 3486 +2310 nt InvocationEx 2311 103281 3487 +2311 sem -2314 103301 0 +2312 alt -2314 2313 2306 3485 +2313 alt -2314 0 2309 3486 +2314 iter 2315 0 2312 3485 +2315 t "(" 2316 3493 +2316 nt NormalOrReDi 2317 103419 3494 +2317 t ")" 2318 3495 +2318 sem 0 103478 0 +2319 rslv 2320 3512 +2320 t "Resume" 2321 3513 +2321 t "Next" 2322 3513 +2322 sem -0 103991 0 +2323 t "Resume" 2325 3514 +2324 nt LabelName -2326 104064 3514 +2325 opt 2326 0 2324 3514 +2326 sem -0 104080 0 +2327 alt 0 2328 2319 3512 +2328 alt -0 0 2323 3514 +2329 nt CaseClause 2330 104294 3523 +2330 sem 2334 104313 0 +2331 t "," 2332 3524 +2332 nt CaseClause 2333 104392 3524 +2333 sem -2334 104411 0 +2334 iter 0 0 2331 3524 +2335 t "Else" 2336 3535 +2336 sem -0 104686 0 +2337 t "Is" -2343 3538 +2338 opt 2343 0 2337 3538 +2339 t "<" 2340 3540 +2340 sem -2357 104750 0 +2341 t ">" 2342 3541 +2342 sem -2357 104799 0 +2343 alt 2357 2344 2339 3540 +2344 alt -2357 2347 2341 3541 +2345 t "<=" 2346 3542 +2346 sem -2357 104852 0 +2347 alt -2357 2350 2345 3542 +2348 t ">=" 2349 3543 +2349 sem -2357 104909 0 +2350 alt -2357 2353 2348 3543 +2351 t "=" 2352 3544 +2352 sem -2357 104968 0 +2353 alt -2357 2356 2351 3544 +2354 t "<>" 2355 3545 +2355 sem -2357 105018 0 +2356 alt -2357 0 2354 3545 +2357 nt Expr 2358 105068 3547 +2358 sem -0 105086 0 +2359 alt 0 2360 2335 3535 +2360 alt -0 2366 2338 3538 +2361 nt Expr 2364 105138 3551 +2362 t "To" 2363 3551 +2363 nt Expr -2365 105160 3551 +2364 opt 2365 0 2362 3551 +2365 sem -0 105181 0 +2366 alt -0 0 2361 3551 +2367 t "While" 2368 3560 +2368 sem -0 105354 0 +2369 t "Until" 2370 3561 +2370 sem -0 105409 0 +2371 alt 0 2372 2367 3560 +2372 alt -0 0 2369 3561 +2373 t "With" 2374 3570 +2374 sem 2375 105593 0 +2375 nt Expr 2376 105632 3571 +2376 nt EndOfStmt 2377 3571 2377 sem 2378 105660 0 -2378 t "End" 2379 3580 -2379 t "With" 2380 3580 -2380 sem 0 105750 0 -2381 t "Try" 2382 3589 -2382 nt EndOfStmt 2383 3589 -2383 nt Block 2385 105984 3590 -2384 nt CatchClauses -2389 106015 3591 -2385 opt 2389 0 2384 3591 -2386 t "Finally" 2387 3592 -2387 nt EndOfStmt 2388 3592 -2388 nt Block -2390 106063 3592 -2389 opt 2390 0 2386 3592 -2390 t "End" 2391 3593 -2391 t "Try" 2392 3593 -2392 sem 0 106104 0 -2393 t "Catch" 2399 3609 -2394 nt Identifier 2395 3610 -2395 sem 2398 106468 0 -2396 t "As" 2397 3610 -2397 nt TypeName -2402 106500 3610 -2398 opt -2402 0 2396 3610 -2399 opt 2402 0 2394 3610 -2400 t "When" 2401 3611 -2401 nt Expr -2403 106530 3611 -2402 opt 2403 0 2400 3611 -2403 nt EndOfStmt 2404 3612 -2404 nt Block 2405 106564 3613 -2405 sem -2406 106585 0 -2406 iter 0 0 2393 3608 -2407 nt Identifier 2408 3625 -2408 sem 2413 106781 0 -2409 rslv 2410 3626 -2410 t "." 2411 3626 -2411 nt IdentifierOr 2412 106867 3626 -2412 sem -2413 106880 0 -2413 iter 2414 0 2409 3626 -2414 sem 0 106954 0 -2415 nt IdentifierFo -0 3633 -2416 t "Custom" -0 3634 -2417 alt 0 2418 2415 3633 -2418 alt -0 0 2416 3634 -2419 t ident -0 3638 -2420 t "Aggregate" -0 3639 -2421 alt 0 2422 2419 3638 -2422 alt -0 2424 2420 3639 -2423 t "Ansi" -0 3640 -2424 alt -0 2426 2423 3640 -2425 t "Ascending" -0 3641 -2426 alt -0 2428 2425 3641 -2427 t "Assembly" -0 3642 -2428 alt -0 2430 2427 3642 -2429 t "Auto" -0 3643 -2430 alt -0 2432 2429 3643 -2431 t "Binary" -0 3644 -2432 alt -0 2434 2431 3644 -2433 t "By" -0 3645 -2434 alt -0 2436 2433 3645 -2435 t "Compare" -0 3646 -2436 alt -0 2438 2435 3646 -2437 t "Descending" -0 3647 -2438 alt -0 2440 2437 3647 -2439 t "Distinct" -0 3648 -2440 alt -0 2442 2439 3648 -2441 t "Equals" -0 3649 -2442 alt -0 2444 2441 3649 -2443 t "Explicit" -0 3650 -2444 alt -0 2446 2443 3650 -2445 t "From" -0 3651 -2446 alt -0 2448 2445 3651 -2447 t "Group" -0 3652 -2448 alt -0 2450 2447 3652 -2449 t "Infer" -0 3653 -2450 alt -0 2452 2449 3653 -2451 t "Into" -0 3654 -2452 alt -0 2454 2451 3654 -2453 t "Join" -0 3655 -2454 alt -0 2456 2453 3655 -2455 t "Key" -0 3656 -2456 alt -0 2458 2455 3656 -2457 t "Off" -0 3657 -2458 alt -0 2460 2457 3657 -2459 t "Order" -0 3658 -2460 alt -0 2462 2459 3658 -2461 t "Out" -0 3659 -2462 alt -0 2464 2461 3659 -2463 t "Preserve" -0 3660 -2464 alt -0 2466 2463 3660 -2465 t "Skip" -0 3661 -2466 alt -0 2468 2465 3661 -2467 t "Take" -0 3662 -2468 alt -0 2470 2467 3662 -2469 t "Text" -0 3663 -2470 alt -0 2472 2469 3663 -2471 t "Unicode" -0 3664 -2472 alt -0 2474 2471 3664 -2473 t "Until" -0 3665 -2474 alt -0 2476 2473 3665 -2475 t "Where" -0 3666 -2476 alt -0 0 2475 3666 -2477 any 2478 3673 -2478 sem 0 107605 0 -2479 t "Boolean" 2480 3680 -2480 sem -0 107724 0 -2481 t "Date" 2482 3681 -2482 sem -0 107767 0 -2483 alt 0 2484 2479 3680 -2484 alt -0 2487 2481 3681 -2485 t "Char" 2486 3682 -2486 sem -0 107811 0 -2487 alt -0 2490 2485 3682 -2488 t "String" 2489 3683 -2489 sem -0 107853 0 -2490 alt -0 2493 2488 3683 -2491 t "Decimal" 2492 3684 -2492 sem -0 107898 0 -2493 alt -0 2496 2491 3684 -2494 t "Byte" 2495 3685 -2495 sem -0 107941 0 -2496 alt -0 2499 2494 3685 -2497 t "Short" 2498 3686 -2498 sem -0 107982 0 -2499 alt -0 2502 2497 3686 -2500 t "Integer" 2501 3687 -2501 sem -0 108026 0 -2502 alt -0 2505 2500 3687 -2503 t "Long" 2504 3688 -2504 sem -0 108067 0 -2505 alt -0 2508 2503 3688 -2506 t "Single" 2507 3689 -2507 sem -0 108110 0 -2508 alt -0 2511 2506 3689 -2509 t "Double" 2510 3690 -2510 sem -0 108154 0 -2511 alt -0 2514 2509 3690 -2512 t "UInteger" 2513 3691 -2513 sem -0 108199 0 -2514 alt -0 2517 2512 3691 -2515 t "ULong" 2516 3692 -2516 sem -0 108242 0 -2517 alt -0 2520 2515 3692 -2518 t "UShort" 2519 3693 -2519 sem -0 108286 0 -2520 alt -0 2523 2518 3693 -2521 t "SByte" 2522 3694 -2522 sem -0 108329 0 -2523 alt -0 0 2521 3694 -2524 t "ByVal" 2525 3698 -2525 sem -0 108418 0 -2526 t "ByRef" 2527 3699 -2527 sem -0 108468 0 -2528 alt 0 2529 2524 3698 -2529 alt -0 2532 2526 3699 -2530 t "Optional" 2531 3700 -2531 sem -0 108521 0 -2532 alt -0 2535 2530 3700 -2533 t "ParamArray" 2534 3701 -2534 sem -0 108581 0 -2535 alt -0 0 2533 3701 -2536 t "Public" 2537 3705 -2537 sem -0 108673 0 -2538 t "Protected" 2539 3706 -2539 sem -0 108733 0 -2540 alt 0 2541 2536 3705 -2541 alt -0 2544 2538 3706 -2542 t "Friend" 2543 3707 -2543 sem -0 108794 0 -2544 alt -0 2547 2542 3707 -2545 t "Private" 2546 3708 -2546 sem -0 108855 0 -2547 alt -0 2550 2545 3708 -2548 t "Shared" 2549 3709 -2549 sem -0 108914 0 -2550 alt -0 2553 2548 3709 -2551 t "Shadows" 2552 3710 -2552 sem -0 108973 0 -2553 alt -0 2556 2551 3710 -2554 t "MustInherit 2555 3711 -2555 sem -0 109032 0 -2556 alt -0 2559 2554 3711 -2557 t "NotInherita 2558 3712 -2558 sem -0 109098 0 -2559 alt -0 2562 2557 3712 -2560 t "Partial" 2561 3713 -2561 sem -0 109157 0 -2562 alt -0 0 2560 3713 -2563 t "MustInherit 2564 3717 -2564 sem -0 109258 0 -2565 t "Default" 2566 3718 -2566 sem -0 109317 0 -2567 alt 0 2568 2563 3717 -2568 alt -0 2571 2565 3718 -2569 t "Friend" 2570 3719 -2570 sem -0 109374 0 -2571 alt -0 2574 2569 3719 -2572 t "Shadows" 2573 3720 -2573 sem -0 109433 0 -2574 alt -0 2577 2572 3720 -2575 t "Overrides" 2576 3721 -2576 sem -0 109488 0 -2577 alt -0 2580 2575 3721 -2578 t "MustOverrid 2579 3722 -2579 sem -0 109550 0 -2580 alt -0 2583 2578 3722 -2581 t "Private" 2582 3723 -2582 sem -0 109609 0 -2583 alt -0 2586 2581 3723 -2584 t "Protected" 2585 3724 -2585 sem -0 109668 0 -2586 alt -0 2589 2584 3724 -2587 t "Public" 2588 3725 -2588 sem -0 109727 0 -2589 alt -0 2592 2587 3725 -2590 t "NotInherita 2591 3726 -2591 sem -0 109789 0 -2592 alt -0 2595 2590 3726 -2593 t "NotOverrida 2594 3727 -2594 sem -0 109851 0 -2595 alt -0 2598 2593 3727 -2596 t "Shared" 2597 3728 -2597 sem -0 109907 0 -2598 alt -0 2601 2596 3728 -2599 t "Overridable 2600 3729 -2600 sem -0 109967 0 -2601 alt -0 2604 2599 3729 -2602 t "Overloads" 2603 3730 -2603 sem -0 110026 0 -2604 alt -0 2607 2602 3730 -2605 t "ReadOnly" 2606 3731 -2606 sem -0 110086 0 -2607 alt -0 2610 2605 3731 -2608 t "WriteOnly" 2609 3732 -2609 sem -0 110146 0 -2610 alt -0 2613 2608 3732 -2611 t "WithEvents" 2612 3733 -2612 sem -0 110208 0 -2613 alt -0 2616 2611 3733 -2614 t "Dim" 2615 3734 -2615 sem -0 110266 0 -2616 alt -0 2619 2614 3734 -2617 t "Partial" 2618 3735 -2618 sem -0 110320 0 -2619 alt -0 0 2617 3735 -2620 sem 2633 110421 0 -2621 t "Public" 2622 3741 -2622 sem -2633 110467 0 -2623 t "Protected" 2624 3742 -2624 sem -2633 110514 0 -2625 alt -2633 2626 2621 3741 -2626 alt -2633 2629 2623 3742 -2627 t "Friend" 2628 3743 -2628 sem -2633 110564 0 -2629 alt -2633 2632 2627 3743 -2630 t "Private" 2631 3744 -2631 sem -2633 110613 0 -2632 alt -2633 0 2630 3744 -2633 iter 0 0 2625 3740 +2378 nt Block 2379 105754 3576 +2379 sem 2380 105777 0 +2380 t "End" 2381 3580 +2381 t "With" 2382 3580 +2382 sem 0 105867 0 +2383 t "Try" 2384 3589 +2384 nt EndOfStmt 2385 3589 +2385 nt Block 2387 106101 3590 +2386 nt CatchClauses -2391 106132 3591 +2387 opt 2391 0 2386 3591 +2388 t "Finally" 2389 3592 +2389 nt EndOfStmt 2390 3592 +2390 nt Block -2392 106180 3592 +2391 opt 2392 0 2388 3592 +2392 t "End" 2393 3593 +2393 t "Try" 2394 3593 +2394 sem 0 106221 0 +2395 t "Catch" 2401 3609 +2396 nt Identifier 2397 3610 +2397 sem 2400 106585 0 +2398 t "As" 2399 3610 +2399 nt TypeName -2404 106617 3610 +2400 opt -2404 0 2398 3610 +2401 opt 2404 0 2396 3610 +2402 t "When" 2403 3611 +2403 nt Expr -2405 106647 3611 +2404 opt 2405 0 2402 3611 +2405 nt EndOfStmt 2406 3612 +2406 nt Block 2407 106681 3613 +2407 sem -2408 106702 0 +2408 iter 0 0 2395 3608 +2409 nt Identifier 2410 3625 +2410 sem 2415 106898 0 +2411 rslv 2412 3626 +2412 t "." 2413 3626 +2413 nt IdentifierOr 2414 106984 3626 +2414 sem -2415 106997 0 +2415 iter 2416 0 2411 3626 +2416 sem 0 107071 0 +2417 nt IdentifierFo -0 3633 +2418 t "Custom" -0 3634 +2419 alt 0 2420 2417 3633 +2420 alt -0 0 2418 3634 +2421 t ident -0 3638 +2422 t "Aggregate" -0 3639 +2423 alt 0 2424 2421 3638 +2424 alt -0 2426 2422 3639 +2425 t "Ansi" -0 3640 +2426 alt -0 2428 2425 3640 +2427 t "Ascending" -0 3641 +2428 alt -0 2430 2427 3641 +2429 t "Assembly" -0 3642 +2430 alt -0 2432 2429 3642 +2431 t "Auto" -0 3643 +2432 alt -0 2434 2431 3643 +2433 t "Binary" -0 3644 +2434 alt -0 2436 2433 3644 +2435 t "By" -0 3645 +2436 alt -0 2438 2435 3645 +2437 t "Compare" -0 3646 +2438 alt -0 2440 2437 3646 +2439 t "Descending" -0 3647 +2440 alt -0 2442 2439 3647 +2441 t "Distinct" -0 3648 +2442 alt -0 2444 2441 3648 +2443 t "Equals" -0 3649 +2444 alt -0 2446 2443 3649 +2445 t "Explicit" -0 3650 +2446 alt -0 2448 2445 3650 +2447 t "From" -0 3651 +2448 alt -0 2450 2447 3651 +2449 t "Group" -0 3652 +2450 alt -0 2452 2449 3652 +2451 t "Infer" -0 3653 +2452 alt -0 2454 2451 3653 +2453 t "Into" -0 3654 +2454 alt -0 2456 2453 3654 +2455 t "Join" -0 3655 +2456 alt -0 2458 2455 3655 +2457 t "Key" -0 3656 +2458 alt -0 2460 2457 3656 +2459 t "Off" -0 3657 +2460 alt -0 2462 2459 3657 +2461 t "Order" -0 3658 +2462 alt -0 2464 2461 3658 +2463 t "Out" -0 3659 +2464 alt -0 2466 2463 3659 +2465 t "Preserve" -0 3660 +2466 alt -0 2468 2465 3660 +2467 t "Skip" -0 3661 +2468 alt -0 2470 2467 3661 +2469 t "Take" -0 3662 +2470 alt -0 2472 2469 3662 +2471 t "Text" -0 3663 +2472 alt -0 2474 2471 3663 +2473 t "Unicode" -0 3664 +2474 alt -0 2476 2473 3664 +2475 t "Until" -0 3665 +2476 alt -0 2478 2475 3665 +2477 t "Where" -0 3666 +2478 alt -0 0 2477 3666 +2479 any 2480 3673 +2480 sem 0 107722 0 +2481 t "Boolean" 2482 3680 +2482 sem -0 107841 0 +2483 t "Date" 2484 3681 +2484 sem -0 107884 0 +2485 alt 0 2486 2481 3680 +2486 alt -0 2489 2483 3681 +2487 t "Char" 2488 3682 +2488 sem -0 107928 0 +2489 alt -0 2492 2487 3682 +2490 t "String" 2491 3683 +2491 sem -0 107970 0 +2492 alt -0 2495 2490 3683 +2493 t "Decimal" 2494 3684 +2494 sem -0 108015 0 +2495 alt -0 2498 2493 3684 +2496 t "Byte" 2497 3685 +2497 sem -0 108058 0 +2498 alt -0 2501 2496 3685 +2499 t "Short" 2500 3686 +2500 sem -0 108099 0 +2501 alt -0 2504 2499 3686 +2502 t "Integer" 2503 3687 +2503 sem -0 108143 0 +2504 alt -0 2507 2502 3687 +2505 t "Long" 2506 3688 +2506 sem -0 108184 0 +2507 alt -0 2510 2505 3688 +2508 t "Single" 2509 3689 +2509 sem -0 108227 0 +2510 alt -0 2513 2508 3689 +2511 t "Double" 2512 3690 +2512 sem -0 108271 0 +2513 alt -0 2516 2511 3690 +2514 t "UInteger" 2515 3691 +2515 sem -0 108316 0 +2516 alt -0 2519 2514 3691 +2517 t "ULong" 2518 3692 +2518 sem -0 108359 0 +2519 alt -0 2522 2517 3692 +2520 t "UShort" 2521 3693 +2521 sem -0 108403 0 +2522 alt -0 2525 2520 3693 +2523 t "SByte" 2524 3694 +2524 sem -0 108446 0 +2525 alt -0 0 2523 3694 +2526 t "ByVal" 2527 3698 +2527 sem -0 108535 0 +2528 t "ByRef" 2529 3699 +2529 sem -0 108585 0 +2530 alt 0 2531 2526 3698 +2531 alt -0 2534 2528 3699 +2532 t "Optional" 2533 3700 +2533 sem -0 108638 0 +2534 alt -0 2537 2532 3700 +2535 t "ParamArray" 2536 3701 +2536 sem -0 108698 0 +2537 alt -0 0 2535 3701 +2538 t "Public" 2539 3705 +2539 sem -0 108790 0 +2540 t "Protected" 2541 3706 +2541 sem -0 108850 0 +2542 alt 0 2543 2538 3705 +2543 alt -0 2546 2540 3706 +2544 t "Friend" 2545 3707 +2545 sem -0 108911 0 +2546 alt -0 2549 2544 3707 +2547 t "Private" 2548 3708 +2548 sem -0 108972 0 +2549 alt -0 2552 2547 3708 +2550 t "Shared" 2551 3709 +2551 sem -0 109031 0 +2552 alt -0 2555 2550 3709 +2553 t "Shadows" 2554 3710 +2554 sem -0 109090 0 +2555 alt -0 2558 2553 3710 +2556 t "MustInherit 2557 3711 +2557 sem -0 109149 0 +2558 alt -0 2561 2556 3711 +2559 t "NotInherita 2560 3712 +2560 sem -0 109215 0 +2561 alt -0 2564 2559 3712 +2562 t "Partial" 2563 3713 +2563 sem -0 109274 0 +2564 alt -0 0 2562 3713 +2565 t "MustInherit 2566 3717 +2566 sem -0 109375 0 +2567 t "Default" 2568 3718 +2568 sem -0 109434 0 +2569 alt 0 2570 2565 3717 +2570 alt -0 2573 2567 3718 +2571 t "Friend" 2572 3719 +2572 sem -0 109491 0 +2573 alt -0 2576 2571 3719 +2574 t "Shadows" 2575 3720 +2575 sem -0 109550 0 +2576 alt -0 2579 2574 3720 +2577 t "Overrides" 2578 3721 +2578 sem -0 109605 0 +2579 alt -0 2582 2577 3721 +2580 t "MustOverrid 2581 3722 +2581 sem -0 109667 0 +2582 alt -0 2585 2580 3722 +2583 t "Private" 2584 3723 +2584 sem -0 109726 0 +2585 alt -0 2588 2583 3723 +2586 t "Protected" 2587 3724 +2587 sem -0 109785 0 +2588 alt -0 2591 2586 3724 +2589 t "Public" 2590 3725 +2590 sem -0 109844 0 +2591 alt -0 2594 2589 3725 +2592 t "NotInherita 2593 3726 +2593 sem -0 109906 0 +2594 alt -0 2597 2592 3726 +2595 t "NotOverrida 2596 3727 +2596 sem -0 109968 0 +2597 alt -0 2600 2595 3727 +2598 t "Shared" 2599 3728 +2599 sem -0 110024 0 +2600 alt -0 2603 2598 3728 +2601 t "Overridable 2602 3729 +2602 sem -0 110084 0 +2603 alt -0 2606 2601 3729 +2604 t "Overloads" 2605 3730 +2605 sem -0 110143 0 +2606 alt -0 2609 2604 3730 +2607 t "ReadOnly" 2608 3731 +2608 sem -0 110203 0 +2609 alt -0 2612 2607 3731 +2610 t "WriteOnly" 2611 3732 +2611 sem -0 110263 0 +2612 alt -0 2615 2610 3732 +2613 t "WithEvents" 2614 3733 +2614 sem -0 110325 0 +2615 alt -0 2618 2613 3733 +2616 t "Dim" 2617 3734 +2617 sem -0 110383 0 +2618 alt -0 2621 2616 3734 +2619 t "Partial" 2620 3735 +2620 sem -0 110437 0 +2621 alt -0 0 2619 3735 +2622 sem 2635 110538 0 +2623 t "Public" 2624 3741 +2624 sem -2635 110584 0 +2625 t "Protected" 2626 3742 +2626 sem -2635 110631 0 +2627 alt -2635 2628 2623 3741 +2628 alt -2635 2631 2625 3742 +2629 t "Friend" 2630 3743 +2630 sem -2635 110681 0 +2631 alt -2635 2634 2629 3743 +2632 t "Private" 2633 3744 +2633 sem -2635 110730 0 +2634 alt -2635 0 2632 3744 +2635 iter 0 0 2627 3740 First & follow symbols: @@ -5030,6 +5032,29 @@ follow: EOL ident LiteralString LiteralCharacter LiteralInteger LiteralDouble "True" "Try" "TryCast" "TypeOf" "UInteger" "ULong" "Unicode" "Until" "UShort" "Using" "Where" "While" "With" "Xor" +ExitStatement +first: "Exit" +follow: EOL ident LiteralString LiteralCharacter LiteralInteger LiteralDouble + LiteralSingle LiteralDecimal LiteralDate XmlOpenTag XmlEndInlineVB + XmlContent XmlComment XmlCData XmlProcessingInstruction "=" ":" "," + "&" "/" "\\" "." "..." ".@" "!" "-" "+" "^" "*" "{" "}" "(" ")" ">" + "<" "<>" ">=" "<=" "<<" ">>" "+=" "^=" "-=" "*=" "/=" "\\=" "<<=" + ">>=" "&=" "AddHandler" "AddressOf" "Aggregate" "And" "AndAlso" + "Ansi" "Ascending" "Assembly" "Auto" "Binary" "Boolean" "By" "Byte" + "Call" "CBool" "CByte" "CChar" "CDate" "CDbl" "CDec" "Char" "CInt" + "CLng" "CObj" "Compare" "Const" "Continue" "CSByte" "CShort" "CSng" + "CStr" "CType" "CUInt" "CULng" "CUShort" "Custom" "Date" "Decimal" + "Descending" "Dim" "DirectCast" "Distinct" "Do" "Double" "Else" "End" + "Equals" "Erase" "Error" "Exit" "Explicit" "False" "For" "From" + "GetType" "Global" "GoTo" "Group" "If" "Implements" "Infer" "Integer" + "Into" "Is" "IsNot" "Join" "Key" "Let" "Like" "Long" "Me" "Mod" + "MyBase" "MyClass" "New" "Nothing" "Object" "Off" "On" "Or" "Order" + "OrElse" "Out" "Preserve" "RaiseEvent" "ReDim" "RemoveHandler" + "Resume" "Return" "SByte" "Select" "Short" "Single" "Skip" "Static" + "Step" "Stop" "String" "SyncLock" "Take" "Text" "Then" "Throw" "To" + "True" "Try" "TryCast" "TypeOf" "UInteger" "ULong" "Unicode" "Until" + "UShort" "Using" "Where" "While" "With" "Xor" + TryStatement first: "Try" follow: EOL ident LiteralString LiteralCharacter LiteralInteger LiteralDouble @@ -5053,6 +5078,29 @@ follow: EOL ident LiteralString LiteralCharacter LiteralInteger LiteralDouble "True" "Try" "TryCast" "TypeOf" "UInteger" "ULong" "Unicode" "Until" "UShort" "Using" "Where" "While" "With" "Xor" +ContinueStatement +first: "Continue" +follow: EOL ident LiteralString LiteralCharacter LiteralInteger LiteralDouble + LiteralSingle LiteralDecimal LiteralDate XmlOpenTag XmlEndInlineVB + XmlContent XmlComment XmlCData XmlProcessingInstruction "=" ":" "," + "&" "/" "\\" "." "..." ".@" "!" "-" "+" "^" "*" "{" "}" "(" ")" ">" + "<" "<>" ">=" "<=" "<<" ">>" "+=" "^=" "-=" "*=" "/=" "\\=" "<<=" + ">>=" "&=" "AddHandler" "AddressOf" "Aggregate" "And" "AndAlso" + "Ansi" "Ascending" "Assembly" "Auto" "Binary" "Boolean" "By" "Byte" + "Call" "CBool" "CByte" "CChar" "CDate" "CDbl" "CDec" "Char" "CInt" + "CLng" "CObj" "Compare" "Const" "Continue" "CSByte" "CShort" "CSng" + "CStr" "CType" "CUInt" "CULng" "CUShort" "Custom" "Date" "Decimal" + "Descending" "Dim" "DirectCast" "Distinct" "Do" "Double" "Else" "End" + "Equals" "Erase" "Error" "Exit" "Explicit" "False" "For" "From" + "GetType" "Global" "GoTo" "Group" "If" "Implements" "Infer" "Integer" + "Into" "Is" "IsNot" "Join" "Key" "Let" "Like" "Long" "Me" "Mod" + "MyBase" "MyClass" "New" "Nothing" "Object" "Off" "On" "Or" "Order" + "OrElse" "Out" "Preserve" "RaiseEvent" "ReDim" "RemoveHandler" + "Resume" "Return" "SByte" "Select" "Short" "Single" "Skip" "Static" + "Step" "Stop" "String" "SyncLock" "Take" "Text" "Then" "Throw" "To" + "True" "Try" "TryCast" "TypeOf" "UInteger" "ULong" "Unicode" "Until" + "UShort" "Using" "Where" "While" "With" "Xor" + WithStatement first: "With" follow: EOL ident LiteralString LiteralCharacter LiteralInteger LiteralDouble diff --git a/VB/Project/Parser/vbnet.atg b/VB/Project/Parser/vb.atg similarity index 96% rename from VB/Project/Parser/vbnet.atg rename to VB/Project/Parser/vb.atg index c67c785d7c..f0d8cfd23d 100644 --- a/VB/Project/Parser/vbnet.atg +++ b/VB/Project/Parser/vb.atg @@ -1,3 +1,4 @@ +using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; @@ -7,7 +8,8 @@ using ICSharpCode.NRefactory.VB.Dom; using ICSharpCode.NRefactory.VB.Parser; using ASTAttribute = ICSharpCode.NRefactory.VB.Dom.Attribute; -COMPILER VBNET +COMPILER VB +$trace=FG /* START AUTOGENERATED TOKENS SECTION */ TOKENS @@ -20,7 +22,7 @@ TOKENS LiteralInteger LiteralDouble LiteralSingle - LiteralDecimal + LiteralDecimal LiteralDate XmlOpenTag XmlCloseTag @@ -53,7 +55,7 @@ TOKENS "}" "(" ")" - ">" + ">" "<" "<>" ">=" @@ -258,7 +260,7 @@ TOKENS PRODUCTIONS -VBNET +VB (. lexer.NextToken(); // get the first token compilationUnit = new CompilationUnit(); @@ -270,7 +272,6 @@ VBNET { ImportsStmt { EndOfStmt } } { IF (IsGlobalAttrTarget()) GlobalAttributeSection { EndOfStmt } } { NamespaceMemberDecl { EndOfStmt } } - EOF . OptionStmt (. INode node = null; bool val = true; .) = @@ -297,7 +298,7 @@ OptionStmt (. INode node = null; bool val = true; .) = AddChild(node); } .) - . +. OptionValue = ( @@ -386,7 +387,7 @@ NamespaceMemberDecl . /* 4.9.1 */ -TypeParameterList templates> +TypeParameterList<.List templates.> (. TemplateDefinition template; .) @@ -452,7 +453,7 @@ TypeParameterConstraint . /* 6.4.2 */ -NonModuleDeclaration attributes> +NonModuleDeclaration<.ModifierList m, List attributes.> (. TypeReference typeRef = null; List baseInterfaces = null; @@ -790,7 +791,7 @@ EnumMemberDecl EndOfStmt . -ClassMemberDecl attributes> = +ClassMemberDecl<.ModifierList m, List attributes.> = StructureMemberDecl . @@ -804,7 +805,7 @@ ClassBaseType . /* 7.6.1 */ -StructureMemberDecl attributes> +StructureMemberDecl<.ModifierList m, List attributes.> (. TypeReference type = null; List p = new List(); @@ -1395,7 +1396,7 @@ AccessorDecls . /* 9.7.1 */ -GetAccessorDecl attributes> +GetAccessorDecl<.out PropertyGetRegion getBlock, List attributes.> (. Statement stmt = null; Modifiers m; .) = PropertyAccessorAccessModifier @@ -1411,7 +1412,7 @@ GetAccessorDecl attribute . /* 9.7.2 */ -SetAccessorDecl attributes> +SetAccessorDecl<.out PropertySetRegion setBlock, List attributes.> (. Statement stmt = null; List p = new List(); @@ -1435,7 +1436,7 @@ SetAccessorDecl attribute . /* 9.5 */ -ConstantDeclarator constantDeclaration> +ConstantDeclarator<.List constantDeclaration.> (. Expression expr = null; TypeReference type = null; @@ -1454,13 +1455,13 @@ ConstantDeclarator constantDeclaration> . /* 9.6 */ -VariableDeclarator fieldDeclaration> +VariableDeclarator<.List fieldDeclaration.> = Identifier (. string name = t.val; .) VariableDeclaratorPartAfterIdentifier . -VariableDeclaratorPartAfterIdentifier fieldDeclaration, string name> +VariableDeclaratorPartAfterIdentifier<.List fieldDeclaration, string name.> (. Expression expr = null; TypeReference type = null; @@ -1528,7 +1529,7 @@ VariableDeclaratorPartAfterIdentifier fieldDeclaration . /* 6.8 */ -ArrayInitializationModifier arrayModifiers> +ArrayInitializationModifier<.out List arrayModifiers.> (. arrayModifiers = null; .) = @@ -1536,7 +1537,7 @@ ArrayInitializationModifier arrayModifiers> . /* 7.5.4.3 */ -InitializationRankList rank> +InitializationRankList<.out List rank.> (. rank = new List(); Expression expr = null; @@ -1589,7 +1590,7 @@ Charset . /* 9.2.6 */ -HandlesClause handlesClause> +HandlesClause<.out List handlesClause.> (. handlesClause = new List(); string name; @@ -1599,7 +1600,7 @@ HandlesClause handlesClause> . /* 7.8. */ -InterfaceBase bases> +InterfaceBase<.out List bases.> (. TypeReference type; bases = new List(); @@ -1614,7 +1615,7 @@ InterfaceBase bases> . /* 7.2 */ -TypeImplementsClause baseInterfaces> +TypeImplementsClause<.out List baseInterfaces.> (. baseInterfaces = new List(); TypeReference type = null; @@ -1631,7 +1632,7 @@ TypeImplementsClause baseInterfaces> . /* 9.1 */ -ImplementsClause baseInterfaces> +ImplementsClause<.out List baseInterfaces.> (. baseInterfaces = new List(); TypeReference type = null; @@ -1827,7 +1828,7 @@ XmlLiteralExpression .) . -XmlContentExpression exprs> = +XmlContentExpression<.List exprs.> = (. XmlContentExpression expr = null; .) ( XmlContent (. expr = new XmlContentExpression(t.val, XmlContentType.Text); .) @@ -1875,7 +1876,7 @@ XmlElement (. expr = el; .) . -XmlAttribute attrs> +XmlAttribute<.List attrs.> (. Location start = la.Location; .) = Identifier (. string name = t.val; .) "=" @@ -1934,7 +1935,6 @@ InvocationExpression . /* 11.11 */ - CastTarget (. type = null; @@ -2300,7 +2300,7 @@ QueryExpr .) . -FromOrAggregateQueryOperator middleClauses> +FromOrAggregateQueryOperator<.List middleClauses.> (. QueryExpressionFromClause fromClause = null; QueryExpressionAggregateClause aggregateClause = null; @@ -2311,7 +2311,7 @@ FromOrAggregateQueryOperator middleClauses> (. middleClauses.Add(aggregateClause); .) . -QueryOperator middleClauses> +QueryOperator<.List middleClauses.> (. QueryExpressionJoinVBClause joinClause = null; QueryExpressionGroupVBClause groupByClause = null; @@ -2339,7 +2339,7 @@ QueryOperator middleClauses> (. middleClauses.Add(groupByClause); .) . -OrderByQueryOperator middleClauses> +OrderByQueryOperator<.List middleClauses.> (. QueryExpressionOrderClause orderClause = new QueryExpressionOrderClause(); orderClause.StartLocation = la.Location; @@ -2353,7 +2353,7 @@ OrderByQueryOperator middleClauses> .) . -OrderExpressionList orderings> +OrderExpressionList<.out List orderings.> (. orderings = new List(); QueryExpressionOrdering ordering = null; @@ -2422,7 +2422,7 @@ FromQueryOperator .) . -SelectQueryOperator middleClauses> +SelectQueryOperator<.List middleClauses.> (. QueryExpressionSelectVBClause selectClause = new QueryExpressionSelectVBClause(); selectClause.StartLocation = la.Location; @@ -2434,7 +2434,7 @@ SelectQueryOperator middleClauses> .) . -DistinctQueryOperator middleClauses> +DistinctQueryOperator<.List middleClauses.> (. QueryExpressionDistinctClause distinctClause = new QueryExpressionDistinctClause(); distinctClause.StartLocation = la.Location; @@ -2446,7 +2446,7 @@ DistinctQueryOperator middleClauses> .) . -WhereQueryOperator middleClauses> +WhereQueryOperator<.List middleClauses.> (. QueryExpressionWhereClause whereClause = new QueryExpressionWhereClause(); whereClause.StartLocation = la.Location; @@ -2500,7 +2500,7 @@ AggregateQueryOperator .) . -LetQueryOperator middleClauses> +LetQueryOperator<.List middleClauses.> (. QueryExpressionLetVBClause letClause = new QueryExpressionLetVBClause(); letClause.StartLocation = la.Location; @@ -2512,7 +2512,7 @@ LetQueryOperator middleClauses> .) . -ExpressionRangeVariableDeclarationList variables> +ExpressionRangeVariableDeclarationList<.List variables.> (. ExpressionRangeVariable variable = null; .) = @@ -2571,7 +2571,7 @@ JoinQueryOperator .) . -CollectionRangeVariableDeclarationList rangeVariables> +CollectionRangeVariableDeclarationList<.List rangeVariables.> (. CollectionRangeVariable variableDeclaration; .) = CollectionRangeVariableDeclaration @@ -2630,7 +2630,7 @@ MemberInitializer . /* 9.3.2 */ -ArgumentList arguments> +ArgumentList<.out List arguments.> (. arguments = new List(); Expression expr = null; @@ -2644,7 +2644,7 @@ ArgumentList arguments> . /* argument list that hasn't decided if it is method call or array initialisation */ -NormalOrReDimArgumentList arguments, out bool canBeNormal, out bool canBeRedim> +NormalOrReDimArgumentList<.out List arguments, out bool canBeNormal, out bool canBeRedim.> (. arguments = new List(); canBeNormal = true; canBeRedim = !IsNamedAssign(); @@ -2802,7 +2802,7 @@ RankList . /* 7.12 */ -TypeArgumentList typeArguments> +TypeArgumentList<.List typeArguments.> (. TypeReference typeref; .) = @@ -2853,7 +2853,7 @@ Attribute . /* Spec, 5.2.2 */ -AttributeArguments positional, List named> +AttributeArguments<.List positional, List named.> (. bool nameFound = false; string name = ""; @@ -2930,7 +2930,7 @@ AttributeSection . /* 9.2.5 */ -FormalParameterList parameter> +FormalParameterList<.List parameter.> (. ParameterDeclarationExpression p; .) = FormalParameter (. if (p != null) parameter.Add(p); .) @@ -2986,18 +2986,19 @@ Block if (t != null) blockStmt.StartLocation = t.EndLocation; BlockStart(blockStmt); .) - { - IF (IsEndStmtAhead()) - (. Token first = la; .) - "End" EndOfStmt - (. - AddChild(new EndStatement() { - StartLocation = first.Location, - EndLocation = first.EndLocation } - ); - .) - | Statement EndOfStmt -/* IF (!LeaveBlock()) { }*/ + { + IF (IsEndStmtAhead() || StartOf(StatementEndOfStmt)) + ( + "End" + (. Token first = t; + AddChild(new EndStatement() { + StartLocation = first.Location, + EndLocation = first.EndLocation } + ); + .) EndOfStmt + | + (.NamedFirstSet:StatementEndOfStmt.) Statement EndOfStmt + ) } (. stmt = blockStmt; @@ -3011,10 +3012,9 @@ Statement Statement stmt = null; Location startPos = la.Location; string label = String.Empty; - .) = ( - | IF (IsLabel()) LabelName + IF (IsLabel()) LabelName (. AddChild(new LabelStatement(t.val)); .) @@ -3070,28 +3070,9 @@ EmbeddedStatement List p = null; Location startLocation = la.Location; .) = - ( - "Exit" (. ExitType exitType = ExitType.None; .) - ( - "Sub" (. exitType = ExitType.Sub; .) - | - "Function" (. exitType = ExitType.Function; .) - | - "Property" (. exitType = ExitType.Property; .) - | - "Do" (. exitType = ExitType.Do; .) - | - "For" (. exitType = ExitType.For; .) - | - "Try" (. exitType = ExitType.Try; .) - | - "While" (. exitType = ExitType.While; .) - | - "Select" (. exitType = ExitType.Select; .) - ) - (. statement = new ExitStatement(exitType); .) + ( ExitStatement | TryStatement - | "Continue" (. ContinueType continueType = ContinueType.None; .) [ "Do" (. continueType = ContinueType.Do; .) | "For" (. continueType = ContinueType.For; .) | "While" (. continueType = ContinueType.While; .)] (. statement = new ContinueStatement(continueType); .) + | ContinueStatement | /* 10.10.1.3 */ "Throw" [ Expr ] (. statement = new ThrowStatement(expr); .) | /* 10.11 */ @@ -3370,7 +3351,28 @@ EmbeddedStatement .) . -SingleLineStatementList list> +ExitStatement = + "Exit" (. ExitType exitType = ExitType.None; .) + ( "Sub" (. exitType = ExitType.Sub; .) + | "Function" (. exitType = ExitType.Function; .) + | "Property" (. exitType = ExitType.Property; .) + | "Do" (. exitType = ExitType.Do; .) + | "For" (. exitType = ExitType.For; .) + | "Try" (. exitType = ExitType.Try; .) + | "While" (. exitType = ExitType.While; .) + | "Select" (. exitType = ExitType.Select; .) ) + (. statement = new ExitStatement(exitType); .) +. + +ContinueStatement = + "Continue" (. ContinueType continueType = ContinueType.None; .) + [ "Do" (. continueType = ContinueType.Do; .) + | "For" (. continueType = ContinueType.For; .) + | "While" (. continueType = ContinueType.While; .) ] + (. statement = new ContinueStatement(continueType); .) +. + +SingleLineStatementList<.List list.> (. Statement embeddedStatement = null; .) = ( "End" (. embeddedStatement = new EndStatement() { StartLocation = t.Location, EndLocation = t.EndLocation }; .) @@ -3513,7 +3515,7 @@ ResumeStatement . /* 18.8.2 */ -CaseClauses caseClauses> +CaseClauses<.out List caseClauses.> (. caseClauses = new List(); CaseLabel caseClause = null; @@ -3595,7 +3597,7 @@ TryStatement . /* 10.10.1.2 */ -CatchClauses catchClauses> +CatchClauses<.out List catchClauses.> (. catchClauses = new List(); TypeReference type = null; @@ -3743,4 +3745,4 @@ PropertyAccessorAccessModifier = )} . -END VBNET. +END VB . \ No newline at end of file diff --git a/VB/Project/ParserFactory.cs b/VB/Project/ParserFactory.cs index 30fe5744e1..aa93d38646 100644 --- a/VB/Project/ParserFactory.cs +++ b/VB/Project/ParserFactory.cs @@ -23,18 +23,18 @@ namespace ICSharpCode.NRefactory.VB return new ICSharpCode.NRefactory.VB.Parser.Lexer(textReader, state); } - public static IParser CreateParser(TextReader textReader) + public static VBParser CreateParser(TextReader textReader) { Parser.ILexer lexer = CreateLexer(textReader); - return new ICSharpCode.NRefactory.VB.Parser.Parser(lexer); + return new ICSharpCode.NRefactory.VB.Parser.VBParser(lexer); } - public static IParser CreateParser(string fileName) + public static VBParser CreateParser(string fileName) { return CreateParser(fileName, Encoding.UTF8); } - public static IParser CreateParser(string fileName, Encoding encoding) + public static VBParser CreateParser(string fileName, Encoding encoding) { string ext = Path.GetExtension(fileName); if (ext.Equals(".vb", StringComparison.OrdinalIgnoreCase)) diff --git a/VB/Project/PrettyPrinter/VBNet/VBNetOutputVisitor.cs b/VB/Project/PrettyPrinter/VBNet/VBNetOutputVisitor.cs index 02c810933b..536987e4ab 100644 --- a/VB/Project/PrettyPrinter/VBNet/VBNetOutputVisitor.cs +++ b/VB/Project/PrettyPrinter/VBNet/VBNetOutputVisitor.cs @@ -2339,12 +2339,6 @@ namespace ICSharpCode.NRefactory.VB.PrettyPrinter return null; } - public override object TrackedVisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression, object data) - { - OutputAnonymousMethodWithStatementBody(anonymousMethodExpression.Parameters, anonymousMethodExpression.Body); - return null; - } - public override object TrackedVisitCastExpression(CastExpression castExpression, object data) { if (castExpression.CastType == CastType.TryCast) { @@ -2779,30 +2773,6 @@ namespace ICSharpCode.NRefactory.VB.PrettyPrinter } } - void OutputAnonymousMethodWithStatementBody(List parameters, Statement body) - { - Error("VB does not support anonymous methods/lambda expressions with a statement body", body.StartLocation); - - outputFormatter.PrintToken(Tokens.Function); - outputFormatter.PrintToken(Tokens.OpenParenthesis); - AppendCommaSeparatedList(parameters); - outputFormatter.PrintToken(Tokens.CloseParenthesis); - outputFormatter.Space(); - outputFormatter.PrintToken(Tokens.Do); - outputFormatter.NewLine(); - - ++outputFormatter.IndentationLevel; - exitTokenStack.Push(Tokens.Function); - body.AcceptVisitor(this, null); - exitTokenStack.Pop(); - --outputFormatter.IndentationLevel; - - outputFormatter.Indent(); - outputFormatter.PrintToken(Tokens.End); - outputFormatter.Space(); - outputFormatter.PrintToken(Tokens.Function); - } - public override object TrackedVisitQueryExpression(QueryExpression queryExpression, object data) { outputFormatter.IndentationLevel++; diff --git a/VB/Project/Properties/AssemblyInfo.cs b/VB/Project/Properties/AssemblyInfo.cs index 0bfcac4fbf..3f604f3e86 100644 --- a/VB/Project/Properties/AssemblyInfo.cs +++ b/VB/Project/Properties/AssemblyInfo.cs @@ -22,6 +22,8 @@ using System.Runtime.InteropServices; // If you need to expose a type to COM, use [ComVisible(true)] on that type. [assembly: ComVisible(false)] +//[assembly: CLSCompliant(true)] + // The assembly version has following format : // // Major.Minor.Build.Revision diff --git a/VB/Project/SnippetParser.cs b/VB/Project/SnippetParser.cs index 85e573f432..fc91a137e5 100644 --- a/VB/Project/SnippetParser.cs +++ b/VB/Project/SnippetParser.cs @@ -46,7 +46,7 @@ namespace ICSharpCode.NRefactory.VB /// public INode Parse(string code) { - IParser parser = ParserFactory.CreateParser(new StringReader(code)); + VBParser parser = ParserFactory.CreateParser(new StringReader(code)); parser.Parse(); this.Errors = parser.Errors; this.Specials = parser.Lexer.SpecialTracker.RetrieveSpecials(); diff --git a/VB/Project/Visitors/AbstractASTVisitor.cs b/VB/Project/Visitors/AbstractASTVisitor.cs index 19396fc77f..7078b6d7b4 100644 --- a/VB/Project/Visitors/AbstractASTVisitor.cs +++ b/VB/Project/Visitors/AbstractASTVisitor.cs @@ -31,17 +31,6 @@ namespace ICSharpCode.NRefactory.VB.Visitors { return addressOfExpression.Expression.AcceptVisitor(this, data); } - public virtual object VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression, object data) { - Debug.Assert((anonymousMethodExpression != null)); - Debug.Assert((anonymousMethodExpression.Parameters != null)); - Debug.Assert((anonymousMethodExpression.Body != null)); - foreach (ParameterDeclarationExpression o in anonymousMethodExpression.Parameters) { - Debug.Assert(o != null); - o.AcceptVisitor(this, data); - } - return anonymousMethodExpression.Body.AcceptVisitor(this, data); - } - public virtual object VisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression, object data) { Debug.Assert((arrayCreateExpression != null)); Debug.Assert((arrayCreateExpression.CreateType != null)); diff --git a/VB/Project/Visitors/AbstractAstTransformer.cs b/VB/Project/Visitors/AbstractAstTransformer.cs index b5d91fab1d..fe91eda0a9 100644 --- a/VB/Project/Visitors/AbstractAstTransformer.cs +++ b/VB/Project/Visitors/AbstractAstTransformer.cs @@ -60,27 +60,6 @@ namespace ICSharpCode.NRefactory.VB.Visitors { return null; } - public virtual object VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression, object data) { - Debug.Assert((anonymousMethodExpression != null)); - Debug.Assert((anonymousMethodExpression.Parameters != null)); - Debug.Assert((anonymousMethodExpression.Body != null)); - for (int i = 0; i < anonymousMethodExpression.Parameters.Count; i++) { - ParameterDeclarationExpression o = anonymousMethodExpression.Parameters[i]; - Debug.Assert(o != null); - nodeStack.Push(o); - o.AcceptVisitor(this, data); - o = (ParameterDeclarationExpression)nodeStack.Pop(); - if (o == null) - anonymousMethodExpression.Parameters.RemoveAt(i--); - else - anonymousMethodExpression.Parameters[i] = o; - } - nodeStack.Push(anonymousMethodExpression.Body); - anonymousMethodExpression.Body.AcceptVisitor(this, data); - anonymousMethodExpression.Body = ((BlockStatement)(nodeStack.Pop())); - return null; - } - public virtual object VisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression, object data) { Debug.Assert((arrayCreateExpression != null)); Debug.Assert((arrayCreateExpression.CreateType != null)); diff --git a/VB/Project/Visitors/LookupTableVisitor.cs b/VB/Project/Visitors/LookupTableVisitor.cs index 8d9fbd84d0..34692b61b2 100644 --- a/VB/Project/Visitors/LookupTableVisitor.cs +++ b/VB/Project/Visitors/LookupTableVisitor.cs @@ -120,16 +120,6 @@ namespace ICSharpCode.NRefactory.VB.Visitors return base.VisitLocalVariableDeclaration(localVariableDeclaration, data); } - public override object VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression, object data) - { - foreach (ParameterDeclarationExpression p in anonymousMethodExpression.Parameters) { - AddVariable(p.TypeReference, p.ParameterName, - anonymousMethodExpression.StartLocation, anonymousMethodExpression.EndLocation, - false, false, null, null, false); - } - return base.VisitAnonymousMethodExpression(anonymousMethodExpression, data); - } - public override object VisitLambdaExpression(LambdaExpression lambdaExpression, object data) { foreach (ParameterDeclarationExpression p in lambdaExpression.Parameters) { diff --git a/VB/Project/Visitors/NodeTrackingAstVisitor.cs b/VB/Project/Visitors/NodeTrackingAstVisitor.cs index 926875299a..bf54850c8d 100644 --- a/VB/Project/Visitors/NodeTrackingAstVisitor.cs +++ b/VB/Project/Visitors/NodeTrackingAstVisitor.cs @@ -45,13 +45,6 @@ namespace ICSharpCode.NRefactory.VB.Visitors { return result; } - public sealed override object VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression, object data) { - this.BeginVisit(anonymousMethodExpression); - object result = this.TrackedVisitAnonymousMethodExpression(anonymousMethodExpression, data); - this.EndVisit(anonymousMethodExpression); - return result; - } - public sealed override object VisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression, object data) { this.BeginVisit(arrayCreateExpression); object result = this.TrackedVisitArrayCreateExpression(arrayCreateExpression, data); @@ -830,10 +823,6 @@ namespace ICSharpCode.NRefactory.VB.Visitors { return base.VisitAddressOfExpression(addressOfExpression, data); } - public virtual object TrackedVisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression, object data) { - return base.VisitAnonymousMethodExpression(anonymousMethodExpression, data); - } - public virtual object TrackedVisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression, object data) { return base.VisitArrayCreateExpression(arrayCreateExpression, data); } diff --git a/VB/Project/Visitors/NotImplementedAstVisitor.cs b/VB/Project/Visitors/NotImplementedAstVisitor.cs index c840449f9c..05f8854a5f 100644 --- a/VB/Project/Visitors/NotImplementedAstVisitor.cs +++ b/VB/Project/Visitors/NotImplementedAstVisitor.cs @@ -26,10 +26,6 @@ namespace ICSharpCode.NRefactory.VB.Visitors { throw new global::System.NotImplementedException("AddressOfExpression"); } - public virtual object VisitAnonymousMethodExpression(AnonymousMethodExpression anonymousMethodExpression, object data) { - throw new global::System.NotImplementedException("AnonymousMethodExpression"); - } - public virtual object VisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression, object data) { throw new global::System.NotImplementedException("ArrayCreateExpression"); } diff --git a/VB/Test/Output/SpecialOutputVisitorTest.cs b/VB/Test/Output/SpecialOutputVisitorTest.cs index fb7eeb5d61..d92b7899e1 100644 --- a/VB/Test/Output/SpecialOutputVisitorTest.cs +++ b/VB/Test/Output/SpecialOutputVisitorTest.cs @@ -4,10 +4,12 @@ using System; using System.Collections.Generic; using System.IO; -using NUnit.Framework; + using ICSharpCode.NRefactory.VB.Dom; -using ICSharpCode.NRefactory.VB.Visitors; +using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.PrettyPrinter; +using ICSharpCode.NRefactory.VB.Visitors; +using NUnit.Framework; namespace ICSharpCode.NRefactory.VB.Tests.PrettyPrinter { @@ -16,7 +18,7 @@ namespace ICSharpCode.NRefactory.VB.Tests.PrettyPrinter { void TestProgram(string program) { - IParser parser = ParserFactory.CreateParser(new StringReader(program)); + VBParser parser = ParserFactory.CreateParser(new StringReader(program)); parser.Parse(); Assert.AreEqual("", parser.Errors.ErrorOutput); VBNetOutputVisitor outputVisitor = new VBNetOutputVisitor(); diff --git a/VB/Test/Output/VBNet/VBNetOutputTest.cs b/VB/Test/Output/VBNet/VBNetOutputTest.cs index c3612379b4..6a6b9f4614 100644 --- a/VB/Test/Output/VBNet/VBNetOutputTest.cs +++ b/VB/Test/Output/VBNet/VBNetOutputTest.cs @@ -3,10 +3,11 @@ using System; using System.IO; -using NUnit.Framework; using ICSharpCode.NRefactory.VB.Dom; -using ICSharpCode.NRefactory.VB.Visitors; +using ICSharpCode.NRefactory.VB.Parser; using ICSharpCode.NRefactory.VB.PrettyPrinter; +using ICSharpCode.NRefactory.VB.Visitors; +using NUnit.Framework; namespace ICSharpCode.NRefactory.VB.Tests.PrettyPrinter { @@ -15,7 +16,7 @@ namespace ICSharpCode.NRefactory.VB.Tests.PrettyPrinter { void TestProgram(string program) { - IParser parser = ParserFactory.CreateParser(new StringReader(program)); + VBParser parser = ParserFactory.CreateParser(new StringReader(program)); parser.Parse(); Assert.AreEqual("", parser.Errors.ErrorOutput); VBNetOutputVisitor outputVisitor = new VBNetOutputVisitor(); @@ -46,7 +47,7 @@ namespace ICSharpCode.NRefactory.VB.Tests.PrettyPrinter void TestExpression(string expression) { - IParser parser = ParserFactory.CreateParser(new StringReader(expression)); + VBParser parser = ParserFactory.CreateParser(new StringReader(expression)); Expression e = parser.ParseExpression(); Assert.AreEqual("", parser.Errors.ErrorOutput); VBNetOutputVisitor outputVisitor = new VBNetOutputVisitor(); diff --git a/VB/Test/Parser/GlobalScope/OptionDeclarationTests.cs b/VB/Test/Parser/GlobalScope/OptionDeclarationTests.cs index 59e2f8e0a2..1c2c0ac301 100644 --- a/VB/Test/Parser/GlobalScope/OptionDeclarationTests.cs +++ b/VB/Test/Parser/GlobalScope/OptionDeclarationTests.cs @@ -79,7 +79,7 @@ namespace ICSharpCode.NRefactory.VB.Tests.Dom public void VBNetInvalidOptionDeclarationTest() { string program = "Option\n"; - IParser parser = ParserFactory.CreateParser(new StringReader(program)); + VBParser parser = ParserFactory.CreateParser(new StringReader(program)); parser.Parse(); Assert.IsFalse(parser.Errors.ErrorOutput.Length == 0, "Expected errors, but operation completed successfully"); } diff --git a/VB/Test/Parser/GlobalScope/UsingDeclarationTests.cs b/VB/Test/Parser/GlobalScope/UsingDeclarationTests.cs index aa4522b279..7cce8b7b30 100644 --- a/VB/Test/Parser/GlobalScope/UsingDeclarationTests.cs +++ b/VB/Test/Parser/GlobalScope/UsingDeclarationTests.cs @@ -61,7 +61,7 @@ namespace ICSharpCode.NRefactory.VB.Tests.Dom public void VBNetWrongUsingTest() { string program = "Imports\n"; - IParser parser = ParserFactory.CreateParser(new StringReader(program)); + VBParser parser = ParserFactory.CreateParser(new StringReader(program)); parser.Parse(); Assert.IsTrue(parser.Errors.Count > 0); UsingDeclaration u = (UsingDeclaration)parser.CompilationUnit.Children[0]; @@ -74,7 +74,7 @@ namespace ICSharpCode.NRefactory.VB.Tests.Dom public void VBNetWrongUsing2Test() { string program = "Imports ,\n"; - IParser parser = ParserFactory.CreateParser(new StringReader(program)); + VBParser parser = ParserFactory.CreateParser(new StringReader(program)); parser.Parse(); Assert.IsTrue(parser.Errors.Count > 0); UsingDeclaration u = (UsingDeclaration)parser.CompilationUnit.Children[0]; @@ -88,7 +88,7 @@ namespace ICSharpCode.NRefactory.VB.Tests.Dom { string program = "Imports System\n" + "Imports My.Name.Space\n"; - IParser parser = ParserFactory.CreateParser(new StringReader(program)); + VBParser parser = ParserFactory.CreateParser(new StringReader(program)); parser.Parse(); Assert.AreEqual("", parser.Errors.ErrorOutput); @@ -101,7 +101,7 @@ namespace ICSharpCode.NRefactory.VB.Tests.Dom string program = "Imports TESTME=System\n" + "Imports myAlias=My.Name.Space\n" + "Imports StringCollection = System.Collections.Generic.List(Of string)\n"; - IParser parser = ParserFactory.CreateParser(new StringReader(program)); + VBParser parser = ParserFactory.CreateParser(new StringReader(program)); parser.Parse(); Assert.AreEqual("", parser.Errors.ErrorOutput); @@ -112,7 +112,7 @@ namespace ICSharpCode.NRefactory.VB.Tests.Dom public void VBNetComplexUsingAliasDeclarationTest() { string program = "Imports NS1, AL=NS2, NS3, AL2=NS4, NS5\n"; - IParser parser = ParserFactory.CreateParser(new StringReader(program)); + VBParser parser = ParserFactory.CreateParser(new StringReader(program)); parser.Parse(); Assert.AreEqual("", parser.Errors.ErrorOutput); @@ -123,7 +123,7 @@ namespace ICSharpCode.NRefactory.VB.Tests.Dom public void VBNetXmlNamespaceUsingTest() { string program = "Imports "; - IParser parser = ParserFactory.CreateParser(new StringReader(program)); + VBParser parser = ParserFactory.CreateParser(new StringReader(program)); parser.Parse(); Assert.AreEqual("", parser.Errors.ErrorOutput); @@ -144,7 +144,7 @@ namespace ICSharpCode.NRefactory.VB.Tests.Dom public void VBNetXmlNamespaceWithPrefixUsingTest() { string program = "Imports "; - IParser parser = ParserFactory.CreateParser(new StringReader(program)); + VBParser parser = ParserFactory.CreateParser(new StringReader(program)); parser.Parse(); Assert.AreEqual("", parser.Errors.ErrorOutput); @@ -165,7 +165,7 @@ namespace ICSharpCode.NRefactory.VB.Tests.Dom public void VBNetXmlNamespaceSingleQuotedUsingTest() { string program = "Imports "; - IParser parser = ParserFactory.CreateParser(new StringReader(program)); + VBParser parser = ParserFactory.CreateParser(new StringReader(program)); parser.Parse(); Assert.AreEqual("", parser.Errors.ErrorOutput); @@ -186,7 +186,7 @@ namespace ICSharpCode.NRefactory.VB.Tests.Dom public void VBNetXmlNamespaceSingleQuotedWithPrefixUsingTest() { string program = "Imports "; - IParser parser = ParserFactory.CreateParser(new StringReader(program)); + VBParser parser = ParserFactory.CreateParser(new StringReader(program)); parser.Parse(); Assert.AreEqual("", parser.Errors.ErrorOutput); diff --git a/VB/Test/Parser/ParseUtil.cs b/VB/Test/Parser/ParseUtil.cs index e8f5c8a077..917b5bde3a 100644 --- a/VB/Test/Parser/ParseUtil.cs +++ b/VB/Test/Parser/ParseUtil.cs @@ -18,7 +18,7 @@ namespace ICSharpCode.NRefactory.VB.Tests.Dom public static T ParseGlobal(string program, bool expectErrors) where T : INode { - IParser parser = ParserFactory.CreateParser(new StringReader(program)); + VBParser parser = ParserFactory.CreateParser(new StringReader(program)); parser.Parse(); if (expectErrors) @@ -76,7 +76,7 @@ namespace ICSharpCode.NRefactory.VB.Tests.Dom public static T ParseExpression(string expr, bool expectErrors) where T : INode { - IParser parser = ParserFactory.CreateParser(new StringReader(expr)); + VBParser parser = ParserFactory.CreateParser(new StringReader(expr)); INode parsedExpression = parser.ParseExpression(); if (expectErrors) Assert.IsFalse(parser.Errors.ErrorOutput.Length == 0, "Expected errors, but operation completed successfully");