public override void Compile(CompilerBase state) { mRow.Compile(state); mCol.Compile(state); Value.Compile(state); state.InsertARRAYWRITE(Name); }
public override void Compile(CompilerBase state) { var cid = Guid.NewGuid(); var end = $"{cid}-function-end"; state.InsertJMP(end); state.FunctionDefine(Name, Parameters.Length, 0); state.EnterFunction(Name); state.InsertLabel($"<{Name}>"); var iadstk = state.InsertALLOCDSTK(); foreach (var p in Parameters) { state.VariableDefine(p); } foreach (var p in Parameters) { state.InsertSD(p); } mBlockStatement.Compile(state); state.InsertLC(new BooleanValue(false)); state.InsertRET(); iadstk.Size = state.CurrentScopeVariableCount; state.ExitFunction(); state.InsertLabel(end); }
public NatashaCSharpEngine(string assemblyName) { Syntax = SyntaxComponent.GetSyntax(); Compiler = CompilerComponent.GetCompiler(); Compiler.AssemblyName = assemblyName; Compiler.CompileFailedEvent += NatashaEngine_CompileFailedHandler; }
public override void Compile(CompilerBase state) { foreach (var s in mStatements) { s.Compile(state); } }
public override void Compile(CompilerBase state) { Row.Compile(state); Col.Compile(state); state.InsertLC(Value); state.InsertARRAYMAKE(); }
public override void Compile(CompilerBase state) { var cid = Guid.NewGuid(); var beginLabel = $"{cid}-begin"; var endLabel = $"{cid}-end"; var indexName = string.IsNullOrEmpty(IndexName)?$"<{cid}-index>": IndexName; state.EnterLoop(beginLabel, endLabel); state.VariableDefine(indexName); state.InsertLC(new IntegerValue(0)); state.InsertSD(indexName); state.InsertLabel(beginLabel); state.InsertLD(indexName); mCount.Compile(state); state.InsertLT(); state.InsertJMPN(endLabel); mLoopBlock.Compile(state); state.InsertLD(indexName); state.InsertLC(new IntegerValue(1)); state.InsertADD(); state.InsertSD(indexName); state.InsertJMP(beginLabel); state.InsertLabel(endLabel); state.ExitLoop(); }
public override void Compile(CompilerBase state) { foreach (var p in mParameters.Reverse()) { p.Compile(state); } state.InsertCALL(Name, mParameters.Length); }
public NatashaCSharpEngine(string name) { Syntax = SyntaxManagement.GetSyntax(); Compiler = CompilerManagement.GetCompiler(); Compiler.AssemblyName = name; Compiler.StreamCompileFailedHandler += NatashaEngine_StreamCompileFailedHandler; Compiler.FileCompileFailedHandler += NatashaEngine_FileCompileFailedHandler;; }
public Resource(ManagedProjectBase project, FileInfo resourceSourceFile, string resourceSourceFileRelativePath, string dependentFile, SolutionTask solutionTask, GacCache gacCache) { _project = project; _resourceSourceFile = resourceSourceFile; _resourceSourceFileRelativePath = resourceSourceFileRelativePath; _dependentFile = dependentFile; _solutionTask = solutionTask; _culture = CompilerBase.GetResourceCulture(resourceSourceFile.FullName, dependentFile); }
public override void Compile(CompilerBase state) { if (mExpression != null) { mExpression.Compile(state); } else { state.InsertLC(new BooleanValue(false)); } state.InsertRET(); }
public void Compile(CompilerBase state) { state.EnterFunction("<Program>"); var iadstk = state.InsertALLOCDSTK(); foreach (var s in mStatements) { s.Compile(state); } state.InsertLC(new BooleanValue(false)); state.InsertRET(); iadstk.Size = state.CurrentScopeVariableCount; state.ExitFunction(); }
public override void Compile(CompilerBase state) { var cid = Guid.NewGuid(); var beginLabel = $"{cid}-begin"; var endLabel = $"{cid}-end"; state.EnterLoop(beginLabel, endLabel); state.InsertLabel(beginLabel); mConditional.Compile(state); state.InsertJMPN(endLabel); mLoopBlock.Compile(state); state.InsertJMP(beginLabel); state.InsertLabel(endLabel); state.ExitLoop(); }
public override void Compile(CompilerBase state) { var cid = Guid.NewGuid(); var falseLabel = $"{cid}-false"; var endLabel = $"{cid}-end"; mConditional.Compile(state); if (mFalseBlock != null) { state.InsertJMPN(falseLabel); } else { state.InsertJMPN(endLabel); } mTrueBlock.Compile(state); state.InsertJMP(endLabel); if (mFalseBlock != null) { state.InsertLabel(falseLabel); mFalseBlock.Compile(state); } state.InsertLabel(endLabel); }
public override void Compile(CompilerBase state) { mRow.Compile(state); mCol.Compile(state); state.InsertARRAYREAD(Name); }
public abstract void Compile(CompilerBase state);
public override void Compile(CompilerBase state) { state.InsertLC(Value); }
public override void Compile(CompilerBase state) { state.InsertLD(Name); }
public override void Compile(CompilerBase state) { mExpression1.Compile(state); mExpression2.Compile(state); state.InsertOR(); }
public override void Compile(CompilerBase state) { state.VariableDefine(Name); Value.Compile(state); state.InsertSD(Name); }
public override void Compile(CompilerBase state) { Value.Compile(state); state.InsertSD(Name); }
public override void Compile(CompilerBase state) { var endLabel = state.CurrentLoopEndLabel; state.InsertJMP(endLabel); }