~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/nrefactory/ICSharpCode.NRefactory.VB/VBParser.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
Import upstream version 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
 
2
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
 
3
 
 
4
using System;
 
5
using System.Collections.Generic;
 
6
using System.Diagnostics;
 
7
using System.IO;
 
8
 
 
9
using ICSharpCode.NRefactory.VB.Ast;
 
10
using ICSharpCode.NRefactory.VB.Parser;
 
11
 
 
12
namespace ICSharpCode.NRefactory.VB
 
13
{
 
14
        public enum SnippetType
 
15
        {
 
16
                None,
 
17
                CompilationUnit,
 
18
                Expression,
 
19
                Statements,
 
20
                TypeMembers
 
21
        }
 
22
        
 
23
        public class VBParser
 
24
        {
 
25
                bool hasErrors;
 
26
                Errors errors;
 
27
                
 
28
                public CompilationUnit Parse(string content)
 
29
                {
 
30
                        return Parse(new StringReader(content));
 
31
                }
 
32
                
 
33
                public CompilationUnit Parse(TextReader reader)
 
34
                {
 
35
                        var parser = new ICSharpCode.NRefactory.VB.Parser.VBParser(new VBLexer(reader));
 
36
                        parser.Parse();
 
37
                        hasErrors = parser.Errors.Count > 0;
 
38
                        errors = parser.Errors;
 
39
                        return parser.CompilationUnit;
 
40
                }
 
41
                
 
42
                public AstNode ParseSnippet(TextReader reader)
 
43
                {
 
44
                        throw new NotImplementedException();
 
45
                }
 
46
                
 
47
                public bool HasErrors {
 
48
                        get { return hasErrors; }
 
49
                }
 
50
                
 
51
                public Errors Errors {
 
52
                        get { return errors; }
 
53
                }
 
54
        }
 
55
}
 
 
b'\\ No newline at end of file'