コード例 #1
0
ファイル: Token.cs プロジェクト: thecocce/dgrok
 public Token(TokenType type, Location location, string text, string parsedText)
 {
     _type = type;
     _location = location;
     _text = text;
     _parsedText = parsedText;
 }
コード例 #2
0
 public PreprocessorException(string message, Location location)
     : base(message, location)
 {
 }
コード例 #3
0
ファイル: EofFrame.cs プロジェクト: Turbo87/DGrok
 public EofFrame(Location location)
 {
     _location = location;
 }
コード例 #4
0
ファイル: TokenFilter.cs プロジェクト: Turbo87/DGrok
 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);
 }
コード例 #5
0
ファイル: TokenFilter.cs プロジェクト: Turbo87/DGrok
 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);
     }
 }
コード例 #6
0
ファイル: DGrokException.cs プロジェクト: DvdKhl/dgrok
 public DGrokException(string message, Location location)
     : base(message)
 {
     _location = location;
 }
コード例 #7
0
ファイル: CompilerDefines.cs プロジェクト: DvdKhl/dgrok
 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);
 }
コード例 #8
0
ファイル: Hit.cs プロジェクト: joewhite/dgrok
 public Hit(Location location, string description)
 {
     _location = location;
     _description = description;
 }
コード例 #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;
     }
 }
コード例 #10
0
 private TreeNode CreateNodeForLocation(Location location)
 {
     TreeNode node = new TreeNode(location.FileName + ":" + location.Offset);
     node.Tag = new Block(delegate { ShowWindowForFailingFile(location); });
     return node;
 }
コード例 #11
0
 public DuplicateFileNameException(string message, Location location)
     : base(message, location) { }
コード例 #12
0
ファイル: ParseException.cs プロジェクト: Turbo87/DGrok
 public ParseException(string message, Location location)
     : base(message, location)
 {
 }