~ubuntu-branches/ubuntu/natty/monodevelop/natty

« back to all changes in this revision

Viewing changes to src/addins/VBNetBinding/Parser/Parser.cs

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Ebner
  • Date: 2008-03-29 23:36:33 UTC
  • mto: (1.5.1 sid)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: james.westby@ubuntu.com-20080329233633-l550uuwvfh1e68at
Tags: upstream-1.0+dfsg
ImportĀ upstreamĀ versionĀ 1.0+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
                                        }
92
92
                                }
93
93
                        }
94
 
                }
95
 
                
96
 
                public ICompilationUnitBase Parse(string fileName)
 
94
                }
 
95
                
 
96
                public ICompilationUnitBase Parse(string fileName)
 
97
                {
 
98
                        using (ICSharpCode.NRefactory.IParser p = ICSharpCode.NRefactory.ParserFactory.CreateParser (SupportedLanguage.VBNet, new StreamReader(fileName))) {
 
99
                                return Parse (p, fileName);
 
100
                        }
 
101
                }
 
102
                
 
103
                public ICompilationUnitBase Parse(string fileName, string fileContent)
 
104
                {
 
105
                        using (ICSharpCode.NRefactory.IParser p = ICSharpCode.NRefactory.ParserFactory.CreateParser (SupportedLanguage.VBNet, new StringReader(fileContent))) {
 
106
                                return Parse (p, fileName);
 
107
                        }
 
108
                }
 
109
                
 
110
                ICompilationUnit Parse (ICSharpCode.NRefactory.IParser p, string fileName)
97
111
                {
98
 
                        ICSharpCode.NRefactory.IParser p = ICSharpCode.NRefactory.ParserFactory.CreateParser (SupportedLanguage.VBNet, new StreamReader(fileName));
99
 
                        
100
112
                        p.Parse();
101
113
                        
102
114
                        VBNetVisitor visitor = new VBNetVisitor();
103
115
                        visitor.VisitCompilationUnit(p.CompilationUnit, null);
104
 
                        //visitor.Cu.FileName = fileName;
105
 
                        visitor.Cu.ErrorsDuringCompile = p.Errors.Count > 0;
106
 
                        RetrieveRegions(visitor.Cu, p.Lexer.SpecialTracker);
107
 
                        
108
 
                        AddCommentTags(visitor.Cu, p.Lexer.TagComments);
109
 
                        return visitor.Cu;
110
 
                }
111
 
                
112
 
                public ICompilationUnitBase Parse(string fileName, string fileContent)
113
 
                {
114
 
                        ICSharpCode.NRefactory.IParser p = ICSharpCode.NRefactory.ParserFactory.CreateParser (SupportedLanguage.VBNet, new StringReader(fileContent));
115
 
                        
116
 
                        p.Parse();
117
 
                        
118
 
                        VBNetVisitor visitor = new VBNetVisitor();
119
 
                        visitor.VisitCompilationUnit (p.CompilationUnit, null);
120
 
                        //visitor.Cu.FileName = fileName;
121
 
                        visitor.Cu.ErrorsDuringCompile = p.Errors.Count > 0;
 
116
                        visitor.Cu.ErrorsDuringCompile = p.Errors.Count > 0;
122
117
                        visitor.Cu.Tag = p.CompilationUnit;
123
118
                        RetrieveRegions(visitor.Cu, p.Lexer.SpecialTracker);
 
119
                        foreach (IClass c in visitor.Cu.Classes)
 
120
                                c.Region.FileName = fileName;
124
121
                        AddCommentTags(visitor.Cu, p.Lexer.TagComments);
125
122
                        return visitor.Cu;
126
123
                }