Пример #1
0
 public CompilationUnit Replace(CompilationUnit cu)
 {
     var visitor = new JumpAstVisitor();
     cu.Accept(visitor);
     var jumps = visitor.Jumps.Where(AcceptJump).ToList();
     var newCu = cu.Accept(new JumpReplacer());
     newCu.Accept(new LabelInserter(jumps));
     return (CompilationUnit)newCu;
 }
Пример #2
0
 public CompilationUnit Replace(CompilationUnit cu)
 {
     var visitor = new JumpAstVisitor();
     cu.Accept(visitor);
     var jumps = visitor.Jumps.Where(jump => jump.JumpOffset < jump.StartOffset).OrderByDescending(jmp => jmp.JumpOffset).ThenByDescending(jmp => jmp.StartOffset).ToList();
     foreach (var jump in jumps)
     {
         cu = new CompilationUnit().AddStatements(ReplaceJump(jump, cu.Statement));
     }
     return cu;
 }
Пример #3
0
        public CompilationUnit Replace(CompilationUnit cu)
        {
            var newCu = cu.Accept(visitor);

            return((CompilationUnit)newCu);
        }
Пример #4
0
 public CompilationUnit Replace(CompilationUnit cu)
 {
     var newCu = cu.Accept(visitor);
     return (CompilationUnit)newCu;
 }