/// <summary> /// Converts this syntax tree into a parsed file that can be stored in the type system. /// </summary> public CSharpUnresolvedFile ToTypeSystem() { if (string.IsNullOrEmpty(this.FileName)) { throw new InvalidOperationException("Cannot use ToTypeSystem() on a syntax tree without file name."); } var v = new TypeSystemConvertVisitor(this.FileName); v.VisitSyntaxTree(this); return(v.UnresolvedFile); }
/// <summary> /// Converts this compilation unit into a parsed file that can be stored in the type system. /// </summary> public CSharpParsedFile ToTypeSystem() { if (string.IsNullOrEmpty(this.FileName)) { throw new InvalidOperationException("Cannot use ToTypeSystem() on a compilation unit without file name."); } var v = new TypeSystemConvertVisitor(this.FileName); v.VisitCompilationUnit(this, null); return(v.ParsedFile); }