Ejemplo n.º 1
0
        private XzaarAssembly Read(byte[] binary)
        {
            var assembly = new XzaarAssembly();
            var ctx      = new AssemblyReaderContext(binary, assembly);

            return(this.Read(ctx));
        }
Ejemplo n.º 2
0
 internal Runtime(VirtualMachine vm, XzaarAssembly asm, RuntimeSettings settings)
 {
     this.vm       = vm;
     this.asm      = asm;
     this.settings = settings ?? RuntimeSettings.Default;
     this.Init();
 }
Ejemplo n.º 3
0
        // private int tempVariableCount;

        public ScriptCompilerContext(string assemblyName, XzaarExpression expressionTree)
        {
            MethodInstructions = new CompilerInstructionCollection(this);
            GlobalInstructions = new CompilerInstructionCollection(this);

            this.ExpressionTree  = expressionTree;
            this.KnownTypes      = new List <TypeReference>();
            this.Assembly        = XzaarAssembly.CreateAssembly(assemblyName);
            this.flowControl     = new FlowControlScope(null, -1);
            this.rootFlowControl = this.flowControl;
        }
Ejemplo n.º 4
0
 public static string AssemblyCode(this XzaarAssembly tree)
 {
     return(XzaarScriptDisassembler.Disassemble(tree));
 }
Ejemplo n.º 5
0
 public static XzaarRuntime Load(this XzaarAssembly asm)
 {
     return(XzaarVirtualMachine.Load(asm));
 }
Ejemplo n.º 6
0
 public AssemblyWriterContext(XzaarAssembly assembly, string filename)
 {
     this.Assembly = assembly;
     this.Filename = filename;
 }
Ejemplo n.º 7
0
 public static Runtime Debug(XzaarAssembly asm, RuntimeSettings settings)
 {
     return(new VirtualMachine(asm).RunImpl(RuntimeStepType.StepByStep, settings));
 }
Ejemplo n.º 8
0
 public static Runtime Load(XzaarAssembly asm, RuntimeSettings settings)
 {
     return(new VirtualMachine(asm).CreateRuntimeInstance(settings));
 }
Ejemplo n.º 9
0
 public static Runtime Run(XzaarAssembly asm, RuntimeSettings settings)
 {
     return(new VirtualMachine(asm).RunImpl(RuntimeStepType.Complete, settings));
 }
Ejemplo n.º 10
0
 public static Runtime Load(this XzaarAssembly asm, RuntimeSettings settings)
 {
     return(VirtualMachine.Load(asm, settings));
 }
Ejemplo n.º 11
0
 public VirtualMachine(XzaarAssembly asm)
 {
     this.asm         = asm;
     this.interpreter = new VirtualMachineInstructionInterpreter(this);
 }
Ejemplo n.º 12
0
 public static Runtime Run(this XzaarAssembly asm)
 {
     return(VirtualMachine.Run(asm));
 }
Ejemplo n.º 13
0
        public static void WriteToFile(XzaarAssembly xzaarAssembly, string filename)
        {
            var writer = new AssemblyWriter();

            writer.Write(new AssemblyWriterContext(xzaarAssembly, filename));
        }
Ejemplo n.º 14
0
 public AssemblyReaderContext(byte[] assemblyBytes, XzaarAssembly assembly)
 {
     this.AssemblyBytes = assemblyBytes;
     this.Assembly      = assembly;
     this.Reader        = new BinaryReader(new MemoryStream(this.AssemblyBytes));
 }
Ejemplo n.º 15
0
 public static string Disassemble(XzaarAssembly asm)
 {
     return(new XzaarScriptDisassembler(asm).Disassemble());
 }
Ejemplo n.º 16
0
 public XzaarScriptDisassembler(XzaarAssembly asm)
 {
     this.asm = asm;
 }