Exemplo n.º 1
0
 public Token(TokenType type, Location location, string text, string parsedText)
 {
     _type = type;
     _location = location;
     _text = text;
     _parsedText = parsedText;
 }
Exemplo n.º 2
0
 public PreprocessorException(string message, Location location)
     : base(message, location)
 {
 }
Exemplo n.º 3
0
 public EofFrame(Location location)
 {
     _location = location;
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
     }
 }
Exemplo n.º 6
0
 public DGrokException(string message, Location location)
     : base(message)
 {
     _location = location;
 }
Exemplo n.º 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);
 }
Exemplo n.º 8
0
 public Hit(Location location, string description)
 {
     _location = location;
     _description = description;
 }
Exemplo n.º 9
0
 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;
     }
 }
Exemplo n.º 10
0
 private TreeNode CreateNodeForLocation(Location location)
 {
     TreeNode node = new TreeNode(location.FileName + ":" + location.Offset);
     node.Tag = new Block(delegate { ShowWindowForFailingFile(location); });
     return node;
 }
Exemplo n.º 11
0
 public DuplicateFileNameException(string message, Location location)
     : base(message, location) { }
Exemplo n.º 12
0
 public ParseException(string message, Location location)
     : base(message, location)
 {
 }