public CompilationUnit Parse(byte[] data) { var compilationUnit = new CompilationUnit(); _br = new BinaryReader(new MemoryStream(data)); while (_br.BaseStream.Position < _br.BaseStream.Length) { _opCode = _br.ReadByte(); try { var statement = ExecuteOpCode(); compilationUnit.AddStatement(statement); } catch (Exception e) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(e); Console.ResetColor(); return(compilationUnit); } } return(compilationUnit); }
public override string Visit(CompilationUnit node) { return(node.Statement.Accept(this)); }
public CompilationUnit Replace(CompilationUnit cu) { var visitor = new PushAstVisitor(); return(cu.Accept(visitor) as CompilationUnit); }
public CompilationUnit Replace(CompilationUnit cu) { var newCu = cu.Accept(visitor); return((CompilationUnit)newCu); }
public override IAstNode Visit(CompilationUnit node) { return(new CompilationUnit((BlockStatement)node.Statement.Accept(this))); }