Beispiel #1
0
 public Token(TokenType type, Location location, string text, string parsedText)
 {
     _type = type;
     _location = location;
     _text = text;
     _parsedText = parsedText;
 }
Beispiel #2
0
 public PreprocessorException(string message, Location location)
     : base(message, location)
 {
 }
Beispiel #3
0
 public EofFrame(Location location)
 {
     _location = location;
 }
Beispiel #4
0
 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);
 }
Beispiel #5
0
 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);
     }
 }
Beispiel #6
0
 public DGrokException(string message, Location location)
     : base(message)
 {
     _location = location;
 }
Beispiel #7
0
 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);
 }
Beispiel #8
0
 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;
     }
 }
Beispiel #10
0
 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) { }
Beispiel #12
0
 public ParseException(string message, Location location)
     : base(message, location)
 {
 }