public Token(TokenType type, Location location, string text, string parsedText) { _type = type; _location = location; _text = text; _parsedText = parsedText; }
public PreprocessorException(string message, Location location) : base(message, location) { }
public EofFrame(Location location) { _location = location; }
private void HandleIf(Stack<IfDefTruth> ifDefStack, string directive, Location location) { if (ifDefStack.Peek() == IfDefTruth.True) { if (_compilerDefines.IsTrue(directive, location)) ifDefStack.Push(IfDefTruth.True); else ifDefStack.Push(IfDefTruth.InitiallyFalse); } else ifDefStack.Push(IfDefTruth.ForeverFalse); }
private void HandleElseIf(Stack<IfDefTruth> ifDefStack, string directive, Location location) { IfDefTruth truth = ifDefStack.Pop(); if (truth == IfDefTruth.True || truth == IfDefTruth.ForeverFalse) ifDefStack.Push(IfDefTruth.ForeverFalse); else { string trimmedDirective = directive.Substring(4); if (_compilerDefines.IsTrue(trimmedDirective, location)) ifDefStack.Push(IfDefTruth.True); else ifDefStack.Push(IfDefTruth.InitiallyFalse); } }
public DGrokException(string message, Location location) : base(message) { _location = location; }
public bool IsTrue(string compilerDirective, Location location) { if(_dictionary.ContainsKey(compilerDirective)) return _dictionary[compilerDirective]; if(compilerDirective.StartsWith("IFDEF ", StringComparison.InvariantCultureIgnoreCase)) return false; if(compilerDirective.StartsWith("IFNDEF ", StringComparison.InvariantCultureIgnoreCase)) return true; throw new PreprocessorException("Compiler directive '" + compilerDirective + "' has not been defined as either true or false", location); }
public Hit(Location location, string description) { _location = location; _description = description; }
private void ShowWindowForFailingFile(Location errorLocation) { Cursor.Current = Cursors.WaitCursor; try { Form form = CreateEmptyWindowForFile(errorLocation.FileName); ViewSourceControl viewSource = new ViewSourceControl(); viewSource.Text = errorLocation.FileSource; viewSource.Dock = DockStyle.Fill; form.Controls.Add(viewSource); form.Show(); viewSource.ScrollToOffset(errorLocation.Offset); } finally { Cursor.Current = Cursors.Default; } }
private TreeNode CreateNodeForLocation(Location location) { TreeNode node = new TreeNode(location.FileName + ":" + location.Offset); node.Tag = new Block(delegate { ShowWindowForFailingFile(location); }); return node; }
public DuplicateFileNameException(string message, Location location) : base(message, location) { }
public ParseException(string message, Location location) : base(message, location) { }