internal static CompilationUnit Parse (bool convertTypeSystemMode, CompilerCompilationUnit top) { if (top == null) return null; CSharpParser.ConversionVisitor conversionVisitor = new ConversionVisitor (convertTypeSystemMode, top.LocationsBag); top.UsingsBag.Global.Accept (conversionVisitor); conversionVisitor.AddAttributeSection (conversionVisitor.Unit, top.ModuleCompiled); InsertComments (top, conversionVisitor); return conversionVisitor.Unit; }
public CompilationUnit Parse (CompilerCompilationUnit top, string fileName, int lineModifier = 0) { if (top == null) return null; CSharpParser.ConversionVisitor conversionVisitor = new ConversionVisitor (GenerateTypeSystemMode, top.LocationsBag); top.UsingsBag.Global.Accept (conversionVisitor); conversionVisitor.AddAttributeSection (conversionVisitor.Unit, top.ModuleCompiled); InsertComments (top, conversionVisitor); if (CompilationUnitCallback != null) CompilationUnitCallback (top); if (lineModifier != 0) AdjustLineLocations (conversionVisitor.Unit, lineModifier); if (top.LastYYValue is Mono.CSharp.Expression) conversionVisitor.Unit.TopExpression = ((Mono.CSharp.Expression)top.LastYYValue).Accept (conversionVisitor) as AstNode; conversionVisitor.Unit.FileName = fileName; return conversionVisitor.Unit; }
public CompilationUnit Parse (CompilerCompilationUnit top, int line) { if (top == null) return null; CSharpParser.ConversionVisitor conversionVisitor = new ConversionVisitor (top.LocationsBag); conversionVisitor.AddAttributeSection (conversionVisitor.Unit, top.ModuleCompiled); top.UsingsBag.Global.Accept (conversionVisitor); InsertComments (top, conversionVisitor); if (line != 0) AdjustLineLocations (conversionVisitor.Unit, line); return conversionVisitor.Unit; }