diff --git a/src/AddIns/BackendBindings/Boo/Boo.InterpreterAddIn/Project/Boo.InterpreterAddIn.booproj b/src/AddIns/BackendBindings/Boo/Boo.InterpreterAddIn/Project/Boo.InterpreterAddIn.booproj index 7f51856771..cee27f0546 100644 --- a/src/AddIns/BackendBindings/Boo/Boo.InterpreterAddIn/Project/Boo.InterpreterAddIn.booproj +++ b/src/AddIns/BackendBindings/Boo/Boo.InterpreterAddIn/Project/Boo.InterpreterAddIn.booproj @@ -39,6 +39,8 @@ + + diff --git a/src/AddIns/BackendBindings/Boo/Boo.InterpreterAddIn/Project/ContextEntry.boo b/src/AddIns/BackendBindings/Boo/Boo.InterpreterAddIn/Project/ContextEntry.boo new file mode 100644 index 0000000000..1ca7038c51 --- /dev/null +++ b/src/AddIns/BackendBindings/Boo/Boo.InterpreterAddIn/Project/ContextEntry.boo @@ -0,0 +1,55 @@ +// +// +// +// +// $Revision$ +// + +namespace Boo.InterpreterAddIn + +import System +import System.Windows.Forms +import ICSharpCode.Core +import ICSharpCode.SharpDevelop.Gui + +class ContextEntry: + [getter(InterpreterControl)] + _ctl as InteractiveInterpreterControl + + [getter(Context)] + _context as InterpreterContext + + [getter(ToolBarItem)] + _item as ToolStripButton + + _parentPad as InterpreterPad + + def constructor([required] context as InterpreterContext, [required] parentPad as InterpreterPad): + _context = context + _parentPad = parentPad + + _ctl = InteractiveInterpreterControl(context) + _ctl.Dock = DockStyle.Fill + + _item = ToolStripButton(StringParser.Parse(context.Title), context.Image) + _item.ToolTipText = context.ToolTipText + _item.Visible = context.Visible + _item.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText + + context.ImageChanged += AutoInvoke() do: + _item.Image = _context.Image + context.TitleChanged += AutoInvoke() do: + _item.Text = StringParser.Parse(_context.Title) + context.ToolTipTextChanged += AutoInvoke() do: + _item.ToolTipText = StringParser.Parse(_context.ToolTipText) + context.VisibleChanged += AutoInvoke() do: + _item.Visible = _context.Visible + _parentPad.UpdateToolBarVisible() + if _parentPad.CurrentContext is self and _context.Visible == false: + _parentPad.ActivateFirstVisibleContext() + _item.Click += def: + _parentPad.CurrentContext = self + + private static def AutoInvoke(what as callable()) as EventHandler: + return def(sender as object, e as EventArgs): + WorkbenchSingleton.SafeThreadAsyncCall(what) diff --git a/src/AddIns/BackendBindings/Boo/Boo.InterpreterAddIn/Project/DefaultBooInterpreterContext.boo b/src/AddIns/BackendBindings/Boo/Boo.InterpreterAddIn/Project/DefaultBooInterpreterContext.boo new file mode 100644 index 0000000000..5ecb5e9905 --- /dev/null +++ b/src/AddIns/BackendBindings/Boo/Boo.InterpreterAddIn/Project/DefaultBooInterpreterContext.boo @@ -0,0 +1,61 @@ +// +// +// +// +// $Revision$ +// + +namespace Boo.InterpreterAddIn + +import System +import System.Reflection + +class DefaultBooInterpreterContext(InterpreterContext): + _interpreter as Boo.Lang.Interpreter.InteractiveInterpreter + _isAdditionalTab as bool + + def constructor(): + self.Image = ICSharpCode.Core.ResourceService.GetBitmap("Boo.ProjectIcon") + + def constructor(isAdditionalTab as bool): + self() + if isAdditionalTab: + self.Title = "New " + self.Title + _isAdditionalTab = true + + private def AddAssemblies(main as Assembly): + _interpreter.References.Add(main) + for reference in main.GetReferencedAssemblies(): + _interpreter.References.Add(Assembly.Load(reference.FullName)) + + private def InitInterpreter(): + _interpreter = Boo.Lang.Interpreter.InteractiveInterpreter( + RememberLastValue: true, + Print: self.PrintLine) + AddAssemblies(typeof(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton).Assembly) + _interpreter.SetValue("cls", RaiseClear) + _interpreter.SetValue("newTab") do(): + InterpreterPad.Instance.AddInterpreterContext(c = DefaultBooInterpreterContext(true)) + return c + if _isAdditionalTab: + _interpreter.SetValue("thisTab", self) + + _interpreter.LoopEval(""" +import System +import System.IO +import System.Text +""") + + def RunCommand(code as string): + InitInterpreter() if _interpreter is null + try: + _interpreter.LoopEval(code) + except x as System.Reflection.TargetInvocationException: + PrintLine(x.InnerException.ToString()) + + def GetGlobals(): + InitInterpreter() if _interpreter is null + return _interpreter.globals() + + def CloseTab(): + InterpreterPad.Instance.RemoveInterpreterContext(self) diff --git a/src/AddIns/BackendBindings/Boo/Boo.InterpreterAddIn/Project/InteractiveInterpreterControl.boo b/src/AddIns/BackendBindings/Boo/Boo.InterpreterAddIn/Project/InteractiveInterpreterControl.boo index 825afca4f3..16573bcb3e 100644 --- a/src/AddIns/BackendBindings/Boo/Boo.InterpreterAddIn/Project/InteractiveInterpreterControl.boo +++ b/src/AddIns/BackendBindings/Boo/Boo.InterpreterAddIn/Project/InteractiveInterpreterControl.boo @@ -14,6 +14,7 @@ import System import System.Drawing import System.IO import System.Windows.Forms +import ICSharpCode.SharpDevelop.Gui import ICSharpCode.TextEditor import ICSharpCode.TextEditor.Document import ICSharpCode.TextEditor.Actions @@ -75,8 +76,16 @@ class InteractiveInterpreterControl(TextEditorControl): def constructor([required] interpreter as InterpreterContext): self._interpreter = interpreter - self._interpreter.LinePrinted += self.print - self._interpreter.Cleared += self.cls + self._interpreter.LinePrinted += def(line as string): + if WorkbenchSingleton.InvokeRequired: + WorkbenchSingleton.SafeThreadAsyncCall(self.print, (line,)) + else: + self.print(line) + self._interpreter.Cleared += def(): + if WorkbenchSingleton.InvokeRequired: + WorkbenchSingleton.SafeThreadAsyncCall(self.cls) + else: + self.cls() self._lineHistory = LineHistory(CurrentLineChanged: _lineHistory_CurrentLineChanged) self.Document.HighlightingStrategy = GetBooHighlighting() self.EnableFolding = false @@ -132,8 +141,8 @@ class InteractiveInterpreterControl(TextEditorControl): else: _block.WriteLine(code) - def print(msg): - AppendText("${msg}\r\n") + def print(msg as string): + AppendText(msg + "\r\n") def prompt(): AppendText((">>> ", "... ")[_state]) @@ -196,10 +205,8 @@ class InteractiveInterpreterControl(TextEditorControl): if key == Keys.Enter: try: (SingleLineInputState, BlockInputState)[_state]() - except x as System.Reflection.TargetInvocationException: - print(x.InnerException) except x: - print(x) + print(x.ToString()) prompt() return true diff --git a/src/AddIns/BackendBindings/Boo/Boo.InterpreterAddIn/Project/InterpreterContext.boo b/src/AddIns/BackendBindings/Boo/Boo.InterpreterAddIn/Project/InterpreterContext.boo index 093022d672..d6e8d2d46d 100644 --- a/src/AddIns/BackendBindings/Boo/Boo.InterpreterAddIn/Project/InterpreterContext.boo +++ b/src/AddIns/BackendBindings/Boo/Boo.InterpreterAddIn/Project/InterpreterContext.boo @@ -49,28 +49,3 @@ abstract class InterpreterContext: virtual def SuggestCodeCompletion(code as string) as (string): """Gets list of available members for completion on the passed expression. Used for '.' completion""" return null - -class DefaultBooInterpreterContext(InterpreterContext): - _interpreter as Boo.Lang.Interpreter.InteractiveInterpreter - - def constructor(): - self.Image = ICSharpCode.Core.ResourceService.GetBitmap("Boo.ProjectIcon") - - private def InitInterpreter(): - _interpreter = Boo.Lang.Interpreter.InteractiveInterpreter( - RememberLastValue: true, - Print: self.PrintLine) - _interpreter.SetValue("cls", RaiseClear) - _interpreter.LoopEval(""" -import System -import System.IO -import System.Text -""") - - def RunCommand(code as string): - InitInterpreter() if _interpreter is null - _interpreter.LoopEval(code) - - def GetGlobals(): - InitInterpreter() if _interpreter is null - return _interpreter.globals() diff --git a/src/AddIns/BackendBindings/Boo/Boo.InterpreterAddIn/Project/InterpreterPad.boo b/src/AddIns/BackendBindings/Boo/Boo.InterpreterAddIn/Project/InterpreterPad.boo index d372334a83..dfbf3058da 100644 --- a/src/AddIns/BackendBindings/Boo/Boo.InterpreterAddIn/Project/InterpreterPad.boo +++ b/src/AddIns/BackendBindings/Boo/Boo.InterpreterAddIn/Project/InterpreterPad.boo @@ -12,81 +12,65 @@ import System.Windows.Forms import ICSharpCode.Core import ICSharpCode.SharpDevelop.Gui -class ContextEntry: - [getter(InterpreterControl)] - _ctl as InteractiveInterpreterControl - - [getter(Context)] - _context as InterpreterContext - - [getter(ToolBarItem)] - _item as ToolStripButton - - _parentPad as InterpreterPad - - def constructor([required] context as InterpreterContext, [required] parentPad as InterpreterPad): - _context = context - _parentPad = parentPad - - _ctl = InteractiveInterpreterControl(context) - _ctl.Dock = DockStyle.Fill - - _item = ToolStripButton(StringParser.Parse(context.Title), context.Image) - _item.ToolTipText = context.ToolTipText - _item.Visible = context.Visible - _item.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText - - context.ImageChanged += AutoInvoke() do: - _item.Image = _context.Image - context.TitleChanged += AutoInvoke() do: - _item.Text = StringParser.Parse(_context.Title) - context.ToolTipTextChanged += AutoInvoke() do: - _item.ToolTipText = StringParser.Parse(_context.ToolTipText) - context.VisibleChanged += AutoInvoke() do: - _item.Visible = _context.Visible - _parentPad.UpdateToolBarVisible() - if _parentPad.CurrentContext is self and _context.Visible == false: - _parentPad.ActivateFirstVisibleContext() - _item.Click += def: - _parentPad.CurrentContext = self - - private static def AutoInvoke(what as callable()) as EventHandler: - return def(sender as object, e as EventArgs): - WorkbenchSingleton.SafeThreadAsyncCall(what) - class InterpreterPad(AbstractPadContent, IClipboardHandler): - [getter(Contexts)] - _contexts = [] + public static Instance as InterpreterPad: + get: + return WorkbenchSingleton.Workbench.GetPad(InterpreterPad).PadContent + _contexts = [] _currentContext as ContextEntry _toolStrip = ToolStrip(GripStyle: ToolStripGripStyle.Hidden) _panel = Panel() + _initDone def constructor(): _panel.Controls.Add(_toolStrip) for context as InterpreterContext in AddInTree.GetTreeNode("/AddIns/InterpreterAddIn/InterpreterContexts").BuildChildItemsArrayList(self): - newContext = ContextEntry(context, self) - _toolStrip.Items.Add(newContext.ToolBarItem) - _contexts.Add(newContext) + AddInterpreterContext(context) ActivateFirstVisibleContext() UpdateToolBarVisible() + _initDone = true + + def AddInterpreterContext([required] context as InterpreterContext): + newContext = ContextEntry(context, self) + _toolStrip.Items.Add(newContext.ToolBarItem) + _contexts.Add(newContext) + UpdateToolBarVisible() if _initDone + return newContext + + def RemoveInterpreterContext([required] context as InterpreterContext): + for c as ContextEntry in _contexts: + if c.Context is context: + RemoveInterpreterContext(c) + return + + def RemoveInterpreterContext([required] context as ContextEntry): + _contexts.Remove(context) + _toolStrip.Items.Remove(context.ToolBarItem) + ActivateFirstVisibleContext() if self.CurrentContext is context + UpdateToolBarVisible() def UpdateToolBarVisible(): count = 0 - for c as ContextEntry in self.Contexts: + for c as ContextEntry in _contexts: count += 1 if c.Context.Visible _toolStrip.Visible = (count > 1) def ActivateFirstVisibleContext(): - for c as ContextEntry in self.Contexts: + for c as ContextEntry in _contexts: if c.Context.Visible: self.CurrentContext = c return + self.CurrentContext = null Control as Control: get: return _panel + public Contexts: + get: + return System.Collections.ArrayList.ReadOnly(_contexts) + CurrentContext: get: return _currentContext @@ -96,9 +80,9 @@ class InterpreterPad(AbstractPadContent, IClipboardHandler): _panel.Controls.Remove(_currentContext.InterpreterControl) if value is not null: _panel.Controls.Add(value.InterpreterControl) - _panel.Controls.SetChildIndex(_toolStrip, 1) + _panel.Controls.SetChildIndex(_toolStrip, 1) _currentContext = value - for c as ContextEntry in self.Contexts: + for c as ContextEntry in _contexts: c.ToolBarItem.Checked = c is value CurrentTextArea: diff --git a/src/AddIns/BackendBindings/Boo/NRefactoryToBooConverter/Project/BooPrinterVisitorWithComments.cs b/src/AddIns/BackendBindings/Boo/NRefactoryToBooConverter/Project/BooPrinterVisitorWithComments.cs index 6e840779b0..374f5c1071 100644 --- a/src/AddIns/BackendBindings/Boo/NRefactoryToBooConverter/Project/BooPrinterVisitorWithComments.cs +++ b/src/AddIns/BackendBindings/Boo/NRefactoryToBooConverter/Project/BooPrinterVisitorWithComments.cs @@ -49,7 +49,7 @@ namespace NRefactoryToBooConverter void AcceptPoint(int line, int column) { while (available) { - Point b = enumerator.Current.StartPosition; + Location b = enumerator.Current.StartPosition; if (b.Y < line || (b.Y == line && b.X <= column)) { WriteCurrent(); } else { diff --git a/src/AddIns/BackendBindings/Boo/NRefactoryToBooConverter/Project/ConvertVisitor.cs b/src/AddIns/BackendBindings/Boo/NRefactoryToBooConverter/Project/ConvertVisitor.cs index 5571996d8f..f655026dea 100644 --- a/src/AddIns/BackendBindings/Boo/NRefactoryToBooConverter/Project/ConvertVisitor.cs +++ b/src/AddIns/BackendBindings/Boo/NRefactoryToBooConverter/Project/ConvertVisitor.cs @@ -47,7 +47,7 @@ namespace NRefactoryToBooConverter { if (node == null) return new B.LexicalInfo(fileName); - Point point = node.StartLocation; + Location point = node.StartLocation; if (!point.IsEmpty) { lastLexicalInfo = new B.LexicalInfo(fileName, point.Y, point.X); } @@ -82,7 +82,7 @@ namespace NRefactoryToBooConverter return GetLocation(node.EndLocation); } - B.SourceLocation GetLocation(Point point) + B.SourceLocation GetLocation(Location point) { return new B.SourceLocation(point.Y, point.X); } diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerLoader/NRefactoryDesignerLoader.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerLoader/NRefactoryDesignerLoader.cs index 8784481ad3..008a871851 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerLoader/NRefactoryDesignerLoader.cs +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerLoader/NRefactoryDesignerLoader.cs @@ -299,7 +299,7 @@ namespace ICSharpCode.FormsDesigner } } - void FixTypeReference(TypeReference type, Point location, ICSharpCode.SharpDevelop.Dom.ICompilationUnit domCu) + void FixTypeReference(TypeReference type, Location location, ICSharpCode.SharpDevelop.Dom.ICompilationUnit domCu) { if (type == null) return; diff --git a/src/Libraries/NRefactory/Project/NRefactory.csproj b/src/Libraries/NRefactory/Project/NRefactory.csproj index dde24b0e62..98737e6c07 100644 --- a/src/Libraries/NRefactory/Project/NRefactory.csproj +++ b/src/Libraries/NRefactory/Project/NRefactory.csproj @@ -49,7 +49,6 @@ - @@ -127,6 +126,7 @@ Configuration\GlobalAssemblyInfo.cs + @@ -137,4 +137,4 @@ - + \ No newline at end of file diff --git a/src/Libraries/NRefactory/Project/Src/Lexer/CSharp/Lexer.cs b/src/Libraries/NRefactory/Project/Src/Lexer/CSharp/Lexer.cs index 5eb7883cdc..0b994a8f06 100644 --- a/src/Libraries/NRefactory/Project/Src/Lexer/CSharp/Lexer.cs +++ b/src/Libraries/NRefactory/Project/Src/Lexer/CSharp/Lexer.cs @@ -8,7 +8,6 @@ using System; using System.IO; using System.Collections; -using System.Drawing; using System.Diagnostics; using System.Globalization; using System.Text; @@ -24,10 +23,10 @@ namespace ICSharpCode.NRefactory.Parser.CSharp void ReadPreProcessingDirective() { - Point start = new Point(Col - 1, Line); + Location start = new Location(Col - 1, Line); string directive = ReadIdent('#'); string argument = ReadToEOL(); - this.specialTracker.AddPreProcessingDirective(directive, argument.Trim(), start, new Point(start.X + directive.Length + argument.Length, start.Y)); + this.specialTracker.AddPreProcessingDirective(directive, argument.Trim(), start, new Location(start.X + directive.Length + argument.Length, start.Y)); } protected override Token Next() @@ -727,9 +726,9 @@ namespace ICSharpCode.NRefactory.Parser.CSharp string tag = curWord.ToString(); curWord.Length = 0; if (specialCommentHash.ContainsKey(tag)) { - Point p = new Point(Col, Line); + Location p = new Location(Col, Line); string comment = ch + ReadToEOL(); - tagComments.Add(new TagComment(tag, comment, p, new Point(Col, Line))); + tagComments.Add(new TagComment(tag, comment, p, new Location(Col, Line))); sb.Append(comment); break; } @@ -743,9 +742,9 @@ namespace ICSharpCode.NRefactory.Parser.CSharp if (skipAllComments) { SkipToEOL(); } else { - specialTracker.StartComment(commentType, new Point(Col, Line)); + specialTracker.StartComment(commentType, new Location(Col, Line)); specialTracker.AddString(ReadCommentToEOL()); - specialTracker.FinishComment(new Point(Col, Line)); + specialTracker.FinishComment(new Location(Col, Line)); } } @@ -761,7 +760,7 @@ namespace ICSharpCode.NRefactory.Parser.CSharp } } } else { - specialTracker.StartComment(CommentType.Block, new Point(Col, Line)); + specialTracker.StartComment(CommentType.Block, new Location(Col, Line)); while ((nextChar = ReaderRead()) != -1) { char ch = (char)nextChar; @@ -773,12 +772,12 @@ namespace ICSharpCode.NRefactory.Parser.CSharp // End of multiline comment reached ? if (ch == '*' && ReaderPeek() == '/') { ReaderRead(); - specialTracker.FinishComment(new Point(Col, Line)); + specialTracker.FinishComment(new Location(Col, Line)); return; } specialTracker.AddChar(ch); } - specialTracker.FinishComment(new Point(Col, Line)); + specialTracker.FinishComment(new Location(Col, Line)); } // Reached EOF before end of multiline comment. errors.Error(Line, Col, String.Format("Reached EOF before the end of a multiline comment")); diff --git a/src/Libraries/NRefactory/Project/Src/Lexer/LookupTable.cs b/src/Libraries/NRefactory/Project/Src/Lexer/LookupTable.cs index 415abf6f0c..b3fd67a05f 100644 --- a/src/Libraries/NRefactory/Project/Src/Lexer/LookupTable.cs +++ b/src/Libraries/NRefactory/Project/Src/Lexer/LookupTable.cs @@ -7,7 +7,6 @@ using System; using System.Collections; -using System.Drawing; using System.Globalization; namespace ICSharpCode.NRefactory.Parser diff --git a/src/Libraries/NRefactory/Project/Src/Lexer/Special/BlankLine.cs b/src/Libraries/NRefactory/Project/Src/Lexer/Special/BlankLine.cs index 694bd2ba86..f8d415f55a 100644 --- a/src/Libraries/NRefactory/Project/Src/Lexer/Special/BlankLine.cs +++ b/src/Libraries/NRefactory/Project/Src/Lexer/Special/BlankLine.cs @@ -6,13 +6,12 @@ // using System; -using System.Drawing; namespace ICSharpCode.NRefactory.Parser { public class BlankLine : AbstractSpecial { - public BlankLine(Point point) : base(point) + public BlankLine(Location point) : base(point) { } diff --git a/src/Libraries/NRefactory/Project/Src/Lexer/Special/Comment.cs b/src/Libraries/NRefactory/Project/Src/Lexer/Special/Comment.cs index f1978a44e3..922a55362f 100644 --- a/src/Libraries/NRefactory/Project/Src/Lexer/Special/Comment.cs +++ b/src/Libraries/NRefactory/Project/Src/Lexer/Special/Comment.cs @@ -9,7 +9,6 @@ using System; using System.Text; using System.CodeDom; using System.Collections; -using System.Drawing; namespace ICSharpCode.NRefactory.Parser { @@ -36,7 +35,7 @@ namespace ICSharpCode.NRefactory.Parser } } - public Comment(CommentType commentType, string comment, Point startPosition, Point endPosition) + public Comment(CommentType commentType, string comment, Location startPosition, Location endPosition) : base(startPosition, endPosition) { this.commentType = commentType; diff --git a/src/Libraries/NRefactory/Project/Src/Lexer/Special/ISpecial.cs b/src/Libraries/NRefactory/Project/Src/Lexer/Special/ISpecial.cs index 88f37e6b0a..8d3231f882 100644 --- a/src/Libraries/NRefactory/Project/Src/Lexer/Special/ISpecial.cs +++ b/src/Libraries/NRefactory/Project/Src/Lexer/Special/ISpecial.cs @@ -6,7 +6,6 @@ // using System; -using System.Drawing; namespace ICSharpCode.NRefactory.Parser { @@ -15,8 +14,8 @@ namespace ICSharpCode.NRefactory.Parser /// public interface ISpecial { - Point StartPosition { get; } - Point EndPosition { get; } + Location StartPosition { get; } + Location EndPosition { get; } object AcceptVisitor(ISpecialVisitor visitor, object data); } @@ -33,21 +32,21 @@ namespace ICSharpCode.NRefactory.Parser { public abstract object AcceptVisitor(ISpecialVisitor visitor, object data); - Point startPosition, endPosition; + Location startPosition, endPosition; - public AbstractSpecial(Point position) + public AbstractSpecial(Location position) { this.startPosition = position; this.endPosition = position; } - public AbstractSpecial(Point startPosition, Point endPosition) + public AbstractSpecial(Location startPosition, Location endPosition) { this.startPosition = startPosition; this.endPosition = endPosition; } - public Point StartPosition { + public Location StartPosition { get { return startPosition; } @@ -56,7 +55,7 @@ namespace ICSharpCode.NRefactory.Parser } } - public Point EndPosition { + public Location EndPosition { get { return endPosition; } diff --git a/src/Libraries/NRefactory/Project/Src/Lexer/Special/PreProcessingDirective.cs b/src/Libraries/NRefactory/Project/Src/Lexer/Special/PreProcessingDirective.cs index 7e663db306..2b7854b6bb 100644 --- a/src/Libraries/NRefactory/Project/Src/Lexer/Special/PreProcessingDirective.cs +++ b/src/Libraries/NRefactory/Project/Src/Lexer/Special/PreProcessingDirective.cs @@ -6,7 +6,6 @@ // using System; -using System.Drawing; using System.Collections.Generic; using System.Globalization; @@ -108,7 +107,7 @@ namespace ICSharpCode.NRefactory.Parser Arg); } - public PreProcessingDirective(string cmd, string arg, Point start, Point end) + public PreProcessingDirective(string cmd, string arg, Location start, Location end) : base(start, end) { this.cmd = cmd; diff --git a/src/Libraries/NRefactory/Project/Src/Lexer/Special/SpecialTracker.cs b/src/Libraries/NRefactory/Project/Src/Lexer/Special/SpecialTracker.cs index 9c580523e7..144df98ce9 100644 --- a/src/Libraries/NRefactory/Project/Src/Lexer/Special/SpecialTracker.cs +++ b/src/Libraries/NRefactory/Project/Src/Lexer/Special/SpecialTracker.cs @@ -9,7 +9,6 @@ using System; using System.Text; using System.CodeDom; using System.Collections.Generic; -using System.Drawing; namespace ICSharpCode.NRefactory.Parser { @@ -19,7 +18,7 @@ namespace ICSharpCode.NRefactory.Parser CommentType currentCommentType; StringBuilder sb = new StringBuilder(); - Point startPosition; + Location startPosition; public List CurrentSpecials { get { @@ -42,18 +41,18 @@ namespace ICSharpCode.NRefactory.Parser return tmp; } - public void AddEndOfLine(Point point) + public void AddEndOfLine(Location point) { currentSpecials.Add(new BlankLine(point)); } - public void AddPreProcessingDirective(string cmd, string arg, Point start, Point end) + public void AddPreProcessingDirective(string cmd, string arg, Location start, Location end) { currentSpecials.Add(new PreProcessingDirective(cmd, arg, start, end)); } // used for comment tracking - public void StartComment(CommentType commentType, Point startPosition) + public void StartComment(CommentType commentType, Location startPosition) { this.currentCommentType = commentType; this.startPosition = startPosition; @@ -70,7 +69,7 @@ namespace ICSharpCode.NRefactory.Parser sb.Append(s); } - public void FinishComment(Point endPosition) + public void FinishComment(Location endPosition) { currentSpecials.Add(new Comment(currentCommentType, sb.ToString(), startPosition, endPosition)); } diff --git a/src/Libraries/NRefactory/Project/Src/Lexer/Special/TagComment.cs b/src/Libraries/NRefactory/Project/Src/Lexer/Special/TagComment.cs index 4a4b203ada..9113b6e8f8 100644 --- a/src/Libraries/NRefactory/Project/Src/Lexer/Special/TagComment.cs +++ b/src/Libraries/NRefactory/Project/Src/Lexer/Special/TagComment.cs @@ -9,7 +9,6 @@ using System; using System.Text; using System.CodeDom; using System.Collections; -using System.Drawing; namespace ICSharpCode.NRefactory.Parser { @@ -29,7 +28,7 @@ namespace ICSharpCode.NRefactory.Parser } } - public TagComment(string tag, string comment, Point startPosition, Point endPosition) : base(CommentType.SingleLine, comment, startPosition, endPosition) + public TagComment(string tag, string comment, Location startPosition, Location endPosition) : base(CommentType.SingleLine, comment, startPosition, endPosition) { this.tag = tag; } diff --git a/src/Libraries/NRefactory/Project/Src/Lexer/Token.cs b/src/Libraries/NRefactory/Project/Src/Lexer/Token.cs index c9710e3284..2e1da317b7 100644 --- a/src/Libraries/NRefactory/Project/Src/Lexer/Token.cs +++ b/src/Libraries/NRefactory/Project/Src/Lexer/Token.cs @@ -6,7 +6,6 @@ // using System; -using System.Drawing; namespace ICSharpCode.NRefactory.Parser { @@ -21,14 +20,14 @@ namespace ICSharpCode.NRefactory.Parser public string val; public Token next; - public Point EndLocation { + public Location EndLocation { get { - return new Point(val == null ? col + 1 : col + val.Length, line); + return new Location(val == null ? col + 1 : col + val.Length, line); } } - public Point Location { + public Location Location { get { - return new Point(col, line); + return new Location(col, line); } } diff --git a/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Lexer.cs b/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Lexer.cs index 3604f26519..e5e78eb2d2 100644 --- a/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Lexer.cs +++ b/src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Lexer.cs @@ -8,7 +8,6 @@ using System; using System.IO; using System.Collections; -using System.Drawing; using System.Diagnostics; using System.Globalization; using System.Text; @@ -469,10 +468,10 @@ namespace ICSharpCode.NRefactory.Parser.VB void ReadPreprocessorDirective() { - Point start = new Point(Col - 1, Line); + Location start = new Location(Col - 1, Line); string directive = ReadIdent('#'); string argument = ReadToEOL(); - this.specialTracker.AddPreProcessingDirective(directive, argument.Trim(), start, new Point(start.X + directive.Length + argument.Length, start.Y)); + this.specialTracker.AddPreProcessingDirective(directive, argument.Trim(), start, new Location(start.X + directive.Length + argument.Length, start.Y)); } string ReadDate() @@ -524,7 +523,7 @@ namespace ICSharpCode.NRefactory.Parser.VB void ReadComment() { - Point startPos = new Point(Col, Line); + Location startPos = new Location(Col, Line); sb.Length = 0; StringBuilder curWord = specialCommentHash != null ? new StringBuilder() : null; int missingApostrophes = 2; // no. of ' missing until it is a documentation comment @@ -559,9 +558,9 @@ namespace ICSharpCode.NRefactory.Parser.VB string tag = curWord.ToString(); curWord.Length = 0; if (specialCommentHash.ContainsKey(tag)) { - Point p = new Point(Col, Line); + Location p = new Location(Col, Line); string comment = ch + ReadToEOL(); - tagComments.Add(new TagComment(tag, comment, p, new Point(Col, Line))); + tagComments.Add(new TagComment(tag, comment, p, new Location(Col, Line))); sb.Append(comment); break; } @@ -572,7 +571,7 @@ namespace ICSharpCode.NRefactory.Parser.VB specialTracker.StartComment(CommentType.SingleLine, startPos); } specialTracker.AddString(sb.ToString()); - specialTracker.FinishComment(new Point(Col, Line)); + specialTracker.FinishComment(new Location(Col, Line)); } Token ReadOperator(char ch) diff --git a/src/Libraries/NRefactory/Project/Src/Output/SpecialNodesInserter.cs b/src/Libraries/NRefactory/Project/Src/Output/SpecialNodesInserter.cs index c5d672e771..9fc5d105ba 100644 --- a/src/Libraries/NRefactory/Project/Src/Output/SpecialNodesInserter.cs +++ b/src/Libraries/NRefactory/Project/Src/Output/SpecialNodesInserter.cs @@ -6,7 +6,6 @@ // using System; -using System.Drawing; using System.Collections.Generic; using ICSharpCode.NRefactory.Parser; using ICSharpCode.NRefactory.Parser.AST; @@ -94,10 +93,10 @@ namespace ICSharpCode.NRefactory.PrettyPrinter /// /// Writes all specials up to the specified location. /// - public void AcceptPoint(Point a) + public void AcceptPoint(Location a) { while (available) { - Point b = enumerator.Current.StartPosition; + Location b = enumerator.Current.StartPosition; if (b.Y < a.Y || (b.Y == a.Y && b.X <= a.X)) { WriteCurrent(); } else { diff --git a/src/Libraries/NRefactory/Project/Src/Parser/AST/AbstractNode.cs b/src/Libraries/NRefactory/Project/Src/Parser/AST/AbstractNode.cs index c7a91eab32..3398b9b339 100644 --- a/src/Libraries/NRefactory/Project/Src/Parser/AST/AbstractNode.cs +++ b/src/Libraries/NRefactory/Project/Src/Parser/AST/AbstractNode.cs @@ -7,7 +7,6 @@ using System; using System.Text; -using System.Drawing; using System.Diagnostics; using System.Collections; using System.Collections.Generic; @@ -19,8 +18,8 @@ namespace ICSharpCode.NRefactory.Parser.AST INode parent; List children = new List(); - Point startLocation; - Point endLocation; + Location startLocation; + Location endLocation; public INode Parent { get { @@ -31,7 +30,7 @@ namespace ICSharpCode.NRefactory.Parser.AST } } - public Point StartLocation { + public Location StartLocation { get { return startLocation; } @@ -40,7 +39,7 @@ namespace ICSharpCode.NRefactory.Parser.AST } } - public Point EndLocation { + public Location EndLocation { get { return endLocation; } diff --git a/src/Libraries/NRefactory/Project/Src/Parser/AST/Generated.cs b/src/Libraries/NRefactory/Project/Src/Parser/AST/Generated.cs index c784ebb1c8..ec57e6ad15 100644 --- a/src/Libraries/NRefactory/Project/Src/Parser/AST/Generated.cs +++ b/src/Libraries/NRefactory/Project/Src/Parser/AST/Generated.cs @@ -12,7 +12,6 @@ namespace ICSharpCode.NRefactory.Parser.AST { using System; using System.Collections.Generic; using System.Diagnostics; - using System.Drawing; public class AddHandlerStatement : Statement { @@ -1459,9 +1458,9 @@ namespace ICSharpCode.NRefactory.Parser.AST { EventRaiseRegion raiseRegion; - Point bodyStart; + Location bodyStart; - Point bodyEnd; + Location bodyEnd; public TypeReference TypeReference { get { @@ -1508,7 +1507,7 @@ namespace ICSharpCode.NRefactory.Parser.AST { } } - public Point BodyStart { + public Location BodyStart { get { return bodyStart; } @@ -1517,7 +1516,7 @@ namespace ICSharpCode.NRefactory.Parser.AST { } } - public Point BodyEnd { + public Location BodyEnd { get { return bodyEnd; } @@ -1533,8 +1532,8 @@ namespace ICSharpCode.NRefactory.Parser.AST { addRegion = EventAddRegion.Null; removeRegion = EventRemoveRegion.Null; raiseRegion = EventRaiseRegion.Null; - bodyStart = new Point(-1, -1); - bodyEnd = new Point(-1, -1); + bodyStart = new Location(-1, -1); + bodyEnd = new Location(-1, -1); } public EventDeclaration(TypeReference typeReference, Modifier modifier, List parameters, List attributes, string name, List interfaceImplementations) : @@ -1544,8 +1543,8 @@ namespace ICSharpCode.NRefactory.Parser.AST { addRegion = EventAddRegion.Null; removeRegion = EventRemoveRegion.Null; raiseRegion = EventRaiseRegion.Null; - bodyStart = new Point(-1, -1); - bodyEnd = new Point(-1, -1); + bodyStart = new Location(-1, -1); + bodyEnd = new Location(-1, -1); } public bool HasAddRegion { @@ -2243,9 +2242,9 @@ namespace ICSharpCode.NRefactory.Parser.AST { TypeReference typeReference; - Point bodyStart; + Location bodyStart; - Point bodyEnd; + Location bodyEnd; PropertyGetRegion getRegion; @@ -2278,7 +2277,7 @@ namespace ICSharpCode.NRefactory.Parser.AST { } } - public Point BodyStart { + public Location BodyStart { get { return bodyStart; } @@ -2287,7 +2286,7 @@ namespace ICSharpCode.NRefactory.Parser.AST { } } - public Point BodyEnd { + public Location BodyEnd { get { return bodyEnd; } @@ -2320,8 +2319,8 @@ namespace ICSharpCode.NRefactory.Parser.AST { Parameters = parameters; interfaceImplementations = new List(); typeReference = TypeReference.Null; - bodyStart = new Point(-1, -1); - bodyEnd = new Point(-1, -1); + bodyStart = new Location(-1, -1); + bodyEnd = new Location(-1, -1); getRegion = PropertyGetRegion.Null; setRegion = PropertySetRegion.Null; } @@ -2332,8 +2331,8 @@ namespace ICSharpCode.NRefactory.Parser.AST { Parameters = parameters; Modifier = modifier; interfaceImplementations = new List(); - bodyStart = new Point(-1, -1); - bodyEnd = new Point(-1, -1); + bodyStart = new Location(-1, -1); + bodyEnd = new Location(-1, -1); getRegion = PropertyGetRegion.Null; setRegion = PropertySetRegion.Null; } @@ -3058,9 +3057,9 @@ namespace ICSharpCode.NRefactory.Parser.AST { TypeReference typeReference; - Point bodyStart; + Location bodyStart; - Point bodyEnd; + Location bodyEnd; PropertyGetRegion getRegion; @@ -3084,7 +3083,7 @@ namespace ICSharpCode.NRefactory.Parser.AST { } } - public Point BodyStart { + public Location BodyStart { get { return bodyStart; } @@ -3093,7 +3092,7 @@ namespace ICSharpCode.NRefactory.Parser.AST { } } - public Point BodyEnd { + public Location BodyEnd { get { return bodyEnd; } @@ -3124,8 +3123,8 @@ namespace ICSharpCode.NRefactory.Parser.AST { base(modifier, attributes, name, parameters) { interfaceImplementations = new List(); typeReference = TypeReference.Null; - bodyStart = new Point(-1, -1); - bodyEnd = new Point(-1, -1); + bodyStart = new Location(-1, -1); + bodyEnd = new Location(-1, -1); getRegion = PropertyGetRegion.Null; setRegion = PropertySetRegion.Null; } @@ -3806,7 +3805,7 @@ namespace ICSharpCode.NRefactory.Parser.AST { List templates; - Point bodyStartLocation; + Location bodyStartLocation; public string Name { get { @@ -3844,7 +3843,7 @@ namespace ICSharpCode.NRefactory.Parser.AST { } } - public Point BodyStartLocation { + public Location BodyStartLocation { get { return bodyStartLocation; } @@ -3859,7 +3858,7 @@ namespace ICSharpCode.NRefactory.Parser.AST { name = ""; baseTypes = new List(); templates = new List(); - bodyStartLocation = new Point(-1, -1); + bodyStartLocation = new Location(-1, -1); } public override object AcceptVisitor(IAstVisitor visitor, object data) { diff --git a/src/Libraries/NRefactory/Project/Src/Parser/AST/INode.cs b/src/Libraries/NRefactory/Project/Src/Parser/AST/INode.cs index 4e5a3a85ec..47c48b8eea 100644 --- a/src/Libraries/NRefactory/Project/Src/Parser/AST/INode.cs +++ b/src/Libraries/NRefactory/Project/Src/Parser/AST/INode.cs @@ -6,7 +6,6 @@ // using System; -using System.Drawing; using System.Collections.Generic; namespace ICSharpCode.NRefactory.Parser.AST @@ -22,12 +21,12 @@ namespace ICSharpCode.NRefactory.Parser.AST get; } - Point StartLocation { + Location StartLocation { get; set; } - Point EndLocation { + Location EndLocation { get; set; } diff --git a/src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs b/src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs index 66fe0bee9a..a466bca440 100644 --- a/src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs +++ b/src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs @@ -1,6 +1,5 @@ #line 1 "cs.ATG" -using System.Drawing; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; @@ -27,7 +26,7 @@ internal class Parser : AbstractParser const bool x = false; -#line 14 "cs.ATG" +#line 13 "cs.ATG" string assemblyName = null; StringBuilder qualidentBuilder = new StringBuilder(); @@ -523,14 +522,14 @@ bool WriteFullTypeName(StringBuilder b, Expression expr) void CS() { -#line 642 "cs.ATG" +#line 641 "cs.ATG" lexer.NextToken(); /* get the first token */ compilationUnit = new CompilationUnit(); while (la.kind == 120) { UsingDirective(); } while ( -#line 646 "cs.ATG" +#line 645 "cs.ATG" IsGlobalAttrTarget()) { GlobalAttributeSection(); } @@ -542,25 +541,25 @@ IsGlobalAttrTarget()) { void UsingDirective() { -#line 653 "cs.ATG" +#line 652 "cs.ATG" string qualident = null; TypeReference aliasedType = null; Expect(120); -#line 656 "cs.ATG" - Point startPos = t.Location; +#line 655 "cs.ATG" + Location startPos = t.Location; Qualident( -#line 657 "cs.ATG" +#line 656 "cs.ATG" out qualident); if (la.kind == 3) { lexer.NextToken(); NonArrayType( -#line 658 "cs.ATG" +#line 657 "cs.ATG" out aliasedType); } Expect(11); -#line 660 "cs.ATG" +#line 659 "cs.ATG" if (qualident != null && qualident.Length > 0) { INode node; if (aliasedType != null) { @@ -578,11 +577,11 @@ out aliasedType); void GlobalAttributeSection() { Expect(18); -#line 676 "cs.ATG" - Point startPos = t.Location; +#line 675 "cs.ATG" + Location startPos = t.Location; Expect(1); -#line 677 "cs.ATG" +#line 676 "cs.ATG" if (t.val != "assembly") Error("global attribute target specifier (\"assembly\") expected"); string attributeTarget = t.val; List attributes = new List(); @@ -590,20 +589,20 @@ out aliasedType); Expect(9); Attribute( -#line 682 "cs.ATG" +#line 681 "cs.ATG" out attribute); -#line 682 "cs.ATG" +#line 681 "cs.ATG" attributes.Add(attribute); while ( -#line 683 "cs.ATG" +#line 682 "cs.ATG" NotFinalComma()) { Expect(14); Attribute( -#line 683 "cs.ATG" +#line 682 "cs.ATG" out attribute); -#line 683 "cs.ATG" +#line 682 "cs.ATG" attributes.Add(attribute); } if (la.kind == 14) { @@ -611,7 +610,7 @@ out attribute); } Expect(19); -#line 685 "cs.ATG" +#line 684 "cs.ATG" AttributeSection section = new AttributeSection(attributeTarget, attributes); section.StartLocation = startPos; section.EndLocation = t.EndLocation; @@ -621,7 +620,7 @@ out attribute); void NamespaceMemberDecl() { -#line 776 "cs.ATG" +#line 775 "cs.ATG" AttributeSection section; List attributes = new List(); Modifiers m = new Modifiers(); @@ -630,13 +629,13 @@ out attribute); if (la.kind == 87) { lexer.NextToken(); -#line 782 "cs.ATG" - Point startPos = t.Location; +#line 781 "cs.ATG" + Location startPos = t.Location; Qualident( -#line 783 "cs.ATG" +#line 782 "cs.ATG" out qualident); -#line 783 "cs.ATG" +#line 782 "cs.ATG" INode node = new NamespaceDeclaration(qualident); node.StartLocation = startPos; compilationUnit.AddChild(node); @@ -654,139 +653,139 @@ out qualident); lexer.NextToken(); } -#line 792 "cs.ATG" +#line 791 "cs.ATG" node.EndLocation = t.EndLocation; compilationUnit.BlockEnd(); } else if (StartOf(2)) { while (la.kind == 18) { AttributeSection( -#line 796 "cs.ATG" +#line 795 "cs.ATG" out section); -#line 796 "cs.ATG" +#line 795 "cs.ATG" attributes.Add(section); } while (StartOf(3)) { TypeModifier( -#line 797 "cs.ATG" +#line 796 "cs.ATG" m); } TypeDecl( -#line 798 "cs.ATG" +#line 797 "cs.ATG" m, attributes); } else SynErr(126); } void Qualident( -#line 920 "cs.ATG" +#line 919 "cs.ATG" out string qualident) { Expect(1); -#line 922 "cs.ATG" +#line 921 "cs.ATG" qualidentBuilder.Length = 0; qualidentBuilder.Append(t.val); while ( -#line 923 "cs.ATG" +#line 922 "cs.ATG" DotAndIdent()) { Expect(15); Expect(1); -#line 923 "cs.ATG" +#line 922 "cs.ATG" qualidentBuilder.Append('.'); qualidentBuilder.Append(t.val); } -#line 926 "cs.ATG" +#line 925 "cs.ATG" qualident = qualidentBuilder.ToString(); } void NonArrayType( -#line 1035 "cs.ATG" +#line 1034 "cs.ATG" out TypeReference type) { -#line 1037 "cs.ATG" +#line 1036 "cs.ATG" string name; int pointer = 0; type = null; if (la.kind == 1 || la.kind == 90 || la.kind == 107) { ClassType( -#line 1042 "cs.ATG" +#line 1041 "cs.ATG" out type, false); } else if (StartOf(4)) { SimpleType( -#line 1043 "cs.ATG" +#line 1042 "cs.ATG" out name); -#line 1043 "cs.ATG" +#line 1042 "cs.ATG" type = new TypeReference(name); } else if (la.kind == 122) { lexer.NextToken(); Expect(6); -#line 1044 "cs.ATG" +#line 1043 "cs.ATG" pointer = 1; type = new TypeReference("void"); } else SynErr(127); if (la.kind == 12) { NullableQuestionMark( -#line 1047 "cs.ATG" +#line 1046 "cs.ATG" ref type); } while ( -#line 1049 "cs.ATG" +#line 1048 "cs.ATG" IsPointer()) { Expect(6); -#line 1050 "cs.ATG" +#line 1049 "cs.ATG" ++pointer; } -#line 1052 "cs.ATG" +#line 1051 "cs.ATG" if (type != null) { type.PointerNestingLevel = pointer; } } void Attribute( -#line 692 "cs.ATG" +#line 691 "cs.ATG" out ASTAttribute attribute) { -#line 693 "cs.ATG" +#line 692 "cs.ATG" string qualident; string alias = null; if ( -#line 697 "cs.ATG" +#line 696 "cs.ATG" la.kind == Tokens.Identifier && Peek(1).kind == Tokens.DoubleColon) { lexer.NextToken(); -#line 698 "cs.ATG" +#line 697 "cs.ATG" alias = t.val; Expect(10); } Qualident( -#line 701 "cs.ATG" +#line 700 "cs.ATG" out qualident); -#line 702 "cs.ATG" +#line 701 "cs.ATG" List positional = new List(); List named = new List(); string name = (alias != null && alias != "global") ? alias + "." + qualident : qualident; if (la.kind == 20) { AttributeArguments( -#line 706 "cs.ATG" +#line 705 "cs.ATG" positional, named); } -#line 706 "cs.ATG" +#line 705 "cs.ATG" attribute = new ICSharpCode.NRefactory.Parser.AST.Attribute(name, positional, named); } void AttributeArguments( -#line 709 "cs.ATG" +#line 708 "cs.ATG" List positional, List named) { -#line 711 "cs.ATG" +#line 710 "cs.ATG" bool nameFound = false; string name = ""; Expression expr; @@ -794,22 +793,22 @@ List positional, List named) { Expect(20); if (StartOf(5)) { if ( -#line 719 "cs.ATG" +#line 718 "cs.ATG" IsAssignment()) { -#line 719 "cs.ATG" +#line 718 "cs.ATG" nameFound = true; lexer.NextToken(); -#line 720 "cs.ATG" +#line 719 "cs.ATG" name = t.val; Expect(3); } Expr( -#line 722 "cs.ATG" +#line 721 "cs.ATG" out expr); -#line 722 "cs.ATG" +#line 721 "cs.ATG" if (expr != null) {if(name == "") positional.Add(expr); else { named.Add(new NamedArgumentExpression(name, expr)); name = ""; } } @@ -817,26 +816,26 @@ out expr); while (la.kind == 14) { lexer.NextToken(); if ( -#line 730 "cs.ATG" +#line 729 "cs.ATG" IsAssignment()) { -#line 730 "cs.ATG" +#line 729 "cs.ATG" nameFound = true; Expect(1); -#line 731 "cs.ATG" +#line 730 "cs.ATG" name = t.val; Expect(3); } else if (StartOf(5)) { -#line 733 "cs.ATG" +#line 732 "cs.ATG" if (nameFound) Error("no positional argument after named argument"); } else SynErr(128); Expr( -#line 734 "cs.ATG" +#line 733 "cs.ATG" out expr); -#line 734 "cs.ATG" +#line 733 "cs.ATG" if (expr != null) { if(name == "") positional.Add(expr); else { named.Add(new NamedArgumentExpression(name, expr)); name = ""; } } @@ -847,70 +846,70 @@ out expr); } void Expr( -#line 2076 "cs.ATG" +#line 2075 "cs.ATG" out Expression expr) { -#line 2077 "cs.ATG" +#line 2076 "cs.ATG" expr = null; Expression expr1 = null, expr2 = null; AssignmentOperatorType op; UnaryExpr( -#line 2079 "cs.ATG" +#line 2078 "cs.ATG" out expr); if (StartOf(6)) { AssignmentOperator( -#line 2082 "cs.ATG" +#line 2081 "cs.ATG" out op); Expr( -#line 2082 "cs.ATG" +#line 2081 "cs.ATG" out expr1); -#line 2082 "cs.ATG" +#line 2081 "cs.ATG" expr = new AssignmentExpression(expr, op, expr1); } else if ( -#line 2083 "cs.ATG" +#line 2082 "cs.ATG" la.kind == Tokens.GreaterThan && Peek(1).kind == Tokens.GreaterEqual) { AssignmentOperator( -#line 2084 "cs.ATG" +#line 2083 "cs.ATG" out op); Expr( -#line 2084 "cs.ATG" +#line 2083 "cs.ATG" out expr1); -#line 2084 "cs.ATG" +#line 2083 "cs.ATG" expr = new AssignmentExpression(expr, op, expr1); } else if (StartOf(7)) { ConditionalOrExpr( -#line 2086 "cs.ATG" +#line 2085 "cs.ATG" ref expr); if (la.kind == 13) { lexer.NextToken(); Expr( -#line 2087 "cs.ATG" +#line 2086 "cs.ATG" out expr1); -#line 2087 "cs.ATG" +#line 2086 "cs.ATG" expr = new BinaryOperatorExpression(expr, BinaryOperatorType.NullCoalescing, expr1); } if (la.kind == 12) { lexer.NextToken(); Expr( -#line 2088 "cs.ATG" +#line 2087 "cs.ATG" out expr1); Expect(9); Expr( -#line 2088 "cs.ATG" +#line 2087 "cs.ATG" out expr2); -#line 2088 "cs.ATG" +#line 2087 "cs.ATG" expr = new ConditionalExpression(expr, expr1, expr2); } } else SynErr(129); } void AttributeSection( -#line 743 "cs.ATG" +#line 742 "cs.ATG" out AttributeSection section) { -#line 745 "cs.ATG" +#line 744 "cs.ATG" string attributeTarget = ""; List attributes = new List(); ASTAttribute attribute; @@ -918,25 +917,25 @@ out AttributeSection section) { Expect(18); -#line 751 "cs.ATG" - Point startPos = t.Location; +#line 750 "cs.ATG" + Location startPos = t.Location; if ( -#line 752 "cs.ATG" +#line 751 "cs.ATG" IsLocalAttrTarget()) { if (la.kind == 68) { lexer.NextToken(); -#line 753 "cs.ATG" +#line 752 "cs.ATG" attributeTarget = "event"; } else if (la.kind == 100) { lexer.NextToken(); -#line 754 "cs.ATG" +#line 753 "cs.ATG" attributeTarget = "return"; } else { lexer.NextToken(); -#line 755 "cs.ATG" +#line 754 "cs.ATG" if (t.val != "field" || t.val != "method" || t.val != "module" || t.val != "param" || t.val != "property" || t.val != "type") @@ -948,20 +947,20 @@ IsLocalAttrTarget()) { Expect(9); } Attribute( -#line 765 "cs.ATG" +#line 764 "cs.ATG" out attribute); -#line 765 "cs.ATG" +#line 764 "cs.ATG" attributes.Add(attribute); while ( -#line 766 "cs.ATG" +#line 765 "cs.ATG" NotFinalComma()) { Expect(14); Attribute( -#line 766 "cs.ATG" +#line 765 "cs.ATG" out attribute); -#line 766 "cs.ATG" +#line 765 "cs.ATG" attributes.Add(attribute); } if (la.kind == 14) { @@ -969,7 +968,7 @@ out attribute); } Expect(19); -#line 768 "cs.ATG" +#line 767 "cs.ATG" section = new AttributeSection(attributeTarget, attributes); section.StartLocation = startPos; section.EndLocation = t.EndLocation; @@ -977,76 +976,76 @@ out attribute); } void TypeModifier( -#line 1122 "cs.ATG" +#line 1121 "cs.ATG" Modifiers m) { switch (la.kind) { case 88: { lexer.NextToken(); -#line 1124 "cs.ATG" +#line 1123 "cs.ATG" m.Add(Modifier.New, t.Location); break; } case 97: { lexer.NextToken(); -#line 1125 "cs.ATG" +#line 1124 "cs.ATG" m.Add(Modifier.Public, t.Location); break; } case 96: { lexer.NextToken(); -#line 1126 "cs.ATG" +#line 1125 "cs.ATG" m.Add(Modifier.Protected, t.Location); break; } case 83: { lexer.NextToken(); -#line 1127 "cs.ATG" +#line 1126 "cs.ATG" m.Add(Modifier.Internal, t.Location); break; } case 95: { lexer.NextToken(); -#line 1128 "cs.ATG" +#line 1127 "cs.ATG" m.Add(Modifier.Private, t.Location); break; } case 118: { lexer.NextToken(); -#line 1129 "cs.ATG" +#line 1128 "cs.ATG" m.Add(Modifier.Unsafe, t.Location); break; } case 48: { lexer.NextToken(); -#line 1130 "cs.ATG" +#line 1129 "cs.ATG" m.Add(Modifier.Abstract, t.Location); break; } case 102: { lexer.NextToken(); -#line 1131 "cs.ATG" +#line 1130 "cs.ATG" m.Add(Modifier.Sealed, t.Location); break; } case 106: { lexer.NextToken(); -#line 1132 "cs.ATG" +#line 1131 "cs.ATG" m.Add(Modifier.Static, t.Location); break; } case 1: { lexer.NextToken(); -#line 1133 "cs.ATG" +#line 1132 "cs.ATG" if (t.val == "partial") { m.Add(Modifier.Partial, t.Location); } else { Error("Unexpected identifier"); } break; } @@ -1055,10 +1054,10 @@ Modifiers m) { } void TypeDecl( -#line 801 "cs.ATG" +#line 800 "cs.ATG" Modifiers m, List attributes) { -#line 803 "cs.ATG" +#line 802 "cs.ATG" TypeReference type; List names; List p = new List(); @@ -1067,11 +1066,11 @@ Modifiers m, List attributes) { if (la.kind == 58) { -#line 809 "cs.ATG" +#line 808 "cs.ATG" m.Check(Modifier.Classes); lexer.NextToken(); -#line 810 "cs.ATG" +#line 809 "cs.ATG" TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); templates = newType.Templates; compilationUnit.AddChild(newType); @@ -1082,48 +1081,48 @@ Modifiers m, List attributes) { Expect(1); -#line 818 "cs.ATG" +#line 817 "cs.ATG" newType.Name = t.val; if (la.kind == 23) { TypeParameterList( -#line 821 "cs.ATG" +#line 820 "cs.ATG" templates); } if (la.kind == 9) { ClassBase( -#line 823 "cs.ATG" +#line 822 "cs.ATG" out names); -#line 823 "cs.ATG" +#line 822 "cs.ATG" newType.BaseTypes = names; } while ( -#line 826 "cs.ATG" +#line 825 "cs.ATG" IdentIsWhere()) { TypeParameterConstraintsClause( -#line 826 "cs.ATG" +#line 825 "cs.ATG" templates); } -#line 828 "cs.ATG" +#line 827 "cs.ATG" newType.BodyStartLocation = t.EndLocation; ClassBody(); if (la.kind == 11) { lexer.NextToken(); } -#line 830 "cs.ATG" +#line 829 "cs.ATG" newType.EndLocation = t.Location; compilationUnit.BlockEnd(); } else if (StartOf(8)) { -#line 833 "cs.ATG" +#line 832 "cs.ATG" m.Check(Modifier.StructsInterfacesEnumsDelegates); if (la.kind == 108) { lexer.NextToken(); -#line 834 "cs.ATG" +#line 833 "cs.ATG" TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); templates = newType.Templates; newType.StartLocation = m.GetDeclarationLocation(t.Location); @@ -1133,44 +1132,44 @@ templates); Expect(1); -#line 841 "cs.ATG" +#line 840 "cs.ATG" newType.Name = t.val; if (la.kind == 23) { TypeParameterList( -#line 844 "cs.ATG" +#line 843 "cs.ATG" templates); } if (la.kind == 9) { StructInterfaces( -#line 846 "cs.ATG" +#line 845 "cs.ATG" out names); -#line 846 "cs.ATG" +#line 845 "cs.ATG" newType.BaseTypes = names; } while ( -#line 849 "cs.ATG" +#line 848 "cs.ATG" IdentIsWhere()) { TypeParameterConstraintsClause( -#line 849 "cs.ATG" +#line 848 "cs.ATG" templates); } -#line 852 "cs.ATG" +#line 851 "cs.ATG" newType.BodyStartLocation = t.EndLocation; StructBody(); if (la.kind == 11) { lexer.NextToken(); } -#line 854 "cs.ATG" +#line 853 "cs.ATG" newType.EndLocation = t.Location; compilationUnit.BlockEnd(); } else if (la.kind == 82) { lexer.NextToken(); -#line 858 "cs.ATG" +#line 857 "cs.ATG" TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); templates = newType.Templates; compilationUnit.AddChild(newType); @@ -1180,44 +1179,44 @@ templates); Expect(1); -#line 865 "cs.ATG" +#line 864 "cs.ATG" newType.Name = t.val; if (la.kind == 23) { TypeParameterList( -#line 868 "cs.ATG" +#line 867 "cs.ATG" templates); } if (la.kind == 9) { InterfaceBase( -#line 870 "cs.ATG" +#line 869 "cs.ATG" out names); -#line 870 "cs.ATG" +#line 869 "cs.ATG" newType.BaseTypes = names; } while ( -#line 873 "cs.ATG" +#line 872 "cs.ATG" IdentIsWhere()) { TypeParameterConstraintsClause( -#line 873 "cs.ATG" +#line 872 "cs.ATG" templates); } -#line 875 "cs.ATG" +#line 874 "cs.ATG" newType.BodyStartLocation = t.EndLocation; InterfaceBody(); if (la.kind == 11) { lexer.NextToken(); } -#line 877 "cs.ATG" +#line 876 "cs.ATG" newType.EndLocation = t.Location; compilationUnit.BlockEnd(); } else if (la.kind == 67) { lexer.NextToken(); -#line 881 "cs.ATG" +#line 880 "cs.ATG" TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); compilationUnit.AddChild(newType); compilationUnit.BlockStart(newType); @@ -1226,81 +1225,81 @@ templates); Expect(1); -#line 887 "cs.ATG" +#line 886 "cs.ATG" newType.Name = t.val; if (la.kind == 9) { lexer.NextToken(); IntegralType( -#line 888 "cs.ATG" +#line 887 "cs.ATG" out name); -#line 888 "cs.ATG" +#line 887 "cs.ATG" newType.BaseTypes.Add(new TypeReference(name)); } -#line 890 "cs.ATG" +#line 889 "cs.ATG" newType.BodyStartLocation = t.EndLocation; EnumBody(); if (la.kind == 11) { lexer.NextToken(); } -#line 892 "cs.ATG" +#line 891 "cs.ATG" newType.EndLocation = t.Location; compilationUnit.BlockEnd(); } else { lexer.NextToken(); -#line 896 "cs.ATG" +#line 895 "cs.ATG" DelegateDeclaration delegateDeclr = new DelegateDeclaration(m.Modifier, attributes); templates = delegateDeclr.Templates; delegateDeclr.StartLocation = m.GetDeclarationLocation(t.Location); if ( -#line 900 "cs.ATG" +#line 899 "cs.ATG" NotVoidPointer()) { Expect(122); -#line 900 "cs.ATG" +#line 899 "cs.ATG" delegateDeclr.ReturnType = new TypeReference("void", 0, null); } else if (StartOf(9)) { Type( -#line 901 "cs.ATG" +#line 900 "cs.ATG" out type); -#line 901 "cs.ATG" +#line 900 "cs.ATG" delegateDeclr.ReturnType = type; } else SynErr(131); Expect(1); -#line 903 "cs.ATG" +#line 902 "cs.ATG" delegateDeclr.Name = t.val; if (la.kind == 23) { TypeParameterList( -#line 906 "cs.ATG" +#line 905 "cs.ATG" templates); } Expect(20); if (StartOf(10)) { FormalParameterList( -#line 908 "cs.ATG" +#line 907 "cs.ATG" p); -#line 908 "cs.ATG" +#line 907 "cs.ATG" delegateDeclr.Parameters = p; } Expect(21); while ( -#line 912 "cs.ATG" +#line 911 "cs.ATG" IdentIsWhere()) { TypeParameterConstraintsClause( -#line 912 "cs.ATG" +#line 911 "cs.ATG" templates); } Expect(11); -#line 914 "cs.ATG" +#line 913 "cs.ATG" delegateDeclr.EndLocation = t.Location; compilationUnit.AddChild(delegateDeclr); @@ -1309,90 +1308,90 @@ templates); } void TypeParameterList( -#line 2477 "cs.ATG" +#line 2476 "cs.ATG" List templates) { -#line 2479 "cs.ATG" +#line 2478 "cs.ATG" AttributeSection section; List attributes = new List(); Expect(23); while (la.kind == 18) { AttributeSection( -#line 2483 "cs.ATG" +#line 2482 "cs.ATG" out section); -#line 2483 "cs.ATG" +#line 2482 "cs.ATG" attributes.Add(section); } Expect(1); -#line 2484 "cs.ATG" +#line 2483 "cs.ATG" templates.Add(new TemplateDefinition(t.val, attributes)); while (la.kind == 14) { lexer.NextToken(); while (la.kind == 18) { AttributeSection( -#line 2485 "cs.ATG" +#line 2484 "cs.ATG" out section); -#line 2485 "cs.ATG" +#line 2484 "cs.ATG" attributes.Add(section); } Expect(1); -#line 2486 "cs.ATG" +#line 2485 "cs.ATG" templates.Add(new TemplateDefinition(t.val, attributes)); } Expect(22); } void ClassBase( -#line 929 "cs.ATG" +#line 928 "cs.ATG" out List names) { -#line 931 "cs.ATG" +#line 930 "cs.ATG" TypeReference typeRef; names = new List(); Expect(9); ClassType( -#line 935 "cs.ATG" +#line 934 "cs.ATG" out typeRef, false); -#line 935 "cs.ATG" +#line 934 "cs.ATG" if (typeRef != null) { names.Add(typeRef); } while (la.kind == 14) { lexer.NextToken(); TypeName( -#line 936 "cs.ATG" +#line 935 "cs.ATG" out typeRef, false); -#line 936 "cs.ATG" +#line 935 "cs.ATG" if (typeRef != null) { names.Add(typeRef); } } } void TypeParameterConstraintsClause( -#line 2490 "cs.ATG" +#line 2489 "cs.ATG" List templates) { -#line 2491 "cs.ATG" +#line 2490 "cs.ATG" string name = ""; TypeReference type; Expect(1); -#line 2493 "cs.ATG" +#line 2492 "cs.ATG" if (t.val != "where") Error("where expected"); Expect(1); -#line 2494 "cs.ATG" +#line 2493 "cs.ATG" name = t.val; Expect(9); TypeParameterConstraintsClauseBase( -#line 2496 "cs.ATG" +#line 2495 "cs.ATG" out type); -#line 2497 "cs.ATG" +#line 2496 "cs.ATG" TemplateDefinition td = null; foreach (TemplateDefinition d in templates) { if (d.Name == name) { @@ -1405,10 +1404,10 @@ out type); while (la.kind == 14) { lexer.NextToken(); TypeParameterConstraintsClauseBase( -#line 2506 "cs.ATG" +#line 2505 "cs.ATG" out type); -#line 2507 "cs.ATG" +#line 2506 "cs.ATG" td = null; foreach (TemplateDefinition d in templates) { if (d.Name == name) { @@ -1423,110 +1422,110 @@ out type); void ClassBody() { -#line 940 "cs.ATG" +#line 939 "cs.ATG" AttributeSection section; Expect(16); while (StartOf(11)) { -#line 943 "cs.ATG" +#line 942 "cs.ATG" List attributes = new List(); Modifiers m = new Modifiers(); while (la.kind == 18) { AttributeSection( -#line 946 "cs.ATG" +#line 945 "cs.ATG" out section); -#line 946 "cs.ATG" +#line 945 "cs.ATG" attributes.Add(section); } MemberModifiers( -#line 947 "cs.ATG" +#line 946 "cs.ATG" m); ClassMemberDecl( -#line 948 "cs.ATG" +#line 947 "cs.ATG" m, attributes); } Expect(17); } void StructInterfaces( -#line 953 "cs.ATG" +#line 952 "cs.ATG" out List names) { -#line 955 "cs.ATG" +#line 954 "cs.ATG" TypeReference typeRef; names = new List(); Expect(9); TypeName( -#line 959 "cs.ATG" +#line 958 "cs.ATG" out typeRef, false); -#line 959 "cs.ATG" +#line 958 "cs.ATG" if (typeRef != null) { names.Add(typeRef); } while (la.kind == 14) { lexer.NextToken(); TypeName( -#line 960 "cs.ATG" +#line 959 "cs.ATG" out typeRef, false); -#line 960 "cs.ATG" +#line 959 "cs.ATG" if (typeRef != null) { names.Add(typeRef); } } } void StructBody() { -#line 964 "cs.ATG" +#line 963 "cs.ATG" AttributeSection section; Expect(16); while (StartOf(12)) { -#line 967 "cs.ATG" +#line 966 "cs.ATG" List attributes = new List(); Modifiers m = new Modifiers(); while (la.kind == 18) { AttributeSection( -#line 970 "cs.ATG" +#line 969 "cs.ATG" out section); -#line 970 "cs.ATG" +#line 969 "cs.ATG" attributes.Add(section); } MemberModifiers( -#line 971 "cs.ATG" +#line 970 "cs.ATG" m); StructMemberDecl( -#line 972 "cs.ATG" +#line 971 "cs.ATG" m, attributes); } Expect(17); } void InterfaceBase( -#line 977 "cs.ATG" +#line 976 "cs.ATG" out List names) { -#line 979 "cs.ATG" +#line 978 "cs.ATG" TypeReference typeRef; names = new List(); Expect(9); TypeName( -#line 983 "cs.ATG" +#line 982 "cs.ATG" out typeRef, false); -#line 983 "cs.ATG" +#line 982 "cs.ATG" if (typeRef != null) { names.Add(typeRef); } while (la.kind == 14) { lexer.NextToken(); TypeName( -#line 984 "cs.ATG" +#line 983 "cs.ATG" out typeRef, false); -#line 984 "cs.ATG" +#line 983 "cs.ATG" if (typeRef != null) { names.Add(typeRef); } } } @@ -1540,72 +1539,72 @@ out typeRef, false); } void IntegralType( -#line 1144 "cs.ATG" +#line 1143 "cs.ATG" out string name) { -#line 1144 "cs.ATG" +#line 1143 "cs.ATG" name = ""; switch (la.kind) { case 101: { lexer.NextToken(); -#line 1146 "cs.ATG" +#line 1145 "cs.ATG" name = "sbyte"; break; } case 53: { lexer.NextToken(); -#line 1147 "cs.ATG" +#line 1146 "cs.ATG" name = "byte"; break; } case 103: { lexer.NextToken(); -#line 1148 "cs.ATG" +#line 1147 "cs.ATG" name = "short"; break; } case 119: { lexer.NextToken(); -#line 1149 "cs.ATG" +#line 1148 "cs.ATG" name = "ushort"; break; } case 81: { lexer.NextToken(); -#line 1150 "cs.ATG" +#line 1149 "cs.ATG" name = "int"; break; } case 115: { lexer.NextToken(); -#line 1151 "cs.ATG" +#line 1150 "cs.ATG" name = "uint"; break; } case 86: { lexer.NextToken(); -#line 1152 "cs.ATG" +#line 1151 "cs.ATG" name = "long"; break; } case 116: { lexer.NextToken(); -#line 1153 "cs.ATG" +#line 1152 "cs.ATG" name = "ulong"; break; } case 56: { lexer.NextToken(); -#line 1154 "cs.ATG" +#line 1153 "cs.ATG" name = "char"; break; } @@ -1615,25 +1614,25 @@ out string name) { void EnumBody() { -#line 993 "cs.ATG" +#line 992 "cs.ATG" FieldDeclaration f; Expect(16); if (la.kind == 1 || la.kind == 18) { EnumMemberDecl( -#line 996 "cs.ATG" +#line 995 "cs.ATG" out f); -#line 996 "cs.ATG" +#line 995 "cs.ATG" compilationUnit.AddChild(f); while ( -#line 997 "cs.ATG" +#line 996 "cs.ATG" NotFinalComma()) { Expect(14); EnumMemberDecl( -#line 998 "cs.ATG" +#line 997 "cs.ATG" out f); -#line 998 "cs.ATG" +#line 997 "cs.ATG" compilationUnit.AddChild(f); } if (la.kind == 14) { @@ -1644,36 +1643,36 @@ out f); } void Type( -#line 1003 "cs.ATG" +#line 1002 "cs.ATG" out TypeReference type) { TypeWithRestriction( -#line 1005 "cs.ATG" +#line 1004 "cs.ATG" out type, true, false); } void FormalParameterList( -#line 1066 "cs.ATG" +#line 1065 "cs.ATG" List parameter) { -#line 1069 "cs.ATG" +#line 1068 "cs.ATG" ParameterDeclarationExpression p; AttributeSection section; List attributes = new List(); while (la.kind == 18) { AttributeSection( -#line 1074 "cs.ATG" +#line 1073 "cs.ATG" out section); -#line 1074 "cs.ATG" +#line 1073 "cs.ATG" attributes.Add(section); } if (StartOf(14)) { FixedParameter( -#line 1076 "cs.ATG" +#line 1075 "cs.ATG" out p); -#line 1076 "cs.ATG" +#line 1075 "cs.ATG" bool paramsFound = false; p.Attributes = attributes; parameter.Add(p); @@ -1681,96 +1680,96 @@ out p); while (la.kind == 14) { lexer.NextToken(); -#line 1081 "cs.ATG" +#line 1080 "cs.ATG" attributes = new List(); if (paramsFound) Error("params array must be at end of parameter list"); while (la.kind == 18) { AttributeSection( -#line 1082 "cs.ATG" +#line 1081 "cs.ATG" out section); -#line 1082 "cs.ATG" +#line 1081 "cs.ATG" attributes.Add(section); } if (StartOf(14)) { FixedParameter( -#line 1084 "cs.ATG" +#line 1083 "cs.ATG" out p); -#line 1084 "cs.ATG" +#line 1083 "cs.ATG" p.Attributes = attributes; parameter.Add(p); } else if (la.kind == 94) { ParameterArray( -#line 1085 "cs.ATG" +#line 1084 "cs.ATG" out p); -#line 1085 "cs.ATG" +#line 1084 "cs.ATG" paramsFound = true; p.Attributes = attributes; parameter.Add(p); } else SynErr(134); } } else if (la.kind == 94) { ParameterArray( -#line 1088 "cs.ATG" +#line 1087 "cs.ATG" out p); -#line 1088 "cs.ATG" +#line 1087 "cs.ATG" p.Attributes = attributes; parameter.Add(p); } else SynErr(135); } void ClassType( -#line 1136 "cs.ATG" +#line 1135 "cs.ATG" out TypeReference typeRef, bool canBeUnbound) { -#line 1137 "cs.ATG" +#line 1136 "cs.ATG" TypeReference r; typeRef = null; if (la.kind == 1) { TypeName( -#line 1139 "cs.ATG" +#line 1138 "cs.ATG" out r, canBeUnbound); -#line 1139 "cs.ATG" +#line 1138 "cs.ATG" typeRef = r; } else if (la.kind == 90) { lexer.NextToken(); -#line 1140 "cs.ATG" +#line 1139 "cs.ATG" typeRef = new TypeReference("object"); } else if (la.kind == 107) { lexer.NextToken(); -#line 1141 "cs.ATG" +#line 1140 "cs.ATG" typeRef = new TypeReference("string"); } else SynErr(136); } void TypeName( -#line 2420 "cs.ATG" +#line 2419 "cs.ATG" out TypeReference typeRef, bool canBeUnbound) { -#line 2421 "cs.ATG" +#line 2420 "cs.ATG" List typeArguments = null; string alias = null; string qualident; if ( -#line 2426 "cs.ATG" +#line 2425 "cs.ATG" la.kind == Tokens.Identifier && Peek(1).kind == Tokens.DoubleColon) { lexer.NextToken(); -#line 2427 "cs.ATG" +#line 2426 "cs.ATG" alias = t.val; Expect(10); } Qualident( -#line 2430 "cs.ATG" +#line 2429 "cs.ATG" out qualident); if (la.kind == 23) { TypeArgumentList( -#line 2431 "cs.ATG" +#line 2430 "cs.ATG" out typeArguments, canBeUnbound); } -#line 2433 "cs.ATG" +#line 2432 "cs.ATG" if (alias == null) { typeRef = new TypeReference(qualident, typeArguments); } else if (alias == "global") { @@ -1781,129 +1780,129 @@ out typeArguments, canBeUnbound); } while ( -#line 2442 "cs.ATG" +#line 2441 "cs.ATG" DotAndIdent()) { Expect(15); -#line 2443 "cs.ATG" +#line 2442 "cs.ATG" typeArguments = null; Qualident( -#line 2444 "cs.ATG" +#line 2443 "cs.ATG" out qualident); if (la.kind == 23) { TypeArgumentList( -#line 2445 "cs.ATG" +#line 2444 "cs.ATG" out typeArguments, canBeUnbound); } -#line 2446 "cs.ATG" +#line 2445 "cs.ATG" typeRef = new InnerClassTypeReference(typeRef, qualident, typeArguments); } } void MemberModifiers( -#line 1157 "cs.ATG" +#line 1156 "cs.ATG" Modifiers m) { while (StartOf(15) || -#line 1174 "cs.ATG" +#line 1173 "cs.ATG" la.kind == Tokens.Identifier && la.val == "partial") { if (la.kind == 48) { lexer.NextToken(); -#line 1160 "cs.ATG" +#line 1159 "cs.ATG" m.Add(Modifier.Abstract, t.Location); } else if (la.kind == 70) { lexer.NextToken(); -#line 1161 "cs.ATG" +#line 1160 "cs.ATG" m.Add(Modifier.Extern, t.Location); } else if (la.kind == 83) { lexer.NextToken(); -#line 1162 "cs.ATG" +#line 1161 "cs.ATG" m.Add(Modifier.Internal, t.Location); } else if (la.kind == 88) { lexer.NextToken(); -#line 1163 "cs.ATG" +#line 1162 "cs.ATG" m.Add(Modifier.New, t.Location); } else if (la.kind == 93) { lexer.NextToken(); -#line 1164 "cs.ATG" +#line 1163 "cs.ATG" m.Add(Modifier.Override, t.Location); } else if (la.kind == 95) { lexer.NextToken(); -#line 1165 "cs.ATG" +#line 1164 "cs.ATG" m.Add(Modifier.Private, t.Location); } else if (la.kind == 96) { lexer.NextToken(); -#line 1166 "cs.ATG" +#line 1165 "cs.ATG" m.Add(Modifier.Protected, t.Location); } else if (la.kind == 97) { lexer.NextToken(); -#line 1167 "cs.ATG" +#line 1166 "cs.ATG" m.Add(Modifier.Public, t.Location); } else if (la.kind == 98) { lexer.NextToken(); -#line 1168 "cs.ATG" +#line 1167 "cs.ATG" m.Add(Modifier.ReadOnly, t.Location); } else if (la.kind == 102) { lexer.NextToken(); -#line 1169 "cs.ATG" +#line 1168 "cs.ATG" m.Add(Modifier.Sealed, t.Location); } else if (la.kind == 106) { lexer.NextToken(); -#line 1170 "cs.ATG" +#line 1169 "cs.ATG" m.Add(Modifier.Static, t.Location); } else if (la.kind == 118) { lexer.NextToken(); -#line 1171 "cs.ATG" +#line 1170 "cs.ATG" m.Add(Modifier.Unsafe, t.Location); } else if (la.kind == 121) { lexer.NextToken(); -#line 1172 "cs.ATG" +#line 1171 "cs.ATG" m.Add(Modifier.Virtual, t.Location); } else if (la.kind == 123) { lexer.NextToken(); -#line 1173 "cs.ATG" +#line 1172 "cs.ATG" m.Add(Modifier.Volatile, t.Location); } else { Expect(1); -#line 1175 "cs.ATG" +#line 1174 "cs.ATG" m.Add(Modifier.Partial, t.Location); } } } void ClassMemberDecl( -#line 1450 "cs.ATG" +#line 1449 "cs.ATG" Modifiers m, List attributes) { -#line 1451 "cs.ATG" +#line 1450 "cs.ATG" Statement stmt = null; if (StartOf(16)) { StructMemberDecl( -#line 1453 "cs.ATG" +#line 1452 "cs.ATG" m, attributes); } else if (la.kind == 27) { -#line 1454 "cs.ATG" - m.Check(Modifier.Destructors); Point startPos = t.Location; +#line 1453 "cs.ATG" + m.Check(Modifier.Destructors); Location startPos = t.Location; lexer.NextToken(); Expect(1); -#line 1455 "cs.ATG" +#line 1454 "cs.ATG" DestructorDeclaration d = new DestructorDeclaration(t.val, m.Modifier, attributes); d.Modifier = m.Modifier; d.StartLocation = m.GetDeclarationLocation(startPos); @@ -1911,17 +1910,17 @@ m, attributes); Expect(20); Expect(21); -#line 1459 "cs.ATG" +#line 1458 "cs.ATG" d.EndLocation = t.EndLocation; if (la.kind == 16) { Block( -#line 1459 "cs.ATG" +#line 1458 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); } else SynErr(137); -#line 1460 "cs.ATG" +#line 1459 "cs.ATG" d.Body = (BlockStatement)stmt; compilationUnit.AddChild(d); @@ -1929,10 +1928,10 @@ out stmt); } void StructMemberDecl( -#line 1180 "cs.ATG" +#line 1179 "cs.ATG" Modifiers m, List attributes) { -#line 1182 "cs.ATG" +#line 1181 "cs.ATG" string qualident = null; TypeReference type; Expression expr; @@ -1944,18 +1943,18 @@ Modifiers m, List attributes) { if (la.kind == 59) { -#line 1192 "cs.ATG" +#line 1191 "cs.ATG" m.Check(Modifier.Constants); lexer.NextToken(); -#line 1193 "cs.ATG" - Point startPos = t.Location; +#line 1192 "cs.ATG" + Location startPos = t.Location; Type( -#line 1194 "cs.ATG" +#line 1193 "cs.ATG" out type); Expect(1); -#line 1194 "cs.ATG" +#line 1193 "cs.ATG" FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier | Modifier.Const); fd.StartLocation = m.GetDeclarationLocation(startPos); VariableDeclaration f = new VariableDeclaration(t.val); @@ -1963,72 +1962,72 @@ out type); Expect(3); Expr( -#line 1199 "cs.ATG" +#line 1198 "cs.ATG" out expr); -#line 1199 "cs.ATG" +#line 1198 "cs.ATG" f.Initializer = expr; while (la.kind == 14) { lexer.NextToken(); Expect(1); -#line 1200 "cs.ATG" +#line 1199 "cs.ATG" f = new VariableDeclaration(t.val); fd.Fields.Add(f); Expect(3); Expr( -#line 1203 "cs.ATG" +#line 1202 "cs.ATG" out expr); -#line 1203 "cs.ATG" +#line 1202 "cs.ATG" f.Initializer = expr; } Expect(11); -#line 1204 "cs.ATG" +#line 1203 "cs.ATG" fd.EndLocation = t.EndLocation; compilationUnit.AddChild(fd); } else if ( -#line 1208 "cs.ATG" +#line 1207 "cs.ATG" NotVoidPointer()) { -#line 1208 "cs.ATG" +#line 1207 "cs.ATG" m.Check(Modifier.PropertysEventsMethods); Expect(122); -#line 1209 "cs.ATG" - Point startPos = t.Location; +#line 1208 "cs.ATG" + Location startPos = t.Location; if ( -#line 1210 "cs.ATG" +#line 1209 "cs.ATG" IsExplicitInterfaceImplementation()) { TypeName( -#line 1211 "cs.ATG" +#line 1210 "cs.ATG" out explicitInterface, false); -#line 1212 "cs.ATG" +#line 1211 "cs.ATG" if (la.kind != Tokens.Dot || Peek(1).kind != Tokens.This) { qualident = TypeReference.StripLastIdentifierFromType(ref explicitInterface); } } else if (la.kind == 1) { lexer.NextToken(); -#line 1215 "cs.ATG" +#line 1214 "cs.ATG" qualident = t.val; } else SynErr(139); if (la.kind == 23) { TypeParameterList( -#line 1218 "cs.ATG" +#line 1217 "cs.ATG" templates); } Expect(20); if (StartOf(10)) { FormalParameterList( -#line 1221 "cs.ATG" +#line 1220 "cs.ATG" p); } Expect(21); -#line 1222 "cs.ATG" +#line 1221 "cs.ATG" MethodDeclaration methodDeclaration = new MethodDeclaration(qualident, m.Modifier, new TypeReference("void"), @@ -2043,31 +2042,31 @@ p); compilationUnit.BlockStart(methodDeclaration); while ( -#line 1237 "cs.ATG" +#line 1236 "cs.ATG" IdentIsWhere()) { TypeParameterConstraintsClause( -#line 1237 "cs.ATG" +#line 1236 "cs.ATG" templates); } if (la.kind == 16) { Block( -#line 1239 "cs.ATG" +#line 1238 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); } else SynErr(140); -#line 1239 "cs.ATG" +#line 1238 "cs.ATG" compilationUnit.BlockEnd(); methodDeclaration.Body = (BlockStatement)stmt; } else if (la.kind == 68) { -#line 1243 "cs.ATG" +#line 1242 "cs.ATG" m.Check(Modifier.PropertysEventsMethods); lexer.NextToken(); -#line 1244 "cs.ATG" +#line 1243 "cs.ATG" EventDeclaration eventDecl = new EventDeclaration(null, null, m.Modifier, attributes, null); eventDecl.StartLocation = t.Location; compilationUnit.AddChild(eventDecl); @@ -2076,151 +2075,151 @@ out stmt); EventRemoveRegion removeBlock = null; Type( -#line 1251 "cs.ATG" +#line 1250 "cs.ATG" out type); -#line 1251 "cs.ATG" +#line 1250 "cs.ATG" eventDecl.TypeReference = type; if ( -#line 1252 "cs.ATG" +#line 1251 "cs.ATG" IsExplicitInterfaceImplementation()) { TypeName( -#line 1253 "cs.ATG" +#line 1252 "cs.ATG" out explicitInterface, false); -#line 1254 "cs.ATG" +#line 1253 "cs.ATG" qualident = TypeReference.StripLastIdentifierFromType(ref explicitInterface); -#line 1255 "cs.ATG" +#line 1254 "cs.ATG" eventDecl.InterfaceImplementations.Add(new InterfaceImplementation(explicitInterface, qualident)); } else if (la.kind == 1) { lexer.NextToken(); -#line 1257 "cs.ATG" +#line 1256 "cs.ATG" qualident = t.val; } else SynErr(141); -#line 1259 "cs.ATG" +#line 1258 "cs.ATG" eventDecl.Name = qualident; eventDecl.EndLocation = t.EndLocation; if (la.kind == 16) { lexer.NextToken(); -#line 1260 "cs.ATG" +#line 1259 "cs.ATG" eventDecl.BodyStart = t.Location; EventAccessorDecls( -#line 1261 "cs.ATG" +#line 1260 "cs.ATG" out addBlock, out removeBlock); Expect(17); -#line 1262 "cs.ATG" +#line 1261 "cs.ATG" eventDecl.BodyEnd = t.EndLocation; } if (la.kind == 11) { lexer.NextToken(); } -#line 1265 "cs.ATG" +#line 1264 "cs.ATG" compilationUnit.BlockEnd(); eventDecl.AddRegion = addBlock; eventDecl.RemoveRegion = removeBlock; } else if ( -#line 1271 "cs.ATG" +#line 1270 "cs.ATG" IdentAndLPar()) { -#line 1271 "cs.ATG" +#line 1270 "cs.ATG" m.Check(Modifier.Constructors | Modifier.StaticConstructors); Expect(1); -#line 1272 "cs.ATG" - string name = t.val; Point startPos = t.Location; +#line 1271 "cs.ATG" + string name = t.val; Location startPos = t.Location; Expect(20); if (StartOf(10)) { -#line 1272 "cs.ATG" +#line 1271 "cs.ATG" m.Check(Modifier.Constructors); FormalParameterList( -#line 1273 "cs.ATG" +#line 1272 "cs.ATG" p); } Expect(21); -#line 1275 "cs.ATG" +#line 1274 "cs.ATG" ConstructorInitializer init = null; if (la.kind == 9) { -#line 1276 "cs.ATG" +#line 1275 "cs.ATG" m.Check(Modifier.Constructors); ConstructorInitializer( -#line 1277 "cs.ATG" +#line 1276 "cs.ATG" out init); } -#line 1279 "cs.ATG" +#line 1278 "cs.ATG" ConstructorDeclaration cd = new ConstructorDeclaration(name, m.Modifier, p, init, attributes); cd.StartLocation = startPos; cd.EndLocation = t.EndLocation; if (la.kind == 16) { Block( -#line 1284 "cs.ATG" +#line 1283 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); } else SynErr(142); -#line 1284 "cs.ATG" +#line 1283 "cs.ATG" cd.Body = (BlockStatement)stmt; compilationUnit.AddChild(cd); } else if (la.kind == 69 || la.kind == 79) { -#line 1287 "cs.ATG" +#line 1286 "cs.ATG" m.Check(Modifier.Operators); if (m.isNone) Error("at least one modifier must be set"); bool isImplicit = true; - Point startPos = Point.Empty; + Location startPos = Location.Empty; if (la.kind == 79) { lexer.NextToken(); -#line 1292 "cs.ATG" +#line 1291 "cs.ATG" startPos = t.Location; } else { lexer.NextToken(); -#line 1292 "cs.ATG" +#line 1291 "cs.ATG" isImplicit = false; startPos = t.Location; } Expect(91); Type( -#line 1293 "cs.ATG" +#line 1292 "cs.ATG" out type); -#line 1293 "cs.ATG" +#line 1292 "cs.ATG" TypeReference operatorType = type; Expect(20); Type( -#line 1294 "cs.ATG" +#line 1293 "cs.ATG" out type); Expect(1); -#line 1294 "cs.ATG" +#line 1293 "cs.ATG" string varName = t.val; Expect(21); -#line 1295 "cs.ATG" - Point endPos = t.Location; +#line 1294 "cs.ATG" + Location endPos = t.Location; if (la.kind == 16) { Block( -#line 1296 "cs.ATG" +#line 1295 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); -#line 1296 "cs.ATG" +#line 1295 "cs.ATG" stmt = null; } else SynErr(143); -#line 1299 "cs.ATG" +#line 1298 "cs.ATG" List parameters = new List(); parameters.Add(new ParameterDeclarationExpression(type, varName)); OperatorDeclaration operatorDeclaration = new OperatorDeclaration(m.Modifier, @@ -2236,61 +2235,61 @@ out stmt); } else if (StartOf(17)) { TypeDecl( -#line 1315 "cs.ATG" +#line 1314 "cs.ATG" m, attributes); } else if (StartOf(9)) { Type( -#line 1317 "cs.ATG" +#line 1316 "cs.ATG" out type); -#line 1317 "cs.ATG" - Point startPos = t.Location; +#line 1316 "cs.ATG" + Location startPos = t.Location; if (la.kind == 91) { -#line 1319 "cs.ATG" +#line 1318 "cs.ATG" OverloadableOperatorType op; m.Check(Modifier.Operators); if (m.isNone) Error("at least one modifier must be set"); lexer.NextToken(); OverloadableOperator( -#line 1323 "cs.ATG" +#line 1322 "cs.ATG" out op); -#line 1323 "cs.ATG" +#line 1322 "cs.ATG" TypeReference firstType, secondType = null; string secondName = null; Expect(20); Type( -#line 1324 "cs.ATG" +#line 1323 "cs.ATG" out firstType); Expect(1); -#line 1324 "cs.ATG" +#line 1323 "cs.ATG" string firstName = t.val; if (la.kind == 14) { lexer.NextToken(); Type( -#line 1325 "cs.ATG" +#line 1324 "cs.ATG" out secondType); Expect(1); -#line 1325 "cs.ATG" +#line 1324 "cs.ATG" secondName = t.val; } else if (la.kind == 21) { } else SynErr(144); -#line 1333 "cs.ATG" - Point endPos = t.Location; +#line 1332 "cs.ATG" + Location endPos = t.Location; Expect(21); if (la.kind == 16) { Block( -#line 1334 "cs.ATG" +#line 1333 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); } else SynErr(145); -#line 1336 "cs.ATG" +#line 1335 "cs.ATG" List parameters = new List(); parameters.Add(new ParameterDeclarationExpression(firstType, firstName)); if (secondType != null) { @@ -2307,43 +2306,43 @@ out stmt); compilationUnit.AddChild(operatorDeclaration); } else if ( -#line 1353 "cs.ATG" +#line 1352 "cs.ATG" IsVarDecl()) { -#line 1353 "cs.ATG" +#line 1352 "cs.ATG" m.Check(Modifier.Fields); FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier); fd.StartLocation = m.GetDeclarationLocation(startPos); VariableDeclarator( -#line 1357 "cs.ATG" +#line 1356 "cs.ATG" variableDeclarators); while (la.kind == 14) { lexer.NextToken(); VariableDeclarator( -#line 1358 "cs.ATG" +#line 1357 "cs.ATG" variableDeclarators); } Expect(11); -#line 1359 "cs.ATG" +#line 1358 "cs.ATG" fd.EndLocation = t.EndLocation; fd.Fields = variableDeclarators; compilationUnit.AddChild(fd); } else if (la.kind == 110) { -#line 1362 "cs.ATG" +#line 1361 "cs.ATG" m.Check(Modifier.Indexers); lexer.NextToken(); Expect(18); FormalParameterList( -#line 1363 "cs.ATG" +#line 1362 "cs.ATG" p); Expect(19); -#line 1363 "cs.ATG" - Point endLocation = t.EndLocation; +#line 1362 "cs.ATG" + Location endLocation = t.EndLocation; Expect(16); -#line 1364 "cs.ATG" +#line 1363 "cs.ATG" IndexerDeclaration indexer = new IndexerDeclaration(type, p, m.Modifier, attributes); indexer.StartLocation = startPos; indexer.EndLocation = endLocation; @@ -2352,58 +2351,58 @@ p); PropertySetRegion setRegion; AccessorDecls( -#line 1371 "cs.ATG" +#line 1370 "cs.ATG" out getRegion, out setRegion); Expect(17); -#line 1372 "cs.ATG" +#line 1371 "cs.ATG" indexer.BodyEnd = t.EndLocation; indexer.GetRegion = getRegion; indexer.SetRegion = setRegion; compilationUnit.AddChild(indexer); } else if ( -#line 1377 "cs.ATG" +#line 1376 "cs.ATG" la.kind == Tokens.Identifier) { if ( -#line 1378 "cs.ATG" +#line 1377 "cs.ATG" IsExplicitInterfaceImplementation()) { TypeName( -#line 1379 "cs.ATG" +#line 1378 "cs.ATG" out explicitInterface, false); -#line 1380 "cs.ATG" +#line 1379 "cs.ATG" if (la.kind != Tokens.Dot || Peek(1).kind != Tokens.This) { qualident = TypeReference.StripLastIdentifierFromType(ref explicitInterface); } } else if (la.kind == 1) { lexer.NextToken(); -#line 1383 "cs.ATG" +#line 1382 "cs.ATG" qualident = t.val; } else SynErr(146); -#line 1385 "cs.ATG" - Point qualIdentEndLocation = t.EndLocation; +#line 1384 "cs.ATG" + Location qualIdentEndLocation = t.EndLocation; if (la.kind == 16 || la.kind == 20 || la.kind == 23) { if (la.kind == 20 || la.kind == 23) { -#line 1389 "cs.ATG" +#line 1388 "cs.ATG" m.Check(Modifier.PropertysEventsMethods); if (la.kind == 23) { TypeParameterList( -#line 1391 "cs.ATG" +#line 1390 "cs.ATG" templates); } Expect(20); if (StartOf(10)) { FormalParameterList( -#line 1392 "cs.ATG" +#line 1391 "cs.ATG" p); } Expect(21); -#line 1393 "cs.ATG" +#line 1392 "cs.ATG" MethodDeclaration methodDeclaration = new MethodDeclaration(qualident, m.Modifier, type, @@ -2417,26 +2416,26 @@ p); compilationUnit.AddChild(methodDeclaration); while ( -#line 1405 "cs.ATG" +#line 1404 "cs.ATG" IdentIsWhere()) { TypeParameterConstraintsClause( -#line 1405 "cs.ATG" +#line 1404 "cs.ATG" templates); } if (la.kind == 16) { Block( -#line 1406 "cs.ATG" +#line 1405 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); } else SynErr(147); -#line 1406 "cs.ATG" +#line 1405 "cs.ATG" methodDeclaration.Body = (BlockStatement)stmt; } else { lexer.NextToken(); -#line 1409 "cs.ATG" +#line 1408 "cs.ATG" PropertyDeclaration pDecl = new PropertyDeclaration(qualident, type, m.Modifier, attributes); if (explicitInterface != null) pDecl.InterfaceImplementations.Add(new InterfaceImplementation(explicitInterface, qualident)); @@ -2447,11 +2446,11 @@ out stmt); PropertySetRegion setRegion; AccessorDecls( -#line 1418 "cs.ATG" +#line 1417 "cs.ATG" out getRegion, out setRegion); Expect(17); -#line 1420 "cs.ATG" +#line 1419 "cs.ATG" pDecl.GetRegion = getRegion; pDecl.SetRegion = setRegion; pDecl.BodyEnd = t.EndLocation; @@ -2460,17 +2459,17 @@ out getRegion, out setRegion); } } else if (la.kind == 15) { -#line 1428 "cs.ATG" +#line 1427 "cs.ATG" m.Check(Modifier.Indexers); lexer.NextToken(); Expect(110); Expect(18); FormalParameterList( -#line 1429 "cs.ATG" +#line 1428 "cs.ATG" p); Expect(19); -#line 1430 "cs.ATG" +#line 1429 "cs.ATG" IndexerDeclaration indexer = new IndexerDeclaration(type, p, m.Modifier, attributes); indexer.StartLocation = m.GetDeclarationLocation(startPos); indexer.EndLocation = t.EndLocation; @@ -2481,14 +2480,14 @@ p); Expect(16); -#line 1438 "cs.ATG" - Point bodyStart = t.Location; +#line 1437 "cs.ATG" + Location bodyStart = t.Location; AccessorDecls( -#line 1439 "cs.ATG" +#line 1438 "cs.ATG" out getRegion, out setRegion); Expect(17); -#line 1440 "cs.ATG" +#line 1439 "cs.ATG" indexer.BodyStart = bodyStart; indexer.BodyEnd = t.EndLocation; indexer.GetRegion = getRegion; @@ -2502,7 +2501,7 @@ out getRegion, out setRegion); void InterfaceMemberDecl() { -#line 1467 "cs.ATG" +#line 1466 "cs.ATG" TypeReference type; AttributeSection section; @@ -2512,56 +2511,56 @@ out getRegion, out setRegion); string name; PropertyGetRegion getBlock; PropertySetRegion setBlock; - Point startLocation = new Point(-1, -1); + Location startLocation = new Location(-1, -1); List templates = new List(); while (la.kind == 18) { AttributeSection( -#line 1480 "cs.ATG" +#line 1479 "cs.ATG" out section); -#line 1480 "cs.ATG" +#line 1479 "cs.ATG" attributes.Add(section); } if (la.kind == 88) { lexer.NextToken(); -#line 1481 "cs.ATG" +#line 1480 "cs.ATG" mod = Modifier.New; startLocation = t.Location; } if ( -#line 1484 "cs.ATG" +#line 1483 "cs.ATG" NotVoidPointer()) { Expect(122); -#line 1484 "cs.ATG" +#line 1483 "cs.ATG" if (startLocation.X == -1) startLocation = t.Location; Expect(1); -#line 1484 "cs.ATG" +#line 1483 "cs.ATG" name = t.val; if (la.kind == 23) { TypeParameterList( -#line 1485 "cs.ATG" +#line 1484 "cs.ATG" templates); } Expect(20); if (StartOf(10)) { FormalParameterList( -#line 1486 "cs.ATG" +#line 1485 "cs.ATG" parameters); } Expect(21); while ( -#line 1487 "cs.ATG" +#line 1486 "cs.ATG" IdentIsWhere()) { TypeParameterConstraintsClause( -#line 1487 "cs.ATG" +#line 1486 "cs.ATG" templates); } Expect(11); -#line 1489 "cs.ATG" +#line 1488 "cs.ATG" MethodDeclaration md = new MethodDeclaration(name, mod, new TypeReference("void"), parameters, attributes); md.StartLocation = startLocation; md.EndLocation = t.EndLocation; @@ -2571,39 +2570,39 @@ templates); } else if (StartOf(18)) { if (StartOf(9)) { Type( -#line 1496 "cs.ATG" +#line 1495 "cs.ATG" out type); -#line 1496 "cs.ATG" +#line 1495 "cs.ATG" if (startLocation.X == -1) startLocation = t.Location; if (la.kind == 1) { lexer.NextToken(); -#line 1498 "cs.ATG" - name = t.val; Point qualIdentEndLocation = t.EndLocation; +#line 1497 "cs.ATG" + name = t.val; Location qualIdentEndLocation = t.EndLocation; if (la.kind == 20 || la.kind == 23) { if (la.kind == 23) { TypeParameterList( -#line 1502 "cs.ATG" +#line 1501 "cs.ATG" templates); } Expect(20); if (StartOf(10)) { FormalParameterList( -#line 1503 "cs.ATG" +#line 1502 "cs.ATG" parameters); } Expect(21); while ( -#line 1505 "cs.ATG" +#line 1504 "cs.ATG" IdentIsWhere()) { TypeParameterConstraintsClause( -#line 1505 "cs.ATG" +#line 1504 "cs.ATG" templates); } Expect(11); -#line 1506 "cs.ATG" +#line 1505 "cs.ATG" MethodDeclaration md = new MethodDeclaration(name, mod, type, parameters, attributes); md.StartLocation = startLocation; md.EndLocation = t.EndLocation; @@ -2612,72 +2611,72 @@ templates); } else if (la.kind == 16) { -#line 1513 "cs.ATG" +#line 1512 "cs.ATG" PropertyDeclaration pd = new PropertyDeclaration(name, type, mod, attributes); compilationUnit.AddChild(pd); lexer.NextToken(); -#line 1514 "cs.ATG" - Point bodyStart = t.Location; +#line 1513 "cs.ATG" + Location bodyStart = t.Location; InterfaceAccessors( -#line 1514 "cs.ATG" +#line 1513 "cs.ATG" out getBlock, out setBlock); Expect(17); -#line 1514 "cs.ATG" +#line 1513 "cs.ATG" pd.GetRegion = getBlock; pd.SetRegion = setBlock; pd.StartLocation = startLocation; pd.EndLocation = qualIdentEndLocation; pd.BodyStart = bodyStart; pd.BodyEnd = t.EndLocation; } else SynErr(151); } else if (la.kind == 110) { lexer.NextToken(); Expect(18); FormalParameterList( -#line 1517 "cs.ATG" +#line 1516 "cs.ATG" parameters); Expect(19); -#line 1517 "cs.ATG" - Point bracketEndLocation = t.EndLocation; +#line 1516 "cs.ATG" + Location bracketEndLocation = t.EndLocation; -#line 1517 "cs.ATG" +#line 1516 "cs.ATG" IndexerDeclaration id = new IndexerDeclaration(type, parameters, mod, attributes); compilationUnit.AddChild(id); Expect(16); -#line 1518 "cs.ATG" - Point bodyStart = t.Location; +#line 1517 "cs.ATG" + Location bodyStart = t.Location; InterfaceAccessors( -#line 1518 "cs.ATG" +#line 1517 "cs.ATG" out getBlock, out setBlock); Expect(17); -#line 1518 "cs.ATG" +#line 1517 "cs.ATG" id.GetRegion = getBlock; id.SetRegion = setBlock; id.StartLocation = startLocation; id.EndLocation = bracketEndLocation; id.BodyStart = bodyStart; id.BodyEnd = t.EndLocation; } else SynErr(152); } else { lexer.NextToken(); -#line 1521 "cs.ATG" +#line 1520 "cs.ATG" if (startLocation.X == -1) startLocation = t.Location; Type( -#line 1521 "cs.ATG" +#line 1520 "cs.ATG" out type); Expect(1); -#line 1521 "cs.ATG" +#line 1520 "cs.ATG" EventDeclaration ed = new EventDeclaration(type, t.val, mod, attributes, null); compilationUnit.AddChild(ed); Expect(11); -#line 1524 "cs.ATG" +#line 1523 "cs.ATG" ed.StartLocation = startLocation; ed.EndLocation = t.EndLocation; } } else SynErr(153); } void EnumMemberDecl( -#line 1529 "cs.ATG" +#line 1528 "cs.ATG" out FieldDeclaration f) { -#line 1531 "cs.ATG" +#line 1530 "cs.ATG" Expression expr = null; List attributes = new List(); AttributeSection section = null; @@ -2685,15 +2684,15 @@ out FieldDeclaration f) { while (la.kind == 18) { AttributeSection( -#line 1537 "cs.ATG" +#line 1536 "cs.ATG" out section); -#line 1537 "cs.ATG" +#line 1536 "cs.ATG" attributes.Add(section); } Expect(1); -#line 1538 "cs.ATG" +#line 1537 "cs.ATG" f = new FieldDeclaration(attributes); varDecl = new VariableDeclaration(t.val); f.Fields.Add(varDecl); @@ -2702,78 +2701,78 @@ out section); if (la.kind == 3) { lexer.NextToken(); Expr( -#line 1543 "cs.ATG" +#line 1542 "cs.ATG" out expr); -#line 1543 "cs.ATG" +#line 1542 "cs.ATG" varDecl.Initializer = expr; } } void TypeWithRestriction( -#line 1008 "cs.ATG" +#line 1007 "cs.ATG" out TypeReference type, bool allowNullable, bool canBeUnbound) { -#line 1010 "cs.ATG" +#line 1009 "cs.ATG" string name; int pointer = 0; type = null; if (la.kind == 1 || la.kind == 90 || la.kind == 107) { ClassType( -#line 1015 "cs.ATG" +#line 1014 "cs.ATG" out type, canBeUnbound); } else if (StartOf(4)) { SimpleType( -#line 1016 "cs.ATG" +#line 1015 "cs.ATG" out name); -#line 1016 "cs.ATG" +#line 1015 "cs.ATG" type = new TypeReference(name); } else if (la.kind == 122) { lexer.NextToken(); Expect(6); -#line 1017 "cs.ATG" +#line 1016 "cs.ATG" pointer = 1; type = new TypeReference("void"); } else SynErr(154); -#line 1018 "cs.ATG" +#line 1017 "cs.ATG" List r = new List(); if ( -#line 1020 "cs.ATG" +#line 1019 "cs.ATG" allowNullable && la.kind == Tokens.Question) { NullableQuestionMark( -#line 1020 "cs.ATG" +#line 1019 "cs.ATG" ref type); } while ( -#line 1022 "cs.ATG" +#line 1021 "cs.ATG" IsPointerOrDims()) { -#line 1022 "cs.ATG" +#line 1021 "cs.ATG" int i = 0; if (la.kind == 6) { lexer.NextToken(); -#line 1023 "cs.ATG" +#line 1022 "cs.ATG" ++pointer; } else if (la.kind == 18) { lexer.NextToken(); while (la.kind == 14) { lexer.NextToken(); -#line 1024 "cs.ATG" +#line 1023 "cs.ATG" ++i; } Expect(19); -#line 1024 "cs.ATG" +#line 1023 "cs.ATG" r.Add(i); } else SynErr(155); } -#line 1027 "cs.ATG" +#line 1026 "cs.ATG" if (type != null) { type.RankSpecifier = r.ToArray(); type.PointerNestingLevel = pointer; @@ -2782,141 +2781,141 @@ IsPointerOrDims()) { } void SimpleType( -#line 1055 "cs.ATG" +#line 1054 "cs.ATG" out string name) { -#line 1056 "cs.ATG" +#line 1055 "cs.ATG" name = String.Empty; if (StartOf(19)) { IntegralType( -#line 1058 "cs.ATG" +#line 1057 "cs.ATG" out name); } else if (la.kind == 74) { lexer.NextToken(); -#line 1059 "cs.ATG" +#line 1058 "cs.ATG" name = "float"; } else if (la.kind == 65) { lexer.NextToken(); -#line 1060 "cs.ATG" +#line 1059 "cs.ATG" name = "double"; } else if (la.kind == 61) { lexer.NextToken(); -#line 1061 "cs.ATG" +#line 1060 "cs.ATG" name = "decimal"; } else if (la.kind == 51) { lexer.NextToken(); -#line 1062 "cs.ATG" +#line 1061 "cs.ATG" name = "bool"; } else SynErr(156); } void NullableQuestionMark( -#line 2451 "cs.ATG" +#line 2450 "cs.ATG" ref TypeReference typeRef) { -#line 2452 "cs.ATG" +#line 2451 "cs.ATG" List typeArguments = new List(1); Expect(12); -#line 2456 "cs.ATG" +#line 2455 "cs.ATG" if (typeRef != null) typeArguments.Add(typeRef); typeRef = new TypeReference("System.Nullable", typeArguments); } void FixedParameter( -#line 1092 "cs.ATG" +#line 1091 "cs.ATG" out ParameterDeclarationExpression p) { -#line 1094 "cs.ATG" +#line 1093 "cs.ATG" TypeReference type; ParamModifier mod = ParamModifier.In; - System.Drawing.Point start = t.Location; + Location start = t.Location; if (la.kind == 92 || la.kind == 99) { if (la.kind == 99) { lexer.NextToken(); -#line 1100 "cs.ATG" +#line 1099 "cs.ATG" mod = ParamModifier.Ref; } else { lexer.NextToken(); -#line 1101 "cs.ATG" +#line 1100 "cs.ATG" mod = ParamModifier.Out; } } Type( -#line 1103 "cs.ATG" +#line 1102 "cs.ATG" out type); Expect(1); -#line 1103 "cs.ATG" +#line 1102 "cs.ATG" p = new ParameterDeclarationExpression(type, t.val, mod); p.StartLocation = start; p.EndLocation = t.Location; } void ParameterArray( -#line 1106 "cs.ATG" +#line 1105 "cs.ATG" out ParameterDeclarationExpression p) { -#line 1107 "cs.ATG" +#line 1106 "cs.ATG" TypeReference type; Expect(94); Type( -#line 1109 "cs.ATG" +#line 1108 "cs.ATG" out type); Expect(1); -#line 1109 "cs.ATG" +#line 1108 "cs.ATG" p = new ParameterDeclarationExpression(type, t.val, ParamModifier.Params); } void AccessorModifiers( -#line 1112 "cs.ATG" +#line 1111 "cs.ATG" out Modifiers m) { -#line 1113 "cs.ATG" +#line 1112 "cs.ATG" m = new Modifiers(); if (la.kind == 95) { lexer.NextToken(); -#line 1115 "cs.ATG" +#line 1114 "cs.ATG" m.Add(Modifier.Private, t.Location); } else if (la.kind == 96) { lexer.NextToken(); -#line 1116 "cs.ATG" +#line 1115 "cs.ATG" m.Add(Modifier.Protected, t.Location); if (la.kind == 83) { lexer.NextToken(); -#line 1117 "cs.ATG" +#line 1116 "cs.ATG" m.Add(Modifier.Internal, t.Location); } } else if (la.kind == 83) { lexer.NextToken(); -#line 1118 "cs.ATG" +#line 1117 "cs.ATG" m.Add(Modifier.Internal, t.Location); if (la.kind == 96) { lexer.NextToken(); -#line 1119 "cs.ATG" +#line 1118 "cs.ATG" m.Add(Modifier.Protected, t.Location); } } else SynErr(157); } void Block( -#line 1668 "cs.ATG" +#line 1667 "cs.ATG" out Statement stmt) { Expect(16); -#line 1670 "cs.ATG" +#line 1669 "cs.ATG" BlockStatement blockStmt = new BlockStatement(); blockStmt.StartLocation = t.EndLocation; compilationUnit.BlockStart(blockStmt); @@ -2927,7 +2926,7 @@ out Statement stmt) { } Expect(17); -#line 1677 "cs.ATG" +#line 1676 "cs.ATG" stmt = blockStmt; blockStmt.EndLocation = t.EndLocation; compilationUnit.BlockEnd(); @@ -2935,10 +2934,10 @@ out Statement stmt) { } void EventAccessorDecls( -#line 1603 "cs.ATG" +#line 1602 "cs.ATG" out EventAddRegion addBlock, out EventRemoveRegion removeBlock) { -#line 1604 "cs.ATG" +#line 1603 "cs.ATG" AttributeSection section; List attributes = new List(); Statement stmt; @@ -2947,102 +2946,102 @@ out EventAddRegion addBlock, out EventRemoveRegion removeBlock) { while (la.kind == 18) { AttributeSection( -#line 1611 "cs.ATG" +#line 1610 "cs.ATG" out section); -#line 1611 "cs.ATG" +#line 1610 "cs.ATG" attributes.Add(section); } if ( -#line 1613 "cs.ATG" +#line 1612 "cs.ATG" IdentIsAdd()) { -#line 1613 "cs.ATG" +#line 1612 "cs.ATG" addBlock = new EventAddRegion(attributes); AddAccessorDecl( -#line 1614 "cs.ATG" +#line 1613 "cs.ATG" out stmt); -#line 1614 "cs.ATG" +#line 1613 "cs.ATG" attributes = new List(); addBlock.Block = (BlockStatement)stmt; while (la.kind == 18) { AttributeSection( -#line 1615 "cs.ATG" +#line 1614 "cs.ATG" out section); -#line 1615 "cs.ATG" +#line 1614 "cs.ATG" attributes.Add(section); } RemoveAccessorDecl( -#line 1616 "cs.ATG" +#line 1615 "cs.ATG" out stmt); -#line 1616 "cs.ATG" +#line 1615 "cs.ATG" removeBlock = new EventRemoveRegion(attributes); removeBlock.Block = (BlockStatement)stmt; } else if ( -#line 1617 "cs.ATG" +#line 1616 "cs.ATG" IdentIsRemove()) { RemoveAccessorDecl( -#line 1618 "cs.ATG" +#line 1617 "cs.ATG" out stmt); -#line 1618 "cs.ATG" +#line 1617 "cs.ATG" removeBlock = new EventRemoveRegion(attributes); removeBlock.Block = (BlockStatement)stmt; attributes = new List(); while (la.kind == 18) { AttributeSection( -#line 1619 "cs.ATG" +#line 1618 "cs.ATG" out section); -#line 1619 "cs.ATG" +#line 1618 "cs.ATG" attributes.Add(section); } AddAccessorDecl( -#line 1620 "cs.ATG" +#line 1619 "cs.ATG" out stmt); -#line 1620 "cs.ATG" +#line 1619 "cs.ATG" addBlock = new EventAddRegion(attributes); addBlock.Block = (BlockStatement)stmt; } else if (la.kind == 1) { lexer.NextToken(); -#line 1621 "cs.ATG" +#line 1620 "cs.ATG" Error("add or remove accessor declaration expected"); } else SynErr(158); } void ConstructorInitializer( -#line 1699 "cs.ATG" +#line 1698 "cs.ATG" out ConstructorInitializer ci) { -#line 1700 "cs.ATG" +#line 1699 "cs.ATG" Expression expr; ci = new ConstructorInitializer(); Expect(9); if (la.kind == 50) { lexer.NextToken(); -#line 1704 "cs.ATG" +#line 1703 "cs.ATG" ci.ConstructorInitializerType = ConstructorInitializerType.Base; } else if (la.kind == 110) { lexer.NextToken(); -#line 1705 "cs.ATG" +#line 1704 "cs.ATG" ci.ConstructorInitializerType = ConstructorInitializerType.This; } else SynErr(159); Expect(20); if (StartOf(21)) { Argument( -#line 1708 "cs.ATG" +#line 1707 "cs.ATG" out expr); -#line 1708 "cs.ATG" +#line 1707 "cs.ATG" if (expr != null) { ci.Arguments.Add(expr); } while (la.kind == 14) { lexer.NextToken(); Argument( -#line 1708 "cs.ATG" +#line 1707 "cs.ATG" out expr); -#line 1708 "cs.ATG" +#line 1707 "cs.ATG" if (expr != null) { ci.Arguments.Add(expr); } } } @@ -3050,161 +3049,161 @@ out expr); } void OverloadableOperator( -#line 1720 "cs.ATG" +#line 1719 "cs.ATG" out OverloadableOperatorType op) { -#line 1721 "cs.ATG" +#line 1720 "cs.ATG" op = OverloadableOperatorType.None; switch (la.kind) { case 4: { lexer.NextToken(); -#line 1723 "cs.ATG" +#line 1722 "cs.ATG" op = OverloadableOperatorType.Add; break; } case 5: { lexer.NextToken(); -#line 1724 "cs.ATG" +#line 1723 "cs.ATG" op = OverloadableOperatorType.Subtract; break; } case 24: { lexer.NextToken(); -#line 1726 "cs.ATG" +#line 1725 "cs.ATG" op = OverloadableOperatorType.Not; break; } case 27: { lexer.NextToken(); -#line 1727 "cs.ATG" +#line 1726 "cs.ATG" op = OverloadableOperatorType.BitNot; break; } case 31: { lexer.NextToken(); -#line 1729 "cs.ATG" +#line 1728 "cs.ATG" op = OverloadableOperatorType.Increment; break; } case 32: { lexer.NextToken(); -#line 1730 "cs.ATG" +#line 1729 "cs.ATG" op = OverloadableOperatorType.Decrement; break; } case 112: { lexer.NextToken(); -#line 1732 "cs.ATG" +#line 1731 "cs.ATG" op = OverloadableOperatorType.IsTrue; break; } case 71: { lexer.NextToken(); -#line 1733 "cs.ATG" +#line 1732 "cs.ATG" op = OverloadableOperatorType.IsFalse; break; } case 6: { lexer.NextToken(); -#line 1735 "cs.ATG" +#line 1734 "cs.ATG" op = OverloadableOperatorType.Multiply; break; } case 7: { lexer.NextToken(); -#line 1736 "cs.ATG" +#line 1735 "cs.ATG" op = OverloadableOperatorType.Divide; break; } case 8: { lexer.NextToken(); -#line 1737 "cs.ATG" +#line 1736 "cs.ATG" op = OverloadableOperatorType.Modulus; break; } case 28: { lexer.NextToken(); -#line 1739 "cs.ATG" +#line 1738 "cs.ATG" op = OverloadableOperatorType.BitwiseAnd; break; } case 29: { lexer.NextToken(); -#line 1740 "cs.ATG" +#line 1739 "cs.ATG" op = OverloadableOperatorType.BitwiseOr; break; } case 30: { lexer.NextToken(); -#line 1741 "cs.ATG" +#line 1740 "cs.ATG" op = OverloadableOperatorType.ExclusiveOr; break; } case 37: { lexer.NextToken(); -#line 1743 "cs.ATG" +#line 1742 "cs.ATG" op = OverloadableOperatorType.ShiftLeft; break; } case 33: { lexer.NextToken(); -#line 1744 "cs.ATG" +#line 1743 "cs.ATG" op = OverloadableOperatorType.Equality; break; } case 34: { lexer.NextToken(); -#line 1745 "cs.ATG" +#line 1744 "cs.ATG" op = OverloadableOperatorType.InEquality; break; } case 23: { lexer.NextToken(); -#line 1746 "cs.ATG" +#line 1745 "cs.ATG" op = OverloadableOperatorType.LessThan; break; } case 35: { lexer.NextToken(); -#line 1747 "cs.ATG" +#line 1746 "cs.ATG" op = OverloadableOperatorType.GreaterThanOrEqual; break; } case 36: { lexer.NextToken(); -#line 1748 "cs.ATG" +#line 1747 "cs.ATG" op = OverloadableOperatorType.LessThanOrEqual; break; } case 22: { lexer.NextToken(); -#line 1749 "cs.ATG" +#line 1748 "cs.ATG" op = OverloadableOperatorType.GreaterThan; if (la.kind == 22) { lexer.NextToken(); -#line 1749 "cs.ATG" +#line 1748 "cs.ATG" op = OverloadableOperatorType.ShiftRight; } break; @@ -3214,34 +3213,34 @@ out OverloadableOperatorType op) { } void VariableDeclarator( -#line 1661 "cs.ATG" +#line 1660 "cs.ATG" List fieldDeclaration) { -#line 1662 "cs.ATG" +#line 1661 "cs.ATG" Expression expr = null; Expect(1); -#line 1664 "cs.ATG" +#line 1663 "cs.ATG" VariableDeclaration f = new VariableDeclaration(t.val); if (la.kind == 3) { lexer.NextToken(); VariableInitializer( -#line 1665 "cs.ATG" +#line 1664 "cs.ATG" out expr); -#line 1665 "cs.ATG" +#line 1664 "cs.ATG" f.Initializer = expr; } -#line 1665 "cs.ATG" +#line 1664 "cs.ATG" fieldDeclaration.Add(f); } void AccessorDecls( -#line 1547 "cs.ATG" +#line 1546 "cs.ATG" out PropertyGetRegion getBlock, out PropertySetRegion setBlock) { -#line 1549 "cs.ATG" +#line 1548 "cs.ATG" List attributes = new List(); AttributeSection section; getBlock = null; @@ -3250,96 +3249,96 @@ out PropertyGetRegion getBlock, out PropertySetRegion setBlock) { while (la.kind == 18) { AttributeSection( -#line 1556 "cs.ATG" +#line 1555 "cs.ATG" out section); -#line 1556 "cs.ATG" +#line 1555 "cs.ATG" attributes.Add(section); } if (la.kind == 83 || la.kind == 95 || la.kind == 96) { AccessorModifiers( -#line 1557 "cs.ATG" +#line 1556 "cs.ATG" out modifiers); } if ( -#line 1559 "cs.ATG" +#line 1558 "cs.ATG" IdentIsGet()) { GetAccessorDecl( -#line 1560 "cs.ATG" +#line 1559 "cs.ATG" out getBlock, attributes); -#line 1561 "cs.ATG" +#line 1560 "cs.ATG" if (modifiers != null) {getBlock.Modifier = modifiers.Modifier; } if (StartOf(22)) { -#line 1562 "cs.ATG" +#line 1561 "cs.ATG" attributes = new List(); modifiers = null; while (la.kind == 18) { AttributeSection( -#line 1563 "cs.ATG" +#line 1562 "cs.ATG" out section); -#line 1563 "cs.ATG" +#line 1562 "cs.ATG" attributes.Add(section); } if (la.kind == 83 || la.kind == 95 || la.kind == 96) { AccessorModifiers( -#line 1564 "cs.ATG" +#line 1563 "cs.ATG" out modifiers); } SetAccessorDecl( -#line 1565 "cs.ATG" +#line 1564 "cs.ATG" out setBlock, attributes); -#line 1566 "cs.ATG" +#line 1565 "cs.ATG" if (modifiers != null) {setBlock.Modifier = modifiers.Modifier; } } } else if ( -#line 1568 "cs.ATG" +#line 1567 "cs.ATG" IdentIsSet()) { SetAccessorDecl( -#line 1569 "cs.ATG" +#line 1568 "cs.ATG" out setBlock, attributes); -#line 1570 "cs.ATG" +#line 1569 "cs.ATG" if (modifiers != null) {setBlock.Modifier = modifiers.Modifier; } if (StartOf(22)) { -#line 1571 "cs.ATG" +#line 1570 "cs.ATG" attributes = new List(); modifiers = null; while (la.kind == 18) { AttributeSection( -#line 1572 "cs.ATG" +#line 1571 "cs.ATG" out section); -#line 1572 "cs.ATG" +#line 1571 "cs.ATG" attributes.Add(section); } if (la.kind == 83 || la.kind == 95 || la.kind == 96) { AccessorModifiers( -#line 1573 "cs.ATG" +#line 1572 "cs.ATG" out modifiers); } GetAccessorDecl( -#line 1574 "cs.ATG" +#line 1573 "cs.ATG" out getBlock, attributes); -#line 1575 "cs.ATG" +#line 1574 "cs.ATG" if (modifiers != null) {getBlock.Modifier = modifiers.Modifier; } } } else if (la.kind == 1) { lexer.NextToken(); -#line 1577 "cs.ATG" +#line 1576 "cs.ATG" Error("get or set accessor declaration expected"); } else SynErr(161); } void InterfaceAccessors( -#line 1625 "cs.ATG" +#line 1624 "cs.ATG" out PropertyGetRegion getBlock, out PropertySetRegion setBlock) { -#line 1627 "cs.ATG" +#line 1626 "cs.ATG" AttributeSection section; List attributes = new List(); getBlock = null; setBlock = null; @@ -3347,274 +3346,274 @@ out PropertyGetRegion getBlock, out PropertySetRegion setBlock) { while (la.kind == 18) { AttributeSection( -#line 1633 "cs.ATG" +#line 1632 "cs.ATG" out section); -#line 1633 "cs.ATG" +#line 1632 "cs.ATG" attributes.Add(section); } -#line 1634 "cs.ATG" - Point startLocation = la.Location; +#line 1633 "cs.ATG" + Location startLocation = la.Location; if ( -#line 1636 "cs.ATG" +#line 1635 "cs.ATG" IdentIsGet()) { Expect(1); -#line 1636 "cs.ATG" +#line 1635 "cs.ATG" getBlock = new PropertyGetRegion(null, attributes); } else if ( -#line 1637 "cs.ATG" +#line 1636 "cs.ATG" IdentIsSet()) { Expect(1); -#line 1637 "cs.ATG" +#line 1636 "cs.ATG" setBlock = new PropertySetRegion(null, attributes); } else if (la.kind == 1) { lexer.NextToken(); -#line 1638 "cs.ATG" +#line 1637 "cs.ATG" Error("set or get expected"); } else SynErr(162); Expect(11); -#line 1641 "cs.ATG" +#line 1640 "cs.ATG" if (getBlock != null) { getBlock.StartLocation = startLocation; getBlock.EndLocation = t.EndLocation; } if (setBlock != null) { setBlock.StartLocation = startLocation; setBlock.EndLocation = t.EndLocation; } attributes = new List(); if (la.kind == 1 || la.kind == 18) { while (la.kind == 18) { AttributeSection( -#line 1645 "cs.ATG" +#line 1644 "cs.ATG" out section); -#line 1645 "cs.ATG" +#line 1644 "cs.ATG" attributes.Add(section); } -#line 1646 "cs.ATG" +#line 1645 "cs.ATG" startLocation = la.Location; if ( -#line 1648 "cs.ATG" +#line 1647 "cs.ATG" IdentIsGet()) { Expect(1); -#line 1648 "cs.ATG" +#line 1647 "cs.ATG" if (getBlock != null) Error("get already declared"); else { getBlock = new PropertyGetRegion(null, attributes); lastBlock = getBlock; } } else if ( -#line 1651 "cs.ATG" +#line 1650 "cs.ATG" IdentIsSet()) { Expect(1); -#line 1651 "cs.ATG" +#line 1650 "cs.ATG" if (setBlock != null) Error("set already declared"); else { setBlock = new PropertySetRegion(null, attributes); lastBlock = setBlock; } } else if (la.kind == 1) { lexer.NextToken(); -#line 1654 "cs.ATG" +#line 1653 "cs.ATG" Error("set or get expected"); } else SynErr(163); Expect(11); -#line 1657 "cs.ATG" +#line 1656 "cs.ATG" if (lastBlock != null) { lastBlock.StartLocation = startLocation; lastBlock.EndLocation = t.EndLocation; } } } void GetAccessorDecl( -#line 1581 "cs.ATG" +#line 1580 "cs.ATG" out PropertyGetRegion getBlock, List attributes) { -#line 1582 "cs.ATG" +#line 1581 "cs.ATG" Statement stmt = null; Expect(1); -#line 1585 "cs.ATG" +#line 1584 "cs.ATG" if (t.val != "get") Error("get expected"); -#line 1586 "cs.ATG" - Point startLocation = t.Location; +#line 1585 "cs.ATG" + Location startLocation = t.Location; if (la.kind == 16) { Block( -#line 1587 "cs.ATG" +#line 1586 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); } else SynErr(164); -#line 1588 "cs.ATG" +#line 1587 "cs.ATG" getBlock = new PropertyGetRegion((BlockStatement)stmt, attributes); -#line 1589 "cs.ATG" +#line 1588 "cs.ATG" getBlock.StartLocation = startLocation; getBlock.EndLocation = t.EndLocation; } void SetAccessorDecl( -#line 1592 "cs.ATG" +#line 1591 "cs.ATG" out PropertySetRegion setBlock, List attributes) { -#line 1593 "cs.ATG" +#line 1592 "cs.ATG" Statement stmt = null; Expect(1); -#line 1596 "cs.ATG" +#line 1595 "cs.ATG" if (t.val != "set") Error("set expected"); -#line 1597 "cs.ATG" - Point startLocation = t.Location; +#line 1596 "cs.ATG" + Location startLocation = t.Location; if (la.kind == 16) { Block( -#line 1598 "cs.ATG" +#line 1597 "cs.ATG" out stmt); } else if (la.kind == 11) { lexer.NextToken(); } else SynErr(165); -#line 1599 "cs.ATG" +#line 1598 "cs.ATG" setBlock = new PropertySetRegion((BlockStatement)stmt, attributes); -#line 1600 "cs.ATG" +#line 1599 "cs.ATG" setBlock.StartLocation = startLocation; setBlock.EndLocation = t.EndLocation; } void AddAccessorDecl( -#line 1683 "cs.ATG" +#line 1682 "cs.ATG" out Statement stmt) { -#line 1684 "cs.ATG" +#line 1683 "cs.ATG" stmt = null; Expect(1); -#line 1687 "cs.ATG" +#line 1686 "cs.ATG" if (t.val != "add") Error("add expected"); Block( -#line 1688 "cs.ATG" +#line 1687 "cs.ATG" out stmt); } void RemoveAccessorDecl( -#line 1691 "cs.ATG" +#line 1690 "cs.ATG" out Statement stmt) { -#line 1692 "cs.ATG" +#line 1691 "cs.ATG" stmt = null; Expect(1); -#line 1695 "cs.ATG" +#line 1694 "cs.ATG" if (t.val != "remove") Error("remove expected"); Block( -#line 1696 "cs.ATG" +#line 1695 "cs.ATG" out stmt); } void VariableInitializer( -#line 1712 "cs.ATG" +#line 1711 "cs.ATG" out Expression initializerExpression) { -#line 1713 "cs.ATG" +#line 1712 "cs.ATG" TypeReference type = null; Expression expr = null; initializerExpression = null; if (StartOf(5)) { Expr( -#line 1715 "cs.ATG" +#line 1714 "cs.ATG" out initializerExpression); } else if (la.kind == 16) { ArrayInitializer( -#line 1716 "cs.ATG" +#line 1715 "cs.ATG" out initializerExpression); } else if (la.kind == 105) { lexer.NextToken(); Type( -#line 1717 "cs.ATG" +#line 1716 "cs.ATG" out type); Expect(18); Expr( -#line 1717 "cs.ATG" +#line 1716 "cs.ATG" out expr); Expect(19); -#line 1717 "cs.ATG" +#line 1716 "cs.ATG" initializerExpression = new StackAllocExpression(type, expr); } else SynErr(166); } void Statement() { -#line 1829 "cs.ATG" +#line 1828 "cs.ATG" TypeReference type; Expression expr; Statement stmt = null; - Point startPos = la.Location; + Location startPos = la.Location; if ( -#line 1837 "cs.ATG" +#line 1836 "cs.ATG" IsLabel()) { Expect(1); -#line 1837 "cs.ATG" +#line 1836 "cs.ATG" compilationUnit.AddChild(new LabelStatement(t.val)); Expect(9); Statement(); } else if (la.kind == 59) { lexer.NextToken(); Type( -#line 1840 "cs.ATG" +#line 1839 "cs.ATG" out type); -#line 1840 "cs.ATG" +#line 1839 "cs.ATG" LocalVariableDeclaration var = new LocalVariableDeclaration(type, Modifier.Const); string ident = null; var.StartLocation = t.Location; Expect(1); -#line 1841 "cs.ATG" +#line 1840 "cs.ATG" ident = t.val; Expect(3); Expr( -#line 1842 "cs.ATG" +#line 1841 "cs.ATG" out expr); -#line 1842 "cs.ATG" +#line 1841 "cs.ATG" var.Variables.Add(new VariableDeclaration(ident, expr)); while (la.kind == 14) { lexer.NextToken(); Expect(1); -#line 1843 "cs.ATG" +#line 1842 "cs.ATG" ident = t.val; Expect(3); Expr( -#line 1843 "cs.ATG" +#line 1842 "cs.ATG" out expr); -#line 1843 "cs.ATG" +#line 1842 "cs.ATG" var.Variables.Add(new VariableDeclaration(ident, expr)); } Expect(11); -#line 1844 "cs.ATG" +#line 1843 "cs.ATG" compilationUnit.AddChild(var); } else if ( -#line 1846 "cs.ATG" +#line 1845 "cs.ATG" IsLocalVarDecl()) { LocalVariableDecl( -#line 1846 "cs.ATG" +#line 1845 "cs.ATG" out stmt); Expect(11); -#line 1846 "cs.ATG" +#line 1845 "cs.ATG" compilationUnit.AddChild(stmt); } else if (StartOf(23)) { EmbeddedStatement( -#line 1847 "cs.ATG" +#line 1846 "cs.ATG" out stmt); -#line 1847 "cs.ATG" +#line 1846 "cs.ATG" compilationUnit.AddChild(stmt); } else SynErr(167); -#line 1853 "cs.ATG" +#line 1852 "cs.ATG" if (stmt != null) { stmt.StartLocation = startPos; stmt.EndLocation = t.EndLocation; @@ -3623,10 +3622,10 @@ out stmt); } void Argument( -#line 1752 "cs.ATG" +#line 1751 "cs.ATG" out Expression argumentexpr) { -#line 1754 "cs.ATG" +#line 1753 "cs.ATG" Expression expr; FieldDirection fd = FieldDirection.None; @@ -3634,48 +3633,48 @@ out Expression argumentexpr) { if (la.kind == 99) { lexer.NextToken(); -#line 1759 "cs.ATG" +#line 1758 "cs.ATG" fd = FieldDirection.Ref; } else { lexer.NextToken(); -#line 1760 "cs.ATG" +#line 1759 "cs.ATG" fd = FieldDirection.Out; } } Expr( -#line 1762 "cs.ATG" +#line 1761 "cs.ATG" out expr); -#line 1762 "cs.ATG" +#line 1761 "cs.ATG" argumentexpr = fd != FieldDirection.None ? argumentexpr = new DirectionExpression(fd, expr) : expr; } void ArrayInitializer( -#line 1782 "cs.ATG" +#line 1781 "cs.ATG" out Expression outExpr) { -#line 1784 "cs.ATG" +#line 1783 "cs.ATG" Expression expr = null; ArrayInitializerExpression initializer = new ArrayInitializerExpression(); Expect(16); if (StartOf(24)) { VariableInitializer( -#line 1789 "cs.ATG" +#line 1788 "cs.ATG" out expr); -#line 1790 "cs.ATG" +#line 1789 "cs.ATG" if (expr != null) { initializer.CreateExpressions.Add(expr); } while ( -#line 1791 "cs.ATG" +#line 1790 "cs.ATG" NotFinalComma()) { Expect(14); VariableInitializer( -#line 1792 "cs.ATG" +#line 1791 "cs.ATG" out expr); -#line 1793 "cs.ATG" +#line 1792 "cs.ATG" if (expr != null) { initializer.CreateExpressions.Add(expr); } } if (la.kind == 14) { @@ -3684,138 +3683,138 @@ out expr); } Expect(17); -#line 1797 "cs.ATG" +#line 1796 "cs.ATG" outExpr = initializer; } void AssignmentOperator( -#line 1765 "cs.ATG" +#line 1764 "cs.ATG" out AssignmentOperatorType op) { -#line 1766 "cs.ATG" +#line 1765 "cs.ATG" op = AssignmentOperatorType.None; if (la.kind == 3) { lexer.NextToken(); -#line 1768 "cs.ATG" +#line 1767 "cs.ATG" op = AssignmentOperatorType.Assign; } else if (la.kind == 38) { lexer.NextToken(); -#line 1769 "cs.ATG" +#line 1768 "cs.ATG" op = AssignmentOperatorType.Add; } else if (la.kind == 39) { lexer.NextToken(); -#line 1770 "cs.ATG" +#line 1769 "cs.ATG" op = AssignmentOperatorType.Subtract; } else if (la.kind == 40) { lexer.NextToken(); -#line 1771 "cs.ATG" +#line 1770 "cs.ATG" op = AssignmentOperatorType.Multiply; } else if (la.kind == 41) { lexer.NextToken(); -#line 1772 "cs.ATG" +#line 1771 "cs.ATG" op = AssignmentOperatorType.Divide; } else if (la.kind == 42) { lexer.NextToken(); -#line 1773 "cs.ATG" +#line 1772 "cs.ATG" op = AssignmentOperatorType.Modulus; } else if (la.kind == 43) { lexer.NextToken(); -#line 1774 "cs.ATG" +#line 1773 "cs.ATG" op = AssignmentOperatorType.BitwiseAnd; } else if (la.kind == 44) { lexer.NextToken(); -#line 1775 "cs.ATG" +#line 1774 "cs.ATG" op = AssignmentOperatorType.BitwiseOr; } else if (la.kind == 45) { lexer.NextToken(); -#line 1776 "cs.ATG" +#line 1775 "cs.ATG" op = AssignmentOperatorType.ExclusiveOr; } else if (la.kind == 46) { lexer.NextToken(); -#line 1777 "cs.ATG" +#line 1776 "cs.ATG" op = AssignmentOperatorType.ShiftLeft; } else if ( -#line 1778 "cs.ATG" +#line 1777 "cs.ATG" la.kind == Tokens.GreaterThan && Peek(1).kind == Tokens.GreaterEqual) { Expect(22); Expect(35); -#line 1779 "cs.ATG" +#line 1778 "cs.ATG" op = AssignmentOperatorType.ShiftRight; } else SynErr(168); } void LocalVariableDecl( -#line 1800 "cs.ATG" +#line 1799 "cs.ATG" out Statement stmt) { -#line 1802 "cs.ATG" +#line 1801 "cs.ATG" TypeReference type; VariableDeclaration var = null; LocalVariableDeclaration localVariableDeclaration; Type( -#line 1807 "cs.ATG" +#line 1806 "cs.ATG" out type); -#line 1807 "cs.ATG" +#line 1806 "cs.ATG" localVariableDeclaration = new LocalVariableDeclaration(type); localVariableDeclaration.StartLocation = t.Location; LocalVariableDeclarator( -#line 1808 "cs.ATG" +#line 1807 "cs.ATG" out var); -#line 1808 "cs.ATG" +#line 1807 "cs.ATG" localVariableDeclaration.Variables.Add(var); while (la.kind == 14) { lexer.NextToken(); LocalVariableDeclarator( -#line 1809 "cs.ATG" +#line 1808 "cs.ATG" out var); -#line 1809 "cs.ATG" +#line 1808 "cs.ATG" localVariableDeclaration.Variables.Add(var); } -#line 1810 "cs.ATG" +#line 1809 "cs.ATG" stmt = localVariableDeclaration; } void LocalVariableDeclarator( -#line 1813 "cs.ATG" +#line 1812 "cs.ATG" out VariableDeclaration var) { -#line 1814 "cs.ATG" +#line 1813 "cs.ATG" Expression expr = null; Expect(1); -#line 1817 "cs.ATG" +#line 1816 "cs.ATG" var = new VariableDeclaration(t.val); if (la.kind == 3) { lexer.NextToken(); VariableInitializer( -#line 1817 "cs.ATG" +#line 1816 "cs.ATG" out expr); -#line 1817 "cs.ATG" +#line 1816 "cs.ATG" var.Initializer = expr; } } void EmbeddedStatement( -#line 1860 "cs.ATG" +#line 1859 "cs.ATG" out Statement statement) { -#line 1862 "cs.ATG" +#line 1861 "cs.ATG" TypeReference type = null; Expression expr = null; Statement embeddedStatement = null; @@ -3823,57 +3822,57 @@ out Statement statement) { if (la.kind == 16) { Block( -#line 1868 "cs.ATG" +#line 1867 "cs.ATG" out statement); } else if (la.kind == 11) { lexer.NextToken(); -#line 1870 "cs.ATG" +#line 1869 "cs.ATG" statement = new EmptyStatement(); } else if ( -#line 1872 "cs.ATG" +#line 1871 "cs.ATG" UnCheckedAndLBrace()) { -#line 1872 "cs.ATG" +#line 1871 "cs.ATG" Statement block; bool isChecked = true; if (la.kind == 57) { lexer.NextToken(); } else if (la.kind == 117) { lexer.NextToken(); -#line 1873 "cs.ATG" +#line 1872 "cs.ATG" isChecked = false; } else SynErr(169); Block( -#line 1874 "cs.ATG" +#line 1873 "cs.ATG" out block); -#line 1874 "cs.ATG" +#line 1873 "cs.ATG" statement = isChecked ? (Statement)new CheckedStatement(block) : (Statement)new UncheckedStatement(block); } else if (la.kind == 78) { lexer.NextToken(); -#line 1876 "cs.ATG" +#line 1875 "cs.ATG" Statement elseStatement = null; Expect(20); Expr( -#line 1877 "cs.ATG" +#line 1876 "cs.ATG" out expr); Expect(21); EmbeddedStatement( -#line 1878 "cs.ATG" +#line 1877 "cs.ATG" out embeddedStatement); if (la.kind == 66) { lexer.NextToken(); EmbeddedStatement( -#line 1879 "cs.ATG" +#line 1878 "cs.ATG" out elseStatement); } -#line 1880 "cs.ATG" +#line 1879 "cs.ATG" statement = elseStatement != null ? new IfElseStatement(expr, embeddedStatement, elseStatement) : new IfElseStatement(expr, embeddedStatement); -#line 1881 "cs.ATG" +#line 1880 "cs.ATG" if (elseStatement is IfElseStatement && (elseStatement as IfElseStatement).TrueStatement.Count == 1) { /* else if-section (otherwise we would have a BlockStatment) */ (statement as IfElseStatement).ElseIfSections.Add( @@ -3885,99 +3884,99 @@ out elseStatement); } else if (la.kind == 109) { lexer.NextToken(); -#line 1889 "cs.ATG" +#line 1888 "cs.ATG" List switchSections = new List(); Expect(20); Expr( -#line 1890 "cs.ATG" +#line 1889 "cs.ATG" out expr); Expect(21); Expect(16); SwitchSections( -#line 1891 "cs.ATG" +#line 1890 "cs.ATG" switchSections); Expect(17); -#line 1892 "cs.ATG" +#line 1891 "cs.ATG" statement = new SwitchStatement(expr, switchSections); } else if (la.kind == 124) { lexer.NextToken(); Expect(20); Expr( -#line 1894 "cs.ATG" +#line 1893 "cs.ATG" out expr); Expect(21); EmbeddedStatement( -#line 1896 "cs.ATG" +#line 1895 "cs.ATG" out embeddedStatement); -#line 1896 "cs.ATG" +#line 1895 "cs.ATG" statement = new DoLoopStatement(expr, embeddedStatement, ConditionType.While, ConditionPosition.Start); } else if (la.kind == 64) { lexer.NextToken(); EmbeddedStatement( -#line 1897 "cs.ATG" +#line 1896 "cs.ATG" out embeddedStatement); Expect(124); Expect(20); Expr( -#line 1898 "cs.ATG" +#line 1897 "cs.ATG" out expr); Expect(21); Expect(11); -#line 1898 "cs.ATG" +#line 1897 "cs.ATG" statement = new DoLoopStatement(expr, embeddedStatement, ConditionType.While, ConditionPosition.End); } else if (la.kind == 75) { lexer.NextToken(); -#line 1899 "cs.ATG" +#line 1898 "cs.ATG" List initializer = null; List iterator = null; Expect(20); if (StartOf(5)) { ForInitializer( -#line 1900 "cs.ATG" +#line 1899 "cs.ATG" out initializer); } Expect(11); if (StartOf(5)) { Expr( -#line 1901 "cs.ATG" +#line 1900 "cs.ATG" out expr); } Expect(11); if (StartOf(5)) { ForIterator( -#line 1902 "cs.ATG" +#line 1901 "cs.ATG" out iterator); } Expect(21); EmbeddedStatement( -#line 1903 "cs.ATG" +#line 1902 "cs.ATG" out embeddedStatement); -#line 1903 "cs.ATG" +#line 1902 "cs.ATG" statement = new ForStatement(initializer, expr, iterator, embeddedStatement); } else if (la.kind == 76) { lexer.NextToken(); Expect(20); Type( -#line 1904 "cs.ATG" +#line 1903 "cs.ATG" out type); Expect(1); -#line 1904 "cs.ATG" - string varName = t.val; Point start = t.Location; +#line 1903 "cs.ATG" + string varName = t.val; Location start = t.Location; Expect(80); Expr( -#line 1905 "cs.ATG" +#line 1904 "cs.ATG" out expr); Expect(21); EmbeddedStatement( -#line 1906 "cs.ATG" +#line 1905 "cs.ATG" out embeddedStatement); -#line 1906 "cs.ATG" +#line 1905 "cs.ATG" statement = new ForeachStatement(type, varName , expr, embeddedStatement); statement.EndLocation = t.EndLocation; @@ -3985,34 +3984,34 @@ out embeddedStatement); lexer.NextToken(); Expect(11); -#line 1910 "cs.ATG" +#line 1909 "cs.ATG" statement = new BreakStatement(); } else if (la.kind == 60) { lexer.NextToken(); Expect(11); -#line 1911 "cs.ATG" +#line 1910 "cs.ATG" statement = new ContinueStatement(); } else if (la.kind == 77) { GotoStatement( -#line 1912 "cs.ATG" +#line 1911 "cs.ATG" out statement); } else if ( -#line 1913 "cs.ATG" +#line 1912 "cs.ATG" IsYieldStatement()) { Expect(1); if (la.kind == 100) { lexer.NextToken(); Expr( -#line 1913 "cs.ATG" +#line 1912 "cs.ATG" out expr); -#line 1913 "cs.ATG" +#line 1912 "cs.ATG" statement = new YieldStatement(new ReturnStatement(expr)); } else if (la.kind == 52) { lexer.NextToken(); -#line 1914 "cs.ATG" +#line 1913 "cs.ATG" statement = new YieldStatement(new BreakStatement()); } else SynErr(170); Expect(11); @@ -4020,140 +4019,140 @@ out expr); lexer.NextToken(); if (StartOf(5)) { Expr( -#line 1915 "cs.ATG" +#line 1914 "cs.ATG" out expr); } Expect(11); -#line 1915 "cs.ATG" +#line 1914 "cs.ATG" statement = new ReturnStatement(expr); } else if (la.kind == 111) { lexer.NextToken(); if (StartOf(5)) { Expr( -#line 1916 "cs.ATG" +#line 1915 "cs.ATG" out expr); } Expect(11); -#line 1916 "cs.ATG" +#line 1915 "cs.ATG" statement = new ThrowStatement(expr); } else if (StartOf(5)) { StatementExpr( -#line 1919 "cs.ATG" +#line 1918 "cs.ATG" out statement); Expect(11); } else if (la.kind == 113) { TryStatement( -#line 1921 "cs.ATG" +#line 1920 "cs.ATG" out statement); } else if (la.kind == 85) { lexer.NextToken(); Expect(20); Expr( -#line 1923 "cs.ATG" +#line 1922 "cs.ATG" out expr); Expect(21); EmbeddedStatement( -#line 1924 "cs.ATG" +#line 1923 "cs.ATG" out embeddedStatement); -#line 1924 "cs.ATG" +#line 1923 "cs.ATG" statement = new LockStatement(expr, embeddedStatement); } else if (la.kind == 120) { -#line 1926 "cs.ATG" +#line 1925 "cs.ATG" Statement resourceAcquisitionStmt = null; lexer.NextToken(); Expect(20); ResourceAcquisition( -#line 1928 "cs.ATG" +#line 1927 "cs.ATG" out resourceAcquisitionStmt); Expect(21); EmbeddedStatement( -#line 1929 "cs.ATG" +#line 1928 "cs.ATG" out embeddedStatement); -#line 1929 "cs.ATG" +#line 1928 "cs.ATG" statement = new UsingStatement(resourceAcquisitionStmt, embeddedStatement); } else if (la.kind == 118) { lexer.NextToken(); Block( -#line 1931 "cs.ATG" +#line 1930 "cs.ATG" out embeddedStatement); -#line 1931 "cs.ATG" +#line 1930 "cs.ATG" statement = new UnsafeStatement(embeddedStatement); } else if (la.kind == 73) { lexer.NextToken(); Expect(20); Type( -#line 1934 "cs.ATG" +#line 1933 "cs.ATG" out type); -#line 1934 "cs.ATG" +#line 1933 "cs.ATG" if (type.PointerNestingLevel == 0) Error("can only fix pointer types"); List pointerDeclarators = new List(1); Expect(1); -#line 1937 "cs.ATG" +#line 1936 "cs.ATG" string identifier = t.val; Expect(3); Expr( -#line 1938 "cs.ATG" +#line 1937 "cs.ATG" out expr); -#line 1938 "cs.ATG" +#line 1937 "cs.ATG" pointerDeclarators.Add(new VariableDeclaration(identifier, expr)); while (la.kind == 14) { lexer.NextToken(); Expect(1); -#line 1940 "cs.ATG" +#line 1939 "cs.ATG" identifier = t.val; Expect(3); Expr( -#line 1941 "cs.ATG" +#line 1940 "cs.ATG" out expr); -#line 1941 "cs.ATG" +#line 1940 "cs.ATG" pointerDeclarators.Add(new VariableDeclaration(identifier, expr)); } Expect(21); EmbeddedStatement( -#line 1943 "cs.ATG" +#line 1942 "cs.ATG" out embeddedStatement); -#line 1943 "cs.ATG" +#line 1942 "cs.ATG" statement = new FixedStatement(type, pointerDeclarators, embeddedStatement); } else SynErr(171); } void SwitchSections( -#line 1965 "cs.ATG" +#line 1964 "cs.ATG" List switchSections) { -#line 1967 "cs.ATG" +#line 1966 "cs.ATG" SwitchSection switchSection = new SwitchSection(); CaseLabel label; SwitchLabel( -#line 1971 "cs.ATG" +#line 1970 "cs.ATG" out label); -#line 1971 "cs.ATG" +#line 1970 "cs.ATG" if (label != null) { switchSection.SwitchLabels.Add(label); } -#line 1972 "cs.ATG" +#line 1971 "cs.ATG" compilationUnit.BlockStart(switchSection); while (StartOf(25)) { if (la.kind == 54 || la.kind == 62) { SwitchLabel( -#line 1974 "cs.ATG" +#line 1973 "cs.ATG" out label); -#line 1975 "cs.ATG" +#line 1974 "cs.ATG" if (label != null) { if (switchSection.Children.Count > 0) { // open new section @@ -4169,346 +4168,346 @@ out label); } } -#line 1987 "cs.ATG" +#line 1986 "cs.ATG" compilationUnit.BlockEnd(); switchSections.Add(switchSection); } void ForInitializer( -#line 1946 "cs.ATG" +#line 1945 "cs.ATG" out List initializer) { -#line 1948 "cs.ATG" +#line 1947 "cs.ATG" Statement stmt; initializer = new List(); if ( -#line 1952 "cs.ATG" +#line 1951 "cs.ATG" IsLocalVarDecl()) { LocalVariableDecl( -#line 1952 "cs.ATG" +#line 1951 "cs.ATG" out stmt); -#line 1952 "cs.ATG" +#line 1951 "cs.ATG" initializer.Add(stmt); } else if (StartOf(5)) { StatementExpr( -#line 1953 "cs.ATG" +#line 1952 "cs.ATG" out stmt); -#line 1953 "cs.ATG" +#line 1952 "cs.ATG" initializer.Add(stmt); while (la.kind == 14) { lexer.NextToken(); StatementExpr( -#line 1953 "cs.ATG" +#line 1952 "cs.ATG" out stmt); -#line 1953 "cs.ATG" +#line 1952 "cs.ATG" initializer.Add(stmt); } } else SynErr(172); } void ForIterator( -#line 1956 "cs.ATG" +#line 1955 "cs.ATG" out List iterator) { -#line 1958 "cs.ATG" +#line 1957 "cs.ATG" Statement stmt; iterator = new List(); StatementExpr( -#line 1962 "cs.ATG" +#line 1961 "cs.ATG" out stmt); -#line 1962 "cs.ATG" +#line 1961 "cs.ATG" iterator.Add(stmt); while (la.kind == 14) { lexer.NextToken(); StatementExpr( -#line 1962 "cs.ATG" +#line 1961 "cs.ATG" out stmt); -#line 1962 "cs.ATG" +#line 1961 "cs.ATG" iterator.Add(stmt); } } void GotoStatement( -#line 2040 "cs.ATG" +#line 2039 "cs.ATG" out Statement stmt) { -#line 2041 "cs.ATG" +#line 2040 "cs.ATG" Expression expr; stmt = null; Expect(77); if (la.kind == 1) { lexer.NextToken(); -#line 2045 "cs.ATG" +#line 2044 "cs.ATG" stmt = new GotoStatement(t.val); Expect(11); } else if (la.kind == 54) { lexer.NextToken(); Expr( -#line 2046 "cs.ATG" +#line 2045 "cs.ATG" out expr); Expect(11); -#line 2046 "cs.ATG" +#line 2045 "cs.ATG" stmt = new GotoCaseStatement(expr); } else if (la.kind == 62) { lexer.NextToken(); Expect(11); -#line 2047 "cs.ATG" +#line 2046 "cs.ATG" stmt = new GotoCaseStatement(null); } else SynErr(173); } void StatementExpr( -#line 2067 "cs.ATG" +#line 2066 "cs.ATG" out Statement stmt) { -#line 2068 "cs.ATG" +#line 2067 "cs.ATG" Expression expr; Expr( -#line 2070 "cs.ATG" +#line 2069 "cs.ATG" out expr); -#line 2073 "cs.ATG" +#line 2072 "cs.ATG" stmt = new StatementExpression(expr); } void TryStatement( -#line 1997 "cs.ATG" +#line 1996 "cs.ATG" out Statement tryStatement) { -#line 1999 "cs.ATG" +#line 1998 "cs.ATG" Statement blockStmt = null, finallyStmt = null; List catchClauses = null; Expect(113); Block( -#line 2003 "cs.ATG" +#line 2002 "cs.ATG" out blockStmt); if (la.kind == 55) { CatchClauses( -#line 2005 "cs.ATG" +#line 2004 "cs.ATG" out catchClauses); if (la.kind == 72) { lexer.NextToken(); Block( -#line 2005 "cs.ATG" +#line 2004 "cs.ATG" out finallyStmt); } } else if (la.kind == 72) { lexer.NextToken(); Block( -#line 2006 "cs.ATG" +#line 2005 "cs.ATG" out finallyStmt); } else SynErr(174); -#line 2009 "cs.ATG" +#line 2008 "cs.ATG" tryStatement = new TryCatchStatement(blockStmt, catchClauses, finallyStmt); } void ResourceAcquisition( -#line 2051 "cs.ATG" +#line 2050 "cs.ATG" out Statement stmt) { -#line 2053 "cs.ATG" +#line 2052 "cs.ATG" stmt = null; Expression expr; if ( -#line 2058 "cs.ATG" +#line 2057 "cs.ATG" IsLocalVarDecl()) { LocalVariableDecl( -#line 2058 "cs.ATG" +#line 2057 "cs.ATG" out stmt); } else if (StartOf(5)) { Expr( -#line 2059 "cs.ATG" +#line 2058 "cs.ATG" out expr); -#line 2063 "cs.ATG" +#line 2062 "cs.ATG" stmt = new StatementExpression(expr); } else SynErr(175); } void SwitchLabel( -#line 1990 "cs.ATG" +#line 1989 "cs.ATG" out CaseLabel label) { -#line 1991 "cs.ATG" +#line 1990 "cs.ATG" Expression expr = null; label = null; if (la.kind == 54) { lexer.NextToken(); Expr( -#line 1993 "cs.ATG" +#line 1992 "cs.ATG" out expr); Expect(9); -#line 1993 "cs.ATG" +#line 1992 "cs.ATG" label = new CaseLabel(expr); } else if (la.kind == 62) { lexer.NextToken(); Expect(9); -#line 1994 "cs.ATG" +#line 1993 "cs.ATG" label = new CaseLabel(); } else SynErr(176); } void CatchClauses( -#line 2014 "cs.ATG" +#line 2013 "cs.ATG" out List catchClauses) { -#line 2016 "cs.ATG" +#line 2015 "cs.ATG" catchClauses = new List(); Expect(55); -#line 2019 "cs.ATG" +#line 2018 "cs.ATG" string identifier; Statement stmt; TypeReference typeRef; if (la.kind == 16) { Block( -#line 2025 "cs.ATG" +#line 2024 "cs.ATG" out stmt); -#line 2025 "cs.ATG" +#line 2024 "cs.ATG" catchClauses.Add(new CatchClause(stmt)); } else if (la.kind == 20) { lexer.NextToken(); ClassType( -#line 2027 "cs.ATG" +#line 2026 "cs.ATG" out typeRef, false); -#line 2027 "cs.ATG" +#line 2026 "cs.ATG" identifier = null; if (la.kind == 1) { lexer.NextToken(); -#line 2028 "cs.ATG" +#line 2027 "cs.ATG" identifier = t.val; } Expect(21); Block( -#line 2029 "cs.ATG" +#line 2028 "cs.ATG" out stmt); -#line 2030 "cs.ATG" +#line 2029 "cs.ATG" catchClauses.Add(new CatchClause(typeRef, identifier, stmt)); while ( -#line 2031 "cs.ATG" +#line 2030 "cs.ATG" IsTypedCatch()) { Expect(55); Expect(20); ClassType( -#line 2031 "cs.ATG" +#line 2030 "cs.ATG" out typeRef, false); -#line 2031 "cs.ATG" +#line 2030 "cs.ATG" identifier = null; if (la.kind == 1) { lexer.NextToken(); -#line 2032 "cs.ATG" +#line 2031 "cs.ATG" identifier = t.val; } Expect(21); Block( -#line 2033 "cs.ATG" +#line 2032 "cs.ATG" out stmt); -#line 2034 "cs.ATG" +#line 2033 "cs.ATG" catchClauses.Add(new CatchClause(typeRef, identifier, stmt)); } if (la.kind == 55) { lexer.NextToken(); Block( -#line 2036 "cs.ATG" +#line 2035 "cs.ATG" out stmt); -#line 2036 "cs.ATG" +#line 2035 "cs.ATG" catchClauses.Add(new CatchClause(stmt)); } } else SynErr(177); } void UnaryExpr( -#line 2094 "cs.ATG" +#line 2093 "cs.ATG" out Expression uExpr) { -#line 2096 "cs.ATG" +#line 2095 "cs.ATG" TypeReference type = null; Expression expr; ArrayList expressions = new ArrayList(); uExpr = null; while (StartOf(26) || -#line 2118 "cs.ATG" +#line 2117 "cs.ATG" IsTypeCast()) { if (la.kind == 4) { lexer.NextToken(); -#line 2105 "cs.ATG" +#line 2104 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Plus)); } else if (la.kind == 5) { lexer.NextToken(); -#line 2106 "cs.ATG" +#line 2105 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Minus)); } else if (la.kind == 24) { lexer.NextToken(); -#line 2107 "cs.ATG" +#line 2106 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Not)); } else if (la.kind == 27) { lexer.NextToken(); -#line 2108 "cs.ATG" +#line 2107 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.BitNot)); } else if (la.kind == 6) { lexer.NextToken(); -#line 2109 "cs.ATG" +#line 2108 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Star)); } else if (la.kind == 31) { lexer.NextToken(); -#line 2110 "cs.ATG" +#line 2109 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Increment)); } else if (la.kind == 32) { lexer.NextToken(); -#line 2111 "cs.ATG" +#line 2110 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.Decrement)); } else if (la.kind == 28) { lexer.NextToken(); -#line 2112 "cs.ATG" +#line 2111 "cs.ATG" expressions.Add(new UnaryOperatorExpression(UnaryOperatorType.BitWiseAnd)); } else { Expect(20); Type( -#line 2118 "cs.ATG" +#line 2117 "cs.ATG" out type); Expect(21); -#line 2118 "cs.ATG" +#line 2117 "cs.ATG" expressions.Add(new CastExpression(type)); } } PrimaryExpr( -#line 2122 "cs.ATG" +#line 2121 "cs.ATG" out expr); -#line 2122 "cs.ATG" +#line 2121 "cs.ATG" for (int i = 0; i < expressions.Count; ++i) { Expression nextExpression = i + 1 < expressions.Count ? (Expression)expressions[i + 1] : expr; if (expressions[i] is CastExpression) { @@ -4526,33 +4525,33 @@ out expr); } void ConditionalOrExpr( -#line 2291 "cs.ATG" +#line 2290 "cs.ATG" ref Expression outExpr) { -#line 2292 "cs.ATG" +#line 2291 "cs.ATG" Expression expr; ConditionalAndExpr( -#line 2294 "cs.ATG" +#line 2293 "cs.ATG" ref outExpr); while (la.kind == 26) { lexer.NextToken(); UnaryExpr( -#line 2294 "cs.ATG" +#line 2293 "cs.ATG" out expr); ConditionalAndExpr( -#line 2294 "cs.ATG" +#line 2293 "cs.ATG" ref expr); -#line 2294 "cs.ATG" +#line 2293 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.LogicalOr, expr); } } void PrimaryExpr( -#line 2139 "cs.ATG" +#line 2138 "cs.ATG" out Expression pexpr) { -#line 2141 "cs.ATG" +#line 2140 "cs.ATG" TypeReference type = null; List typeList = null; bool isArrayCreation = false; @@ -4562,332 +4561,332 @@ out Expression pexpr) { if (la.kind == 112) { lexer.NextToken(); -#line 2149 "cs.ATG" +#line 2148 "cs.ATG" pexpr = new PrimitiveExpression(true, "true"); } else if (la.kind == 71) { lexer.NextToken(); -#line 2150 "cs.ATG" +#line 2149 "cs.ATG" pexpr = new PrimitiveExpression(false, "false"); } else if (la.kind == 89) { lexer.NextToken(); -#line 2151 "cs.ATG" +#line 2150 "cs.ATG" pexpr = new PrimitiveExpression(null, "null"); } else if (la.kind == 2) { lexer.NextToken(); -#line 2152 "cs.ATG" +#line 2151 "cs.ATG" pexpr = new PrimitiveExpression(t.literalValue, t.val); } else if ( -#line 2153 "cs.ATG" +#line 2152 "cs.ATG" la.kind == Tokens.Identifier && Peek(1).kind == Tokens.DoubleColon) { Expect(1); -#line 2154 "cs.ATG" +#line 2153 "cs.ATG" type = new TypeReference(t.val); Expect(10); -#line 2155 "cs.ATG" +#line 2154 "cs.ATG" pexpr = new TypeReferenceExpression(type); Expect(1); -#line 2156 "cs.ATG" +#line 2155 "cs.ATG" if (type.Type == "global") { type.IsGlobal = true; type.Type = (t.val ?? "?"); } else type.Type += "." + (t.val ?? "?"); } else if (la.kind == 1) { lexer.NextToken(); -#line 2158 "cs.ATG" +#line 2157 "cs.ATG" pexpr = new IdentifierExpression(t.val); } else if (la.kind == 20) { lexer.NextToken(); Expr( -#line 2160 "cs.ATG" +#line 2159 "cs.ATG" out expr); Expect(21); -#line 2160 "cs.ATG" +#line 2159 "cs.ATG" pexpr = new ParenthesizedExpression(expr); } else if (StartOf(27)) { -#line 2162 "cs.ATG" +#line 2161 "cs.ATG" string val = null; switch (la.kind) { case 51: { lexer.NextToken(); -#line 2164 "cs.ATG" +#line 2163 "cs.ATG" val = "bool"; break; } case 53: { lexer.NextToken(); -#line 2165 "cs.ATG" +#line 2164 "cs.ATG" val = "byte"; break; } case 56: { lexer.NextToken(); -#line 2166 "cs.ATG" +#line 2165 "cs.ATG" val = "char"; break; } case 61: { lexer.NextToken(); -#line 2167 "cs.ATG" +#line 2166 "cs.ATG" val = "decimal"; break; } case 65: { lexer.NextToken(); -#line 2168 "cs.ATG" +#line 2167 "cs.ATG" val = "double"; break; } case 74: { lexer.NextToken(); -#line 2169 "cs.ATG" +#line 2168 "cs.ATG" val = "float"; break; } case 81: { lexer.NextToken(); -#line 2170 "cs.ATG" +#line 2169 "cs.ATG" val = "int"; break; } case 86: { lexer.NextToken(); -#line 2171 "cs.ATG" +#line 2170 "cs.ATG" val = "long"; break; } case 90: { lexer.NextToken(); -#line 2172 "cs.ATG" +#line 2171 "cs.ATG" val = "object"; break; } case 101: { lexer.NextToken(); -#line 2173 "cs.ATG" +#line 2172 "cs.ATG" val = "sbyte"; break; } case 103: { lexer.NextToken(); -#line 2174 "cs.ATG" +#line 2173 "cs.ATG" val = "short"; break; } case 107: { lexer.NextToken(); -#line 2175 "cs.ATG" +#line 2174 "cs.ATG" val = "string"; break; } case 115: { lexer.NextToken(); -#line 2176 "cs.ATG" +#line 2175 "cs.ATG" val = "uint"; break; } case 116: { lexer.NextToken(); -#line 2177 "cs.ATG" +#line 2176 "cs.ATG" val = "ulong"; break; } case 119: { lexer.NextToken(); -#line 2178 "cs.ATG" +#line 2177 "cs.ATG" val = "ushort"; break; } } -#line 2179 "cs.ATG" +#line 2178 "cs.ATG" t.val = ""; Expect(15); Expect(1); -#line 2179 "cs.ATG" +#line 2178 "cs.ATG" pexpr = new FieldReferenceExpression(new TypeReferenceExpression(val), t.val); } else if (la.kind == 110) { lexer.NextToken(); -#line 2181 "cs.ATG" +#line 2180 "cs.ATG" pexpr = new ThisReferenceExpression(); } else if (la.kind == 50) { lexer.NextToken(); -#line 2183 "cs.ATG" +#line 2182 "cs.ATG" Expression retExpr = new BaseReferenceExpression(); if (la.kind == 15) { lexer.NextToken(); Expect(1); -#line 2185 "cs.ATG" +#line 2184 "cs.ATG" retExpr = new FieldReferenceExpression(retExpr, t.val); } else if (la.kind == 18) { lexer.NextToken(); Expr( -#line 2186 "cs.ATG" +#line 2185 "cs.ATG" out expr); -#line 2186 "cs.ATG" +#line 2185 "cs.ATG" List indices = new List(); if (expr != null) { indices.Add(expr); } while (la.kind == 14) { lexer.NextToken(); Expr( -#line 2187 "cs.ATG" +#line 2186 "cs.ATG" out expr); -#line 2187 "cs.ATG" +#line 2186 "cs.ATG" if (expr != null) { indices.Add(expr); } } Expect(19); -#line 2188 "cs.ATG" +#line 2187 "cs.ATG" retExpr = new IndexerExpression(retExpr, indices); } else SynErr(178); -#line 2189 "cs.ATG" +#line 2188 "cs.ATG" pexpr = retExpr; } else if (la.kind == 88) { lexer.NextToken(); NonArrayType( -#line 2190 "cs.ATG" +#line 2189 "cs.ATG" out type); -#line 2191 "cs.ATG" +#line 2190 "cs.ATG" List parameters = new List(); if (la.kind == 20) { lexer.NextToken(); -#line 2196 "cs.ATG" +#line 2195 "cs.ATG" ObjectCreateExpression oce = new ObjectCreateExpression(type, parameters); if (StartOf(21)) { Argument( -#line 2197 "cs.ATG" +#line 2196 "cs.ATG" out expr); -#line 2197 "cs.ATG" +#line 2196 "cs.ATG" if (expr != null) { parameters.Add(expr); } while (la.kind == 14) { lexer.NextToken(); Argument( -#line 2198 "cs.ATG" +#line 2197 "cs.ATG" out expr); -#line 2198 "cs.ATG" +#line 2197 "cs.ATG" if (expr != null) { parameters.Add(expr); } } } Expect(21); -#line 2200 "cs.ATG" +#line 2199 "cs.ATG" pexpr = oce; } else if (la.kind == 18) { lexer.NextToken(); -#line 2202 "cs.ATG" +#line 2201 "cs.ATG" isArrayCreation = true; ArrayCreateExpression ace = new ArrayCreateExpression(type); pexpr = ace; -#line 2203 "cs.ATG" +#line 2202 "cs.ATG" int dims = 0; List ranks = new List(); if (la.kind == 14 || la.kind == 19) { while (la.kind == 14) { lexer.NextToken(); -#line 2205 "cs.ATG" +#line 2204 "cs.ATG" dims += 1; } Expect(19); -#line 2206 "cs.ATG" +#line 2205 "cs.ATG" ranks.Add(dims); dims = 0; while (la.kind == 18) { lexer.NextToken(); while (la.kind == 14) { lexer.NextToken(); -#line 2207 "cs.ATG" +#line 2206 "cs.ATG" ++dims; } Expect(19); -#line 2207 "cs.ATG" +#line 2206 "cs.ATG" ranks.Add(dims); dims = 0; } -#line 2208 "cs.ATG" +#line 2207 "cs.ATG" ace.CreateType.RankSpecifier = ranks.ToArray(); ArrayInitializer( -#line 2209 "cs.ATG" +#line 2208 "cs.ATG" out expr); -#line 2209 "cs.ATG" +#line 2208 "cs.ATG" ace.ArrayInitializer = (ArrayInitializerExpression)expr; } else if (StartOf(5)) { Expr( -#line 2210 "cs.ATG" +#line 2209 "cs.ATG" out expr); -#line 2210 "cs.ATG" +#line 2209 "cs.ATG" if (expr != null) parameters.Add(expr); while (la.kind == 14) { lexer.NextToken(); -#line 2211 "cs.ATG" +#line 2210 "cs.ATG" dims += 1; Expr( -#line 2212 "cs.ATG" +#line 2211 "cs.ATG" out expr); -#line 2212 "cs.ATG" +#line 2211 "cs.ATG" if (expr != null) parameters.Add(expr); } Expect(19); -#line 2214 "cs.ATG" +#line 2213 "cs.ATG" ranks.Add(dims); ace.Arguments = parameters; dims = 0; while (la.kind == 18) { lexer.NextToken(); while (la.kind == 14) { lexer.NextToken(); -#line 2215 "cs.ATG" +#line 2214 "cs.ATG" ++dims; } Expect(19); -#line 2215 "cs.ATG" +#line 2214 "cs.ATG" ranks.Add(dims); dims = 0; } -#line 2216 "cs.ATG" +#line 2215 "cs.ATG" ace.CreateType.RankSpecifier = ranks.ToArray(); if (la.kind == 16) { ArrayInitializer( -#line 2217 "cs.ATG" +#line 2216 "cs.ATG" out expr); -#line 2217 "cs.ATG" +#line 2216 "cs.ATG" ace.ArrayInitializer = (ArrayInitializerExpression)expr; } } else SynErr(179); @@ -4896,202 +4895,202 @@ out expr); lexer.NextToken(); Expect(20); if ( -#line 2222 "cs.ATG" +#line 2221 "cs.ATG" NotVoidPointer()) { Expect(122); -#line 2222 "cs.ATG" +#line 2221 "cs.ATG" type = new TypeReference("void"); } else if (StartOf(9)) { TypeWithRestriction( -#line 2223 "cs.ATG" +#line 2222 "cs.ATG" out type, true, true); } else SynErr(181); Expect(21); -#line 2224 "cs.ATG" +#line 2223 "cs.ATG" pexpr = new TypeOfExpression(type); } else if (la.kind == 62) { lexer.NextToken(); Expect(20); Type( -#line 2226 "cs.ATG" +#line 2225 "cs.ATG" out type); Expect(21); -#line 2226 "cs.ATG" +#line 2225 "cs.ATG" pexpr = new DefaultValueExpression(type); } else if (la.kind == 104) { lexer.NextToken(); Expect(20); Type( -#line 2227 "cs.ATG" +#line 2226 "cs.ATG" out type); Expect(21); -#line 2227 "cs.ATG" +#line 2226 "cs.ATG" pexpr = new SizeOfExpression(type); } else if (la.kind == 57) { lexer.NextToken(); Expect(20); Expr( -#line 2228 "cs.ATG" +#line 2227 "cs.ATG" out expr); Expect(21); -#line 2228 "cs.ATG" +#line 2227 "cs.ATG" pexpr = new CheckedExpression(expr); } else if (la.kind == 117) { lexer.NextToken(); Expect(20); Expr( -#line 2229 "cs.ATG" +#line 2228 "cs.ATG" out expr); Expect(21); -#line 2229 "cs.ATG" +#line 2228 "cs.ATG" pexpr = new UncheckedExpression(expr); } else if (la.kind == 63) { lexer.NextToken(); AnonymousMethodExpr( -#line 2230 "cs.ATG" +#line 2229 "cs.ATG" out expr); -#line 2230 "cs.ATG" +#line 2229 "cs.ATG" pexpr = expr; } else SynErr(182); while (StartOf(28) || -#line 2241 "cs.ATG" +#line 2240 "cs.ATG" IsGenericFollowedBy(Tokens.Dot) && IsTypeReferenceExpression(pexpr) || -#line 2250 "cs.ATG" +#line 2249 "cs.ATG" IsGenericFollowedBy(Tokens.OpenParenthesis)) { if (la.kind == 31 || la.kind == 32) { if (la.kind == 31) { lexer.NextToken(); -#line 2234 "cs.ATG" +#line 2233 "cs.ATG" pexpr = new UnaryOperatorExpression(pexpr, UnaryOperatorType.PostIncrement); } else if (la.kind == 32) { lexer.NextToken(); -#line 2235 "cs.ATG" +#line 2234 "cs.ATG" pexpr = new UnaryOperatorExpression(pexpr, UnaryOperatorType.PostDecrement); } else SynErr(183); } else if (la.kind == 47) { lexer.NextToken(); Expect(1); -#line 2238 "cs.ATG" +#line 2237 "cs.ATG" pexpr = new PointerReferenceExpression(pexpr, t.val); } else if (la.kind == 15) { lexer.NextToken(); Expect(1); -#line 2239 "cs.ATG" +#line 2238 "cs.ATG" pexpr = new FieldReferenceExpression(pexpr, t.val); } else if ( -#line 2241 "cs.ATG" +#line 2240 "cs.ATG" IsGenericFollowedBy(Tokens.Dot) && IsTypeReferenceExpression(pexpr)) { TypeArgumentList( -#line 2242 "cs.ATG" +#line 2241 "cs.ATG" out typeList, false); Expect(15); Expect(1); -#line 2244 "cs.ATG" +#line 2243 "cs.ATG" pexpr = new FieldReferenceExpression(GetTypeReferenceExpression(pexpr, typeList), t.val); } else if (la.kind == 20) { lexer.NextToken(); -#line 2246 "cs.ATG" +#line 2245 "cs.ATG" List parameters = new List(); if (StartOf(21)) { Argument( -#line 2247 "cs.ATG" +#line 2246 "cs.ATG" out expr); -#line 2247 "cs.ATG" +#line 2246 "cs.ATG" if (expr != null) {parameters.Add(expr);} while (la.kind == 14) { lexer.NextToken(); Argument( -#line 2248 "cs.ATG" +#line 2247 "cs.ATG" out expr); -#line 2248 "cs.ATG" +#line 2247 "cs.ATG" if (expr != null) {parameters.Add(expr);} } } Expect(21); -#line 2249 "cs.ATG" +#line 2248 "cs.ATG" pexpr = new InvocationExpression(pexpr, parameters); } else if ( -#line 2250 "cs.ATG" +#line 2249 "cs.ATG" IsGenericFollowedBy(Tokens.OpenParenthesis)) { TypeArgumentList( -#line 2250 "cs.ATG" +#line 2249 "cs.ATG" out typeList, false); Expect(20); -#line 2251 "cs.ATG" +#line 2250 "cs.ATG" List parameters = new List(); if (StartOf(21)) { Argument( -#line 2252 "cs.ATG" +#line 2251 "cs.ATG" out expr); -#line 2252 "cs.ATG" +#line 2251 "cs.ATG" if (expr != null) {parameters.Add(expr);} while (la.kind == 14) { lexer.NextToken(); Argument( -#line 2253 "cs.ATG" +#line 2252 "cs.ATG" out expr); -#line 2253 "cs.ATG" +#line 2252 "cs.ATG" if (expr != null) {parameters.Add(expr);} } } Expect(21); -#line 2254 "cs.ATG" +#line 2253 "cs.ATG" pexpr = new InvocationExpression(pexpr, parameters, typeList); } else { -#line 2256 "cs.ATG" +#line 2255 "cs.ATG" if (isArrayCreation) Error("element access not allow on array creation"); List indices = new List(); lexer.NextToken(); Expr( -#line 2259 "cs.ATG" +#line 2258 "cs.ATG" out expr); -#line 2259 "cs.ATG" +#line 2258 "cs.ATG" if (expr != null) { indices.Add(expr); } while (la.kind == 14) { lexer.NextToken(); Expr( -#line 2260 "cs.ATG" +#line 2259 "cs.ATG" out expr); -#line 2260 "cs.ATG" +#line 2259 "cs.ATG" if (expr != null) { indices.Add(expr); } } Expect(19); -#line 2261 "cs.ATG" +#line 2260 "cs.ATG" pexpr = new IndexerExpression(pexpr, indices); } } } void AnonymousMethodExpr( -#line 2265 "cs.ATG" +#line 2264 "cs.ATG" out Expression outExpr) { -#line 2267 "cs.ATG" +#line 2266 "cs.ATG" AnonymousMethodExpression expr = new AnonymousMethodExpression(); expr.StartLocation = t.Location; Statement stmt; @@ -5102,74 +5101,74 @@ out Expression outExpr) { lexer.NextToken(); if (StartOf(10)) { FormalParameterList( -#line 2276 "cs.ATG" +#line 2275 "cs.ATG" p); -#line 2276 "cs.ATG" +#line 2275 "cs.ATG" expr.Parameters = p; } Expect(21); } -#line 2281 "cs.ATG" +#line 2280 "cs.ATG" if (compilationUnit != null) { Block( -#line 2282 "cs.ATG" +#line 2281 "cs.ATG" out stmt); -#line 2282 "cs.ATG" +#line 2281 "cs.ATG" expr.Body = (BlockStatement)stmt; -#line 2283 "cs.ATG" +#line 2282 "cs.ATG" } else { Expect(16); -#line 2285 "cs.ATG" +#line 2284 "cs.ATG" lexer.SkipCurrentBlock(); Expect(17); -#line 2287 "cs.ATG" +#line 2286 "cs.ATG" } -#line 2288 "cs.ATG" +#line 2287 "cs.ATG" expr.EndLocation = t.Location; } void TypeArgumentList( -#line 2461 "cs.ATG" +#line 2460 "cs.ATG" out List types, bool canBeUnbound) { -#line 2463 "cs.ATG" +#line 2462 "cs.ATG" types = new List(); TypeReference type = null; Expect(23); if ( -#line 2468 "cs.ATG" +#line 2467 "cs.ATG" canBeUnbound && (la.kind == Tokens.GreaterThan || la.kind == Tokens.Comma)) { -#line 2469 "cs.ATG" +#line 2468 "cs.ATG" types.Add(TypeReference.Null); while (la.kind == 14) { lexer.NextToken(); -#line 2470 "cs.ATG" +#line 2469 "cs.ATG" types.Add(TypeReference.Null); } } else if (StartOf(9)) { Type( -#line 2471 "cs.ATG" +#line 2470 "cs.ATG" out type); -#line 2471 "cs.ATG" +#line 2470 "cs.ATG" types.Add(type); while (la.kind == 14) { lexer.NextToken(); Type( -#line 2472 "cs.ATG" +#line 2471 "cs.ATG" out type); -#line 2472 "cs.ATG" +#line 2471 "cs.ATG" types.Add(type); } } else SynErr(184); @@ -5177,206 +5176,206 @@ out type); } void ConditionalAndExpr( -#line 2297 "cs.ATG" +#line 2296 "cs.ATG" ref Expression outExpr) { -#line 2298 "cs.ATG" +#line 2297 "cs.ATG" Expression expr; InclusiveOrExpr( -#line 2300 "cs.ATG" +#line 2299 "cs.ATG" ref outExpr); while (la.kind == 25) { lexer.NextToken(); UnaryExpr( -#line 2300 "cs.ATG" +#line 2299 "cs.ATG" out expr); InclusiveOrExpr( -#line 2300 "cs.ATG" +#line 2299 "cs.ATG" ref expr); -#line 2300 "cs.ATG" +#line 2299 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.LogicalAnd, expr); } } void InclusiveOrExpr( -#line 2303 "cs.ATG" +#line 2302 "cs.ATG" ref Expression outExpr) { -#line 2304 "cs.ATG" +#line 2303 "cs.ATG" Expression expr; ExclusiveOrExpr( -#line 2306 "cs.ATG" +#line 2305 "cs.ATG" ref outExpr); while (la.kind == 29) { lexer.NextToken(); UnaryExpr( -#line 2306 "cs.ATG" +#line 2305 "cs.ATG" out expr); ExclusiveOrExpr( -#line 2306 "cs.ATG" +#line 2305 "cs.ATG" ref expr); -#line 2306 "cs.ATG" +#line 2305 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.BitwiseOr, expr); } } void ExclusiveOrExpr( -#line 2309 "cs.ATG" +#line 2308 "cs.ATG" ref Expression outExpr) { -#line 2310 "cs.ATG" +#line 2309 "cs.ATG" Expression expr; AndExpr( -#line 2312 "cs.ATG" +#line 2311 "cs.ATG" ref outExpr); while (la.kind == 30) { lexer.NextToken(); UnaryExpr( -#line 2312 "cs.ATG" +#line 2311 "cs.ATG" out expr); AndExpr( -#line 2312 "cs.ATG" +#line 2311 "cs.ATG" ref expr); -#line 2312 "cs.ATG" +#line 2311 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.ExclusiveOr, expr); } } void AndExpr( -#line 2315 "cs.ATG" +#line 2314 "cs.ATG" ref Expression outExpr) { -#line 2316 "cs.ATG" +#line 2315 "cs.ATG" Expression expr; EqualityExpr( -#line 2318 "cs.ATG" +#line 2317 "cs.ATG" ref outExpr); while (la.kind == 28) { lexer.NextToken(); UnaryExpr( -#line 2318 "cs.ATG" +#line 2317 "cs.ATG" out expr); EqualityExpr( -#line 2318 "cs.ATG" +#line 2317 "cs.ATG" ref expr); -#line 2318 "cs.ATG" +#line 2317 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.BitwiseAnd, expr); } } void EqualityExpr( -#line 2321 "cs.ATG" +#line 2320 "cs.ATG" ref Expression outExpr) { -#line 2323 "cs.ATG" +#line 2322 "cs.ATG" Expression expr; BinaryOperatorType op = BinaryOperatorType.None; RelationalExpr( -#line 2327 "cs.ATG" +#line 2326 "cs.ATG" ref outExpr); while (la.kind == 33 || la.kind == 34) { if (la.kind == 34) { lexer.NextToken(); -#line 2330 "cs.ATG" +#line 2329 "cs.ATG" op = BinaryOperatorType.InEquality; } else { lexer.NextToken(); -#line 2331 "cs.ATG" +#line 2330 "cs.ATG" op = BinaryOperatorType.Equality; } UnaryExpr( -#line 2333 "cs.ATG" +#line 2332 "cs.ATG" out expr); RelationalExpr( -#line 2333 "cs.ATG" +#line 2332 "cs.ATG" ref expr); -#line 2333 "cs.ATG" +#line 2332 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr); } } void RelationalExpr( -#line 2337 "cs.ATG" +#line 2336 "cs.ATG" ref Expression outExpr) { -#line 2339 "cs.ATG" +#line 2338 "cs.ATG" TypeReference type; Expression expr; BinaryOperatorType op = BinaryOperatorType.None; ShiftExpr( -#line 2344 "cs.ATG" +#line 2343 "cs.ATG" ref outExpr); while (StartOf(29)) { if (StartOf(30)) { if (la.kind == 23) { lexer.NextToken(); -#line 2346 "cs.ATG" +#line 2345 "cs.ATG" op = BinaryOperatorType.LessThan; } else if (la.kind == 22) { lexer.NextToken(); -#line 2347 "cs.ATG" +#line 2346 "cs.ATG" op = BinaryOperatorType.GreaterThan; } else if (la.kind == 36) { lexer.NextToken(); -#line 2348 "cs.ATG" +#line 2347 "cs.ATG" op = BinaryOperatorType.LessThanOrEqual; } else if (la.kind == 35) { lexer.NextToken(); -#line 2349 "cs.ATG" +#line 2348 "cs.ATG" op = BinaryOperatorType.GreaterThanOrEqual; } else SynErr(185); UnaryExpr( -#line 2351 "cs.ATG" +#line 2350 "cs.ATG" out expr); ShiftExpr( -#line 2352 "cs.ATG" +#line 2351 "cs.ATG" ref expr); -#line 2353 "cs.ATG" +#line 2352 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr); } else { if (la.kind == 84) { lexer.NextToken(); TypeWithRestriction( -#line 2356 "cs.ATG" +#line 2355 "cs.ATG" out type, false, false); if ( -#line 2357 "cs.ATG" +#line 2356 "cs.ATG" la.kind == Tokens.Question && Tokens.CastFollower[Peek(1).kind] == false) { NullableQuestionMark( -#line 2358 "cs.ATG" +#line 2357 "cs.ATG" ref type); } -#line 2359 "cs.ATG" +#line 2358 "cs.ATG" outExpr = new TypeOfIsExpression(outExpr, type); } else if (la.kind == 49) { lexer.NextToken(); TypeWithRestriction( -#line 2361 "cs.ATG" +#line 2360 "cs.ATG" out type, false, false); if ( -#line 2362 "cs.ATG" +#line 2361 "cs.ATG" la.kind == Tokens.Question && Tokens.CastFollower[Peek(1).kind] == false) { NullableQuestionMark( -#line 2363 "cs.ATG" +#line 2362 "cs.ATG" ref type); } -#line 2364 "cs.ATG" +#line 2363 "cs.ATG" outExpr = new CastExpression(type, outExpr, CastType.TryCast); } else SynErr(186); } @@ -5384,83 +5383,83 @@ ref type); } void ShiftExpr( -#line 2369 "cs.ATG" +#line 2368 "cs.ATG" ref Expression outExpr) { -#line 2371 "cs.ATG" +#line 2370 "cs.ATG" Expression expr; BinaryOperatorType op = BinaryOperatorType.None; AdditiveExpr( -#line 2375 "cs.ATG" +#line 2374 "cs.ATG" ref outExpr); while (la.kind == 37 || -#line 2378 "cs.ATG" +#line 2377 "cs.ATG" IsShiftRight()) { if (la.kind == 37) { lexer.NextToken(); -#line 2377 "cs.ATG" +#line 2376 "cs.ATG" op = BinaryOperatorType.ShiftLeft; } else { Expect(22); Expect(22); -#line 2379 "cs.ATG" +#line 2378 "cs.ATG" op = BinaryOperatorType.ShiftRight; } UnaryExpr( -#line 2382 "cs.ATG" +#line 2381 "cs.ATG" out expr); AdditiveExpr( -#line 2382 "cs.ATG" +#line 2381 "cs.ATG" ref expr); -#line 2382 "cs.ATG" +#line 2381 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr); } } void AdditiveExpr( -#line 2386 "cs.ATG" +#line 2385 "cs.ATG" ref Expression outExpr) { -#line 2388 "cs.ATG" +#line 2387 "cs.ATG" Expression expr; BinaryOperatorType op = BinaryOperatorType.None; MultiplicativeExpr( -#line 2392 "cs.ATG" +#line 2391 "cs.ATG" ref outExpr); while (la.kind == 4 || la.kind == 5) { if (la.kind == 4) { lexer.NextToken(); -#line 2395 "cs.ATG" +#line 2394 "cs.ATG" op = BinaryOperatorType.Add; } else { lexer.NextToken(); -#line 2396 "cs.ATG" +#line 2395 "cs.ATG" op = BinaryOperatorType.Subtract; } UnaryExpr( -#line 2398 "cs.ATG" +#line 2397 "cs.ATG" out expr); MultiplicativeExpr( -#line 2398 "cs.ATG" +#line 2397 "cs.ATG" ref expr); -#line 2398 "cs.ATG" +#line 2397 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr); } } void MultiplicativeExpr( -#line 2402 "cs.ATG" +#line 2401 "cs.ATG" ref Expression outExpr) { -#line 2404 "cs.ATG" +#line 2403 "cs.ATG" Expression expr; BinaryOperatorType op = BinaryOperatorType.None; @@ -5468,57 +5467,57 @@ ref Expression outExpr) { if (la.kind == 6) { lexer.NextToken(); -#line 2410 "cs.ATG" +#line 2409 "cs.ATG" op = BinaryOperatorType.Multiply; } else if (la.kind == 7) { lexer.NextToken(); -#line 2411 "cs.ATG" +#line 2410 "cs.ATG" op = BinaryOperatorType.Divide; } else { lexer.NextToken(); -#line 2412 "cs.ATG" +#line 2411 "cs.ATG" op = BinaryOperatorType.Modulus; } UnaryExpr( -#line 2414 "cs.ATG" +#line 2413 "cs.ATG" out expr); -#line 2414 "cs.ATG" +#line 2413 "cs.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr); } } void TypeParameterConstraintsClauseBase( -#line 2518 "cs.ATG" +#line 2517 "cs.ATG" out TypeReference type) { -#line 2519 "cs.ATG" +#line 2518 "cs.ATG" TypeReference t; type = null; if (la.kind == 108) { lexer.NextToken(); -#line 2521 "cs.ATG" +#line 2520 "cs.ATG" type = new TypeReference("struct"); } else if (la.kind == 58) { lexer.NextToken(); -#line 2522 "cs.ATG" +#line 2521 "cs.ATG" type = new TypeReference("struct"); } else if (la.kind == 88) { lexer.NextToken(); Expect(20); Expect(21); -#line 2523 "cs.ATG" +#line 2522 "cs.ATG" type = new TypeReference("struct"); } else if (StartOf(9)) { Type( -#line 2524 "cs.ATG" +#line 2523 "cs.ATG" out t); -#line 2524 "cs.ATG" +#line 2523 "cs.ATG" type = t; } else SynErr(187); } @@ -5807,4 +5806,4 @@ out t); }; } // end Parser -} \ No newline at end of file +} diff --git a/src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG b/src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG index 4fe3666c04..2334489135 100644 --- a/src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG +++ b/src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG @@ -1,4 +1,3 @@ -using System.Drawing; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; @@ -1093,7 +1092,7 @@ FixedParameter (. TypeReference type; ParamModifier mod = ParamModifier.In; - System.Drawing.Point start = t.Location; + Location start = t.Location; .) = [ diff --git a/src/Libraries/NRefactory/Project/Src/Parser/Location.cs b/src/Libraries/NRefactory/Project/Src/Parser/Location.cs new file mode 100644 index 0000000000..e42b86997f --- /dev/null +++ b/src/Libraries/NRefactory/Project/Src/Parser/Location.cs @@ -0,0 +1,51 @@ +/* + * Created by SharpDevelop. + * User: Daniel Grunwald + * Date: 15.07.2006 + * Time: 19:49 + */ + +using System; + +namespace ICSharpCode.NRefactory.Parser +{ + /// + /// Description of Position. + /// + public struct Location + { + public static readonly Location Empty = new Location(0, 0); + + public Location(int column, int line) + { + x = column; + y = line; + } + + int x, y; + + public int X { + get { + return x; + } + set { + x = value; + } + } + + public int Y { + get { + return y; + } + set { + y = value; + } + } + + public bool IsEmpty { + get { + return x <= 0 && y <= 0; + } + } + } +} diff --git a/src/Libraries/NRefactory/Project/Src/Parser/Modifiers.cs b/src/Libraries/NRefactory/Project/Src/Parser/Modifiers.cs index 833dc3c762..9fc191aea4 100644 --- a/src/Libraries/NRefactory/Project/Src/Parser/Modifiers.cs +++ b/src/Libraries/NRefactory/Project/Src/Parser/Modifiers.cs @@ -6,14 +6,13 @@ // using ICSharpCode.NRefactory.Parser.AST; -using System.Drawing; namespace ICSharpCode.NRefactory.Parser { internal class Modifiers { Modifier cur; - Point location = new Point(-1, -1); + Location location = new Location(-1, -1); public Modifier Modifier { get { @@ -21,7 +20,7 @@ namespace ICSharpCode.NRefactory.Parser } } - public Point GetDeclarationLocation(Point keywordLocation) + public Location GetDeclarationLocation(Location keywordLocation) { if(location.X == -1 && location.Y == -1) { return keywordLocation; @@ -29,7 +28,7 @@ namespace ICSharpCode.NRefactory.Parser return location; } - public Point Location { + public Location Location { get { return location; } @@ -45,7 +44,7 @@ namespace ICSharpCode.NRefactory.Parser return ((cur & m) != 0); } - public void Add(Modifier m, Point tokenLocation) + public void Add(Modifier m, Location tokenLocation) { if(location.X == -1 && location.Y == -1) { location = tokenLocation; diff --git a/src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs b/src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs index f6c874a6f5..ad7cc5e77c 100644 --- a/src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs +++ b/src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs @@ -1,6 +1,5 @@ #line 1 "VBNET.ATG" -using System.Drawing; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; @@ -26,7 +25,7 @@ internal class Parser : AbstractParser const bool x = false; -#line 12 "VBNET.ATG" +#line 11 "VBNET.ATG" private Stack withStatements; private StringBuilder qualidentBuilder = new StringBuilder(); @@ -282,7 +281,7 @@ bool IsLocalAttrTarget() { void VBNET() { -#line 477 "VBNET.ATG" +#line 476 "VBNET.ATG" lexer.NextToken(); // get the first token compilationUnit = new CompilationUnit(); withStatements = new Stack(); @@ -297,7 +296,7 @@ bool IsLocalAttrTarget() { ImportsStmt(); } while ( -#line 484 "VBNET.ATG" +#line 483 "VBNET.ATG" IsGlobalAttrTarget()) { GlobalAttributeSection(); } @@ -309,49 +308,49 @@ IsGlobalAttrTarget()) { void OptionStmt() { -#line 489 "VBNET.ATG" +#line 488 "VBNET.ATG" INode node = null; bool val = true; Expect(136); -#line 490 "VBNET.ATG" - Point startPos = t.Location; +#line 489 "VBNET.ATG" + Location startPos = t.Location; if (la.kind == 95) { lexer.NextToken(); if (la.kind == 134 || la.kind == 135) { OptionValue( -#line 492 "VBNET.ATG" +#line 491 "VBNET.ATG" ref val); } -#line 493 "VBNET.ATG" +#line 492 "VBNET.ATG" node = new OptionDeclaration(OptionType.Explicit, val); } else if (la.kind == 164) { lexer.NextToken(); if (la.kind == 134 || la.kind == 135) { OptionValue( -#line 495 "VBNET.ATG" +#line 494 "VBNET.ATG" ref val); } -#line 496 "VBNET.ATG" +#line 495 "VBNET.ATG" node = new OptionDeclaration(OptionType.Strict, val); } else if (la.kind == 70) { lexer.NextToken(); if (la.kind == 51) { lexer.NextToken(); -#line 498 "VBNET.ATG" +#line 497 "VBNET.ATG" node = new OptionDeclaration(OptionType.CompareBinary, val); } else if (la.kind == 169) { lexer.NextToken(); -#line 499 "VBNET.ATG" +#line 498 "VBNET.ATG" node = new OptionDeclaration(OptionType.CompareText, val); } else SynErr(206); } else SynErr(207); EndOfStmt(); -#line 504 "VBNET.ATG" +#line 503 "VBNET.ATG" if (node != null) { node.StartLocation = startPos; node.EndLocation = t.Location; @@ -362,33 +361,33 @@ ref val); void ImportsStmt() { -#line 527 "VBNET.ATG" +#line 526 "VBNET.ATG" List usings = new List(); Expect(108); -#line 531 "VBNET.ATG" - Point startPos = t.Location; +#line 530 "VBNET.ATG" + Location startPos = t.Location; Using u; ImportClause( -#line 534 "VBNET.ATG" +#line 533 "VBNET.ATG" out u); -#line 534 "VBNET.ATG" +#line 533 "VBNET.ATG" if (u != null) { usings.Add(u); } while (la.kind == 12) { lexer.NextToken(); ImportClause( -#line 536 "VBNET.ATG" +#line 535 "VBNET.ATG" out u); -#line 536 "VBNET.ATG" +#line 535 "VBNET.ATG" if (u != null) { usings.Add(u); } } EndOfStmt(); -#line 540 "VBNET.ATG" +#line 539 "VBNET.ATG" UsingDeclaration usingDeclaration = new UsingDeclaration(usings); usingDeclaration.StartLocation = startPos; usingDeclaration.EndLocation = t.Location; @@ -398,8 +397,8 @@ out u); void GlobalAttributeSection() { -#line 2189 "VBNET.ATG" - Point startPos = t.Location; +#line 2188 "VBNET.ATG" + Location startPos = t.Location; Expect(27); if (la.kind == 49) { lexer.NextToken(); @@ -407,20 +406,20 @@ out u); lexer.NextToken(); } else SynErr(208); -#line 2191 "VBNET.ATG" +#line 2190 "VBNET.ATG" string attributeTarget = t.val.ToLower(System.Globalization.CultureInfo.InvariantCulture); List attributes = new List(); ASTAttribute attribute; Expect(13); Attribute( -#line 2195 "VBNET.ATG" +#line 2194 "VBNET.ATG" out attribute); -#line 2195 "VBNET.ATG" +#line 2194 "VBNET.ATG" attributes.Add(attribute); while ( -#line 2196 "VBNET.ATG" +#line 2195 "VBNET.ATG" NotFinalComma()) { if (la.kind == 12) { lexer.NextToken(); @@ -432,10 +431,10 @@ NotFinalComma()) { Expect(13); } Attribute( -#line 2196 "VBNET.ATG" +#line 2195 "VBNET.ATG" out attribute); -#line 2196 "VBNET.ATG" +#line 2195 "VBNET.ATG" attributes.Add(attribute); } if (la.kind == 12) { @@ -444,7 +443,7 @@ out attribute); Expect(26); EndOfStmt(); -#line 2201 "VBNET.ATG" +#line 2200 "VBNET.ATG" AttributeSection section = new AttributeSection(attributeTarget, attributes); section.StartLocation = startPos; section.EndLocation = t.EndLocation; @@ -454,7 +453,7 @@ out attribute); void NamespaceMemberDecl() { -#line 569 "VBNET.ATG" +#line 568 "VBNET.ATG" Modifiers m = new Modifiers(); AttributeSection section; List attributes = new List(); @@ -463,14 +462,14 @@ out attribute); if (la.kind == 126) { lexer.NextToken(); -#line 576 "VBNET.ATG" - Point startPos = t.Location; +#line 575 "VBNET.ATG" + Location startPos = t.Location; Qualident( -#line 578 "VBNET.ATG" +#line 577 "VBNET.ATG" out qualident); -#line 580 "VBNET.ATG" +#line 579 "VBNET.ATG" INode node = new NamespaceDeclaration(qualident); node.StartLocation = startPos; compilationUnit.AddChild(node); @@ -479,42 +478,42 @@ out qualident); Expect(1); NamespaceBody(); -#line 588 "VBNET.ATG" +#line 587 "VBNET.ATG" node.EndLocation = t.Location; compilationUnit.BlockEnd(); } else if (StartOf(2)) { while (la.kind == 27) { AttributeSection( -#line 592 "VBNET.ATG" +#line 591 "VBNET.ATG" out section); -#line 592 "VBNET.ATG" +#line 591 "VBNET.ATG" attributes.Add(section); } while (StartOf(3)) { TypeModifier( -#line 593 "VBNET.ATG" +#line 592 "VBNET.ATG" m); } NonModuleDeclaration( -#line 593 "VBNET.ATG" +#line 592 "VBNET.ATG" m, attributes); } else SynErr(210); } void OptionValue( -#line 512 "VBNET.ATG" +#line 511 "VBNET.ATG" ref bool val) { if (la.kind == 135) { lexer.NextToken(); -#line 514 "VBNET.ATG" +#line 513 "VBNET.ATG" val = true; } else if (la.kind == 134) { lexer.NextToken(); -#line 516 "VBNET.ATG" +#line 515 "VBNET.ATG" val = false; } else SynErr(211); } @@ -531,25 +530,25 @@ ref bool val) { } void ImportClause( -#line 547 "VBNET.ATG" +#line 546 "VBNET.ATG" out Using u) { -#line 549 "VBNET.ATG" +#line 548 "VBNET.ATG" string qualident = null; TypeReference aliasedType = null; u = null; Qualident( -#line 553 "VBNET.ATG" +#line 552 "VBNET.ATG" out qualident); if (la.kind == 11) { lexer.NextToken(); TypeName( -#line 554 "VBNET.ATG" +#line 553 "VBNET.ATG" out aliasedType); } -#line 556 "VBNET.ATG" +#line 555 "VBNET.ATG" if (qualident != null && qualident.Length > 0) { if (aliasedType != null) { u = new Using(qualident, aliasedType); @@ -561,47 +560,47 @@ out aliasedType); } void Qualident( -#line 2901 "VBNET.ATG" +#line 2900 "VBNET.ATG" out string qualident) { -#line 2903 "VBNET.ATG" +#line 2902 "VBNET.ATG" string name; qualidentBuilder.Length = 0; Identifier(); -#line 2907 "VBNET.ATG" +#line 2906 "VBNET.ATG" qualidentBuilder.Append(t.val); while ( -#line 2908 "VBNET.ATG" +#line 2907 "VBNET.ATG" DotAndIdentOrKw()) { Expect(10); IdentifierOrKeyword( -#line 2908 "VBNET.ATG" +#line 2907 "VBNET.ATG" out name); -#line 2908 "VBNET.ATG" +#line 2907 "VBNET.ATG" qualidentBuilder.Append('.'); qualidentBuilder.Append(name); } -#line 2910 "VBNET.ATG" +#line 2909 "VBNET.ATG" qualident = qualidentBuilder.ToString(); } void TypeName( -#line 2082 "VBNET.ATG" +#line 2081 "VBNET.ATG" out TypeReference typeref) { -#line 2083 "VBNET.ATG" +#line 2082 "VBNET.ATG" ArrayList rank = null; NonArrayTypeName( -#line 2085 "VBNET.ATG" +#line 2084 "VBNET.ATG" out typeref, false); ArrayTypeModifiers( -#line 2086 "VBNET.ATG" +#line 2085 "VBNET.ATG" out rank); -#line 2087 "VBNET.ATG" +#line 2086 "VBNET.ATG" if (rank != null && typeref != null) { typeref.RankSpecifier = (int[])rank.ToArray(typeof(int)); } @@ -618,35 +617,35 @@ out rank); } void AttributeSection( -#line 2258 "VBNET.ATG" +#line 2257 "VBNET.ATG" out AttributeSection section) { -#line 2260 "VBNET.ATG" +#line 2259 "VBNET.ATG" string attributeTarget = "";List attributes = new List(); ASTAttribute attribute; Expect(27); -#line 2264 "VBNET.ATG" - Point startPos = t.Location; +#line 2263 "VBNET.ATG" + Location startPos = t.Location; if ( -#line 2265 "VBNET.ATG" +#line 2264 "VBNET.ATG" IsLocalAttrTarget()) { if (la.kind == 93) { lexer.NextToken(); -#line 2266 "VBNET.ATG" +#line 2265 "VBNET.ATG" attributeTarget = "event"; } else if (la.kind == 154) { lexer.NextToken(); -#line 2267 "VBNET.ATG" +#line 2266 "VBNET.ATG" attributeTarget = "return"; } else { Identifier(); -#line 2270 "VBNET.ATG" +#line 2269 "VBNET.ATG" string val = t.val.ToLower(System.Globalization.CultureInfo.InvariantCulture); if (val != "field" || val != "method" || val != "module" || val != "param" || @@ -659,20 +658,20 @@ IsLocalAttrTarget()) { Expect(13); } Attribute( -#line 2280 "VBNET.ATG" +#line 2279 "VBNET.ATG" out attribute); -#line 2280 "VBNET.ATG" +#line 2279 "VBNET.ATG" attributes.Add(attribute); while ( -#line 2281 "VBNET.ATG" +#line 2280 "VBNET.ATG" NotFinalComma()) { Expect(12); Attribute( -#line 2281 "VBNET.ATG" +#line 2280 "VBNET.ATG" out attribute); -#line 2281 "VBNET.ATG" +#line 2280 "VBNET.ATG" attributes.Add(attribute); } if (la.kind == 12) { @@ -680,7 +679,7 @@ out attribute); } Expect(26); -#line 2285 "VBNET.ATG" +#line 2284 "VBNET.ATG" section = new AttributeSection(attributeTarget, attributes); section.StartLocation = startPos; section.EndLocation = t.EndLocation; @@ -688,69 +687,69 @@ out attribute); } void TypeModifier( -#line 2977 "VBNET.ATG" +#line 2976 "VBNET.ATG" Modifiers m) { switch (la.kind) { case 148: { lexer.NextToken(); -#line 2978 "VBNET.ATG" +#line 2977 "VBNET.ATG" m.Add(Modifier.Public, t.Location); break; } case 147: { lexer.NextToken(); -#line 2979 "VBNET.ATG" +#line 2978 "VBNET.ATG" m.Add(Modifier.Protected, t.Location); break; } case 99: { lexer.NextToken(); -#line 2980 "VBNET.ATG" +#line 2979 "VBNET.ATG" m.Add(Modifier.Internal, t.Location); break; } case 145: { lexer.NextToken(); -#line 2981 "VBNET.ATG" +#line 2980 "VBNET.ATG" m.Add(Modifier.Private, t.Location); break; } case 158: { lexer.NextToken(); -#line 2982 "VBNET.ATG" +#line 2981 "VBNET.ATG" m.Add(Modifier.Static, t.Location); break; } case 157: { lexer.NextToken(); -#line 2983 "VBNET.ATG" +#line 2982 "VBNET.ATG" m.Add(Modifier.New, t.Location); break; } case 122: { lexer.NextToken(); -#line 2984 "VBNET.ATG" +#line 2983 "VBNET.ATG" m.Add(Modifier.Abstract, t.Location); break; } case 131: { lexer.NextToken(); -#line 2985 "VBNET.ATG" +#line 2984 "VBNET.ATG" m.Add(Modifier.Sealed, t.Location); break; } case 203: { lexer.NextToken(); -#line 2986 "VBNET.ATG" +#line 2985 "VBNET.ATG" m.Add(Modifier.Partial, t.Location); break; } @@ -759,21 +758,21 @@ Modifiers m) { } void NonModuleDeclaration( -#line 644 "VBNET.ATG" +#line 643 "VBNET.ATG" Modifiers m, List attributes) { -#line 646 "VBNET.ATG" +#line 645 "VBNET.ATG" TypeReference typeRef = null; List baseInterfaces = null; switch (la.kind) { case 67: { -#line 649 "VBNET.ATG" +#line 648 "VBNET.ATG" m.Check(Modifier.Classes); lexer.NextToken(); -#line 652 "VBNET.ATG" +#line 651 "VBNET.ATG" TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); newType.StartLocation = t.Location; compilationUnit.AddChild(newType); @@ -783,36 +782,36 @@ Modifiers m, List attributes) { Identifier(); -#line 659 "VBNET.ATG" +#line 658 "VBNET.ATG" newType.Name = t.val; TypeParameterList( -#line 660 "VBNET.ATG" +#line 659 "VBNET.ATG" newType.Templates); EndOfStmt(); -#line 662 "VBNET.ATG" +#line 661 "VBNET.ATG" newType.BodyStartLocation = t.Location; if (la.kind == 110) { ClassBaseType( -#line 663 "VBNET.ATG" +#line 662 "VBNET.ATG" out typeRef); -#line 663 "VBNET.ATG" +#line 662 "VBNET.ATG" newType.BaseTypes.Add(typeRef); } while (la.kind == 107) { TypeImplementsClause( -#line 664 "VBNET.ATG" +#line 663 "VBNET.ATG" out baseInterfaces); -#line 664 "VBNET.ATG" +#line 663 "VBNET.ATG" newType.BaseTypes.AddRange(baseInterfaces); } ClassBody( -#line 665 "VBNET.ATG" +#line 664 "VBNET.ATG" newType); -#line 667 "VBNET.ATG" +#line 666 "VBNET.ATG" compilationUnit.BlockEnd(); break; @@ -820,7 +819,7 @@ newType); case 121: { lexer.NextToken(); -#line 671 "VBNET.ATG" +#line 670 "VBNET.ATG" m.Check(Modifier.VBModules); TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); compilationUnit.AddChild(newType); @@ -830,17 +829,17 @@ newType); Identifier(); -#line 678 "VBNET.ATG" +#line 677 "VBNET.ATG" newType.Name = t.val; Expect(1); -#line 680 "VBNET.ATG" +#line 679 "VBNET.ATG" newType.BodyStartLocation = t.Location; ModuleBody( -#line 681 "VBNET.ATG" +#line 680 "VBNET.ATG" newType); -#line 683 "VBNET.ATG" +#line 682 "VBNET.ATG" compilationUnit.BlockEnd(); break; @@ -848,7 +847,7 @@ newType); case 166: { lexer.NextToken(); -#line 687 "VBNET.ATG" +#line 686 "VBNET.ATG" m.Check(Modifier.VBStructures); TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); compilationUnit.AddChild(newType); @@ -858,28 +857,28 @@ newType); Identifier(); -#line 694 "VBNET.ATG" +#line 693 "VBNET.ATG" newType.Name = t.val; TypeParameterList( -#line 695 "VBNET.ATG" +#line 694 "VBNET.ATG" newType.Templates); Expect(1); -#line 697 "VBNET.ATG" +#line 696 "VBNET.ATG" newType.BodyStartLocation = t.Location; while (la.kind == 107) { TypeImplementsClause( -#line 698 "VBNET.ATG" +#line 697 "VBNET.ATG" out baseInterfaces); -#line 698 "VBNET.ATG" +#line 697 "VBNET.ATG" newType.BaseTypes.AddRange(baseInterfaces); } StructureBody( -#line 699 "VBNET.ATG" +#line 698 "VBNET.ATG" newType); -#line 701 "VBNET.ATG" +#line 700 "VBNET.ATG" compilationUnit.BlockEnd(); break; @@ -887,7 +886,7 @@ newType); case 90: { lexer.NextToken(); -#line 706 "VBNET.ATG" +#line 705 "VBNET.ATG" m.Check(Modifier.VBEnums); TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); newType.StartLocation = m.GetDeclarationLocation(t.Location); @@ -898,26 +897,26 @@ newType); Identifier(); -#line 714 "VBNET.ATG" +#line 713 "VBNET.ATG" newType.Name = t.val; if (la.kind == 48) { lexer.NextToken(); NonArrayTypeName( -#line 715 "VBNET.ATG" +#line 714 "VBNET.ATG" out typeRef, false); -#line 715 "VBNET.ATG" +#line 714 "VBNET.ATG" newType.BaseTypes.Add(typeRef); } Expect(1); -#line 717 "VBNET.ATG" +#line 716 "VBNET.ATG" newType.BodyStartLocation = t.Location; EnumBody( -#line 718 "VBNET.ATG" +#line 717 "VBNET.ATG" newType); -#line 720 "VBNET.ATG" +#line 719 "VBNET.ATG" compilationUnit.BlockEnd(); break; @@ -925,7 +924,7 @@ newType); case 112: { lexer.NextToken(); -#line 725 "VBNET.ATG" +#line 724 "VBNET.ATG" m.Check(Modifier.VBInterfacs); TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes); newType.StartLocation = m.GetDeclarationLocation(t.Location); @@ -935,28 +934,28 @@ newType); Identifier(); -#line 732 "VBNET.ATG" +#line 731 "VBNET.ATG" newType.Name = t.val; TypeParameterList( -#line 733 "VBNET.ATG" +#line 732 "VBNET.ATG" newType.Templates); EndOfStmt(); -#line 735 "VBNET.ATG" +#line 734 "VBNET.ATG" newType.BodyStartLocation = t.Location; while (la.kind == 110) { InterfaceBase( -#line 736 "VBNET.ATG" +#line 735 "VBNET.ATG" out baseInterfaces); -#line 736 "VBNET.ATG" +#line 735 "VBNET.ATG" newType.BaseTypes.AddRange(baseInterfaces); } InterfaceBody( -#line 737 "VBNET.ATG" +#line 736 "VBNET.ATG" newType); -#line 739 "VBNET.ATG" +#line 738 "VBNET.ATG" compilationUnit.BlockEnd(); break; @@ -964,7 +963,7 @@ newType); case 80: { lexer.NextToken(); -#line 744 "VBNET.ATG" +#line 743 "VBNET.ATG" m.Check(Modifier.VBDelegates); DelegateDeclaration delegateDeclr = new DelegateDeclaration(m.Modifier, attributes); delegateDeclr.ReturnType = new TypeReference("", "System.Void"); @@ -975,63 +974,63 @@ newType); lexer.NextToken(); Identifier(); -#line 751 "VBNET.ATG" +#line 750 "VBNET.ATG" delegateDeclr.Name = t.val; TypeParameterList( -#line 752 "VBNET.ATG" +#line 751 "VBNET.ATG" delegateDeclr.Templates); if (la.kind == 24) { lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 753 "VBNET.ATG" +#line 752 "VBNET.ATG" p); } Expect(25); -#line 753 "VBNET.ATG" +#line 752 "VBNET.ATG" delegateDeclr.Parameters = p; } } else if (la.kind == 100) { lexer.NextToken(); Identifier(); -#line 755 "VBNET.ATG" +#line 754 "VBNET.ATG" delegateDeclr.Name = t.val; TypeParameterList( -#line 756 "VBNET.ATG" +#line 755 "VBNET.ATG" delegateDeclr.Templates); if (la.kind == 24) { lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 757 "VBNET.ATG" +#line 756 "VBNET.ATG" p); } Expect(25); -#line 757 "VBNET.ATG" +#line 756 "VBNET.ATG" delegateDeclr.Parameters = p; } if (la.kind == 48) { lexer.NextToken(); -#line 758 "VBNET.ATG" +#line 757 "VBNET.ATG" TypeReference type; TypeName( -#line 758 "VBNET.ATG" +#line 757 "VBNET.ATG" out type); -#line 758 "VBNET.ATG" +#line 757 "VBNET.ATG" delegateDeclr.ReturnType = type; } } else SynErr(214); -#line 760 "VBNET.ATG" +#line 759 "VBNET.ATG" delegateDeclr.EndLocation = t.EndLocation; Expect(1); -#line 763 "VBNET.ATG" +#line 762 "VBNET.ATG" compilationUnit.AddChild(delegateDeclr); break; @@ -1041,31 +1040,31 @@ out type); } void TypeParameterList( -#line 597 "VBNET.ATG" +#line 596 "VBNET.ATG" List templates) { -#line 599 "VBNET.ATG" +#line 598 "VBNET.ATG" TemplateDefinition template; if ( -#line 602 "VBNET.ATG" +#line 601 "VBNET.ATG" la.kind == Tokens.OpenParenthesis && Peek(1).kind == Tokens.Of) { lexer.NextToken(); Expect(200); TypeParameter( -#line 603 "VBNET.ATG" +#line 602 "VBNET.ATG" out template); -#line 605 "VBNET.ATG" +#line 604 "VBNET.ATG" if (template != null) templates.Add(template); while (la.kind == 12) { lexer.NextToken(); TypeParameter( -#line 608 "VBNET.ATG" +#line 607 "VBNET.ATG" out template); -#line 610 "VBNET.ATG" +#line 609 "VBNET.ATG" if (template != null) templates.Add(template); } @@ -1074,15 +1073,15 @@ out template); } void TypeParameter( -#line 618 "VBNET.ATG" +#line 617 "VBNET.ATG" out TemplateDefinition template) { Identifier(); -#line 620 "VBNET.ATG" +#line 619 "VBNET.ATG" template = new TemplateDefinition(t.val, null); if (la.kind == 48) { TypeParameterConstraints( -#line 621 "VBNET.ATG" +#line 620 "VBNET.ATG" template); } } @@ -1138,199 +1137,199 @@ template); } void TypeParameterConstraints( -#line 625 "VBNET.ATG" +#line 624 "VBNET.ATG" TemplateDefinition template) { -#line 627 "VBNET.ATG" +#line 626 "VBNET.ATG" TypeReference constraint; Expect(48); if (la.kind == 22) { lexer.NextToken(); TypeName( -#line 633 "VBNET.ATG" +#line 632 "VBNET.ATG" out constraint); -#line 633 "VBNET.ATG" +#line 632 "VBNET.ATG" if (constraint != null) { template.Bases.Add(constraint); } while (la.kind == 12) { lexer.NextToken(); TypeName( -#line 636 "VBNET.ATG" +#line 635 "VBNET.ATG" out constraint); -#line 636 "VBNET.ATG" +#line 635 "VBNET.ATG" if (constraint != null) { template.Bases.Add(constraint); } } Expect(23); } else if (StartOf(5)) { TypeName( -#line 639 "VBNET.ATG" +#line 638 "VBNET.ATG" out constraint); -#line 639 "VBNET.ATG" +#line 638 "VBNET.ATG" if (constraint != null) { template.Bases.Add(constraint); } } else SynErr(217); } void ClassBaseType( -#line 940 "VBNET.ATG" +#line 939 "VBNET.ATG" out TypeReference typeRef) { -#line 942 "VBNET.ATG" +#line 941 "VBNET.ATG" typeRef = null; Expect(110); TypeName( -#line 945 "VBNET.ATG" +#line 944 "VBNET.ATG" out typeRef); EndOfStmt(); } void TypeImplementsClause( -#line 1687 "VBNET.ATG" +#line 1686 "VBNET.ATG" out List baseInterfaces) { -#line 1689 "VBNET.ATG" +#line 1688 "VBNET.ATG" baseInterfaces = new List(); TypeReference type = null; Expect(107); TypeName( -#line 1692 "VBNET.ATG" +#line 1691 "VBNET.ATG" out type); -#line 1694 "VBNET.ATG" +#line 1693 "VBNET.ATG" baseInterfaces.Add(type); while (la.kind == 12) { lexer.NextToken(); TypeName( -#line 1697 "VBNET.ATG" +#line 1696 "VBNET.ATG" out type); -#line 1698 "VBNET.ATG" +#line 1697 "VBNET.ATG" baseInterfaces.Add(type); } EndOfStmt(); } void ClassBody( -#line 773 "VBNET.ATG" +#line 772 "VBNET.ATG" TypeDeclaration newType) { -#line 774 "VBNET.ATG" +#line 773 "VBNET.ATG" AttributeSection section; while (StartOf(6)) { -#line 776 "VBNET.ATG" +#line 775 "VBNET.ATG" List attributes = new List(); Modifiers m = new Modifiers(); while (la.kind == 27) { AttributeSection( -#line 779 "VBNET.ATG" +#line 778 "VBNET.ATG" out section); -#line 779 "VBNET.ATG" +#line 778 "VBNET.ATG" attributes.Add(section); } while (StartOf(7)) { MemberModifier( -#line 780 "VBNET.ATG" +#line 779 "VBNET.ATG" m); } ClassMemberDecl( -#line 781 "VBNET.ATG" +#line 780 "VBNET.ATG" m, attributes); } Expect(88); Expect(67); -#line 783 "VBNET.ATG" +#line 782 "VBNET.ATG" newType.EndLocation = t.EndLocation; Expect(1); } void ModuleBody( -#line 802 "VBNET.ATG" +#line 801 "VBNET.ATG" TypeDeclaration newType) { -#line 803 "VBNET.ATG" +#line 802 "VBNET.ATG" AttributeSection section; while (StartOf(6)) { -#line 805 "VBNET.ATG" +#line 804 "VBNET.ATG" List attributes = new List(); Modifiers m = new Modifiers(); while (la.kind == 27) { AttributeSection( -#line 808 "VBNET.ATG" +#line 807 "VBNET.ATG" out section); -#line 808 "VBNET.ATG" +#line 807 "VBNET.ATG" attributes.Add(section); } while (StartOf(7)) { MemberModifier( -#line 809 "VBNET.ATG" +#line 808 "VBNET.ATG" m); } ClassMemberDecl( -#line 810 "VBNET.ATG" +#line 809 "VBNET.ATG" m, attributes); } Expect(88); Expect(121); -#line 812 "VBNET.ATG" +#line 811 "VBNET.ATG" newType.EndLocation = t.EndLocation; Expect(1); } void StructureBody( -#line 787 "VBNET.ATG" +#line 786 "VBNET.ATG" TypeDeclaration newType) { -#line 788 "VBNET.ATG" +#line 787 "VBNET.ATG" AttributeSection section; while (StartOf(6)) { -#line 790 "VBNET.ATG" +#line 789 "VBNET.ATG" List attributes = new List(); Modifiers m = new Modifiers(); while (la.kind == 27) { AttributeSection( -#line 793 "VBNET.ATG" +#line 792 "VBNET.ATG" out section); -#line 793 "VBNET.ATG" +#line 792 "VBNET.ATG" attributes.Add(section); } while (StartOf(7)) { MemberModifier( -#line 794 "VBNET.ATG" +#line 793 "VBNET.ATG" m); } StructureMemberDecl( -#line 795 "VBNET.ATG" +#line 794 "VBNET.ATG" m, attributes); } Expect(88); Expect(166); -#line 797 "VBNET.ATG" +#line 796 "VBNET.ATG" newType.EndLocation = t.EndLocation; Expect(1); } void NonArrayTypeName( -#line 2105 "VBNET.ATG" +#line 2104 "VBNET.ATG" out TypeReference typeref, bool canBeUnbound) { -#line 2107 "VBNET.ATG" +#line 2106 "VBNET.ATG" string name; typeref = null; bool isGlobal = false; @@ -1340,93 +1339,93 @@ out TypeReference typeref, bool canBeUnbound) { lexer.NextToken(); Expect(10); -#line 2112 "VBNET.ATG" +#line 2111 "VBNET.ATG" isGlobal = true; } QualIdentAndTypeArguments( -#line 2113 "VBNET.ATG" +#line 2112 "VBNET.ATG" out typeref, canBeUnbound); -#line 2114 "VBNET.ATG" +#line 2113 "VBNET.ATG" typeref.IsGlobal = isGlobal; while (la.kind == 10) { lexer.NextToken(); -#line 2115 "VBNET.ATG" +#line 2114 "VBNET.ATG" TypeReference nestedTypeRef; QualIdentAndTypeArguments( -#line 2116 "VBNET.ATG" +#line 2115 "VBNET.ATG" out nestedTypeRef, canBeUnbound); -#line 2117 "VBNET.ATG" +#line 2116 "VBNET.ATG" typeref = new InnerClassTypeReference(typeref, nestedTypeRef.Type, nestedTypeRef.GenericTypes); } } else if (la.kind == 133) { lexer.NextToken(); -#line 2120 "VBNET.ATG" +#line 2119 "VBNET.ATG" typeref = new TypeReference("System.Object"); } else if (StartOf(9)) { PrimitiveTypeName( -#line 2121 "VBNET.ATG" +#line 2120 "VBNET.ATG" out name); -#line 2121 "VBNET.ATG" +#line 2120 "VBNET.ATG" typeref = new TypeReference(name); } else SynErr(218); } void EnumBody( -#line 816 "VBNET.ATG" +#line 815 "VBNET.ATG" TypeDeclaration newType) { -#line 817 "VBNET.ATG" +#line 816 "VBNET.ATG" FieldDeclaration f; while (StartOf(10)) { EnumMemberDecl( -#line 819 "VBNET.ATG" +#line 818 "VBNET.ATG" out f); -#line 819 "VBNET.ATG" +#line 818 "VBNET.ATG" compilationUnit.AddChild(f); } Expect(88); Expect(90); -#line 821 "VBNET.ATG" +#line 820 "VBNET.ATG" newType.EndLocation = t.EndLocation; Expect(1); } void InterfaceBase( -#line 1672 "VBNET.ATG" +#line 1671 "VBNET.ATG" out List bases) { -#line 1674 "VBNET.ATG" +#line 1673 "VBNET.ATG" TypeReference type; bases = new List(); Expect(110); TypeName( -#line 1678 "VBNET.ATG" +#line 1677 "VBNET.ATG" out type); -#line 1678 "VBNET.ATG" +#line 1677 "VBNET.ATG" bases.Add(type); while (la.kind == 12) { lexer.NextToken(); TypeName( -#line 1681 "VBNET.ATG" +#line 1680 "VBNET.ATG" out type); -#line 1681 "VBNET.ATG" +#line 1680 "VBNET.ATG" bases.Add(type); } Expect(1); } void InterfaceBody( -#line 825 "VBNET.ATG" +#line 824 "VBNET.ATG" TypeDeclaration newType) { while (StartOf(11)) { InterfaceMemberDecl(); @@ -1434,33 +1433,33 @@ TypeDeclaration newType) { Expect(88); Expect(112); -#line 827 "VBNET.ATG" +#line 826 "VBNET.ATG" newType.EndLocation = t.EndLocation; Expect(1); } void FormalParameterList( -#line 2292 "VBNET.ATG" +#line 2291 "VBNET.ATG" List parameter) { -#line 2294 "VBNET.ATG" +#line 2293 "VBNET.ATG" ParameterDeclarationExpression p; AttributeSection section; List attributes = new List(); while (la.kind == 27) { AttributeSection( -#line 2298 "VBNET.ATG" +#line 2297 "VBNET.ATG" out section); -#line 2298 "VBNET.ATG" +#line 2297 "VBNET.ATG" attributes.Add(section); } FormalParameter( -#line 2300 "VBNET.ATG" +#line 2299 "VBNET.ATG" out p); -#line 2302 "VBNET.ATG" +#line 2301 "VBNET.ATG" bool paramsFound = false; p.Attributes = attributes; parameter.Add(p); @@ -1468,152 +1467,152 @@ out p); while (la.kind == 12) { lexer.NextToken(); -#line 2307 "VBNET.ATG" +#line 2306 "VBNET.ATG" if (paramsFound) Error("params array must be at end of parameter list"); while (la.kind == 27) { AttributeSection( -#line 2308 "VBNET.ATG" +#line 2307 "VBNET.ATG" out section); -#line 2308 "VBNET.ATG" +#line 2307 "VBNET.ATG" attributes.Add(section); } FormalParameter( -#line 2310 "VBNET.ATG" +#line 2309 "VBNET.ATG" out p); -#line 2310 "VBNET.ATG" +#line 2309 "VBNET.ATG" p.Attributes = attributes; parameter.Add(p); } } void MemberModifier( -#line 2989 "VBNET.ATG" +#line 2988 "VBNET.ATG" Modifiers m) { switch (la.kind) { case 122: { lexer.NextToken(); -#line 2990 "VBNET.ATG" +#line 2989 "VBNET.ATG" m.Add(Modifier.Abstract, t.Location); break; } case 79: { lexer.NextToken(); -#line 2991 "VBNET.ATG" +#line 2990 "VBNET.ATG" m.Add(Modifier.Default, t.Location); break; } case 99: { lexer.NextToken(); -#line 2992 "VBNET.ATG" +#line 2991 "VBNET.ATG" m.Add(Modifier.Internal, t.Location); break; } case 157: { lexer.NextToken(); -#line 2993 "VBNET.ATG" +#line 2992 "VBNET.ATG" m.Add(Modifier.New, t.Location); break; } case 142: { lexer.NextToken(); -#line 2994 "VBNET.ATG" +#line 2993 "VBNET.ATG" m.Add(Modifier.Override, t.Location); break; } case 123: { lexer.NextToken(); -#line 2995 "VBNET.ATG" +#line 2994 "VBNET.ATG" m.Add(Modifier.Abstract, t.Location); break; } case 145: { lexer.NextToken(); -#line 2996 "VBNET.ATG" +#line 2995 "VBNET.ATG" m.Add(Modifier.Private, t.Location); break; } case 147: { lexer.NextToken(); -#line 2997 "VBNET.ATG" +#line 2996 "VBNET.ATG" m.Add(Modifier.Protected, t.Location); break; } case 148: { lexer.NextToken(); -#line 2998 "VBNET.ATG" +#line 2997 "VBNET.ATG" m.Add(Modifier.Public, t.Location); break; } case 131: { lexer.NextToken(); -#line 2999 "VBNET.ATG" +#line 2998 "VBNET.ATG" m.Add(Modifier.Sealed, t.Location); break; } case 132: { lexer.NextToken(); -#line 3000 "VBNET.ATG" +#line 2999 "VBNET.ATG" m.Add(Modifier.Sealed, t.Location); break; } case 158: { lexer.NextToken(); -#line 3001 "VBNET.ATG" +#line 3000 "VBNET.ATG" m.Add(Modifier.Static, t.Location); break; } case 141: { lexer.NextToken(); -#line 3002 "VBNET.ATG" +#line 3001 "VBNET.ATG" m.Add(Modifier.Virtual, t.Location); break; } case 140: { lexer.NextToken(); -#line 3003 "VBNET.ATG" +#line 3002 "VBNET.ATG" m.Add(Modifier.Overloads, t.Location); break; } case 150: { lexer.NextToken(); -#line 3004 "VBNET.ATG" +#line 3003 "VBNET.ATG" m.Add(Modifier.ReadOnly, t.Location); break; } case 184: { lexer.NextToken(); -#line 3005 "VBNET.ATG" +#line 3004 "VBNET.ATG" m.Add(Modifier.WriteOnly, t.Location); break; } case 183: { lexer.NextToken(); -#line 3006 "VBNET.ATG" +#line 3005 "VBNET.ATG" m.Add(Modifier.WithEvents, t.Location); break; } case 81: { lexer.NextToken(); -#line 3007 "VBNET.ATG" +#line 3006 "VBNET.ATG" m.Add(Modifier.Dim, t.Location); break; } @@ -1622,18 +1621,18 @@ Modifiers m) { } void ClassMemberDecl( -#line 936 "VBNET.ATG" +#line 935 "VBNET.ATG" Modifiers m, List attributes) { StructureMemberDecl( -#line 937 "VBNET.ATG" +#line 936 "VBNET.ATG" m, attributes); } void StructureMemberDecl( -#line 950 "VBNET.ATG" +#line 949 "VBNET.ATG" Modifiers m, List attributes) { -#line 952 "VBNET.ATG" +#line 951 "VBNET.ATG" TypeReference type = null; List p = new List(); Statement stmt = null; @@ -1643,37 +1642,37 @@ Modifiers m, List attributes) { switch (la.kind) { case 67: case 80: case 90: case 112: case 121: case 166: { NonModuleDeclaration( -#line 959 "VBNET.ATG" +#line 958 "VBNET.ATG" m, attributes); break; } case 167: { lexer.NextToken(); -#line 963 "VBNET.ATG" - Point startPos = t.Location; +#line 962 "VBNET.ATG" + Location startPos = t.Location; if (StartOf(12)) { -#line 967 "VBNET.ATG" +#line 966 "VBNET.ATG" string name = String.Empty; MethodDeclaration methodDeclaration; List handlesClause = null; List implementsClause = null; Identifier(); -#line 973 "VBNET.ATG" +#line 972 "VBNET.ATG" name = t.val; m.Check(Modifier.VBMethods); TypeParameterList( -#line 976 "VBNET.ATG" +#line 975 "VBNET.ATG" templates); if (la.kind == 24) { lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 977 "VBNET.ATG" +#line 976 "VBNET.ATG" p); } Expect(25); @@ -1681,23 +1680,23 @@ p); if (la.kind == 105 || la.kind == 107) { if (la.kind == 107) { ImplementsClause( -#line 980 "VBNET.ATG" +#line 979 "VBNET.ATG" out implementsClause); } else { HandlesClause( -#line 982 "VBNET.ATG" +#line 981 "VBNET.ATG" out handlesClause); } } -#line 985 "VBNET.ATG" - Point endLocation = t.EndLocation; +#line 984 "VBNET.ATG" + Location endLocation = t.EndLocation; Expect(1); if ( -#line 989 "VBNET.ATG" +#line 988 "VBNET.ATG" IsMustOverride(m)) { -#line 991 "VBNET.ATG" +#line 990 "VBNET.ATG" methodDeclaration = new MethodDeclaration(name, m.Modifier, null, p, attributes); methodDeclaration.StartLocation = m.GetDeclarationLocation(startPos); methodDeclaration.EndLocation = endLocation; @@ -1711,7 +1710,7 @@ IsMustOverride(m)) { } else if (StartOf(13)) { -#line 1004 "VBNET.ATG" +#line 1003 "VBNET.ATG" methodDeclaration = new MethodDeclaration(name, m.Modifier, null, p, attributes); methodDeclaration.StartLocation = m.GetDeclarationLocation(startPos); methodDeclaration.EndLocation = endLocation; @@ -1725,17 +1724,17 @@ IsMustOverride(m)) { compilationUnit.BlockStart(methodDeclaration); Block( -#line 1016 "VBNET.ATG" +#line 1015 "VBNET.ATG" out stmt); -#line 1018 "VBNET.ATG" +#line 1017 "VBNET.ATG" compilationUnit.BlockEnd(); methodDeclaration.Body = (BlockStatement)stmt; Expect(88); Expect(167); -#line 1021 "VBNET.ATG" +#line 1020 "VBNET.ATG" methodDeclaration.Body.EndLocation = t.EndLocation; Expect(1); } else SynErr(220); @@ -1745,29 +1744,29 @@ out stmt); lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 1024 "VBNET.ATG" +#line 1023 "VBNET.ATG" p); } Expect(25); } -#line 1025 "VBNET.ATG" +#line 1024 "VBNET.ATG" m.Check(Modifier.Constructors); -#line 1026 "VBNET.ATG" - Point constructorEndLocation = t.EndLocation; +#line 1025 "VBNET.ATG" + Location constructorEndLocation = t.EndLocation; Expect(1); Block( -#line 1028 "VBNET.ATG" +#line 1027 "VBNET.ATG" out stmt); Expect(88); Expect(167); -#line 1029 "VBNET.ATG" - Point endLocation = t.EndLocation; +#line 1028 "VBNET.ATG" + Location endLocation = t.EndLocation; Expect(1); -#line 1031 "VBNET.ATG" +#line 1030 "VBNET.ATG" ConstructorDeclaration cd = new ConstructorDeclaration("New", m.Modifier, p, attributes); cd.StartLocation = m.GetDeclarationLocation(startPos); cd.EndLocation = constructorEndLocation; @@ -1781,26 +1780,26 @@ out stmt); case 100: { lexer.NextToken(); -#line 1043 "VBNET.ATG" +#line 1042 "VBNET.ATG" m.Check(Modifier.VBMethods); string name = String.Empty; - Point startPos = t.Location; + Location startPos = t.Location; MethodDeclaration methodDeclaration;List handlesClause = null; List implementsClause = null; AttributeSection returnTypeAttributeSection = null; Identifier(); -#line 1050 "VBNET.ATG" +#line 1049 "VBNET.ATG" name = t.val; TypeParameterList( -#line 1051 "VBNET.ATG" +#line 1050 "VBNET.ATG" templates); if (la.kind == 24) { lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 1052 "VBNET.ATG" +#line 1051 "VBNET.ATG" p); } Expect(25); @@ -1809,15 +1808,15 @@ p); lexer.NextToken(); while (la.kind == 27) { AttributeSection( -#line 1053 "VBNET.ATG" +#line 1052 "VBNET.ATG" out returnTypeAttributeSection); } TypeName( -#line 1053 "VBNET.ATG" +#line 1052 "VBNET.ATG" out type); } -#line 1055 "VBNET.ATG" +#line 1054 "VBNET.ATG" if(type == null) { type = new TypeReference("System.Object"); } @@ -1825,20 +1824,20 @@ out type); if (la.kind == 105 || la.kind == 107) { if (la.kind == 107) { ImplementsClause( -#line 1061 "VBNET.ATG" +#line 1060 "VBNET.ATG" out implementsClause); } else { HandlesClause( -#line 1063 "VBNET.ATG" +#line 1062 "VBNET.ATG" out handlesClause); } } Expect(1); if ( -#line 1069 "VBNET.ATG" +#line 1068 "VBNET.ATG" IsMustOverride(m)) { -#line 1071 "VBNET.ATG" +#line 1070 "VBNET.ATG" methodDeclaration = new MethodDeclaration(name, m.Modifier, type, p, attributes); methodDeclaration.StartLocation = m.GetDeclarationLocation(startPos); methodDeclaration.EndLocation = t.EndLocation; @@ -1854,7 +1853,7 @@ IsMustOverride(m)) { } else if (StartOf(13)) { -#line 1086 "VBNET.ATG" +#line 1085 "VBNET.ATG" methodDeclaration = new MethodDeclaration(name, m.Modifier, type, p, attributes); methodDeclaration.StartLocation = m.GetDeclarationLocation(startPos); methodDeclaration.EndLocation = t.EndLocation; @@ -1871,17 +1870,17 @@ IsMustOverride(m)) { compilationUnit.BlockStart(methodDeclaration); Block( -#line 1101 "VBNET.ATG" +#line 1100 "VBNET.ATG" out stmt); -#line 1103 "VBNET.ATG" +#line 1102 "VBNET.ATG" compilationUnit.BlockEnd(); methodDeclaration.Body = (BlockStatement)stmt; Expect(88); Expect(100); -#line 1108 "VBNET.ATG" +#line 1107 "VBNET.ATG" methodDeclaration.Body.StartLocation = methodDeclaration.EndLocation; methodDeclaration.Body.EndLocation = t.EndLocation; @@ -1892,9 +1891,9 @@ out stmt); case 78: { lexer.NextToken(); -#line 1117 "VBNET.ATG" +#line 1116 "VBNET.ATG" m.Check(Modifier.VBExternalMethods); - Point startPos = t.Location; + Location startPos = t.Location; CharsetModifier charsetModifer = CharsetModifier.None; string library = String.Empty; string alias = null; @@ -1902,39 +1901,39 @@ out stmt); if (StartOf(14)) { Charset( -#line 1124 "VBNET.ATG" +#line 1123 "VBNET.ATG" out charsetModifer); } if (la.kind == 167) { lexer.NextToken(); Identifier(); -#line 1127 "VBNET.ATG" +#line 1126 "VBNET.ATG" name = t.val; Expect(115); Expect(3); -#line 1128 "VBNET.ATG" +#line 1127 "VBNET.ATG" library = t.literalValue.ToString(); if (la.kind == 44) { lexer.NextToken(); Expect(3); -#line 1129 "VBNET.ATG" +#line 1128 "VBNET.ATG" alias = t.literalValue.ToString(); } if (la.kind == 24) { lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 1130 "VBNET.ATG" +#line 1129 "VBNET.ATG" p); } Expect(25); } Expect(1); -#line 1133 "VBNET.ATG" +#line 1132 "VBNET.ATG" DeclareDeclaration declareDeclaration = new DeclareDeclaration(name, m.Modifier, null, p, attributes, library, alias, charsetModifer); declareDeclaration.StartLocation = m.GetDeclarationLocation(startPos); declareDeclaration.EndLocation = t.EndLocation; @@ -1944,25 +1943,25 @@ p); lexer.NextToken(); Identifier(); -#line 1140 "VBNET.ATG" +#line 1139 "VBNET.ATG" name = t.val; Expect(115); Expect(3); -#line 1141 "VBNET.ATG" +#line 1140 "VBNET.ATG" library = t.literalValue.ToString(); if (la.kind == 44) { lexer.NextToken(); Expect(3); -#line 1142 "VBNET.ATG" +#line 1141 "VBNET.ATG" alias = t.literalValue.ToString(); } if (la.kind == 24) { lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 1143 "VBNET.ATG" +#line 1142 "VBNET.ATG" p); } Expect(25); @@ -1970,12 +1969,12 @@ p); if (la.kind == 48) { lexer.NextToken(); TypeName( -#line 1144 "VBNET.ATG" +#line 1143 "VBNET.ATG" out type); } Expect(1); -#line 1147 "VBNET.ATG" +#line 1146 "VBNET.ATG" DeclareDeclaration declareDeclaration = new DeclareDeclaration(name, m.Modifier, type, p, attributes, library, alias, charsetModifer); declareDeclaration.StartLocation = m.GetDeclarationLocation(startPos); declareDeclaration.EndLocation = t.EndLocation; @@ -1987,28 +1986,28 @@ out type); case 93: { lexer.NextToken(); -#line 1157 "VBNET.ATG" +#line 1156 "VBNET.ATG" m.Check(Modifier.VBEvents); - Point startPos = t.Location; + Location startPos = t.Location; EventDeclaration eventDeclaration; string name = String.Empty; List implementsClause = null; Identifier(); -#line 1163 "VBNET.ATG" +#line 1162 "VBNET.ATG" name= t.val; if (la.kind == 48) { lexer.NextToken(); TypeName( -#line 1165 "VBNET.ATG" +#line 1164 "VBNET.ATG" out type); } else if (la.kind == 1 || la.kind == 24 || la.kind == 107) { if (la.kind == 24) { lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 1167 "VBNET.ATG" +#line 1166 "VBNET.ATG" p); } Expect(25); @@ -2016,11 +2015,11 @@ p); } else SynErr(224); if (la.kind == 107) { ImplementsClause( -#line 1169 "VBNET.ATG" +#line 1168 "VBNET.ATG" out implementsClause); } -#line 1171 "VBNET.ATG" +#line 1170 "VBNET.ATG" eventDeclaration = new EventDeclaration(type, m.Modifier, p, attributes, name, implementsClause); eventDeclaration.StartLocation = m.GetDeclarationLocation(startPos); eventDeclaration.EndLocation = t.EndLocation; @@ -2031,30 +2030,30 @@ out implementsClause); } case 2: case 47: case 49: case 50: case 51: case 70: case 144: case 169: case 176: case 177: { -#line 1178 "VBNET.ATG" - Point startPos = t.Location; +#line 1177 "VBNET.ATG" + Location startPos = t.Location; -#line 1180 "VBNET.ATG" +#line 1179 "VBNET.ATG" m.Check(Modifier.Fields); FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier); fd.StartLocation = m.GetDeclarationLocation(startPos); IdentifierForFieldDeclaration(); -#line 1184 "VBNET.ATG" +#line 1183 "VBNET.ATG" string name = t.val; VariableDeclaratorPartAfterIdentifier( -#line 1185 "VBNET.ATG" +#line 1184 "VBNET.ATG" variableDeclarators, name); while (la.kind == 12) { lexer.NextToken(); VariableDeclarator( -#line 1186 "VBNET.ATG" +#line 1185 "VBNET.ATG" variableDeclarators); } Expect(1); -#line 1189 "VBNET.ATG" +#line 1188 "VBNET.ATG" fd.EndLocation = t.EndLocation; fd.Fields = variableDeclarators; compilationUnit.AddChild(fd); @@ -2063,35 +2062,35 @@ variableDeclarators); } case 71: { -#line 1194 "VBNET.ATG" +#line 1193 "VBNET.ATG" m.Check(Modifier.Fields); lexer.NextToken(); -#line 1195 "VBNET.ATG" +#line 1194 "VBNET.ATG" m.Add(Modifier.Const, t.Location); -#line 1197 "VBNET.ATG" +#line 1196 "VBNET.ATG" FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier); fd.StartLocation = m.GetDeclarationLocation(t.Location); List constantDeclarators = new List(); ConstantDeclarator( -#line 1201 "VBNET.ATG" +#line 1200 "VBNET.ATG" constantDeclarators); while (la.kind == 12) { lexer.NextToken(); ConstantDeclarator( -#line 1202 "VBNET.ATG" +#line 1201 "VBNET.ATG" constantDeclarators); } -#line 1204 "VBNET.ATG" +#line 1203 "VBNET.ATG" fd.Fields = constantDeclarators; fd.EndLocation = t.Location; Expect(1); -#line 1209 "VBNET.ATG" +#line 1208 "VBNET.ATG" fd.EndLocation = t.EndLocation; compilationUnit.AddChild(fd); @@ -2100,20 +2099,20 @@ constantDeclarators); case 146: { lexer.NextToken(); -#line 1215 "VBNET.ATG" +#line 1214 "VBNET.ATG" m.Check(Modifier.VBProperties); - Point startPos = t.Location; + Location startPos = t.Location; List implementsClause = null; Identifier(); -#line 1219 "VBNET.ATG" +#line 1218 "VBNET.ATG" string propertyName = t.val; if (la.kind == 24) { lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 1220 "VBNET.ATG" +#line 1219 "VBNET.ATG" p); } Expect(25); @@ -2121,26 +2120,26 @@ p); if (la.kind == 48) { lexer.NextToken(); TypeName( -#line 1221 "VBNET.ATG" +#line 1220 "VBNET.ATG" out type); } -#line 1223 "VBNET.ATG" +#line 1222 "VBNET.ATG" if(type == null) { type = new TypeReference("System.Object"); } if (la.kind == 107) { ImplementsClause( -#line 1227 "VBNET.ATG" +#line 1226 "VBNET.ATG" out implementsClause); } Expect(1); if ( -#line 1231 "VBNET.ATG" +#line 1230 "VBNET.ATG" IsMustOverride(m)) { -#line 1233 "VBNET.ATG" +#line 1232 "VBNET.ATG" PropertyDeclaration pDecl = new PropertyDeclaration(propertyName, type, m.Modifier, attributes); pDecl.StartLocation = m.GetDeclarationLocation(startPos); pDecl.EndLocation = t.Location; @@ -2151,7 +2150,7 @@ IsMustOverride(m)) { } else if (la.kind == 27 || la.kind == 101 || la.kind == 156) { -#line 1243 "VBNET.ATG" +#line 1242 "VBNET.ATG" PropertyDeclaration pDecl = new PropertyDeclaration(propertyName, type, m.Modifier, attributes); pDecl.StartLocation = m.GetDeclarationLocation(startPos); pDecl.EndLocation = t.Location; @@ -2163,13 +2162,13 @@ IsMustOverride(m)) { PropertySetRegion setRegion; AccessorDecls( -#line 1253 "VBNET.ATG" +#line 1252 "VBNET.ATG" out getRegion, out setRegion); Expect(88); Expect(146); Expect(1); -#line 1257 "VBNET.ATG" +#line 1256 "VBNET.ATG" pDecl.GetRegion = getRegion; pDecl.SetRegion = setRegion; pDecl.BodyEnd = t.EndLocation; @@ -2181,11 +2180,11 @@ out getRegion, out setRegion); case 204: { lexer.NextToken(); -#line 1264 "VBNET.ATG" - Point startPos = t.Location; +#line 1263 "VBNET.ATG" + Location startPos = t.Location; Expect(93); -#line 1266 "VBNET.ATG" +#line 1265 "VBNET.ATG" m.Check(Modifier.VBCustomEvents); EventAddRemoveRegion eventAccessorDeclaration; EventAddRegion addHandlerAccessorDeclaration = null; @@ -2195,24 +2194,24 @@ out getRegion, out setRegion); Identifier(); -#line 1273 "VBNET.ATG" +#line 1272 "VBNET.ATG" string customEventName = t.val; Expect(48); TypeName( -#line 1274 "VBNET.ATG" +#line 1273 "VBNET.ATG" out type); if (la.kind == 107) { ImplementsClause( -#line 1275 "VBNET.ATG" +#line 1274 "VBNET.ATG" out implementsClause); } Expect(1); while (StartOf(15)) { EventAccessorDeclaration( -#line 1278 "VBNET.ATG" +#line 1277 "VBNET.ATG" out eventAccessorDeclaration); -#line 1280 "VBNET.ATG" +#line 1279 "VBNET.ATG" if(eventAccessorDeclaration is EventAddRegion) { addHandlerAccessorDeclaration = (EventAddRegion)eventAccessorDeclaration; @@ -2231,7 +2230,7 @@ out eventAccessorDeclaration); Expect(93); Expect(1); -#line 1296 "VBNET.ATG" +#line 1295 "VBNET.ATG" if(addHandlerAccessorDeclaration == null) { Error("Need to provide AddHandler accessor."); @@ -2259,26 +2258,26 @@ out eventAccessorDeclaration); } case 187: case 201: case 202: { -#line 1319 "VBNET.ATG" +#line 1318 "VBNET.ATG" ConversionType opConversionType = ConversionType.None; if (la.kind == 201 || la.kind == 202) { if (la.kind == 202) { lexer.NextToken(); -#line 1320 "VBNET.ATG" +#line 1319 "VBNET.ATG" opConversionType = ConversionType.Implicit; } else { lexer.NextToken(); -#line 1321 "VBNET.ATG" +#line 1320 "VBNET.ATG" opConversionType = ConversionType.Explicit; } } Expect(187); -#line 1324 "VBNET.ATG" +#line 1323 "VBNET.ATG" m.Check(Modifier.VBOperators); - Point startPos = t.Location; + Location startPos = t.Location; TypeReference returnType = NullTypeReference.Instance; TypeReference operandType = NullTypeReference.Instance; string operandName; @@ -2288,7 +2287,7 @@ out eventAccessorDeclaration); List returnTypeAttributes = new List(); OverloadableOperator( -#line 1334 "VBNET.ATG" +#line 1333 "VBNET.ATG" out operatorType); Expect(24); if (la.kind == 55) { @@ -2296,16 +2295,16 @@ out operatorType); } Identifier(); -#line 1335 "VBNET.ATG" +#line 1334 "VBNET.ATG" operandName = t.val; if (la.kind == 48) { lexer.NextToken(); TypeName( -#line 1336 "VBNET.ATG" +#line 1335 "VBNET.ATG" out operandType); } -#line 1337 "VBNET.ATG" +#line 1336 "VBNET.ATG" parameters.Add(new ParameterDeclarationExpression(operandType, operandName, ParamModifier.In)); while (la.kind == 12) { lexer.NextToken(); @@ -2314,48 +2313,48 @@ out operandType); } Identifier(); -#line 1341 "VBNET.ATG" +#line 1340 "VBNET.ATG" operandName = t.val; if (la.kind == 48) { lexer.NextToken(); TypeName( -#line 1342 "VBNET.ATG" +#line 1341 "VBNET.ATG" out operandType); } -#line 1343 "VBNET.ATG" +#line 1342 "VBNET.ATG" parameters.Add(new ParameterDeclarationExpression(operandType, operandName, ParamModifier.In)); } Expect(25); -#line 1346 "VBNET.ATG" - Point endPos = t.EndLocation; +#line 1345 "VBNET.ATG" + Location endPos = t.EndLocation; if (la.kind == 48) { lexer.NextToken(); while (la.kind == 27) { AttributeSection( -#line 1347 "VBNET.ATG" +#line 1346 "VBNET.ATG" out section); -#line 1347 "VBNET.ATG" +#line 1346 "VBNET.ATG" returnTypeAttributes.Add(section); } TypeName( -#line 1347 "VBNET.ATG" +#line 1346 "VBNET.ATG" out returnType); -#line 1347 "VBNET.ATG" +#line 1346 "VBNET.ATG" endPos = t.EndLocation; Expect(1); } Block( -#line 1348 "VBNET.ATG" +#line 1347 "VBNET.ATG" out stmt); Expect(88); Expect(187); Expect(1); -#line 1350 "VBNET.ATG" +#line 1349 "VBNET.ATG" OperatorDeclaration operatorDeclaration = new OperatorDeclaration(m.Modifier, attributes, parameters, @@ -2378,25 +2377,25 @@ out stmt); } void EnumMemberDecl( -#line 918 "VBNET.ATG" +#line 917 "VBNET.ATG" out FieldDeclaration f) { -#line 920 "VBNET.ATG" +#line 919 "VBNET.ATG" Expression expr = null;List attributes = new List(); AttributeSection section = null; VariableDeclaration varDecl = null; while (la.kind == 27) { AttributeSection( -#line 924 "VBNET.ATG" +#line 923 "VBNET.ATG" out section); -#line 924 "VBNET.ATG" +#line 923 "VBNET.ATG" attributes.Add(section); } Identifier(); -#line 927 "VBNET.ATG" +#line 926 "VBNET.ATG" f = new FieldDeclaration(attributes); varDecl = new VariableDeclaration(t.val); f.Fields.Add(varDecl); @@ -2405,10 +2404,10 @@ out section); if (la.kind == 11) { lexer.NextToken(); Expr( -#line 932 "VBNET.ATG" +#line 931 "VBNET.ATG" out expr); -#line 932 "VBNET.ATG" +#line 931 "VBNET.ATG" varDecl.Initializer = expr; } Expect(1); @@ -2416,7 +2415,7 @@ out expr); void InterfaceMemberDecl() { -#line 835 "VBNET.ATG" +#line 834 "VBNET.ATG" TypeReference type =null; List p = new List(); List templates = new List(); @@ -2428,31 +2427,31 @@ out expr); if (StartOf(16)) { while (la.kind == 27) { AttributeSection( -#line 843 "VBNET.ATG" +#line 842 "VBNET.ATG" out section); -#line 843 "VBNET.ATG" +#line 842 "VBNET.ATG" attributes.Add(section); } while (StartOf(7)) { MemberModifier( -#line 846 "VBNET.ATG" +#line 845 "VBNET.ATG" mod); } if (la.kind == 93) { lexer.NextToken(); -#line 849 "VBNET.ATG" +#line 848 "VBNET.ATG" mod.Check(Modifier.VBInterfaceEvents); Identifier(); -#line 850 "VBNET.ATG" +#line 849 "VBNET.ATG" name = t.val; if (la.kind == 24) { lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 851 "VBNET.ATG" +#line 850 "VBNET.ATG" p); } Expect(25); @@ -2460,12 +2459,12 @@ p); if (la.kind == 48) { lexer.NextToken(); TypeName( -#line 852 "VBNET.ATG" +#line 851 "VBNET.ATG" out type); } Expect(1); -#line 855 "VBNET.ATG" +#line 854 "VBNET.ATG" EventDeclaration ed = new EventDeclaration(type, mod.Modifier, p, attributes, name, null); compilationUnit.AddChild(ed); ed.EndLocation = t.EndLocation; @@ -2473,27 +2472,27 @@ out type); } else if (la.kind == 167) { lexer.NextToken(); -#line 861 "VBNET.ATG" +#line 860 "VBNET.ATG" mod.Check(Modifier.VBInterfaceMethods); Identifier(); -#line 862 "VBNET.ATG" +#line 861 "VBNET.ATG" name = t.val; TypeParameterList( -#line 863 "VBNET.ATG" +#line 862 "VBNET.ATG" templates); if (la.kind == 24) { lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 864 "VBNET.ATG" +#line 863 "VBNET.ATG" p); } Expect(25); } Expect(1); -#line 867 "VBNET.ATG" +#line 866 "VBNET.ATG" MethodDeclaration md = new MethodDeclaration(name, mod.Modifier, null, p, attributes); md.TypeReference = new TypeReference("", "System.Void"); md.EndLocation = t.EndLocation; @@ -2503,20 +2502,20 @@ p); } else if (la.kind == 100) { lexer.NextToken(); -#line 875 "VBNET.ATG" +#line 874 "VBNET.ATG" mod.Check(Modifier.VBInterfaceMethods); Identifier(); -#line 876 "VBNET.ATG" +#line 875 "VBNET.ATG" name = t.val; TypeParameterList( -#line 877 "VBNET.ATG" +#line 876 "VBNET.ATG" templates); if (la.kind == 24) { lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 878 "VBNET.ATG" +#line 877 "VBNET.ATG" p); } Expect(25); @@ -2525,15 +2524,15 @@ p); lexer.NextToken(); while (la.kind == 27) { AttributeSection( -#line 879 "VBNET.ATG" +#line 878 "VBNET.ATG" out returnTypeAttributeSection); } TypeName( -#line 879 "VBNET.ATG" +#line 878 "VBNET.ATG" out type); } -#line 881 "VBNET.ATG" +#line 880 "VBNET.ATG" if(type == null) { type = new TypeReference("System.Object"); } @@ -2550,17 +2549,17 @@ out type); } else if (la.kind == 146) { lexer.NextToken(); -#line 896 "VBNET.ATG" +#line 895 "VBNET.ATG" mod.Check(Modifier.VBInterfaceProperties); Identifier(); -#line 897 "VBNET.ATG" +#line 896 "VBNET.ATG" name = t.val; if (la.kind == 24) { lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 898 "VBNET.ATG" +#line 897 "VBNET.ATG" p); } Expect(25); @@ -2568,18 +2567,18 @@ p); if (la.kind == 48) { lexer.NextToken(); TypeName( -#line 899 "VBNET.ATG" +#line 898 "VBNET.ATG" out type); } -#line 901 "VBNET.ATG" +#line 900 "VBNET.ATG" if(type == null) { type = new TypeReference("System.Object"); } Expect(1); -#line 907 "VBNET.ATG" +#line 906 "VBNET.ATG" PropertyDeclaration pd = new PropertyDeclaration(name, type, mod.Modifier, attributes); pd.Parameters = p; pd.EndLocation = t.EndLocation; @@ -2588,97 +2587,97 @@ out type); } else SynErr(227); } else if (StartOf(17)) { NonModuleDeclaration( -#line 914 "VBNET.ATG" +#line 913 "VBNET.ATG" mod, attributes); } else SynErr(228); } void Expr( -#line 1733 "VBNET.ATG" +#line 1732 "VBNET.ATG" out Expression expr) { DisjunctionExpr( -#line 1735 "VBNET.ATG" +#line 1734 "VBNET.ATG" out expr); } void ImplementsClause( -#line 1704 "VBNET.ATG" +#line 1703 "VBNET.ATG" out List baseInterfaces) { -#line 1706 "VBNET.ATG" +#line 1705 "VBNET.ATG" baseInterfaces = new List(); TypeReference type = null; string memberName = null; Expect(107); NonArrayTypeName( -#line 1711 "VBNET.ATG" +#line 1710 "VBNET.ATG" out type, false); -#line 1712 "VBNET.ATG" +#line 1711 "VBNET.ATG" if (type != null) memberName = TypeReference.StripLastIdentifierFromType(ref type); -#line 1713 "VBNET.ATG" +#line 1712 "VBNET.ATG" baseInterfaces.Add(new InterfaceImplementation(type, memberName)); while (la.kind == 12) { lexer.NextToken(); NonArrayTypeName( -#line 1715 "VBNET.ATG" +#line 1714 "VBNET.ATG" out type, false); -#line 1716 "VBNET.ATG" +#line 1715 "VBNET.ATG" if (type != null) memberName = TypeReference.StripLastIdentifierFromType(ref type); -#line 1717 "VBNET.ATG" +#line 1716 "VBNET.ATG" baseInterfaces.Add(new InterfaceImplementation(type, memberName)); } } void HandlesClause( -#line 1662 "VBNET.ATG" +#line 1661 "VBNET.ATG" out List handlesClause) { -#line 1664 "VBNET.ATG" +#line 1663 "VBNET.ATG" handlesClause = new List(); string name; Expect(105); EventMemberSpecifier( -#line 1667 "VBNET.ATG" +#line 1666 "VBNET.ATG" out name); -#line 1667 "VBNET.ATG" +#line 1666 "VBNET.ATG" handlesClause.Add(name); while (la.kind == 12) { lexer.NextToken(); EventMemberSpecifier( -#line 1668 "VBNET.ATG" +#line 1667 "VBNET.ATG" out name); -#line 1668 "VBNET.ATG" +#line 1667 "VBNET.ATG" handlesClause.Add(name); } } void Block( -#line 2348 "VBNET.ATG" +#line 2347 "VBNET.ATG" out Statement stmt) { -#line 2351 "VBNET.ATG" +#line 2350 "VBNET.ATG" BlockStatement blockStmt = new BlockStatement(); blockStmt.StartLocation = t.Location; compilationUnit.BlockStart(blockStmt); while (StartOf(18) || -#line 2356 "VBNET.ATG" +#line 2355 "VBNET.ATG" IsEndStmtAhead()) { if ( -#line 2356 "VBNET.ATG" +#line 2355 "VBNET.ATG" IsEndStmtAhead()) { Expect(88); EndOfStmt(); -#line 2356 "VBNET.ATG" +#line 2355 "VBNET.ATG" compilationUnit.AddChild(new EndStatement()); } else { Statement(); @@ -2686,7 +2685,7 @@ IsEndStmtAhead()) { } } -#line 2361 "VBNET.ATG" +#line 2360 "VBNET.ATG" stmt = blockStmt; blockStmt.EndLocation = t.EndLocation; compilationUnit.BlockEnd(); @@ -2694,26 +2693,26 @@ IsEndStmtAhead()) { } void Charset( -#line 1654 "VBNET.ATG" +#line 1653 "VBNET.ATG" out CharsetModifier charsetModifier) { -#line 1655 "VBNET.ATG" +#line 1654 "VBNET.ATG" charsetModifier = CharsetModifier.None; if (la.kind == 100 || la.kind == 167) { } else if (la.kind == 47) { lexer.NextToken(); -#line 1656 "VBNET.ATG" +#line 1655 "VBNET.ATG" charsetModifier = CharsetModifier.ANSI; } else if (la.kind == 50) { lexer.NextToken(); -#line 1657 "VBNET.ATG" +#line 1656 "VBNET.ATG" charsetModifier = CharsetModifier.Auto; } else if (la.kind == 176) { lexer.NextToken(); -#line 1658 "VBNET.ATG" +#line 1657 "VBNET.ATG" charsetModifier = CharsetModifier.Unicode; } else SynErr(229); } @@ -2765,38 +2764,38 @@ out CharsetModifier charsetModifier) { } void VariableDeclaratorPartAfterIdentifier( -#line 1543 "VBNET.ATG" +#line 1542 "VBNET.ATG" List fieldDeclaration, string name) { -#line 1545 "VBNET.ATG" +#line 1544 "VBNET.ATG" Expression expr = null; TypeReference type = null; ArrayList rank = null; List dimension = null; if ( -#line 1550 "VBNET.ATG" +#line 1549 "VBNET.ATG" IsSize() && !IsDims()) { ArrayInitializationModifier( -#line 1550 "VBNET.ATG" +#line 1549 "VBNET.ATG" out dimension); } if ( -#line 1551 "VBNET.ATG" +#line 1550 "VBNET.ATG" IsDims()) { ArrayNameModifier( -#line 1551 "VBNET.ATG" +#line 1550 "VBNET.ATG" out rank); } if ( -#line 1553 "VBNET.ATG" +#line 1552 "VBNET.ATG" IsObjectCreation()) { Expect(48); ObjectCreateExpression( -#line 1553 "VBNET.ATG" +#line 1552 "VBNET.ATG" out expr); -#line 1555 "VBNET.ATG" +#line 1554 "VBNET.ATG" if (expr is ObjectCreateExpression) { type = ((ObjectCreateExpression)expr).CreateType; } else { @@ -2807,11 +2806,11 @@ out expr); if (la.kind == 48) { lexer.NextToken(); TypeName( -#line 1562 "VBNET.ATG" +#line 1561 "VBNET.ATG" out type); } -#line 1564 "VBNET.ATG" +#line 1563 "VBNET.ATG" if (type != null && dimension != null) { if(type.RankSpecifier != null) { Error("array rank only allowed one time"); @@ -2837,52 +2836,52 @@ out type); if (la.kind == 11) { lexer.NextToken(); VariableInitializer( -#line 1586 "VBNET.ATG" +#line 1585 "VBNET.ATG" out expr); } } else SynErr(231); -#line 1588 "VBNET.ATG" +#line 1587 "VBNET.ATG" fieldDeclaration.Add(new VariableDeclaration(name, expr, type)); } void VariableDeclarator( -#line 1537 "VBNET.ATG" +#line 1536 "VBNET.ATG" List fieldDeclaration) { Identifier(); -#line 1539 "VBNET.ATG" +#line 1538 "VBNET.ATG" string name = t.val; VariableDeclaratorPartAfterIdentifier( -#line 1540 "VBNET.ATG" +#line 1539 "VBNET.ATG" fieldDeclaration, name); } void ConstantDeclarator( -#line 1520 "VBNET.ATG" +#line 1519 "VBNET.ATG" List constantDeclaration) { -#line 1522 "VBNET.ATG" +#line 1521 "VBNET.ATG" Expression expr = null; TypeReference type = null; string name = String.Empty; Identifier(); -#line 1526 "VBNET.ATG" +#line 1525 "VBNET.ATG" name = t.val; if (la.kind == 48) { lexer.NextToken(); TypeName( -#line 1527 "VBNET.ATG" +#line 1526 "VBNET.ATG" out type); } Expect(11); Expr( -#line 1528 "VBNET.ATG" +#line 1527 "VBNET.ATG" out expr); -#line 1530 "VBNET.ATG" +#line 1529 "VBNET.ATG" VariableDeclaration f = new VariableDeclaration(name, expr); f.TypeReference = type; constantDeclaration.Add(f); @@ -2890,10 +2889,10 @@ out expr); } void AccessorDecls( -#line 1462 "VBNET.ATG" +#line 1461 "VBNET.ATG" out PropertyGetRegion getBlock, out PropertySetRegion setBlock) { -#line 1464 "VBNET.ATG" +#line 1463 "VBNET.ATG" List attributes = new List(); AttributeSection section; getBlock = null; @@ -2901,60 +2900,60 @@ out PropertyGetRegion getBlock, out PropertySetRegion setBlock) { while (la.kind == 27) { AttributeSection( -#line 1469 "VBNET.ATG" +#line 1468 "VBNET.ATG" out section); -#line 1469 "VBNET.ATG" +#line 1468 "VBNET.ATG" attributes.Add(section); } if (la.kind == 101) { GetAccessorDecl( -#line 1471 "VBNET.ATG" +#line 1470 "VBNET.ATG" out getBlock, attributes); if (la.kind == 27 || la.kind == 156) { -#line 1473 "VBNET.ATG" +#line 1472 "VBNET.ATG" attributes = new List(); while (la.kind == 27) { AttributeSection( -#line 1474 "VBNET.ATG" +#line 1473 "VBNET.ATG" out section); -#line 1474 "VBNET.ATG" +#line 1473 "VBNET.ATG" attributes.Add(section); } SetAccessorDecl( -#line 1475 "VBNET.ATG" +#line 1474 "VBNET.ATG" out setBlock, attributes); } } else if (la.kind == 156) { SetAccessorDecl( -#line 1478 "VBNET.ATG" +#line 1477 "VBNET.ATG" out setBlock, attributes); if (la.kind == 27 || la.kind == 101) { -#line 1480 "VBNET.ATG" +#line 1479 "VBNET.ATG" attributes = new List(); while (la.kind == 27) { AttributeSection( -#line 1481 "VBNET.ATG" +#line 1480 "VBNET.ATG" out section); -#line 1481 "VBNET.ATG" +#line 1480 "VBNET.ATG" attributes.Add(section); } GetAccessorDecl( -#line 1482 "VBNET.ATG" +#line 1481 "VBNET.ATG" out getBlock, attributes); } } else SynErr(232); } void EventAccessorDeclaration( -#line 1425 "VBNET.ATG" +#line 1424 "VBNET.ATG" out EventAddRemoveRegion eventAccessorDeclaration) { -#line 1427 "VBNET.ATG" +#line 1426 "VBNET.ATG" Statement stmt = null; List p = new List(); AttributeSection section; @@ -2963,10 +2962,10 @@ out EventAddRemoveRegion eventAccessorDeclaration) { while (la.kind == 27) { AttributeSection( -#line 1433 "VBNET.ATG" +#line 1432 "VBNET.ATG" out section); -#line 1433 "VBNET.ATG" +#line 1432 "VBNET.ATG" attributes.Add(section); } if (la.kind == 42) { @@ -2975,20 +2974,20 @@ out section); lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 1435 "VBNET.ATG" +#line 1434 "VBNET.ATG" p); } Expect(25); } Expect(1); Block( -#line 1436 "VBNET.ATG" +#line 1435 "VBNET.ATG" out stmt); Expect(88); Expect(42); Expect(1); -#line 1438 "VBNET.ATG" +#line 1437 "VBNET.ATG" eventAccessorDeclaration = new EventAddRegion(attributes); eventAccessorDeclaration.Block = (BlockStatement)stmt; eventAccessorDeclaration.Parameters = p; @@ -2999,20 +2998,20 @@ out stmt); lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 1443 "VBNET.ATG" +#line 1442 "VBNET.ATG" p); } Expect(25); } Expect(1); Block( -#line 1444 "VBNET.ATG" +#line 1443 "VBNET.ATG" out stmt); Expect(88); Expect(152); Expect(1); -#line 1446 "VBNET.ATG" +#line 1445 "VBNET.ATG" eventAccessorDeclaration = new EventRemoveRegion(attributes); eventAccessorDeclaration.Block = (BlockStatement)stmt; eventAccessorDeclaration.Parameters = p; @@ -3023,20 +3022,20 @@ out stmt); lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 1451 "VBNET.ATG" +#line 1450 "VBNET.ATG" p); } Expect(25); } Expect(1); Block( -#line 1452 "VBNET.ATG" +#line 1451 "VBNET.ATG" out stmt); Expect(88); Expect(149); Expect(1); -#line 1454 "VBNET.ATG" +#line 1453 "VBNET.ATG" eventAccessorDeclaration = new EventRaiseRegion(attributes); eventAccessorDeclaration.Block = (BlockStatement)stmt; eventAccessorDeclaration.Parameters = p; @@ -3045,163 +3044,163 @@ out stmt); } void OverloadableOperator( -#line 1367 "VBNET.ATG" +#line 1366 "VBNET.ATG" out OverloadableOperatorType operatorType) { -#line 1368 "VBNET.ATG" +#line 1367 "VBNET.ATG" operatorType = OverloadableOperatorType.None; switch (la.kind) { case 14: { lexer.NextToken(); -#line 1370 "VBNET.ATG" +#line 1369 "VBNET.ATG" operatorType = OverloadableOperatorType.Add; break; } case 15: { lexer.NextToken(); -#line 1372 "VBNET.ATG" +#line 1371 "VBNET.ATG" operatorType = OverloadableOperatorType.Subtract; break; } case 16: { lexer.NextToken(); -#line 1374 "VBNET.ATG" +#line 1373 "VBNET.ATG" operatorType = OverloadableOperatorType.Multiply; break; } case 17: { lexer.NextToken(); -#line 1376 "VBNET.ATG" +#line 1375 "VBNET.ATG" operatorType = OverloadableOperatorType.Divide; break; } case 18: { lexer.NextToken(); -#line 1378 "VBNET.ATG" +#line 1377 "VBNET.ATG" operatorType = OverloadableOperatorType.DivideInteger; break; } case 19: { lexer.NextToken(); -#line 1380 "VBNET.ATG" +#line 1379 "VBNET.ATG" operatorType = OverloadableOperatorType.Concat; break; } case 116: { lexer.NextToken(); -#line 1382 "VBNET.ATG" +#line 1381 "VBNET.ATG" operatorType = OverloadableOperatorType.Like; break; } case 120: { lexer.NextToken(); -#line 1384 "VBNET.ATG" +#line 1383 "VBNET.ATG" operatorType = OverloadableOperatorType.Modulus; break; } case 45: { lexer.NextToken(); -#line 1386 "VBNET.ATG" +#line 1385 "VBNET.ATG" operatorType = OverloadableOperatorType.BitwiseAnd; break; } case 138: { lexer.NextToken(); -#line 1388 "VBNET.ATG" +#line 1387 "VBNET.ATG" operatorType = OverloadableOperatorType.BitwiseOr; break; } case 185: { lexer.NextToken(); -#line 1390 "VBNET.ATG" +#line 1389 "VBNET.ATG" operatorType = OverloadableOperatorType.ExclusiveOr; break; } case 20: { lexer.NextToken(); -#line 1392 "VBNET.ATG" +#line 1391 "VBNET.ATG" operatorType = OverloadableOperatorType.Power; break; } case 31: { lexer.NextToken(); -#line 1394 "VBNET.ATG" +#line 1393 "VBNET.ATG" operatorType = OverloadableOperatorType.ShiftLeft; break; } case 32: { lexer.NextToken(); -#line 1396 "VBNET.ATG" +#line 1395 "VBNET.ATG" operatorType = OverloadableOperatorType.ShiftRight; break; } case 11: { lexer.NextToken(); -#line 1398 "VBNET.ATG" +#line 1397 "VBNET.ATG" operatorType = OverloadableOperatorType.Equality; break; } case 28: { lexer.NextToken(); -#line 1400 "VBNET.ATG" +#line 1399 "VBNET.ATG" operatorType = OverloadableOperatorType.InEquality; break; } case 27: { lexer.NextToken(); -#line 1402 "VBNET.ATG" +#line 1401 "VBNET.ATG" operatorType = OverloadableOperatorType.LessThan; break; } case 30: { lexer.NextToken(); -#line 1404 "VBNET.ATG" +#line 1403 "VBNET.ATG" operatorType = OverloadableOperatorType.LessThanOrEqual; break; } case 26: { lexer.NextToken(); -#line 1406 "VBNET.ATG" +#line 1405 "VBNET.ATG" operatorType = OverloadableOperatorType.GreaterThan; break; } case 29: { lexer.NextToken(); -#line 1408 "VBNET.ATG" +#line 1407 "VBNET.ATG" operatorType = OverloadableOperatorType.GreaterThanOrEqual; break; } case 75: { lexer.NextToken(); -#line 1410 "VBNET.ATG" +#line 1409 "VBNET.ATG" operatorType = OverloadableOperatorType.CType; break; } case 2: case 47: case 49: case 50: case 51: case 70: case 144: case 169: case 176: case 177: case 204: { Identifier(); -#line 1414 "VBNET.ATG" +#line 1413 "VBNET.ATG" string opName = t.val; if (string.Equals(opName, "istrue", StringComparison.InvariantCultureIgnoreCase)) { operatorType = OverloadableOperatorType.IsTrue; @@ -3218,98 +3217,98 @@ out OverloadableOperatorType operatorType) { } void GetAccessorDecl( -#line 1488 "VBNET.ATG" +#line 1487 "VBNET.ATG" out PropertyGetRegion getBlock, List attributes) { -#line 1489 "VBNET.ATG" +#line 1488 "VBNET.ATG" Statement stmt = null; Expect(101); -#line 1491 "VBNET.ATG" - Point startLocation = t.Location; +#line 1490 "VBNET.ATG" + Location startLocation = t.Location; Expect(1); Block( -#line 1493 "VBNET.ATG" +#line 1492 "VBNET.ATG" out stmt); -#line 1494 "VBNET.ATG" +#line 1493 "VBNET.ATG" getBlock = new PropertyGetRegion((BlockStatement)stmt, attributes); Expect(88); Expect(101); -#line 1496 "VBNET.ATG" +#line 1495 "VBNET.ATG" getBlock.StartLocation = startLocation; getBlock.EndLocation = t.EndLocation; Expect(1); } void SetAccessorDecl( -#line 1501 "VBNET.ATG" +#line 1500 "VBNET.ATG" out PropertySetRegion setBlock, List attributes) { -#line 1503 "VBNET.ATG" +#line 1502 "VBNET.ATG" Statement stmt = null; List p = new List(); Expect(156); -#line 1506 "VBNET.ATG" - Point startLocation = t.Location; +#line 1505 "VBNET.ATG" + Location startLocation = t.Location; if (la.kind == 24) { lexer.NextToken(); if (StartOf(4)) { FormalParameterList( -#line 1507 "VBNET.ATG" +#line 1506 "VBNET.ATG" p); } Expect(25); } Expect(1); Block( -#line 1509 "VBNET.ATG" +#line 1508 "VBNET.ATG" out stmt); -#line 1511 "VBNET.ATG" +#line 1510 "VBNET.ATG" setBlock = new PropertySetRegion((BlockStatement)stmt, attributes); setBlock.Parameters = p; Expect(88); Expect(156); -#line 1515 "VBNET.ATG" +#line 1514 "VBNET.ATG" setBlock.StartLocation = startLocation; setBlock.EndLocation = t.EndLocation; Expect(1); } void ArrayInitializationModifier( -#line 1592 "VBNET.ATG" +#line 1591 "VBNET.ATG" out List arrayModifiers) { -#line 1594 "VBNET.ATG" +#line 1593 "VBNET.ATG" arrayModifiers = null; Expect(24); InitializationRankList( -#line 1596 "VBNET.ATG" +#line 1595 "VBNET.ATG" out arrayModifiers); Expect(25); } void ArrayNameModifier( -#line 2141 "VBNET.ATG" +#line 2140 "VBNET.ATG" out ArrayList arrayModifiers) { -#line 2143 "VBNET.ATG" +#line 2142 "VBNET.ATG" arrayModifiers = null; ArrayTypeModifiers( -#line 2145 "VBNET.ATG" +#line 2144 "VBNET.ATG" out arrayModifiers); } void ObjectCreateExpression( -#line 2022 "VBNET.ATG" +#line 2021 "VBNET.ATG" out Expression oce) { -#line 2024 "VBNET.ATG" +#line 2023 "VBNET.ATG" TypeReference type = null; Expression initializer = null; List arguments = null; @@ -3318,35 +3317,35 @@ out Expression oce) { Expect(127); NonArrayTypeName( -#line 2030 "VBNET.ATG" +#line 2029 "VBNET.ATG" out type, false); if (la.kind == 24) { lexer.NextToken(); ArgumentList( -#line 2031 "VBNET.ATG" +#line 2030 "VBNET.ATG" out arguments); Expect(25); if (la.kind == 22 || -#line 2032 "VBNET.ATG" +#line 2031 "VBNET.ATG" la.kind == Tokens.OpenParenthesis) { if ( -#line 2032 "VBNET.ATG" +#line 2031 "VBNET.ATG" la.kind == Tokens.OpenParenthesis) { ArrayTypeModifiers( -#line 2033 "VBNET.ATG" +#line 2032 "VBNET.ATG" out dimensions); ArrayInitializer( -#line 2034 "VBNET.ATG" +#line 2033 "VBNET.ATG" out initializer); } else { ArrayInitializer( -#line 2035 "VBNET.ATG" +#line 2034 "VBNET.ATG" out initializer); } } } -#line 2038 "VBNET.ATG" +#line 2037 "VBNET.ATG" if (type == null) type = new TypeReference("Object"); // fallback type on parser errors if (initializer == null) { oce = new ObjectCreateExpression(type, arguments); @@ -3362,120 +3361,120 @@ out initializer); } void VariableInitializer( -#line 1626 "VBNET.ATG" +#line 1625 "VBNET.ATG" out Expression initializerExpression) { -#line 1628 "VBNET.ATG" +#line 1627 "VBNET.ATG" initializerExpression = null; if (StartOf(20)) { Expr( -#line 1630 "VBNET.ATG" +#line 1629 "VBNET.ATG" out initializerExpression); } else if (la.kind == 22) { ArrayInitializer( -#line 1631 "VBNET.ATG" +#line 1630 "VBNET.ATG" out initializerExpression); } else SynErr(235); } void InitializationRankList( -#line 1600 "VBNET.ATG" +#line 1599 "VBNET.ATG" out List rank) { -#line 1602 "VBNET.ATG" +#line 1601 "VBNET.ATG" rank = new List(); Expression expr = null; Expr( -#line 1605 "VBNET.ATG" +#line 1604 "VBNET.ATG" out expr); if (la.kind == 172) { lexer.NextToken(); -#line 1607 "VBNET.ATG" +#line 1606 "VBNET.ATG" if (!(expr is PrimitiveExpression) || (expr as PrimitiveExpression).StringValue != "0") Error("lower bound of array must be zero"); Expr( -#line 1610 "VBNET.ATG" +#line 1609 "VBNET.ATG" out expr); } -#line 1612 "VBNET.ATG" +#line 1611 "VBNET.ATG" if (expr != null) { rank.Add(expr); } while (la.kind == 12) { lexer.NextToken(); Expr( -#line 1614 "VBNET.ATG" +#line 1613 "VBNET.ATG" out expr); if (la.kind == 172) { lexer.NextToken(); -#line 1616 "VBNET.ATG" +#line 1615 "VBNET.ATG" if (!(expr is PrimitiveExpression) || (expr as PrimitiveExpression).StringValue != "0") Error("lower bound of array must be zero"); Expr( -#line 1619 "VBNET.ATG" +#line 1618 "VBNET.ATG" out expr); } -#line 1621 "VBNET.ATG" +#line 1620 "VBNET.ATG" if (expr != null) { rank.Add(expr); } } } void ArrayInitializer( -#line 1635 "VBNET.ATG" +#line 1634 "VBNET.ATG" out Expression outExpr) { -#line 1637 "VBNET.ATG" +#line 1636 "VBNET.ATG" Expression expr = null; ArrayInitializerExpression initializer = new ArrayInitializerExpression(); Expect(22); if (StartOf(21)) { VariableInitializer( -#line 1642 "VBNET.ATG" +#line 1641 "VBNET.ATG" out expr); -#line 1644 "VBNET.ATG" +#line 1643 "VBNET.ATG" if (expr != null) { initializer.CreateExpressions.Add(expr); } while ( -#line 1647 "VBNET.ATG" +#line 1646 "VBNET.ATG" NotFinalComma()) { Expect(12); VariableInitializer( -#line 1647 "VBNET.ATG" +#line 1646 "VBNET.ATG" out expr); -#line 1648 "VBNET.ATG" +#line 1647 "VBNET.ATG" if (expr != null) { initializer.CreateExpressions.Add(expr); } } } Expect(23); -#line 1651 "VBNET.ATG" +#line 1650 "VBNET.ATG" outExpr = initializer; } void EventMemberSpecifier( -#line 1721 "VBNET.ATG" +#line 1720 "VBNET.ATG" out string name) { -#line 1722 "VBNET.ATG" +#line 1721 "VBNET.ATG" string type; name = String.Empty; if (StartOf(12)) { Identifier(); -#line 1723 "VBNET.ATG" +#line 1722 "VBNET.ATG" type = t.val; Expect(10); Identifier(); -#line 1725 "VBNET.ATG" +#line 1724 "VBNET.ATG" name = type + "." + t.val; } else if (la.kind == 124) { lexer.NextToken(); @@ -3483,128 +3482,128 @@ out string name) { if (StartOf(12)) { Identifier(); -#line 1728 "VBNET.ATG" +#line 1727 "VBNET.ATG" name = "MyBase." + t.val; } else if (la.kind == 92) { lexer.NextToken(); -#line 1729 "VBNET.ATG" +#line 1728 "VBNET.ATG" name = "MyBase.Error"; } else SynErr(236); } else SynErr(237); } void DisjunctionExpr( -#line 1871 "VBNET.ATG" +#line 1870 "VBNET.ATG" out Expression outExpr) { -#line 1873 "VBNET.ATG" +#line 1872 "VBNET.ATG" Expression expr; BinaryOperatorType op = BinaryOperatorType.None; ConjunctionExpr( -#line 1876 "VBNET.ATG" +#line 1875 "VBNET.ATG" out outExpr); while (la.kind == 138 || la.kind == 139 || la.kind == 185) { if (la.kind == 138) { lexer.NextToken(); -#line 1879 "VBNET.ATG" +#line 1878 "VBNET.ATG" op = BinaryOperatorType.BitwiseOr; } else if (la.kind == 139) { lexer.NextToken(); -#line 1880 "VBNET.ATG" +#line 1879 "VBNET.ATG" op = BinaryOperatorType.LogicalOr; } else { lexer.NextToken(); -#line 1881 "VBNET.ATG" +#line 1880 "VBNET.ATG" op = BinaryOperatorType.ExclusiveOr; } ConjunctionExpr( -#line 1883 "VBNET.ATG" +#line 1882 "VBNET.ATG" out expr); -#line 1883 "VBNET.ATG" +#line 1882 "VBNET.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr); } } void AssignmentOperator( -#line 1738 "VBNET.ATG" +#line 1737 "VBNET.ATG" out AssignmentOperatorType op) { -#line 1739 "VBNET.ATG" +#line 1738 "VBNET.ATG" op = AssignmentOperatorType.None; switch (la.kind) { case 11: { lexer.NextToken(); -#line 1740 "VBNET.ATG" +#line 1739 "VBNET.ATG" op = AssignmentOperatorType.Assign; break; } case 41: { lexer.NextToken(); -#line 1741 "VBNET.ATG" +#line 1740 "VBNET.ATG" op = AssignmentOperatorType.ConcatString; break; } case 33: { lexer.NextToken(); -#line 1742 "VBNET.ATG" +#line 1741 "VBNET.ATG" op = AssignmentOperatorType.Add; break; } case 35: { lexer.NextToken(); -#line 1743 "VBNET.ATG" +#line 1742 "VBNET.ATG" op = AssignmentOperatorType.Subtract; break; } case 36: { lexer.NextToken(); -#line 1744 "VBNET.ATG" +#line 1743 "VBNET.ATG" op = AssignmentOperatorType.Multiply; break; } case 37: { lexer.NextToken(); -#line 1745 "VBNET.ATG" +#line 1744 "VBNET.ATG" op = AssignmentOperatorType.Divide; break; } case 38: { lexer.NextToken(); -#line 1746 "VBNET.ATG" +#line 1745 "VBNET.ATG" op = AssignmentOperatorType.DivideInteger; break; } case 34: { lexer.NextToken(); -#line 1747 "VBNET.ATG" +#line 1746 "VBNET.ATG" op = AssignmentOperatorType.Power; break; } case 39: { lexer.NextToken(); -#line 1748 "VBNET.ATG" +#line 1747 "VBNET.ATG" op = AssignmentOperatorType.ShiftLeft; break; } case 40: { lexer.NextToken(); -#line 1749 "VBNET.ATG" +#line 1748 "VBNET.ATG" op = AssignmentOperatorType.ShiftRight; break; } @@ -3613,10 +3612,10 @@ out AssignmentOperatorType op) { } void SimpleExpr( -#line 1753 "VBNET.ATG" +#line 1752 "VBNET.ATG" out Expression pexpr) { -#line 1755 "VBNET.ATG" +#line 1754 "VBNET.ATG" Expression expr; TypeReference type = null; string name = String.Empty; @@ -3627,145 +3626,145 @@ out Expression pexpr) { case 3: { lexer.NextToken(); -#line 1763 "VBNET.ATG" +#line 1762 "VBNET.ATG" pexpr = new PrimitiveExpression(t.literalValue, t.val); break; } case 4: { lexer.NextToken(); -#line 1764 "VBNET.ATG" +#line 1763 "VBNET.ATG" pexpr = new PrimitiveExpression(t.literalValue, t.val); break; } case 7: { lexer.NextToken(); -#line 1765 "VBNET.ATG" +#line 1764 "VBNET.ATG" pexpr = new PrimitiveExpression(t.literalValue, t.val); break; } case 6: { lexer.NextToken(); -#line 1766 "VBNET.ATG" +#line 1765 "VBNET.ATG" pexpr = new PrimitiveExpression(t.literalValue, t.val); break; } case 5: { lexer.NextToken(); -#line 1767 "VBNET.ATG" +#line 1766 "VBNET.ATG" pexpr = new PrimitiveExpression(t.literalValue, t.val); break; } case 9: { lexer.NextToken(); -#line 1768 "VBNET.ATG" +#line 1767 "VBNET.ATG" pexpr = new PrimitiveExpression(t.literalValue, t.val); break; } case 8: { lexer.NextToken(); -#line 1769 "VBNET.ATG" +#line 1768 "VBNET.ATG" pexpr = new PrimitiveExpression(t.literalValue, t.val); break; } case 173: { lexer.NextToken(); -#line 1771 "VBNET.ATG" +#line 1770 "VBNET.ATG" pexpr = new PrimitiveExpression(true, "true"); break; } case 96: { lexer.NextToken(); -#line 1772 "VBNET.ATG" +#line 1771 "VBNET.ATG" pexpr = new PrimitiveExpression(false, "false"); break; } case 130: { lexer.NextToken(); -#line 1773 "VBNET.ATG" +#line 1772 "VBNET.ATG" pexpr = new PrimitiveExpression(null, "null"); break; } case 24: { lexer.NextToken(); Expr( -#line 1774 "VBNET.ATG" +#line 1773 "VBNET.ATG" out expr); Expect(25); -#line 1774 "VBNET.ATG" +#line 1773 "VBNET.ATG" pexpr = new ParenthesizedExpression(expr); break; } case 2: case 47: case 49: case 50: case 51: case 70: case 144: case 169: case 176: case 177: case 204: { Identifier(); -#line 1775 "VBNET.ATG" +#line 1774 "VBNET.ATG" pexpr = new IdentifierExpression(t.val); break; } case 10: case 52: case 54: case 65: case 76: case 77: case 84: case 111: case 117: case 133: case 159: case 160: case 165: case 190: case 191: case 192: case 193: { -#line 1776 "VBNET.ATG" +#line 1775 "VBNET.ATG" string val = String.Empty; if (StartOf(23)) { if (StartOf(9)) { PrimitiveTypeName( -#line 1777 "VBNET.ATG" +#line 1776 "VBNET.ATG" out val); } else { lexer.NextToken(); -#line 1777 "VBNET.ATG" +#line 1776 "VBNET.ATG" val = "Object"; } } Expect(10); -#line 1778 "VBNET.ATG" +#line 1777 "VBNET.ATG" t.val = ""; Identifier(); -#line 1778 "VBNET.ATG" +#line 1777 "VBNET.ATG" pexpr = new FieldReferenceExpression(new TypeReferenceExpression(val), t.val); break; } case 119: { lexer.NextToken(); -#line 1779 "VBNET.ATG" +#line 1778 "VBNET.ATG" pexpr = new ThisReferenceExpression(); break; } case 124: case 125: { -#line 1780 "VBNET.ATG" +#line 1779 "VBNET.ATG" Expression retExpr = null; if (la.kind == 124) { lexer.NextToken(); -#line 1781 "VBNET.ATG" +#line 1780 "VBNET.ATG" retExpr = new BaseReferenceExpression(); } else if (la.kind == 125) { lexer.NextToken(); -#line 1782 "VBNET.ATG" +#line 1781 "VBNET.ATG" retExpr = new ClassReferenceExpression(); } else SynErr(239); Expect(10); IdentifierOrKeyword( -#line 1784 "VBNET.ATG" +#line 1783 "VBNET.ATG" out name); -#line 1784 "VBNET.ATG" +#line 1783 "VBNET.ATG" pexpr = new FieldReferenceExpression(retExpr, name); break; } @@ -3774,77 +3773,77 @@ out name); Expect(10); Identifier(); -#line 1786 "VBNET.ATG" +#line 1785 "VBNET.ATG" type = new TypeReference(t.val ?? ""); -#line 1788 "VBNET.ATG" +#line 1787 "VBNET.ATG" type.IsGlobal = true; -#line 1789 "VBNET.ATG" +#line 1788 "VBNET.ATG" pexpr = new TypeReferenceExpression(type); break; } case 127: { ObjectCreateExpression( -#line 1790 "VBNET.ATG" +#line 1789 "VBNET.ATG" out expr); -#line 1790 "VBNET.ATG" +#line 1789 "VBNET.ATG" pexpr = expr; break; } case 75: case 82: case 199: { -#line 1792 "VBNET.ATG" +#line 1791 "VBNET.ATG" CastType castType = CastType.Cast; if (la.kind == 82) { lexer.NextToken(); } else if (la.kind == 75) { lexer.NextToken(); -#line 1794 "VBNET.ATG" +#line 1793 "VBNET.ATG" castType = CastType.Conversion; } else if (la.kind == 199) { lexer.NextToken(); -#line 1795 "VBNET.ATG" +#line 1794 "VBNET.ATG" castType = CastType.TryCast; } else SynErr(240); Expect(24); Expr( -#line 1797 "VBNET.ATG" +#line 1796 "VBNET.ATG" out expr); Expect(12); TypeName( -#line 1797 "VBNET.ATG" +#line 1796 "VBNET.ATG" out type); Expect(25); -#line 1798 "VBNET.ATG" +#line 1797 "VBNET.ATG" pexpr = new CastExpression(type, expr, castType); break; } case 59: case 60: case 61: case 62: case 63: case 64: case 66: case 68: case 69: case 72: case 73: case 74: case 194: case 195: case 196: case 197: { CastTarget( -#line 1799 "VBNET.ATG" +#line 1798 "VBNET.ATG" out type); Expect(24); Expr( -#line 1799 "VBNET.ATG" +#line 1798 "VBNET.ATG" out expr); Expect(25); -#line 1799 "VBNET.ATG" +#line 1798 "VBNET.ATG" pexpr = new CastExpression(type, expr, CastType.PrimitiveConversion); break; } case 43: { lexer.NextToken(); Expr( -#line 1800 "VBNET.ATG" +#line 1799 "VBNET.ATG" out expr); -#line 1800 "VBNET.ATG" +#line 1799 "VBNET.ATG" pexpr = new AddressOfExpression(expr); break; } @@ -3852,159 +3851,159 @@ out expr); lexer.NextToken(); Expect(24); GetTypeTypeName( -#line 1801 "VBNET.ATG" +#line 1800 "VBNET.ATG" out type); Expect(25); -#line 1801 "VBNET.ATG" +#line 1800 "VBNET.ATG" pexpr = new TypeOfExpression(type); break; } case 175: { lexer.NextToken(); SimpleExpr( -#line 1802 "VBNET.ATG" +#line 1801 "VBNET.ATG" out expr); Expect(113); TypeName( -#line 1802 "VBNET.ATG" +#line 1801 "VBNET.ATG" out type); -#line 1802 "VBNET.ATG" +#line 1801 "VBNET.ATG" pexpr = new TypeOfIsExpression(expr, type); break; } } while (la.kind == 10 || la.kind == 24) { InvocationOrMemberReferenceExpression( -#line 1804 "VBNET.ATG" +#line 1803 "VBNET.ATG" ref pexpr); } } else if (la.kind == 10) { lexer.NextToken(); IdentifierOrKeyword( -#line 1807 "VBNET.ATG" +#line 1806 "VBNET.ATG" out name); -#line 1807 "VBNET.ATG" +#line 1806 "VBNET.ATG" pexpr = new FieldReferenceExpression(pexpr, name); while (la.kind == 10 || la.kind == 24) { InvocationOrMemberReferenceExpression( -#line 1808 "VBNET.ATG" +#line 1807 "VBNET.ATG" ref pexpr); } } else SynErr(241); } void PrimitiveTypeName( -#line 2951 "VBNET.ATG" +#line 2950 "VBNET.ATG" out string type) { -#line 2952 "VBNET.ATG" +#line 2951 "VBNET.ATG" type = String.Empty; switch (la.kind) { case 52: { lexer.NextToken(); -#line 2953 "VBNET.ATG" +#line 2952 "VBNET.ATG" type = "Boolean"; break; } case 76: { lexer.NextToken(); -#line 2954 "VBNET.ATG" +#line 2953 "VBNET.ATG" type = "Date"; break; } case 65: { lexer.NextToken(); -#line 2955 "VBNET.ATG" +#line 2954 "VBNET.ATG" type = "Char"; break; } case 165: { lexer.NextToken(); -#line 2956 "VBNET.ATG" +#line 2955 "VBNET.ATG" type = "String"; break; } case 77: { lexer.NextToken(); -#line 2957 "VBNET.ATG" +#line 2956 "VBNET.ATG" type = "Decimal"; break; } case 54: { lexer.NextToken(); -#line 2958 "VBNET.ATG" +#line 2957 "VBNET.ATG" type = "Byte"; break; } case 159: { lexer.NextToken(); -#line 2959 "VBNET.ATG" +#line 2958 "VBNET.ATG" type = "Short"; break; } case 111: { lexer.NextToken(); -#line 2960 "VBNET.ATG" +#line 2959 "VBNET.ATG" type = "Integer"; break; } case 117: { lexer.NextToken(); -#line 2961 "VBNET.ATG" +#line 2960 "VBNET.ATG" type = "Long"; break; } case 160: { lexer.NextToken(); -#line 2962 "VBNET.ATG" +#line 2961 "VBNET.ATG" type = "Single"; break; } case 84: { lexer.NextToken(); -#line 2963 "VBNET.ATG" +#line 2962 "VBNET.ATG" type = "Double"; break; } case 191: { lexer.NextToken(); -#line 2964 "VBNET.ATG" +#line 2963 "VBNET.ATG" type = "UInteger"; break; } case 192: { lexer.NextToken(); -#line 2965 "VBNET.ATG" +#line 2964 "VBNET.ATG" type = "ULong"; break; } case 193: { lexer.NextToken(); -#line 2966 "VBNET.ATG" +#line 2965 "VBNET.ATG" type = "UShort"; break; } case 190: { lexer.NextToken(); -#line 2967 "VBNET.ATG" +#line 2966 "VBNET.ATG" type = "SByte"; break; } @@ -4013,130 +4012,130 @@ out string type) { } void IdentifierOrKeyword( -#line 2944 "VBNET.ATG" +#line 2943 "VBNET.ATG" out string name) { -#line 2946 "VBNET.ATG" +#line 2945 "VBNET.ATG" lexer.NextToken(); name = t.val; } void CastTarget( -#line 1849 "VBNET.ATG" +#line 1848 "VBNET.ATG" out TypeReference type) { -#line 1851 "VBNET.ATG" +#line 1850 "VBNET.ATG" type = null; switch (la.kind) { case 59: { lexer.NextToken(); -#line 1853 "VBNET.ATG" +#line 1852 "VBNET.ATG" type = new TypeReference("System.Boolean"); break; } case 60: { lexer.NextToken(); -#line 1854 "VBNET.ATG" +#line 1853 "VBNET.ATG" type = new TypeReference("System.Byte"); break; } case 194: { lexer.NextToken(); -#line 1855 "VBNET.ATG" +#line 1854 "VBNET.ATG" type = new TypeReference("System.SByte"); break; } case 61: { lexer.NextToken(); -#line 1856 "VBNET.ATG" +#line 1855 "VBNET.ATG" type = new TypeReference("System.Char"); break; } case 62: { lexer.NextToken(); -#line 1857 "VBNET.ATG" +#line 1856 "VBNET.ATG" type = new TypeReference("System.DateTime"); break; } case 64: { lexer.NextToken(); -#line 1858 "VBNET.ATG" +#line 1857 "VBNET.ATG" type = new TypeReference("System.Decimal"); break; } case 63: { lexer.NextToken(); -#line 1859 "VBNET.ATG" +#line 1858 "VBNET.ATG" type = new TypeReference("System.Double"); break; } case 72: { lexer.NextToken(); -#line 1860 "VBNET.ATG" +#line 1859 "VBNET.ATG" type = new TypeReference("System.Int16"); break; } case 66: { lexer.NextToken(); -#line 1861 "VBNET.ATG" +#line 1860 "VBNET.ATG" type = new TypeReference("System.Int32"); break; } case 68: { lexer.NextToken(); -#line 1862 "VBNET.ATG" +#line 1861 "VBNET.ATG" type = new TypeReference("System.Int64"); break; } case 195: { lexer.NextToken(); -#line 1863 "VBNET.ATG" +#line 1862 "VBNET.ATG" type = new TypeReference("System.UInt16"); break; } case 196: { lexer.NextToken(); -#line 1864 "VBNET.ATG" +#line 1863 "VBNET.ATG" type = new TypeReference("System.UInt32"); break; } case 197: { lexer.NextToken(); -#line 1865 "VBNET.ATG" +#line 1864 "VBNET.ATG" type = new TypeReference("System.UInt64"); break; } case 69: { lexer.NextToken(); -#line 1866 "VBNET.ATG" +#line 1865 "VBNET.ATG" type = new TypeReference("System.Object"); break; } case 73: { lexer.NextToken(); -#line 1867 "VBNET.ATG" +#line 1866 "VBNET.ATG" type = new TypeReference("System.Single"); break; } case 74: { lexer.NextToken(); -#line 1868 "VBNET.ATG" +#line 1867 "VBNET.ATG" type = new TypeReference("System.String"); break; } @@ -4145,19 +4144,19 @@ out TypeReference type) { } void GetTypeTypeName( -#line 2093 "VBNET.ATG" +#line 2092 "VBNET.ATG" out TypeReference typeref) { -#line 2094 "VBNET.ATG" +#line 2093 "VBNET.ATG" ArrayList rank = null; NonArrayTypeName( -#line 2096 "VBNET.ATG" +#line 2095 "VBNET.ATG" out typeref, true); ArrayTypeModifiers( -#line 2097 "VBNET.ATG" +#line 2096 "VBNET.ATG" out rank); -#line 2098 "VBNET.ATG" +#line 2097 "VBNET.ATG" if (rank != null && typeref != null) { typeref.RankSpecifier = (int[])rank.ToArray(typeof(int)); } @@ -4165,53 +4164,53 @@ out rank); } void InvocationOrMemberReferenceExpression( -#line 1812 "VBNET.ATG" +#line 1811 "VBNET.ATG" ref Expression pexpr) { -#line 1813 "VBNET.ATG" +#line 1812 "VBNET.ATG" string name; if (la.kind == 10) { lexer.NextToken(); IdentifierOrKeyword( -#line 1815 "VBNET.ATG" +#line 1814 "VBNET.ATG" out name); -#line 1815 "VBNET.ATG" +#line 1814 "VBNET.ATG" pexpr = new FieldReferenceExpression(pexpr, name); } else if (la.kind == 24) { InvocationExpression( -#line 1816 "VBNET.ATG" +#line 1815 "VBNET.ATG" ref pexpr); } else SynErr(244); } void InvocationExpression( -#line 1819 "VBNET.ATG" +#line 1818 "VBNET.ATG" ref Expression pexpr) { -#line 1820 "VBNET.ATG" +#line 1819 "VBNET.ATG" List typeParameters = new List(); List parameters = null; TypeReference type; Expect(24); -#line 1824 "VBNET.ATG" - Point start = t.Location; +#line 1823 "VBNET.ATG" + Location start = t.Location; if (la.kind == 200) { lexer.NextToken(); TypeName( -#line 1826 "VBNET.ATG" +#line 1825 "VBNET.ATG" out type); -#line 1826 "VBNET.ATG" +#line 1825 "VBNET.ATG" if (type != null) typeParameters.Add(type); while (la.kind == 12) { lexer.NextToken(); TypeName( -#line 1829 "VBNET.ATG" +#line 1828 "VBNET.ATG" out type); -#line 1829 "VBNET.ATG" +#line 1828 "VBNET.ATG" if (type != null) typeParameters.Add(type); } Expect(25); @@ -4219,365 +4218,365 @@ out type); lexer.NextToken(); Identifier(); -#line 1834 "VBNET.ATG" +#line 1833 "VBNET.ATG" pexpr = new FieldReferenceExpression(GetTypeReferenceExpression(pexpr, typeParameters), t.val); } else if (la.kind == 24) { lexer.NextToken(); ArgumentList( -#line 1836 "VBNET.ATG" +#line 1835 "VBNET.ATG" out parameters); Expect(25); -#line 1838 "VBNET.ATG" +#line 1837 "VBNET.ATG" pexpr = new InvocationExpression(pexpr, parameters, typeParameters); } else SynErr(245); } else if (StartOf(24)) { ArgumentList( -#line 1840 "VBNET.ATG" +#line 1839 "VBNET.ATG" out parameters); Expect(25); -#line 1842 "VBNET.ATG" +#line 1841 "VBNET.ATG" pexpr = new InvocationExpression(pexpr, parameters, typeParameters); } else SynErr(246); -#line 1844 "VBNET.ATG" +#line 1843 "VBNET.ATG" pexpr.StartLocation = start; pexpr.EndLocation = t.Location; } void ArgumentList( -#line 2053 "VBNET.ATG" +#line 2052 "VBNET.ATG" out List arguments) { -#line 2055 "VBNET.ATG" +#line 2054 "VBNET.ATG" arguments = new List(); Expression expr = null; if (StartOf(20)) { Argument( -#line 2058 "VBNET.ATG" +#line 2057 "VBNET.ATG" out expr); } while (la.kind == 12) { lexer.NextToken(); -#line 2059 "VBNET.ATG" +#line 2058 "VBNET.ATG" arguments.Add(expr ?? Expression.Null); expr = null; if (StartOf(20)) { Argument( -#line 2060 "VBNET.ATG" +#line 2059 "VBNET.ATG" out expr); } -#line 2061 "VBNET.ATG" +#line 2060 "VBNET.ATG" if (expr == null) expr = Expression.Null; } -#line 2063 "VBNET.ATG" +#line 2062 "VBNET.ATG" if (expr != null) arguments.Add(expr); } void ConjunctionExpr( -#line 1887 "VBNET.ATG" +#line 1886 "VBNET.ATG" out Expression outExpr) { -#line 1889 "VBNET.ATG" +#line 1888 "VBNET.ATG" Expression expr; BinaryOperatorType op = BinaryOperatorType.None; NotExpr( -#line 1892 "VBNET.ATG" +#line 1891 "VBNET.ATG" out outExpr); while (la.kind == 45 || la.kind == 46) { if (la.kind == 45) { lexer.NextToken(); -#line 1895 "VBNET.ATG" +#line 1894 "VBNET.ATG" op = BinaryOperatorType.BitwiseAnd; } else { lexer.NextToken(); -#line 1896 "VBNET.ATG" +#line 1895 "VBNET.ATG" op = BinaryOperatorType.LogicalAnd; } NotExpr( -#line 1898 "VBNET.ATG" +#line 1897 "VBNET.ATG" out expr); -#line 1898 "VBNET.ATG" +#line 1897 "VBNET.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr); } } void NotExpr( -#line 1902 "VBNET.ATG" +#line 1901 "VBNET.ATG" out Expression outExpr) { -#line 1903 "VBNET.ATG" +#line 1902 "VBNET.ATG" UnaryOperatorType uop = UnaryOperatorType.None; while (la.kind == 129) { lexer.NextToken(); -#line 1904 "VBNET.ATG" +#line 1903 "VBNET.ATG" uop = UnaryOperatorType.Not; } ComparisonExpr( -#line 1905 "VBNET.ATG" +#line 1904 "VBNET.ATG" out outExpr); -#line 1906 "VBNET.ATG" +#line 1905 "VBNET.ATG" if (uop != UnaryOperatorType.None) outExpr = new UnaryOperatorExpression(outExpr, uop); } void ComparisonExpr( -#line 1911 "VBNET.ATG" +#line 1910 "VBNET.ATG" out Expression outExpr) { -#line 1913 "VBNET.ATG" +#line 1912 "VBNET.ATG" Expression expr; BinaryOperatorType op = BinaryOperatorType.None; ShiftExpr( -#line 1916 "VBNET.ATG" +#line 1915 "VBNET.ATG" out outExpr); while (StartOf(25)) { switch (la.kind) { case 27: { lexer.NextToken(); -#line 1919 "VBNET.ATG" +#line 1918 "VBNET.ATG" op = BinaryOperatorType.LessThan; break; } case 26: { lexer.NextToken(); -#line 1920 "VBNET.ATG" +#line 1919 "VBNET.ATG" op = BinaryOperatorType.GreaterThan; break; } case 30: { lexer.NextToken(); -#line 1921 "VBNET.ATG" +#line 1920 "VBNET.ATG" op = BinaryOperatorType.LessThanOrEqual; break; } case 29: { lexer.NextToken(); -#line 1922 "VBNET.ATG" +#line 1921 "VBNET.ATG" op = BinaryOperatorType.GreaterThanOrEqual; break; } case 28: { lexer.NextToken(); -#line 1923 "VBNET.ATG" +#line 1922 "VBNET.ATG" op = BinaryOperatorType.InEquality; break; } case 11: { lexer.NextToken(); -#line 1924 "VBNET.ATG" +#line 1923 "VBNET.ATG" op = BinaryOperatorType.Equality; break; } case 116: { lexer.NextToken(); -#line 1925 "VBNET.ATG" +#line 1924 "VBNET.ATG" op = BinaryOperatorType.Like; break; } case 113: { lexer.NextToken(); -#line 1926 "VBNET.ATG" +#line 1925 "VBNET.ATG" op = BinaryOperatorType.ReferenceEquality; break; } case 189: { lexer.NextToken(); -#line 1927 "VBNET.ATG" +#line 1926 "VBNET.ATG" op = BinaryOperatorType.ReferenceInequality; break; } } ShiftExpr( -#line 1929 "VBNET.ATG" +#line 1928 "VBNET.ATG" out expr); -#line 1929 "VBNET.ATG" +#line 1928 "VBNET.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr); } } void ShiftExpr( -#line 1933 "VBNET.ATG" +#line 1932 "VBNET.ATG" out Expression outExpr) { -#line 1935 "VBNET.ATG" +#line 1934 "VBNET.ATG" Expression expr; BinaryOperatorType op = BinaryOperatorType.None; ConcatenationExpr( -#line 1938 "VBNET.ATG" +#line 1937 "VBNET.ATG" out outExpr); while (la.kind == 31 || la.kind == 32) { if (la.kind == 31) { lexer.NextToken(); -#line 1941 "VBNET.ATG" +#line 1940 "VBNET.ATG" op = BinaryOperatorType.ShiftLeft; } else { lexer.NextToken(); -#line 1942 "VBNET.ATG" +#line 1941 "VBNET.ATG" op = BinaryOperatorType.ShiftRight; } ConcatenationExpr( -#line 1944 "VBNET.ATG" +#line 1943 "VBNET.ATG" out expr); -#line 1944 "VBNET.ATG" +#line 1943 "VBNET.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr); } } void ConcatenationExpr( -#line 1948 "VBNET.ATG" +#line 1947 "VBNET.ATG" out Expression outExpr) { -#line 1949 "VBNET.ATG" +#line 1948 "VBNET.ATG" Expression expr; AdditiveExpr( -#line 1951 "VBNET.ATG" +#line 1950 "VBNET.ATG" out outExpr); while (la.kind == 19) { lexer.NextToken(); AdditiveExpr( -#line 1951 "VBNET.ATG" +#line 1950 "VBNET.ATG" out expr); -#line 1951 "VBNET.ATG" +#line 1950 "VBNET.ATG" outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.Concat, expr); } } void AdditiveExpr( -#line 1954 "VBNET.ATG" +#line 1953 "VBNET.ATG" out Expression outExpr) { -#line 1956 "VBNET.ATG" +#line 1955 "VBNET.ATG" Expression expr; BinaryOperatorType op = BinaryOperatorType.None; ModuloExpr( -#line 1959 "VBNET.ATG" +#line 1958 "VBNET.ATG" out outExpr); while (la.kind == 14 || la.kind == 15) { if (la.kind == 14) { lexer.NextToken(); -#line 1962 "VBNET.ATG" +#line 1961 "VBNET.ATG" op = BinaryOperatorType.Add; } else { lexer.NextToken(); -#line 1963 "VBNET.ATG" +#line 1962 "VBNET.ATG" op = BinaryOperatorType.Subtract; } ModuloExpr( -#line 1965 "VBNET.ATG" +#line 1964 "VBNET.ATG" out expr); -#line 1965 "VBNET.ATG" +#line 1964 "VBNET.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr); } } void ModuloExpr( -#line 1969 "VBNET.ATG" +#line 1968 "VBNET.ATG" out Expression outExpr) { -#line 1970 "VBNET.ATG" +#line 1969 "VBNET.ATG" Expression expr; IntegerDivisionExpr( -#line 1972 "VBNET.ATG" +#line 1971 "VBNET.ATG" out outExpr); while (la.kind == 120) { lexer.NextToken(); IntegerDivisionExpr( -#line 1972 "VBNET.ATG" +#line 1971 "VBNET.ATG" out expr); -#line 1972 "VBNET.ATG" +#line 1971 "VBNET.ATG" outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.Modulus, expr); } } void IntegerDivisionExpr( -#line 1975 "VBNET.ATG" +#line 1974 "VBNET.ATG" out Expression outExpr) { -#line 1976 "VBNET.ATG" +#line 1975 "VBNET.ATG" Expression expr; MultiplicativeExpr( -#line 1978 "VBNET.ATG" +#line 1977 "VBNET.ATG" out outExpr); while (la.kind == 18) { lexer.NextToken(); MultiplicativeExpr( -#line 1978 "VBNET.ATG" +#line 1977 "VBNET.ATG" out expr); -#line 1978 "VBNET.ATG" +#line 1977 "VBNET.ATG" outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.DivideInteger, expr); } } void MultiplicativeExpr( -#line 1981 "VBNET.ATG" +#line 1980 "VBNET.ATG" out Expression outExpr) { -#line 1983 "VBNET.ATG" +#line 1982 "VBNET.ATG" Expression expr; BinaryOperatorType op = BinaryOperatorType.None; UnaryExpr( -#line 1986 "VBNET.ATG" +#line 1985 "VBNET.ATG" out outExpr); while (la.kind == 16 || la.kind == 17) { if (la.kind == 16) { lexer.NextToken(); -#line 1989 "VBNET.ATG" +#line 1988 "VBNET.ATG" op = BinaryOperatorType.Multiply; } else { lexer.NextToken(); -#line 1990 "VBNET.ATG" +#line 1989 "VBNET.ATG" op = BinaryOperatorType.Divide; } UnaryExpr( -#line 1992 "VBNET.ATG" +#line 1991 "VBNET.ATG" out expr); -#line 1992 "VBNET.ATG" +#line 1991 "VBNET.ATG" outExpr = new BinaryOperatorExpression(outExpr, op, expr); } } void UnaryExpr( -#line 1996 "VBNET.ATG" +#line 1995 "VBNET.ATG" out Expression uExpr) { -#line 1998 "VBNET.ATG" +#line 1997 "VBNET.ATG" Expression expr; UnaryOperatorType uop = UnaryOperatorType.None; bool isUOp = false; @@ -4586,25 +4585,25 @@ out Expression uExpr) { if (la.kind == 14) { lexer.NextToken(); -#line 2002 "VBNET.ATG" +#line 2001 "VBNET.ATG" uop = UnaryOperatorType.Plus; isUOp = true; } else if (la.kind == 15) { lexer.NextToken(); -#line 2003 "VBNET.ATG" +#line 2002 "VBNET.ATG" uop = UnaryOperatorType.Minus; isUOp = true; } else { lexer.NextToken(); -#line 2004 "VBNET.ATG" +#line 2003 "VBNET.ATG" uop = UnaryOperatorType.Star; isUOp = true; } } ExponentiationExpr( -#line 2006 "VBNET.ATG" +#line 2005 "VBNET.ATG" out expr); -#line 2008 "VBNET.ATG" +#line 2007 "VBNET.ATG" if (isUOp) { uExpr = new UnaryOperatorExpression(expr, uop); } else { @@ -4614,50 +4613,50 @@ out expr); } void ExponentiationExpr( -#line 2016 "VBNET.ATG" +#line 2015 "VBNET.ATG" out Expression outExpr) { -#line 2017 "VBNET.ATG" +#line 2016 "VBNET.ATG" Expression expr; SimpleExpr( -#line 2019 "VBNET.ATG" +#line 2018 "VBNET.ATG" out outExpr); while (la.kind == 20) { lexer.NextToken(); SimpleExpr( -#line 2019 "VBNET.ATG" +#line 2018 "VBNET.ATG" out expr); -#line 2019 "VBNET.ATG" +#line 2018 "VBNET.ATG" outExpr = new BinaryOperatorExpression(outExpr, BinaryOperatorType.Power, expr); } } void ArrayTypeModifiers( -#line 2150 "VBNET.ATG" +#line 2149 "VBNET.ATG" out ArrayList arrayModifiers) { -#line 2152 "VBNET.ATG" +#line 2151 "VBNET.ATG" arrayModifiers = new ArrayList(); int i = 0; while ( -#line 2155 "VBNET.ATG" +#line 2154 "VBNET.ATG" IsDims()) { Expect(24); if (la.kind == 12 || la.kind == 25) { RankList( -#line 2157 "VBNET.ATG" +#line 2156 "VBNET.ATG" out i); } -#line 2159 "VBNET.ATG" +#line 2158 "VBNET.ATG" arrayModifiers.Add(i); Expect(25); } -#line 2164 "VBNET.ATG" +#line 2163 "VBNET.ATG" if(arrayModifiers.Count == 0) { arrayModifiers = null; } @@ -4665,69 +4664,69 @@ out i); } void Argument( -#line 2067 "VBNET.ATG" +#line 2066 "VBNET.ATG" out Expression argumentexpr) { -#line 2069 "VBNET.ATG" +#line 2068 "VBNET.ATG" Expression expr; argumentexpr = null; string name; if ( -#line 2073 "VBNET.ATG" +#line 2072 "VBNET.ATG" IsNamedAssign()) { Identifier(); -#line 2073 "VBNET.ATG" +#line 2072 "VBNET.ATG" name = t.val; Expect(13); Expect(11); Expr( -#line 2073 "VBNET.ATG" +#line 2072 "VBNET.ATG" out expr); -#line 2075 "VBNET.ATG" +#line 2074 "VBNET.ATG" argumentexpr = new NamedArgumentExpression(name, expr); } else if (StartOf(20)) { Expr( -#line 2078 "VBNET.ATG" +#line 2077 "VBNET.ATG" out argumentexpr); } else SynErr(247); } void QualIdentAndTypeArguments( -#line 2124 "VBNET.ATG" +#line 2123 "VBNET.ATG" out TypeReference typeref, bool canBeUnbound) { -#line 2125 "VBNET.ATG" +#line 2124 "VBNET.ATG" string name; typeref = null; Qualident( -#line 2127 "VBNET.ATG" +#line 2126 "VBNET.ATG" out name); -#line 2128 "VBNET.ATG" +#line 2127 "VBNET.ATG" typeref = new TypeReference(name); if ( -#line 2129 "VBNET.ATG" +#line 2128 "VBNET.ATG" la.kind == Tokens.OpenParenthesis && Peek(1).kind == Tokens.Of) { lexer.NextToken(); Expect(200); if ( -#line 2131 "VBNET.ATG" +#line 2130 "VBNET.ATG" canBeUnbound && (la.kind == Tokens.CloseParenthesis || la.kind == Tokens.Comma)) { -#line 2132 "VBNET.ATG" +#line 2131 "VBNET.ATG" typeref.GenericTypes.Add(NullTypeReference.Instance); while (la.kind == 12) { lexer.NextToken(); -#line 2133 "VBNET.ATG" +#line 2132 "VBNET.ATG" typeref.GenericTypes.Add(NullTypeReference.Instance); } } else if (StartOf(5)) { TypeArgumentList( -#line 2134 "VBNET.ATG" +#line 2133 "VBNET.ATG" typeref.GenericTypes); } else SynErr(248); Expect(25); @@ -4735,48 +4734,48 @@ typeref.GenericTypes); } void TypeArgumentList( -#line 2177 "VBNET.ATG" +#line 2176 "VBNET.ATG" List typeArguments) { -#line 2179 "VBNET.ATG" +#line 2178 "VBNET.ATG" TypeReference typeref; TypeName( -#line 2181 "VBNET.ATG" +#line 2180 "VBNET.ATG" out typeref); -#line 2181 "VBNET.ATG" +#line 2180 "VBNET.ATG" if (typeref != null) typeArguments.Add(typeref); while (la.kind == 12) { lexer.NextToken(); TypeName( -#line 2184 "VBNET.ATG" +#line 2183 "VBNET.ATG" out typeref); -#line 2184 "VBNET.ATG" +#line 2183 "VBNET.ATG" if (typeref != null) typeArguments.Add(typeref); } } void RankList( -#line 2171 "VBNET.ATG" +#line 2170 "VBNET.ATG" out int i) { -#line 2172 "VBNET.ATG" +#line 2171 "VBNET.ATG" i = 0; while (la.kind == 12) { lexer.NextToken(); -#line 2173 "VBNET.ATG" +#line 2172 "VBNET.ATG" ++i; } } void Attribute( -#line 2209 "VBNET.ATG" +#line 2208 "VBNET.ATG" out ICSharpCode.NRefactory.Parser.AST.Attribute attribute) { -#line 2210 "VBNET.ATG" +#line 2209 "VBNET.ATG" string name; List positional = new List(); List named = new List(); @@ -4786,39 +4785,39 @@ out ICSharpCode.NRefactory.Parser.AST.Attribute attribute) { Expect(10); } Qualident( -#line 2215 "VBNET.ATG" +#line 2214 "VBNET.ATG" out name); if (la.kind == 24) { AttributeArguments( -#line 2216 "VBNET.ATG" +#line 2215 "VBNET.ATG" positional, named); } -#line 2217 "VBNET.ATG" +#line 2216 "VBNET.ATG" attribute = new ICSharpCode.NRefactory.Parser.AST.Attribute(name, positional, named); } void AttributeArguments( -#line 2221 "VBNET.ATG" +#line 2220 "VBNET.ATG" List positional, List named) { -#line 2223 "VBNET.ATG" +#line 2222 "VBNET.ATG" bool nameFound = false; string name = ""; Expression expr; Expect(24); if ( -#line 2229 "VBNET.ATG" +#line 2228 "VBNET.ATG" IsNotClosingParenthesis()) { if ( -#line 2231 "VBNET.ATG" +#line 2230 "VBNET.ATG" IsNamedAssign()) { -#line 2231 "VBNET.ATG" +#line 2230 "VBNET.ATG" nameFound = true; IdentifierOrKeyword( -#line 2232 "VBNET.ATG" +#line 2231 "VBNET.ATG" out name); if (la.kind == 13) { lexer.NextToken(); @@ -4826,10 +4825,10 @@ out name); Expect(11); } Expr( -#line 2234 "VBNET.ATG" +#line 2233 "VBNET.ATG" out expr); -#line 2236 "VBNET.ATG" +#line 2235 "VBNET.ATG" if (expr != null) { if(name == "") positional.Add(expr); else { named.Add(new NamedArgumentExpression(name, expr)); name = ""; } } @@ -4837,13 +4836,13 @@ out expr); while (la.kind == 12) { lexer.NextToken(); if ( -#line 2243 "VBNET.ATG" +#line 2242 "VBNET.ATG" IsNamedAssign()) { -#line 2243 "VBNET.ATG" +#line 2242 "VBNET.ATG" nameFound = true; IdentifierOrKeyword( -#line 2244 "VBNET.ATG" +#line 2243 "VBNET.ATG" out name); if (la.kind == 13) { lexer.NextToken(); @@ -4851,14 +4850,14 @@ out name); Expect(11); } else if (StartOf(20)) { -#line 2246 "VBNET.ATG" +#line 2245 "VBNET.ATG" if (nameFound) Error("no positional argument after named argument"); } else SynErr(249); Expr( -#line 2247 "VBNET.ATG" +#line 2246 "VBNET.ATG" out expr); -#line 2247 "VBNET.ATG" +#line 2246 "VBNET.ATG" if (expr != null) { if(name == "") positional.Add(expr); else { named.Add(new NamedArgumentExpression(name, expr)); name = ""; } } @@ -4869,10 +4868,10 @@ out expr); } void FormalParameter( -#line 2316 "VBNET.ATG" +#line 2315 "VBNET.ATG" out ParameterDeclarationExpression p) { -#line 2318 "VBNET.ATG" +#line 2317 "VBNET.ATG" TypeReference type = null; ParamModifiers mod = new ParamModifiers(this); Expression expr = null; @@ -4880,28 +4879,28 @@ out ParameterDeclarationExpression p) { while (StartOf(26)) { ParameterModifier( -#line 2323 "VBNET.ATG" +#line 2322 "VBNET.ATG" mod); } Identifier(); -#line 2324 "VBNET.ATG" +#line 2323 "VBNET.ATG" string parameterName = t.val; if ( -#line 2325 "VBNET.ATG" +#line 2324 "VBNET.ATG" IsDims()) { ArrayTypeModifiers( -#line 2325 "VBNET.ATG" +#line 2324 "VBNET.ATG" out arrayModifiers); } if (la.kind == 48) { lexer.NextToken(); TypeName( -#line 2326 "VBNET.ATG" +#line 2325 "VBNET.ATG" out type); } -#line 2328 "VBNET.ATG" +#line 2327 "VBNET.ATG" if(type != null) { if (arrayModifiers != null) { if (type.RankSpecifier != null) { @@ -4917,80 +4916,80 @@ out type); if (la.kind == 11) { lexer.NextToken(); Expr( -#line 2340 "VBNET.ATG" +#line 2339 "VBNET.ATG" out expr); } -#line 2342 "VBNET.ATG" +#line 2341 "VBNET.ATG" mod.Check(); p = new ParameterDeclarationExpression(type, parameterName, mod.Modifier, expr); } void ParameterModifier( -#line 2970 "VBNET.ATG" +#line 2969 "VBNET.ATG" ParamModifiers m) { if (la.kind == 55) { lexer.NextToken(); -#line 2971 "VBNET.ATG" +#line 2970 "VBNET.ATG" m.Add(ParamModifier.In); } else if (la.kind == 53) { lexer.NextToken(); -#line 2972 "VBNET.ATG" +#line 2971 "VBNET.ATG" m.Add(ParamModifier.Ref); } else if (la.kind == 137) { lexer.NextToken(); -#line 2973 "VBNET.ATG" +#line 2972 "VBNET.ATG" m.Add(ParamModifier.Optional); } else if (la.kind == 143) { lexer.NextToken(); -#line 2974 "VBNET.ATG" +#line 2973 "VBNET.ATG" m.Add(ParamModifier.Params); } else SynErr(250); } void Statement() { -#line 2369 "VBNET.ATG" +#line 2368 "VBNET.ATG" Statement stmt = null; - Point startPos = la.Location; + Location startPos = la.Location; string label = String.Empty; if (la.kind == 1 || la.kind == 13) { } else if ( -#line 2375 "VBNET.ATG" +#line 2374 "VBNET.ATG" IsLabel()) { LabelName( -#line 2375 "VBNET.ATG" +#line 2374 "VBNET.ATG" out label); -#line 2377 "VBNET.ATG" +#line 2376 "VBNET.ATG" compilationUnit.AddChild(new LabelStatement(t.val)); Expect(13); Statement(); } else if (StartOf(27)) { EmbeddedStatement( -#line 2380 "VBNET.ATG" +#line 2379 "VBNET.ATG" out stmt); -#line 2380 "VBNET.ATG" +#line 2379 "VBNET.ATG" compilationUnit.AddChild(stmt); } else if (StartOf(28)) { LocalDeclarationStatement( -#line 2381 "VBNET.ATG" +#line 2380 "VBNET.ATG" out stmt); -#line 2381 "VBNET.ATG" +#line 2380 "VBNET.ATG" compilationUnit.AddChild(stmt); } else SynErr(251); -#line 2384 "VBNET.ATG" +#line 2383 "VBNET.ATG" if (stmt != null) { stmt.StartLocation = startPos; stmt.EndLocation = t.Location; @@ -4999,30 +4998,30 @@ out stmt); } void LabelName( -#line 2755 "VBNET.ATG" +#line 2754 "VBNET.ATG" out string name) { -#line 2757 "VBNET.ATG" +#line 2756 "VBNET.ATG" name = String.Empty; if (StartOf(12)) { Identifier(); -#line 2759 "VBNET.ATG" +#line 2758 "VBNET.ATG" name = t.val; } else if (la.kind == 5) { lexer.NextToken(); -#line 2760 "VBNET.ATG" +#line 2759 "VBNET.ATG" name = t.val; } else SynErr(252); } void EmbeddedStatement( -#line 2423 "VBNET.ATG" +#line 2422 "VBNET.ATG" out Statement statement) { -#line 2425 "VBNET.ATG" +#line 2424 "VBNET.ATG" Statement embeddedStatement = null; statement = null; Expression expr = null; @@ -5033,103 +5032,103 @@ out Statement statement) { case 94: { lexer.NextToken(); -#line 2431 "VBNET.ATG" +#line 2430 "VBNET.ATG" ExitType exitType = ExitType.None; switch (la.kind) { case 167: { lexer.NextToken(); -#line 2433 "VBNET.ATG" +#line 2432 "VBNET.ATG" exitType = ExitType.Sub; break; } case 100: { lexer.NextToken(); -#line 2435 "VBNET.ATG" +#line 2434 "VBNET.ATG" exitType = ExitType.Function; break; } case 146: { lexer.NextToken(); -#line 2437 "VBNET.ATG" +#line 2436 "VBNET.ATG" exitType = ExitType.Property; break; } case 83: { lexer.NextToken(); -#line 2439 "VBNET.ATG" +#line 2438 "VBNET.ATG" exitType = ExitType.Do; break; } case 98: { lexer.NextToken(); -#line 2441 "VBNET.ATG" +#line 2440 "VBNET.ATG" exitType = ExitType.For; break; } case 174: { lexer.NextToken(); -#line 2443 "VBNET.ATG" +#line 2442 "VBNET.ATG" exitType = ExitType.Try; break; } case 181: { lexer.NextToken(); -#line 2445 "VBNET.ATG" +#line 2444 "VBNET.ATG" exitType = ExitType.While; break; } case 155: { lexer.NextToken(); -#line 2447 "VBNET.ATG" +#line 2446 "VBNET.ATG" exitType = ExitType.Select; break; } default: SynErr(253); break; } -#line 2449 "VBNET.ATG" +#line 2448 "VBNET.ATG" statement = new ExitStatement(exitType); break; } case 174: { TryStatement( -#line 2450 "VBNET.ATG" +#line 2449 "VBNET.ATG" out statement); break; } case 186: { lexer.NextToken(); -#line 2451 "VBNET.ATG" +#line 2450 "VBNET.ATG" ContinueType continueType = ContinueType.None; if (la.kind == 83 || la.kind == 98 || la.kind == 181) { if (la.kind == 83) { lexer.NextToken(); -#line 2451 "VBNET.ATG" +#line 2450 "VBNET.ATG" continueType = ContinueType.Do; } else if (la.kind == 98) { lexer.NextToken(); -#line 2451 "VBNET.ATG" +#line 2450 "VBNET.ATG" continueType = ContinueType.For; } else { lexer.NextToken(); -#line 2451 "VBNET.ATG" +#line 2450 "VBNET.ATG" continueType = ContinueType.While; } } -#line 2451 "VBNET.ATG" +#line 2450 "VBNET.ATG" statement = new ContinueStatement(continueType); break; } @@ -5137,11 +5136,11 @@ out statement); lexer.NextToken(); if (StartOf(20)) { Expr( -#line 2453 "VBNET.ATG" +#line 2452 "VBNET.ATG" out expr); } -#line 2453 "VBNET.ATG" +#line 2452 "VBNET.ATG" statement = new ThrowStatement(expr); break; } @@ -5149,27 +5148,27 @@ out expr); lexer.NextToken(); if (StartOf(20)) { Expr( -#line 2455 "VBNET.ATG" +#line 2454 "VBNET.ATG" out expr); } -#line 2455 "VBNET.ATG" +#line 2454 "VBNET.ATG" statement = new ReturnStatement(expr); break; } case 168: { lexer.NextToken(); Expr( -#line 2457 "VBNET.ATG" +#line 2456 "VBNET.ATG" out expr); EndOfStmt(); Block( -#line 2457 "VBNET.ATG" +#line 2456 "VBNET.ATG" out embeddedStatement); Expect(88); Expect(168); -#line 2458 "VBNET.ATG" +#line 2457 "VBNET.ATG" statement = new LockStatement(expr, embeddedStatement); break; } @@ -5177,42 +5176,42 @@ out embeddedStatement); lexer.NextToken(); Identifier(); -#line 2460 "VBNET.ATG" +#line 2459 "VBNET.ATG" name = t.val; if (la.kind == 24) { lexer.NextToken(); if (StartOf(24)) { ArgumentList( -#line 2461 "VBNET.ATG" +#line 2460 "VBNET.ATG" out p); } Expect(25); } -#line 2462 "VBNET.ATG" +#line 2461 "VBNET.ATG" statement = new RaiseEventStatement(name, p); break; } case 182: { WithStatement( -#line 2464 "VBNET.ATG" +#line 2463 "VBNET.ATG" out statement); break; } case 42: { lexer.NextToken(); -#line 2466 "VBNET.ATG" +#line 2465 "VBNET.ATG" Expression handlerExpr = null; Expr( -#line 2467 "VBNET.ATG" +#line 2466 "VBNET.ATG" out expr); Expect(12); Expr( -#line 2467 "VBNET.ATG" +#line 2466 "VBNET.ATG" out handlerExpr); -#line 2469 "VBNET.ATG" +#line 2468 "VBNET.ATG" statement = new AddHandlerStatement(expr, handlerExpr); break; @@ -5220,17 +5219,17 @@ out handlerExpr); case 152: { lexer.NextToken(); -#line 2472 "VBNET.ATG" +#line 2471 "VBNET.ATG" Expression handlerExpr = null; Expr( -#line 2473 "VBNET.ATG" +#line 2472 "VBNET.ATG" out expr); Expect(12); Expr( -#line 2473 "VBNET.ATG" +#line 2472 "VBNET.ATG" out handlerExpr); -#line 2475 "VBNET.ATG" +#line 2474 "VBNET.ATG" statement = new RemoveHandlerStatement(expr, handlerExpr); break; @@ -5238,16 +5237,16 @@ out handlerExpr); case 181: { lexer.NextToken(); Expr( -#line 2478 "VBNET.ATG" +#line 2477 "VBNET.ATG" out expr); EndOfStmt(); Block( -#line 2479 "VBNET.ATG" +#line 2478 "VBNET.ATG" out embeddedStatement); Expect(88); Expect(181); -#line 2481 "VBNET.ATG" +#line 2480 "VBNET.ATG" statement = new DoLoopStatement(expr, embeddedStatement, ConditionType.While, ConditionPosition.Start); break; @@ -5255,23 +5254,23 @@ out embeddedStatement); case 83: { lexer.NextToken(); -#line 2486 "VBNET.ATG" +#line 2485 "VBNET.ATG" ConditionType conditionType = ConditionType.None; if (la.kind == 177 || la.kind == 181) { WhileOrUntil( -#line 2489 "VBNET.ATG" +#line 2488 "VBNET.ATG" out conditionType); Expr( -#line 2489 "VBNET.ATG" +#line 2488 "VBNET.ATG" out expr); EndOfStmt(); Block( -#line 2490 "VBNET.ATG" +#line 2489 "VBNET.ATG" out embeddedStatement); Expect(118); -#line 2493 "VBNET.ATG" +#line 2492 "VBNET.ATG" statement = new DoLoopStatement(expr, embeddedStatement, conditionType == ConditionType.While ? ConditionType.DoWhile : conditionType, @@ -5280,19 +5279,19 @@ out embeddedStatement); } else if (la.kind == 1 || la.kind == 13) { EndOfStmt(); Block( -#line 2500 "VBNET.ATG" +#line 2499 "VBNET.ATG" out embeddedStatement); Expect(118); if (la.kind == 177 || la.kind == 181) { WhileOrUntil( -#line 2501 "VBNET.ATG" +#line 2500 "VBNET.ATG" out conditionType); Expr( -#line 2501 "VBNET.ATG" +#line 2500 "VBNET.ATG" out expr); } -#line 2503 "VBNET.ATG" +#line 2502 "VBNET.ATG" statement = new DoLoopStatement(expr, embeddedStatement, conditionType, ConditionPosition.End); } else SynErr(254); @@ -5301,33 +5300,33 @@ out expr); case 98: { lexer.NextToken(); -#line 2508 "VBNET.ATG" +#line 2507 "VBNET.ATG" Expression group = null; TypeReference typeReference; string typeName; - Point startLocation = t.Location; + Location startLocation = t.Location; if (la.kind == 85) { lexer.NextToken(); LoopControlVariable( -#line 2515 "VBNET.ATG" +#line 2514 "VBNET.ATG" out typeReference, out typeName); Expect(109); Expr( -#line 2516 "VBNET.ATG" +#line 2515 "VBNET.ATG" out group); EndOfStmt(); Block( -#line 2517 "VBNET.ATG" +#line 2516 "VBNET.ATG" out embeddedStatement); Expect(128); if (StartOf(20)) { Expr( -#line 2518 "VBNET.ATG" +#line 2517 "VBNET.ATG" out expr); } -#line 2520 "VBNET.ATG" +#line 2519 "VBNET.ATG" statement = new ForeachStatement(typeReference, typeName, group, @@ -5339,53 +5338,53 @@ out expr); } else if (StartOf(12)) { -#line 2531 "VBNET.ATG" +#line 2530 "VBNET.ATG" Expression start = null; Expression end = null; Expression step = null; Expression nextExpr = null;List nextExpressions = null; LoopControlVariable( -#line 2536 "VBNET.ATG" +#line 2535 "VBNET.ATG" out typeReference, out typeName); Expect(11); Expr( -#line 2537 "VBNET.ATG" +#line 2536 "VBNET.ATG" out start); Expect(172); Expr( -#line 2537 "VBNET.ATG" +#line 2536 "VBNET.ATG" out end); if (la.kind == 162) { lexer.NextToken(); Expr( -#line 2537 "VBNET.ATG" +#line 2536 "VBNET.ATG" out step); } EndOfStmt(); Block( -#line 2538 "VBNET.ATG" +#line 2537 "VBNET.ATG" out embeddedStatement); Expect(128); if (StartOf(20)) { Expr( -#line 2541 "VBNET.ATG" +#line 2540 "VBNET.ATG" out nextExpr); -#line 2541 "VBNET.ATG" +#line 2540 "VBNET.ATG" nextExpressions = new List(); nextExpressions.Add(nextExpr); while (la.kind == 12) { lexer.NextToken(); Expr( -#line 2542 "VBNET.ATG" +#line 2541 "VBNET.ATG" out nextExpr); -#line 2542 "VBNET.ATG" +#line 2541 "VBNET.ATG" nextExpressions.Add(nextExpr); } } -#line 2545 "VBNET.ATG" +#line 2544 "VBNET.ATG" statement = new ForNextStatement(typeReference, typeName, start, end, step, embeddedStatement, nextExpressions); } else SynErr(255); @@ -5394,29 +5393,29 @@ out nextExpr); case 92: { lexer.NextToken(); Expr( -#line 2549 "VBNET.ATG" +#line 2548 "VBNET.ATG" out expr); -#line 2549 "VBNET.ATG" +#line 2548 "VBNET.ATG" statement = new ErrorStatement(expr); break; } case 151: { lexer.NextToken(); -#line 2551 "VBNET.ATG" +#line 2550 "VBNET.ATG" bool isPreserve = false; if (la.kind == 144) { lexer.NextToken(); -#line 2551 "VBNET.ATG" +#line 2550 "VBNET.ATG" isPreserve = true; } Expr( -#line 2552 "VBNET.ATG" +#line 2551 "VBNET.ATG" out expr); -#line 2554 "VBNET.ATG" +#line 2553 "VBNET.ATG" ReDimStatement reDimStatement = new ReDimStatement(isPreserve); statement = reDimStatement; InvocationExpression redimClause = expr as InvocationExpression; @@ -5425,13 +5424,13 @@ out expr); while (la.kind == 12) { lexer.NextToken(); Expr( -#line 2559 "VBNET.ATG" +#line 2558 "VBNET.ATG" out expr); -#line 2560 "VBNET.ATG" +#line 2559 "VBNET.ATG" redimClause = expr as InvocationExpression; -#line 2561 "VBNET.ATG" +#line 2560 "VBNET.ATG" if (redimClause != null) { reDimStatement.ReDimClauses.Add(redimClause); } } break; @@ -5439,10 +5438,10 @@ out expr); case 91: { lexer.NextToken(); Expr( -#line 2565 "VBNET.ATG" +#line 2564 "VBNET.ATG" out expr); -#line 2566 "VBNET.ATG" +#line 2565 "VBNET.ATG" List arrays = new List(); if (expr != null) { arrays.Add(expr);} EraseStatement eraseStatement = new EraseStatement(arrays); @@ -5451,53 +5450,53 @@ out expr); while (la.kind == 12) { lexer.NextToken(); Expr( -#line 2571 "VBNET.ATG" +#line 2570 "VBNET.ATG" out expr); -#line 2571 "VBNET.ATG" +#line 2570 "VBNET.ATG" if (expr != null) { arrays.Add(expr); } } -#line 2572 "VBNET.ATG" +#line 2571 "VBNET.ATG" statement = eraseStatement; break; } case 163: { lexer.NextToken(); -#line 2574 "VBNET.ATG" +#line 2573 "VBNET.ATG" statement = new StopStatement(); break; } case 106: { lexer.NextToken(); Expr( -#line 2576 "VBNET.ATG" +#line 2575 "VBNET.ATG" out expr); if (la.kind == 170) { lexer.NextToken(); } if ( -#line 2578 "VBNET.ATG" +#line 2577 "VBNET.ATG" IsEndStmtAhead()) { Expect(88); -#line 2578 "VBNET.ATG" +#line 2577 "VBNET.ATG" statement = new IfElseStatement(expr, new EndStatement()); } else if (la.kind == 1 || la.kind == 13) { EndOfStmt(); Block( -#line 2581 "VBNET.ATG" +#line 2580 "VBNET.ATG" out embeddedStatement); -#line 2583 "VBNET.ATG" +#line 2582 "VBNET.ATG" IfElseStatement ifStatement = new IfElseStatement(expr, embeddedStatement); while (la.kind == 87 || -#line 2587 "VBNET.ATG" +#line 2586 "VBNET.ATG" IsElseIf()) { if ( -#line 2587 "VBNET.ATG" +#line 2586 "VBNET.ATG" IsElseIf()) { Expect(86); Expect(106); @@ -5505,20 +5504,20 @@ IsElseIf()) { lexer.NextToken(); } -#line 2590 "VBNET.ATG" +#line 2589 "VBNET.ATG" Expression condition = null; Statement block = null; Expr( -#line 2591 "VBNET.ATG" +#line 2590 "VBNET.ATG" out condition); if (la.kind == 170) { lexer.NextToken(); } EndOfStmt(); Block( -#line 2592 "VBNET.ATG" +#line 2591 "VBNET.ATG" out block); -#line 2594 "VBNET.ATG" +#line 2593 "VBNET.ATG" ifStatement.ElseIfSections.Add(new ElseIfSection(condition, block)); } @@ -5526,59 +5525,59 @@ out block); lexer.NextToken(); EndOfStmt(); Block( -#line 2599 "VBNET.ATG" +#line 2598 "VBNET.ATG" out embeddedStatement); -#line 2601 "VBNET.ATG" +#line 2600 "VBNET.ATG" ifStatement.FalseStatement.Add(embeddedStatement); } Expect(88); Expect(106); -#line 2605 "VBNET.ATG" +#line 2604 "VBNET.ATG" statement = ifStatement; } else if (StartOf(27)) { EmbeddedStatement( -#line 2608 "VBNET.ATG" +#line 2607 "VBNET.ATG" out embeddedStatement); -#line 2610 "VBNET.ATG" +#line 2609 "VBNET.ATG" IfElseStatement ifStatement = new IfElseStatement(expr, embeddedStatement); while (la.kind == 13) { lexer.NextToken(); EmbeddedStatement( -#line 2612 "VBNET.ATG" +#line 2611 "VBNET.ATG" out embeddedStatement); -#line 2612 "VBNET.ATG" +#line 2611 "VBNET.ATG" ifStatement.TrueStatement.Add(embeddedStatement); } if (la.kind == 86) { lexer.NextToken(); if (StartOf(27)) { EmbeddedStatement( -#line 2614 "VBNET.ATG" +#line 2613 "VBNET.ATG" out embeddedStatement); } -#line 2616 "VBNET.ATG" +#line 2615 "VBNET.ATG" ifStatement.FalseStatement.Add(embeddedStatement); while (la.kind == 13) { lexer.NextToken(); EmbeddedStatement( -#line 2619 "VBNET.ATG" +#line 2618 "VBNET.ATG" out embeddedStatement); -#line 2620 "VBNET.ATG" +#line 2619 "VBNET.ATG" ifStatement.FalseStatement.Add(embeddedStatement); } } -#line 2623 "VBNET.ATG" +#line 2622 "VBNET.ATG" statement = ifStatement; } else SynErr(256); break; @@ -5589,43 +5588,43 @@ out embeddedStatement); lexer.NextToken(); } Expr( -#line 2626 "VBNET.ATG" +#line 2625 "VBNET.ATG" out expr); EndOfStmt(); -#line 2627 "VBNET.ATG" +#line 2626 "VBNET.ATG" List selectSections = new List(); Statement block = null; while (la.kind == 57) { -#line 2631 "VBNET.ATG" +#line 2630 "VBNET.ATG" List caseClauses = null; lexer.NextToken(); CaseClauses( -#line 2632 "VBNET.ATG" +#line 2631 "VBNET.ATG" out caseClauses); if ( -#line 2632 "VBNET.ATG" +#line 2631 "VBNET.ATG" IsNotStatementSeparator()) { lexer.NextToken(); } EndOfStmt(); -#line 2634 "VBNET.ATG" +#line 2633 "VBNET.ATG" SwitchSection selectSection = new SwitchSection(caseClauses); Block( -#line 2636 "VBNET.ATG" +#line 2635 "VBNET.ATG" out block); -#line 2638 "VBNET.ATG" +#line 2637 "VBNET.ATG" selectSection.Children = block.Children; selectSections.Add(selectSection); } -#line 2642 "VBNET.ATG" +#line 2641 "VBNET.ATG" statement = new SwitchStatement(expr, selectSections); Expect(88); Expect(155); @@ -5633,43 +5632,43 @@ out block); } case 135: { -#line 2644 "VBNET.ATG" +#line 2643 "VBNET.ATG" OnErrorStatement onErrorStatement = null; OnErrorStatement( -#line 2645 "VBNET.ATG" +#line 2644 "VBNET.ATG" out onErrorStatement); -#line 2645 "VBNET.ATG" +#line 2644 "VBNET.ATG" statement = onErrorStatement; break; } case 104: { -#line 2646 "VBNET.ATG" +#line 2645 "VBNET.ATG" GotoStatement goToStatement = null; GotoStatement( -#line 2647 "VBNET.ATG" +#line 2646 "VBNET.ATG" out goToStatement); -#line 2647 "VBNET.ATG" +#line 2646 "VBNET.ATG" statement = goToStatement; break; } case 153: { -#line 2648 "VBNET.ATG" +#line 2647 "VBNET.ATG" ResumeStatement resumeStatement = null; ResumeStatement( -#line 2649 "VBNET.ATG" +#line 2648 "VBNET.ATG" out resumeStatement); -#line 2649 "VBNET.ATG" +#line 2648 "VBNET.ATG" statement = resumeStatement; break; } case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 24: case 43: case 47: case 49: case 50: case 51: case 52: case 54: case 59: case 60: case 61: case 62: case 63: case 64: case 65: case 66: case 68: case 69: case 70: case 72: case 73: case 74: case 75: case 76: case 77: case 82: case 84: case 96: case 102: case 111: case 117: case 119: case 124: case 125: case 127: case 130: case 133: case 144: case 159: case 160: case 165: case 169: case 173: case 175: case 176: case 177: case 190: case 191: case 192: case 193: case 194: case 195: case 196: case 197: case 198: case 199: case 204: { -#line 2652 "VBNET.ATG" +#line 2651 "VBNET.ATG" Expression val = null; AssignmentOperatorType op; @@ -5677,25 +5676,25 @@ out resumeStatement); la.kind == Tokens.Not || la.kind == Tokens.Times; SimpleExpr( -#line 2658 "VBNET.ATG" +#line 2657 "VBNET.ATG" out expr); if (StartOf(29)) { AssignmentOperator( -#line 2660 "VBNET.ATG" +#line 2659 "VBNET.ATG" out op); Expr( -#line 2660 "VBNET.ATG" +#line 2659 "VBNET.ATG" out val); -#line 2660 "VBNET.ATG" +#line 2659 "VBNET.ATG" expr = new AssignmentExpression(expr, op, val); } else if (la.kind == 1 || la.kind == 13 || la.kind == 86) { -#line 2661 "VBNET.ATG" +#line 2660 "VBNET.ATG" if (mustBeAssignment) Error("error in assignment."); } else SynErr(257); -#line 2664 "VBNET.ATG" +#line 2663 "VBNET.ATG" // a field reference expression that stands alone is a // invocation expression without parantheses and arguments if(expr is FieldReferenceExpression || expr is IdentifierExpression) { @@ -5708,37 +5707,37 @@ out val); case 56: { lexer.NextToken(); SimpleExpr( -#line 2671 "VBNET.ATG" +#line 2670 "VBNET.ATG" out expr); -#line 2671 "VBNET.ATG" +#line 2670 "VBNET.ATG" statement = new StatementExpression(expr); break; } case 188: { lexer.NextToken(); -#line 2673 "VBNET.ATG" +#line 2672 "VBNET.ATG" LocalVariableDeclaration resourceAquisition = new LocalVariableDeclaration(Modifier.None); -#line 2674 "VBNET.ATG" +#line 2673 "VBNET.ATG" Statement block; VariableDeclarator( -#line 2675 "VBNET.ATG" +#line 2674 "VBNET.ATG" resourceAquisition.Variables); while (la.kind == 12) { lexer.NextToken(); VariableDeclarator( -#line 2677 "VBNET.ATG" +#line 2676 "VBNET.ATG" resourceAquisition.Variables); } Block( -#line 2679 "VBNET.ATG" +#line 2678 "VBNET.ATG" out block); Expect(88); Expect(188); -#line 2681 "VBNET.ATG" +#line 2680 "VBNET.ATG" statement = new UsingStatement(resourceAquisition, block); break; } @@ -5747,10 +5746,10 @@ out block); } void LocalDeclarationStatement( -#line 2392 "VBNET.ATG" +#line 2391 "VBNET.ATG" out Statement statement) { -#line 2394 "VBNET.ATG" +#line 2393 "VBNET.ATG" Modifiers m = new Modifiers(); LocalVariableDeclaration localVariableDeclaration; bool dimfound = false; @@ -5759,22 +5758,22 @@ out Statement statement) { if (la.kind == 71) { lexer.NextToken(); -#line 2400 "VBNET.ATG" +#line 2399 "VBNET.ATG" m.Add(Modifier.Const, t.Location); } else if (la.kind == 161) { lexer.NextToken(); -#line 2401 "VBNET.ATG" +#line 2400 "VBNET.ATG" m.Add(Modifier.Static, t.Location); } else { lexer.NextToken(); -#line 2402 "VBNET.ATG" +#line 2401 "VBNET.ATG" dimfound = true; } } -#line 2405 "VBNET.ATG" +#line 2404 "VBNET.ATG" if(dimfound && (m.Modifier & Modifier.Const) != 0) { Error("Dim is not allowed on constants."); } @@ -5787,137 +5786,137 @@ out Statement statement) { localVariableDeclaration.StartLocation = t.Location; VariableDeclarator( -#line 2416 "VBNET.ATG" +#line 2415 "VBNET.ATG" localVariableDeclaration.Variables); while (la.kind == 12) { lexer.NextToken(); VariableDeclarator( -#line 2417 "VBNET.ATG" +#line 2416 "VBNET.ATG" localVariableDeclaration.Variables); } -#line 2419 "VBNET.ATG" +#line 2418 "VBNET.ATG" statement = localVariableDeclaration; } void TryStatement( -#line 2867 "VBNET.ATG" +#line 2866 "VBNET.ATG" out Statement tryStatement) { -#line 2869 "VBNET.ATG" +#line 2868 "VBNET.ATG" Statement blockStmt = null, finallyStmt = null;List catchClauses = null; Expect(174); EndOfStmt(); Block( -#line 2872 "VBNET.ATG" +#line 2871 "VBNET.ATG" out blockStmt); if (la.kind == 58 || la.kind == 88 || la.kind == 97) { CatchClauses( -#line 2873 "VBNET.ATG" +#line 2872 "VBNET.ATG" out catchClauses); } if (la.kind == 97) { lexer.NextToken(); EndOfStmt(); Block( -#line 2874 "VBNET.ATG" +#line 2873 "VBNET.ATG" out finallyStmt); } Expect(88); Expect(174); -#line 2877 "VBNET.ATG" +#line 2876 "VBNET.ATG" tryStatement = new TryCatchStatement(blockStmt, catchClauses, finallyStmt); } void WithStatement( -#line 2845 "VBNET.ATG" +#line 2844 "VBNET.ATG" out Statement withStatement) { -#line 2847 "VBNET.ATG" +#line 2846 "VBNET.ATG" Statement blockStmt = null; Expression expr = null; Expect(182); -#line 2850 "VBNET.ATG" - Point start = t.Location; +#line 2849 "VBNET.ATG" + Location start = t.Location; Expr( -#line 2851 "VBNET.ATG" +#line 2850 "VBNET.ATG" out expr); EndOfStmt(); -#line 2853 "VBNET.ATG" +#line 2852 "VBNET.ATG" withStatement = new WithStatement(expr); withStatement.StartLocation = start; withStatements.Push(withStatement); Block( -#line 2857 "VBNET.ATG" +#line 2856 "VBNET.ATG" out blockStmt); -#line 2859 "VBNET.ATG" +#line 2858 "VBNET.ATG" ((WithStatement)withStatement).Body = (BlockStatement)blockStmt; withStatements.Pop(); Expect(88); Expect(182); -#line 2863 "VBNET.ATG" +#line 2862 "VBNET.ATG" withStatement.EndLocation = t.Location; } void WhileOrUntil( -#line 2838 "VBNET.ATG" +#line 2837 "VBNET.ATG" out ConditionType conditionType) { -#line 2839 "VBNET.ATG" +#line 2838 "VBNET.ATG" conditionType = ConditionType.None; if (la.kind == 181) { lexer.NextToken(); -#line 2840 "VBNET.ATG" +#line 2839 "VBNET.ATG" conditionType = ConditionType.While; } else if (la.kind == 177) { lexer.NextToken(); -#line 2841 "VBNET.ATG" +#line 2840 "VBNET.ATG" conditionType = ConditionType.Until; } else SynErr(259); } void LoopControlVariable( -#line 2685 "VBNET.ATG" +#line 2684 "VBNET.ATG" out TypeReference type, out string name) { -#line 2686 "VBNET.ATG" +#line 2685 "VBNET.ATG" ArrayList arrayModifiers = null; type = null; Qualident( -#line 2690 "VBNET.ATG" +#line 2689 "VBNET.ATG" out name); if ( -#line 2691 "VBNET.ATG" +#line 2690 "VBNET.ATG" IsDims()) { ArrayTypeModifiers( -#line 2691 "VBNET.ATG" +#line 2690 "VBNET.ATG" out arrayModifiers); } if (la.kind == 48) { lexer.NextToken(); TypeName( -#line 2692 "VBNET.ATG" +#line 2691 "VBNET.ATG" out type); -#line 2692 "VBNET.ATG" +#line 2691 "VBNET.ATG" if (name.IndexOf('.') > 0) { Error("No type def for 'for each' member indexer allowed."); } } -#line 2694 "VBNET.ATG" +#line 2693 "VBNET.ATG" if (type != null) { if(type.RankSpecifier != null && arrayModifiers != null) { Error("array rank only allowed one time"); @@ -5929,48 +5928,48 @@ out type); } void CaseClauses( -#line 2798 "VBNET.ATG" +#line 2797 "VBNET.ATG" out List caseClauses) { -#line 2800 "VBNET.ATG" +#line 2799 "VBNET.ATG" caseClauses = new List(); CaseLabel caseClause = null; CaseClause( -#line 2803 "VBNET.ATG" +#line 2802 "VBNET.ATG" out caseClause); -#line 2803 "VBNET.ATG" +#line 2802 "VBNET.ATG" if (caseClause != null) { caseClauses.Add(caseClause); } while (la.kind == 12) { lexer.NextToken(); CaseClause( -#line 2804 "VBNET.ATG" +#line 2803 "VBNET.ATG" out caseClause); -#line 2804 "VBNET.ATG" +#line 2803 "VBNET.ATG" if (caseClause != null) { caseClauses.Add(caseClause); } } } void OnErrorStatement( -#line 2705 "VBNET.ATG" +#line 2704 "VBNET.ATG" out OnErrorStatement stmt) { -#line 2707 "VBNET.ATG" +#line 2706 "VBNET.ATG" stmt = null; GotoStatement goToStatement = null; Expect(135); Expect(92); if ( -#line 2713 "VBNET.ATG" +#line 2712 "VBNET.ATG" IsNegativeLabelName()) { Expect(104); Expect(15); Expect(5); -#line 2715 "VBNET.ATG" +#line 2714 "VBNET.ATG" long intLabel = Int64.Parse(t.val); if(intLabel != 1) { Error("invalid label in on error statement."); @@ -5979,10 +5978,10 @@ IsNegativeLabelName()) { } else if (la.kind == 104) { GotoStatement( -#line 2721 "VBNET.ATG" +#line 2720 "VBNET.ATG" out goToStatement); -#line 2723 "VBNET.ATG" +#line 2722 "VBNET.ATG" string val = goToStatement.Label; // if value is numeric, make sure that is 0 @@ -5999,63 +5998,63 @@ out goToStatement); lexer.NextToken(); Expect(128); -#line 2737 "VBNET.ATG" +#line 2736 "VBNET.ATG" stmt = new OnErrorStatement(new ResumeStatement(true)); } else SynErr(260); } void GotoStatement( -#line 2743 "VBNET.ATG" +#line 2742 "VBNET.ATG" out ICSharpCode.NRefactory.Parser.AST.GotoStatement goToStatement) { -#line 2745 "VBNET.ATG" +#line 2744 "VBNET.ATG" string label = String.Empty; Expect(104); LabelName( -#line 2748 "VBNET.ATG" +#line 2747 "VBNET.ATG" out label); -#line 2750 "VBNET.ATG" +#line 2749 "VBNET.ATG" goToStatement = new ICSharpCode.NRefactory.Parser.AST.GotoStatement(label); } void ResumeStatement( -#line 2787 "VBNET.ATG" +#line 2786 "VBNET.ATG" out ResumeStatement resumeStatement) { -#line 2789 "VBNET.ATG" +#line 2788 "VBNET.ATG" resumeStatement = null; string label = String.Empty; if ( -#line 2792 "VBNET.ATG" +#line 2791 "VBNET.ATG" IsResumeNext()) { Expect(153); Expect(128); -#line 2793 "VBNET.ATG" +#line 2792 "VBNET.ATG" resumeStatement = new ResumeStatement(true); } else if (la.kind == 153) { lexer.NextToken(); if (StartOf(30)) { LabelName( -#line 2794 "VBNET.ATG" +#line 2793 "VBNET.ATG" out label); } -#line 2794 "VBNET.ATG" +#line 2793 "VBNET.ATG" resumeStatement = new ResumeStatement(label); } else SynErr(261); } void CaseClause( -#line 2808 "VBNET.ATG" +#line 2807 "VBNET.ATG" out CaseLabel caseClause) { -#line 2810 "VBNET.ATG" +#line 2809 "VBNET.ATG" Expression expr = null; Expression sexpr = null; BinaryOperatorType op = BinaryOperatorType.None; @@ -6064,7 +6063,7 @@ out CaseLabel caseClause) { if (la.kind == 86) { lexer.NextToken(); -#line 2816 "VBNET.ATG" +#line 2815 "VBNET.ATG" caseClause = new CaseLabel(); } else if (StartOf(31)) { if (la.kind == 113) { @@ -6074,76 +6073,76 @@ out CaseLabel caseClause) { case 27: { lexer.NextToken(); -#line 2820 "VBNET.ATG" +#line 2819 "VBNET.ATG" op = BinaryOperatorType.LessThan; break; } case 26: { lexer.NextToken(); -#line 2821 "VBNET.ATG" +#line 2820 "VBNET.ATG" op = BinaryOperatorType.GreaterThan; break; } case 30: { lexer.NextToken(); -#line 2822 "VBNET.ATG" +#line 2821 "VBNET.ATG" op = BinaryOperatorType.LessThanOrEqual; break; } case 29: { lexer.NextToken(); -#line 2823 "VBNET.ATG" +#line 2822 "VBNET.ATG" op = BinaryOperatorType.GreaterThanOrEqual; break; } case 11: { lexer.NextToken(); -#line 2824 "VBNET.ATG" +#line 2823 "VBNET.ATG" op = BinaryOperatorType.Equality; break; } case 28: { lexer.NextToken(); -#line 2825 "VBNET.ATG" +#line 2824 "VBNET.ATG" op = BinaryOperatorType.InEquality; break; } default: SynErr(262); break; } Expr( -#line 2827 "VBNET.ATG" +#line 2826 "VBNET.ATG" out expr); -#line 2829 "VBNET.ATG" +#line 2828 "VBNET.ATG" caseClause = new CaseLabel(op, expr); } else if (StartOf(20)) { Expr( -#line 2831 "VBNET.ATG" +#line 2830 "VBNET.ATG" out expr); if (la.kind == 172) { lexer.NextToken(); Expr( -#line 2831 "VBNET.ATG" +#line 2830 "VBNET.ATG" out sexpr); } -#line 2833 "VBNET.ATG" +#line 2832 "VBNET.ATG" caseClause = new CaseLabel(expr, sexpr); } else SynErr(263); } void CatchClauses( -#line 2882 "VBNET.ATG" +#line 2881 "VBNET.ATG" out List catchClauses) { -#line 2884 "VBNET.ATG" +#line 2883 "VBNET.ATG" catchClauses = new List(); TypeReference type = null; Statement blockStmt = null; @@ -6155,27 +6154,27 @@ out List catchClauses) { if (StartOf(12)) { Identifier(); -#line 2892 "VBNET.ATG" +#line 2891 "VBNET.ATG" name = t.val; if (la.kind == 48) { lexer.NextToken(); TypeName( -#line 2892 "VBNET.ATG" +#line 2891 "VBNET.ATG" out type); } } if (la.kind == 180) { lexer.NextToken(); Expr( -#line 2893 "VBNET.ATG" +#line 2892 "VBNET.ATG" out expr); } EndOfStmt(); Block( -#line 2895 "VBNET.ATG" +#line 2894 "VBNET.ATG" out blockStmt); -#line 2896 "VBNET.ATG" +#line 2895 "VBNET.ATG" catchClauses.Add(new CatchClause(type, name, blockStmt, expr)); } } @@ -6541,4 +6540,4 @@ out blockStmt); }; } // end Parser -} \ No newline at end of file +} diff --git a/src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG b/src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG index 853450277d..9a88f7d33c 100644 --- a/src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG +++ b/src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG @@ -1,4 +1,3 @@ -using System.Drawing; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; diff --git a/src/Libraries/NRefactory/Project/Src/Parser/Visitors/LookupTableVisitor.cs b/src/Libraries/NRefactory/Project/Src/Parser/Visitors/LookupTableVisitor.cs index e3b4414f77..13e8368587 100644 --- a/src/Libraries/NRefactory/Project/Src/Parser/Visitors/LookupTableVisitor.cs +++ b/src/Libraries/NRefactory/Project/Src/Parser/Visitors/LookupTableVisitor.cs @@ -6,7 +6,6 @@ // using System; -using System.Drawing; using System.Collections.Generic; using ICSharpCode.NRefactory.Parser.AST; @@ -16,8 +15,8 @@ namespace ICSharpCode.NRefactory.Parser public class LocalLookupVariable { TypeReference typeRef; - Point startPos; - Point endPos; + Location startPos; + Location endPos; bool isConst; public TypeReference TypeRef { @@ -25,12 +24,12 @@ namespace ICSharpCode.NRefactory.Parser return typeRef; } } - public Point StartPos { + public Location StartPos { get { return startPos; } } - public Point EndPos { + public Location EndPos { get { return endPos; } @@ -42,7 +41,7 @@ namespace ICSharpCode.NRefactory.Parser } } - public LocalLookupVariable(TypeReference typeRef, Point startPos, Point endPos, bool isConst) + public LocalLookupVariable(TypeReference typeRef, Location startPos, Location endPos, bool isConst) { this.typeRef = typeRef; this.startPos = startPos; @@ -74,7 +73,7 @@ namespace ICSharpCode.NRefactory.Parser variables = new Dictionary>(nameComparer); } - public void AddVariable(TypeReference typeRef, string name, Point startPos, Point endPos, bool isConst) + public void AddVariable(TypeReference typeRef, string name, Location startPos, Location endPos, bool isConst) { if (name == null || name.Length == 0) { return; @@ -112,7 +111,7 @@ namespace ICSharpCode.NRefactory.Parser AddVariable(localVariableDeclaration.GetTypeForVariable(i), varDecl.Name, localVariableDeclaration.StartLocation, - (blockStack.Count == 0) ? new Point(-1, -1) : blockStack.Peek().EndLocation, + (blockStack.Count == 0) ? new Location(-1, -1) : blockStack.Peek().EndLocation, (localVariableDeclaration.Modifier & Modifier.Const) == Modifier.Const); } return base.Visit(localVariableDeclaration, data); diff --git a/src/Main/Base/Project/Src/Dom/NRefactoryResolver/NRefactoryASTConvertVisitor.cs b/src/Main/Base/Project/Src/Dom/NRefactoryResolver/NRefactoryASTConvertVisitor.cs index 98dbc1c2b0..500f0a3cd4 100644 --- a/src/Main/Base/Project/Src/Dom/NRefactoryResolver/NRefactoryASTConvertVisitor.cs +++ b/src/Main/Base/Project/Src/Dom/NRefactoryResolver/NRefactoryASTConvertVisitor.cs @@ -8,7 +8,6 @@ // created on 04.08.2003 at 17:49 using System; using System.Text; -using System.Drawing; using System.Diagnostics; using System.Collections; using System.Collections.Generic; @@ -271,7 +270,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver } } - DomRegion GetRegion(Point start, Point end) + static DomRegion GetRegion(RefParser.Location start, RefParser.Location end) { return new DomRegion(start, end); } @@ -420,7 +419,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver internal static IParameter CreateParameter(AST.ParameterDeclarationExpression par, IMethod method, IClass currentClass, ICompilationUnit cu) { IReturnType parType = CreateReturnType(par.TypeReference, method, currentClass, cu); - DefaultParameter p = new DefaultParameter(par.ParameterName, parType, new DomRegion(par.StartLocation, par.EndLocation)); + DefaultParameter p = new DefaultParameter(par.ParameterName, parType, GetRegion(par.StartLocation, par.EndLocation)); p.Modifiers = (ParameterModifiers)par.ParamModifier; return p; } @@ -428,7 +427,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver public override object Visit(AST.MethodDeclaration methodDeclaration, object data) { DomRegion region = GetRegion(methodDeclaration.StartLocation, methodDeclaration.EndLocation); - DomRegion bodyRegion = GetRegion(methodDeclaration.EndLocation, methodDeclaration.Body != null ? methodDeclaration.Body.EndLocation : new Point(-1, -1)); + DomRegion bodyRegion = GetRegion(methodDeclaration.EndLocation, methodDeclaration.Body != null ? methodDeclaration.Body.EndLocation : RefParser.Location.Empty); DefaultClass c = GetCurrentClass(); DefaultMethod method = new DefaultMethod(methodDeclaration.Name, null, ConvertModifier(methodDeclaration.Modifier), region, bodyRegion, GetCurrentClass()); @@ -451,7 +450,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver { DefaultClass c = GetCurrentClass(); DomRegion region = GetRegion(operatorDeclaration.StartLocation, operatorDeclaration.EndLocation); - DomRegion bodyRegion = GetRegion(operatorDeclaration.EndLocation, operatorDeclaration.Body != null ? operatorDeclaration.Body.EndLocation : new Point(-1, -1)); + DomRegion bodyRegion = GetRegion(operatorDeclaration.EndLocation, operatorDeclaration.Body != null ? operatorDeclaration.Body.EndLocation : RefParser.Location.Empty); DefaultMethod method = new DefaultMethod(operatorDeclaration.Name, CreateReturnType(operatorDeclaration.TypeReference), ConvertModifier(operatorDeclaration.Modifier), region, bodyRegion, c); ConvertAttributes(operatorDeclaration, method); @@ -468,7 +467,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver public override object Visit(AST.ConstructorDeclaration constructorDeclaration, object data) { DomRegion region = GetRegion(constructorDeclaration.StartLocation, constructorDeclaration.EndLocation); - DomRegion bodyRegion = GetRegion(constructorDeclaration.EndLocation, constructorDeclaration.Body != null ? constructorDeclaration.Body.EndLocation : new Point(-1, -1)); + DomRegion bodyRegion = GetRegion(constructorDeclaration.EndLocation, constructorDeclaration.Body != null ? constructorDeclaration.Body.EndLocation : RefParser.Location.Empty); DefaultClass c = GetCurrentClass(); Constructor constructor = new Constructor(ConvertModifier(constructorDeclaration.Modifier), region, bodyRegion, GetCurrentClass()); @@ -486,7 +485,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver public override object Visit(AST.DestructorDeclaration destructorDeclaration, object data) { DomRegion region = GetRegion(destructorDeclaration.StartLocation, destructorDeclaration.EndLocation); - DomRegion bodyRegion = GetRegion(destructorDeclaration.EndLocation, destructorDeclaration.Body != null ? destructorDeclaration.Body.EndLocation : new Point(-1, -1)); + DomRegion bodyRegion = GetRegion(destructorDeclaration.EndLocation, destructorDeclaration.Body != null ? destructorDeclaration.Body.EndLocation : RefParser.Location.Empty); DefaultClass c = GetCurrentClass(); diff --git a/src/Main/Base/Project/Src/Dom/NRefactoryResolver/NRefactoryResolver.cs b/src/Main/Base/Project/Src/Dom/NRefactoryResolver/NRefactoryResolver.cs index c1bbfe6568..a23bad0c33 100644 --- a/src/Main/Base/Project/Src/Dom/NRefactoryResolver/NRefactoryResolver.cs +++ b/src/Main/Base/Project/Src/Dom/NRefactoryResolver/NRefactoryResolver.cs @@ -8,7 +8,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Drawing; using ICSharpCode.Core; using ICSharpCode.NRefactory.Parser; @@ -213,7 +212,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver WithStatement innermost = null; if (lookupTableVisitor.WithStatements != null) { foreach (WithStatement with in lookupTableVisitor.WithStatements) { - if (IsInside(new Point(caretColumn, caretLine), with.StartLocation, with.EndLocation)) { + if (IsInside(new Location(caretColumn, caretLine), with.StartLocation, with.EndLocation)) { innermost = with; } } @@ -721,7 +720,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver return languageProperties.NameComparer.Equals(name1, name2); } - bool IsInside(Point between, Point start, Point end) + bool IsInside(Location between, Location start, Location end) { if (between.Y < start.Y || between.Y > end.Y) { return false; @@ -940,7 +939,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver } foreach (LocalLookupVariable v in variables) { - if (IsInside(new Point(caretColumn, caretLine), v.StartPos, v.EndPos)) { + if (IsInside(new Location(caretColumn, caretLine), v.StartPos, v.EndPos)) { return v; } } @@ -1012,7 +1011,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver foreach (KeyValuePair> pair in lookupTableVisitor.Variables) { if (pair.Value != null && pair.Value.Count > 0) { foreach (LocalLookupVariable v in pair.Value) { - if (IsInside(new Point(caretColumn, caretLine), v.StartPos, v.EndPos)) { + if (IsInside(new Location(caretColumn, caretLine), v.StartPos, v.EndPos)) { // convert to a field for display result.Add(CreateLocalVariableField(v, pair.Key)); break; diff --git a/src/Main/Base/Project/Src/Dom/Region.cs b/src/Main/Base/Project/Src/Dom/Region.cs index 5bdf3cec11..b91ae0fba8 100644 --- a/src/Main/Base/Project/Src/Dom/Region.cs +++ b/src/Main/Base/Project/Src/Dom/Region.cs @@ -6,7 +6,7 @@ // using System; -using System.Drawing; +using Location = ICSharpCode.NRefactory.Parser.Location; namespace ICSharpCode.SharpDevelop.Dom { @@ -50,7 +50,7 @@ namespace ICSharpCode.SharpDevelop.Dom /// /// if the end column is == -1 the end line is -1 too - /// this stands for an unknwon end + /// this stands for an unknown end /// public int EndColumn { get { @@ -58,16 +58,11 @@ namespace ICSharpCode.SharpDevelop.Dom } } - public DomRegion(Point start, Point end) + public DomRegion(Location start, Location end) : this(start.Y, start.X, end.Y, end.X) { } - public DomRegion(Point start) - : this(start.Y, start.X) - { - } - public DomRegion(int beginLine, int beginColumn, int endLine, int endColumn) { this.beginLine = beginLine;