コード例 #1
0
 public virtual CompilationUnit VisitCompilationUnitSnippet(CompilationUnitSnippet snippet)
 {
     return this.VisitCompilationUnit(snippet);
 }
コード例 #2
0
ファイル: Duplicator.cs プロジェクト: modulexcite/SHFB-1
 public override CompilationUnit VisitCompilationUnitSnippet(CompilationUnitSnippet snippet)
 {
     if (snippet == null) return null;
     return base.VisitCompilationUnitSnippet((CompilationUnitSnippet)snippet.Clone());
 }
コード例 #3
0
ファイル: main.cs プロジェクト: hesam/SketchSharp
 void ConstructCompilationUnit(){
   CompilationUnitSnippet cu = new CompilationUnitSnippet();
   this.compilationUnit = cu;
   this.compilation.CompilationUnits.Add(cu);
   cu.Compilation = this.compilation;
   cu.Name = new Identifier(this.inputLine.Substring(5));
   string snippetText = this.ReadString();
   cu.SourceContext.Document = this.currentDocument = this.compiler.CreateDocument(cu.Name.ToString(), 1, snippetText);
   cu.SourceContext.EndPos = snippetText.Length;
   cu.ParserFactory = new Microsoft.SpecSharp.ParserFactory();
 }
コード例 #4
0
ファイル: Compiler.cs プロジェクト: hesam/SketchSharp
    public override CompilationUnitSnippet CreateCompilationUnitSnippet(string fileName, int lineNumber, DocumentText text, Compilation compilation){
      if (fileName == null) return null;
      SpecSharpCompilerOptions options = compilation == null ? null : (compilation.CompilerParameters as SpecSharpCompilerOptions);
      if (options != null && options.Compatibility)
        return base.CreateCompilationUnitSnippet(fileName, lineNumber, text, compilation);
#if Xaml
      if (this.CompileAsXaml || string.Compare(Path.GetExtension(fileName), ".xaml", true, CultureInfo.InvariantCulture) == 0){
        Document doc = Microsoft.XamlCompiler.Compiler.CreateXamlDocument(fileName, 1, text);
        CompilationUnitSnippet cu = new CompilationUnitSnippet();
        cu.Name = Identifier.For(doc.Name);
        cu.SourceContext = new SourceContext(doc);
        cu.ParserFactory = new XamlParserFactory();
        cu.Compilation = compilation;
        return cu;
      }else
#endif
        return base.CreateCompilationUnitSnippet(fileName, lineNumber, text, compilation);
    }
コード例 #5
0
 public EventingVisitor(Action<CompilationUnitSnippet> visitCompilationUnitSnippet) { VisitedCompilationUnitSnippet += visitCompilationUnitSnippet; } public event Action<CompilationUnitSnippet> VisitedCompilationUnitSnippet; public override CompilationUnit VisitCompilationUnitSnippet(CompilationUnitSnippet snippet) { if (VisitedCompilationUnitSnippet != null) VisitedCompilationUnitSnippet(snippet); return base.VisitCompilationUnitSnippet(snippet); }
コード例 #6
0
ファイル: Parser.cs プロジェクト: hesam/SketchSharp
 public override CompilationUnitSnippet VisitCompilationUnitSnippet(CompilationUnitSnippet snippet){
   System.Compiler.Parser p = this.DefaultCompiler.CreateParser(snippet.SourceContext.Document, this.ErrorNodes);
   p.ParseCompilationUnit(snippet);
   return null;
 }