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

            return(this.Read(ctx));
        }
Esempio n. 2
0
 internal Runtime(VirtualMachine vm, XzaarAssembly asm, RuntimeSettings settings)
 {
     this.vm       = vm;
     this.asm      = asm;
     this.settings = settings ?? RuntimeSettings.Default;
     this.Init();
 }
Esempio 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;
        }
Esempio n. 4
0
 public static string AssemblyCode(this XzaarAssembly tree)
 {
     return(XzaarScriptDisassembler.Disassemble(tree));
 }
Esempio n. 5
0
 public static XzaarRuntime Load(this XzaarAssembly asm)
 {
     return(XzaarVirtualMachine.Load(asm));
 }
Esempio n. 6
0
 public AssemblyWriterContext(XzaarAssembly assembly, string filename)
 {
     this.Assembly = assembly;
     this.Filename = filename;
 }
Esempio n. 7
0
 public static Runtime Debug(XzaarAssembly asm, RuntimeSettings settings)
 {
     return(new VirtualMachine(asm).RunImpl(RuntimeStepType.StepByStep, settings));
 }
Esempio n. 8
0
 public static Runtime Load(XzaarAssembly asm, RuntimeSettings settings)
 {
     return(new VirtualMachine(asm).CreateRuntimeInstance(settings));
 }
Esempio n. 9
0
 public static Runtime Run(XzaarAssembly asm, RuntimeSettings settings)
 {
     return(new VirtualMachine(asm).RunImpl(RuntimeStepType.Complete, settings));
 }
Esempio n. 10
0
 public static Runtime Load(this XzaarAssembly asm, RuntimeSettings settings)
 {
     return(VirtualMachine.Load(asm, settings));
 }
Esempio n. 11
0
 public VirtualMachine(XzaarAssembly asm)
 {
     this.asm         = asm;
     this.interpreter = new VirtualMachineInstructionInterpreter(this);
 }
Esempio n. 12
0
 public static Runtime Run(this XzaarAssembly asm)
 {
     return(VirtualMachine.Run(asm));
 }
Esempio n. 13
0
        public static void WriteToFile(XzaarAssembly xzaarAssembly, string filename)
        {
            var writer = new AssemblyWriter();

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