public static StackValue ConcatString(StackValue op1, StackValue op2, ProtoCore.Core core) { var v1 = op1.IsString ? ArrayUtils.GetValues(op1, core) : new StackValue[] { op1 }; var v2 = op2.IsString ? ArrayUtils.GetValues(op2, core) : new StackValue[] { op2 }; StackValue tmp = core.Rmem.BuildArray(v1.Concat(v2).ToArray()); return StackValue.BuildString(tmp.opdata); }
public static ProtoCore.AST.AssociativeAST.IdentifierNode BuildAssocIdentifier(ProtoLanguage.CompileStateTracker compileState, string name, ProtoCore.PrimitiveType type = ProtoCore.PrimitiveType.kTypeVar) { var ident = new ProtoCore.AST.AssociativeAST.IdentifierNode(); ident.Name = ident.Value = name; ident.datatype = TypeSystem.BuildPrimitiveTypeObject(type, false); return ident; }
public static ProtoCore.AST.AssociativeAST.IdentifierNode BuildAssocIdentifier(Core core, string name, ProtoCore.PrimitiveType type = ProtoCore.PrimitiveType.kTypeVar) { var ident = new ProtoCore.AST.AssociativeAST.IdentifierNode(); ident.Name = ident.Value = name; ident.datatype = TypeSystem.BuildPrimitiveTypeObject(type, 0); return ident; }
private bool Compile(string code, ProtoCore.Core core, ProtoCore.CompileTime.Context context) { bool buildSucceeded = false; try { // No More HashAngleReplace for unified parser (Fuqiang) //String strSource = ProtoCore.Utils.LexerUtils.HashAngleReplace(code); //defining the global Assoc block that wraps the entire .ds source file ProtoCore.LanguageCodeBlock globalBlock = new ProtoCore.LanguageCodeBlock(); globalBlock.Language = ProtoCore.Language.Associative; globalBlock.Code = code; //passing the global Assoc wrapper block to the compiler ProtoCore.Language id = globalBlock.Language; int blockId = Constants.kInvalidIndex; core.Compilers[id].Compile(out blockId, null, globalBlock, context, EventSink); core.BuildStatus.ReportBuildResult(); buildSucceeded = core.BuildStatus.BuildSucceeded; } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return buildSucceeded; }
public ImperativeCodeGen(ProtoLanguage.CompileStateTracker compileState, ProtoCore.DSASM.CodeBlock parentBlock = null) : base(compileState, parentBlock) { // dumpbytecode is optionally enabled // astNodes = new List<ImperativeNode>(); SetCompileOptions(); // Create a new symboltable for this block // Set the new symbol table's parent // Set the new table as a child of the parent table codeBlock = new ProtoCore.DSASM.CodeBlock( ProtoCore.DSASM.CodeBlockType.kLanguage, ProtoCore.Language.kImperative, compileState.CodeBlockIndex, new ProtoCore.DSASM.SymbolTable("imperative lang block", compileState.RuntimeTableIndex), new ProtoCore.DSASM.ProcedureTable(compileState.RuntimeTableIndex)); ++compileState.CodeBlockIndex; ++compileState.RuntimeTableIndex; compileState.CodeBlockList.Add(codeBlock); if (null != parentBlock) { // This is a nested block parentBlock.children.Add(codeBlock); codeBlock.parent = parentBlock; } blockScope = 0; }
/// <summary> /// Create a mirror for a given executive /// </summary> /// <param name="exec"></param> public ExecutionMirror(ProtoCore.DSASM.Executive exec, ProtoCore.RuntimeCore coreObj) { Validity.Assert(exec != null, "Can't mirror a null executive"); runtimeCore = coreObj; MirrorTarget = exec; }
public ExecutionMirror LoadAndExecute(string fileName, ProtoCore.Core core, bool isTest = true) { string codeContent = string.Empty; try { using (System.IO.StreamReader reader = new System.IO.StreamReader(fileName, Encoding.UTF8, true)) { codeContent = reader.ReadToEnd(); } } catch (System.IO.IOException) { throw new FatalError("Cannot open file " + fileName); } //Start the timer core.StartTimer(); core.CurrentDSFileName = ProtoCore.Utils.FileUtils.GetFullPathName(fileName); core.Options.RootModulePathName = core.CurrentDSFileName; Execute(codeContent, core); if (!core.Options.CompileToLib && (null != core.CurrentExecutive)) return new ExecutionMirror(core.CurrentExecutive.CurrentDSASMExec, core); return null; }
public override bool Compile(out int blockId, ProtoCore.DSASM.CodeBlock parentBlock, ProtoCore.LanguageCodeBlock langBlock, ProtoCore.CompileTime.Context callContext, ProtoCore.DebugServices.EventSink sink, ProtoCore.AST.Node codeBlockNode, ProtoCore.AssociativeGraph.GraphNode graphNode = null) { Validity.Assert(langBlock != null); blockId = ProtoCore.DSASM.Constants.kInvalidIndex; bool buildSucceeded = false; bool isLanguageSignValid = isLanguageSignValid = core.Langverify.Verify(langBlock); if (isLanguageSignValid) { try { ProtoImperative.CodeGen codegen = new ProtoImperative.CodeGen(core, callContext, parentBlock); codegen.context = callContext; codegen.codeBlock.EventSink = sink; blockId = codegen.Emit(codeBlockNode as ProtoCore.AST.ImperativeAST.CodeBlockNode, graphNode); } catch (ProtoCore.BuildHaltException) { } buildSucceeded = core.BuildStatus.BuildSucceeded; } return buildSucceeded; }
public CoreCodeGen(ProtoLanguage.CompileStateTracker compileState, ProtoCore.DSASM.CodeBlock parentBlock = null) { Debug.Assert(compileState != null); this.compileState = compileState; argOffset = 0; globalClassIndex = compileState.ClassIndex; if (null == CoreCodeGen.CodeRangeTable) CoreCodeGen.CodeRangeTable = new CodeRangeTable(); if (null == CoreCodeGen.IdentLocation) CoreCodeGen.IdentLocation = new IdentLocationTable(); if (null == CoreCodeGen.ImportTable) CoreCodeGen.ImportTable = new ImportTable(); context = new ProtoCore.CompileTime.Context(); targetLangBlock = ProtoCore.DSASM.Constants.kInvalidIndex; enforceTypeCheck = true; localProcedure = compileState.ProcNode; globalProcIndex = null != localProcedure ? localProcedure.procId : ProtoCore.DSASM.Constants.kGlobalScope; tryLevel = 0; }
public override bool Compile(ProtoLanguage.CompileStateTracker compileState, out int blockId, ProtoCore.DSASM.CodeBlock parentBlock, ProtoCore.LanguageCodeBlock langBlock, ProtoCore.CompileTime.Context callContext, ProtoCore.DebugServices.EventSink sink, ProtoCore.AST.Node codeBlockNode, ProtoCore.AssociativeGraph.GraphNode graphNode = null) { Debug.Assert(langBlock != null); blockId = ProtoCore.DSASM.Constants.kInvalidIndex; bool buildSucceeded = false; bool isLanguageSignValid = isLanguageSignValid = compileState.Langverify.Verify(langBlock); if (isLanguageSignValid) { try { ProtoImperative.CodeGen codegen = new ProtoImperative.CodeGen(compileState, parentBlock); codegen.context = callContext; codegen.codeBlock.EventSink = sink; blockId = codegen.Emit(codeBlockNode as ProtoCore.AST.ImperativeAST.CodeBlockNode, graphNode); } catch (ProtoCore.BuildHaltException e) { #if DEBUG //core.BuildStatus.LogSemanticError(e.errorMsg); #endif } int errors = 0; int warnings = 0; buildSucceeded = compileState.BuildStatus.GetBuildResult(out errors, out warnings); } return buildSucceeded; }
public BinExprNode(ProtoCore.DSASM.Operator optr, Node leftNode, Node rightNode) : base(leftNode.Name, leftNode.Guid) { this.Optr = optr; this.left = leftNode; this.right = rightNode; }
public bool Compile(string code, ProtoCore.Core core, out int blockId) { bool buildSucceeded = false; blockId = ProtoCore.DSASM.Constants.kInvalidIndex; try { // No More HashAngleReplace for unified parser (Fuqiang) //String strSource = ProtoCore.Utils.LexerUtils.HashAngleReplace(code); System.IO.MemoryStream sourceMemStream = new System.IO.MemoryStream(System.Text.Encoding.Default.GetBytes(code)); ProtoScript.GenerateScript gs = new ProtoScript.GenerateScript(core); core.Script = gs.preParseFromStream(sourceMemStream); foreach (ProtoCore.LanguageCodeBlock codeblock in core.Script.codeblockList) { ProtoCore.CompileTime.Context context = new ProtoCore.CompileTime.Context(); ProtoCore.Language id = codeblock.language; core.Executives[id].Compile(out blockId, null, codeblock, context, EventSink); } core.BuildStatus.ReportBuildResult(); buildSucceeded = core.BuildStatus.BuildSucceeded; } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return buildSucceeded; }
private ExecutionMirror Execute(string code, ProtoCore.Core core, bool isTest = true) { int blockId = ProtoCore.DSASM.Constants.kInvalidIndex; bool succeeded = Compile(code, core, out blockId); if (succeeded) { core.GenerateExecutable(); core.Rmem.PushFrameForGlobals(core.GlobOffset); core.RunningBlock = blockId; Execute(core); if (!isTest) { core.Heap.Free(); } if (isTest && !core.Options.CompileToLib) return new ExecutionMirror(core.CurrentExecutive.CurrentDSASMExec, core); else return null; } //else // throw new ProtoCore.Exceptions.CompileErrorsOccured(); //if (isTest && !core.Options.CompileToLib) // return new ExecutionMirror(core.CurrentExecutive.CurrentDSASMExec, core); //else return null; }
/// <summary> /// This consutructor is for instantiating a Runtime mirror object where we already have the mirrorData /// </summary> /// <param name="mirrorData"></param> /// <param name="core"></param> public RuntimeMirror(MirrorData mirrorData, ProtoCore.Core core, ProtoCore.Core staticCore = null) : base(core, staticCore) { Validity.Assert(this.core != null); TargetExecutive = core.CurrentExecutive.CurrentDSASMExec; deprecateThisMirror = new DSASM.Mirror.ExecutionMirror(TargetExecutive, core); this.mirrorData = mirrorData; }
public DebugRunner(ProtoCore.Core core) { this.core = core; this.core.Options.IDEDebugMode = true; RegisteredBreakpoints = new List<Breakpoint>(); executionsuspended = false; }
protected ProtoCore.DSASM.AddressType GetOpType(ProtoCore.PrimitiveType type) { ProtoCore.DSASM.AddressType optype = ProtoCore.DSASM.AddressType.Int; // Data coercion for the prototype // The JIL executive handles int primitives if (ProtoCore.PrimitiveType.kTypeInt == type || ProtoCore.PrimitiveType.kTypeBool == type || ProtoCore.PrimitiveType.kTypeChar == type || ProtoCore.PrimitiveType.kTypeString == type) { optype = ProtoCore.DSASM.AddressType.Int; } else if (ProtoCore.PrimitiveType.kTypeDouble == type) { optype = ProtoCore.DSASM.AddressType.Double; } else if (ProtoCore.PrimitiveType.kTypeVar == type) { optype = ProtoCore.DSASM.AddressType.VarIndex; } else if (ProtoCore.PrimitiveType.kTypeReturn == type) { optype = ProtoCore.DSASM.AddressType.Register; } else { Debug.Assert(false); } return optype; }
public ProtoLanguage.CompileStateTracker Compile(ProtoCore.CompileTime.Context context, ProtoCore.Core core, out int blockId) { ProtoLanguage.CompileStateTracker compileState = ProtoScript.CompilerUtils.BuildDefaultCompilerState(core.Options.IsDeltaExecution); core.ExecMode = ProtoCore.DSASM.InterpreterMode.kNormal; blockId = ProtoCore.DSASM.Constants.kInvalidIndex; try { //defining the global Assoc block that wraps the entire .ds source file ProtoCore.LanguageCodeBlock globalBlock = new ProtoCore.LanguageCodeBlock(); globalBlock.language = ProtoCore.Language.kAssociative; Validity.Assert(null != context.SourceCode && String.Empty != context.SourceCode); globalBlock.body = context.SourceCode; //the wrapper block can be given a unique id to identify it as the global scope globalBlock.id = ProtoCore.LanguageCodeBlock.OUTERMOST_BLOCK_ID; //passing the global Assoc wrapper block to the compiler ProtoCore.Language id = globalBlock.language; compileState.Executives[id].Compile(compileState, out blockId, null, globalBlock, context, EventSink); compileState.BuildStatus.ReportBuildResult(); int errors = 0; int warnings = 0; compileState.compileSucceeded = compileState.BuildStatus.GetBuildResult(out errors, out warnings); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return compileState; }
public void Execute(string code, ProtoCore.Core core) { int blockId = ProtoCore.DSASM.Constants.kInvalidIndex; ProtoLanguage.CompileStateTracker compileState = Compile(code, out blockId); Validity.Assert(null != compileState); if (compileState.compileSucceeded) { // This is the boundary between compilestate and runtime core // Generate the executable compileState.GenerateExecutable(); // Get the executable from the compileState core.DSExecutable = compileState.DSExecutable; // Setup the initial size of the global stack core.Rmem.PushGlobFrame(compileState.GlobOffset); core.RunningBlock = blockId; Execute(core); core.Heap.Free(); //core.GenerateExecutable(); //core.Rmem.PushGlobFrame(core.GlobOffset); //core.RunningBlock = blockId; //Execute(core); //core.Heap.Free(); } else { throw new ProtoCore.Exceptions.CompileErrorsOccured(); } }
/// <summary> /// Finds all graphnodes associated with each AST and marks them dirty /// </summary> /// <param name="nodeList"></param> /// <summary> /// <returns></returns> public static void MarkGraphNodesDirty(ProtoCore.Core core, IEnumerable<ProtoCore.AST.AssociativeAST.AssociativeNode> nodeList) { if (nodeList == null) return; bool setEntryPoint = false; foreach (var node in nodeList) { var bNode = node as ProtoCore.AST.AssociativeAST.BinaryExpressionNode; if (bNode == null) { continue; } foreach (var gnode in core.DSExecutable.instrStreamList[0].dependencyGraph.GraphList) { if (gnode.isActive && gnode.OriginalAstID == bNode.OriginalAstID) { if (!setEntryPoint) { setEntryPoint = true; core.SetNewEntryPoint(gnode.updateBlock.startpc); } gnode.isDirty = true; gnode.isActive = true; } } } }
public bool Compile(string code, ProtoCore.Core core, out int blockId) { bool buildSucceeded = false; core.ExecMode = ProtoCore.DSASM.InterpreterMode.kNormal; blockId = ProtoCore.DSASM.Constants.kInvalidIndex; try { // No More HashAngleReplace for unified parser (Fuqiang) //String strSource = ProtoCore.Utils.LexerUtils.HashAngleReplace(code); //defining the global Assoc block that wraps the entire .ds source file ProtoCore.LanguageCodeBlock globalBlock = new ProtoCore.LanguageCodeBlock(); globalBlock.language = ProtoCore.Language.kAssociative; globalBlock.body = code; //the wrapper block can be given a unique id to identify it as the global scope globalBlock.id = ProtoCore.LanguageCodeBlock.OUTERMOST_BLOCK_ID; //passing the global Assoc wrapper block to the compiler ProtoCore.CompileTime.Context context = new ProtoCore.CompileTime.Context(); ProtoCore.Language id = globalBlock.language; core.Executives[id].Compile(out blockId, null, globalBlock, context, EventSink); core.BuildStatus.ReportBuildResult(); buildSucceeded = core.BuildStatus.BuildSucceeded; } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return buildSucceeded; }
public static void MinTest(ProtoCore.Core core) { ProtoAssociative.DependencyPass.GraphOptimiser optimiser = new ProtoAssociative.DependencyPass.GraphOptimiser(); ProtoAssociative.DependencyPass.AST ast = new ProtoAssociative.DependencyPass.AST(); ProtoAssociative.DependencyPass.DependencyTracker optimisedTracker = ast.GetDemoTracker2(core); optimiser.Execute(optimisedTracker); }
public CodeGen(Core coreObj, ProtoCore.CompileTime.Context callContext, ProtoCore.DSASM.CodeBlock parentBlock = null) : base(coreObj, parentBlock) { context = callContext; codeBlock = BuildNewCodeBlock(); if (null == parentBlock) { // This is a top level block core.CodeBlockList.Add(codeBlock); } else { // This is a nested block parentBlock.children.Add(codeBlock); codeBlock.parent = parentBlock; } blockScope = 0; // Bouncing to this language codeblock from a function should immediatlet se the first instruction as the entry point if (ProtoCore.DSASM.Constants.kGlobalScope != globalProcIndex) { isEntrySet = true; codeBlock.instrStream.entrypoint = 0; } backpatchMap = new BackpatchMap(); nodeBuilder = new NodeBuilder(core); }
public static StackValue ConcatString(StackValue op1, StackValue op2, ProtoCore.Runtime.RuntimeMemory rmem) { StackValue[] v1 = (AddressType.String == op1.optype) ? rmem.GetArrayElements(op1) : new StackValue[] { op1 }; StackValue[] v2 = (AddressType.String == op2.optype) ? rmem.GetArrayElements(op2) : new StackValue[] { op2 }; StackValue tmp = rmem.BuildArray(v1.Concat(v2).ToArray()); return StackUtils.BuildString(tmp.opdata); }
/// <summary> /// </summary> /// <param name="codeBlock"></param> /// <param name="inferedType"></param> /// <param name="subPass"></param> private void EmitCodeBlock( List<ImperativeNode> codeBlock, ref ProtoCore.Type inferedType, bool isBooleanOp = false, ProtoCore.AssociativeGraph.GraphNode graphNode = null) { foreach (ImperativeNode bodyNode in codeBlock) { inferedType = new ProtoCore.Type(); inferedType.UID = (int)PrimitiveType.Var; if (bodyNode is LanguageBlockNode) { BinaryExpressionNode langBlockNode = new BinaryExpressionNode(); langBlockNode.LeftNode = nodeBuilder.BuildIdentfier(core.GenerateTempLangageVar()); langBlockNode.Optr = ProtoCore.DSASM.Operator.assign; langBlockNode.RightNode = bodyNode; DfsTraverse(langBlockNode, ref inferedType, isBooleanOp, graphNode); } else { DfsTraverse(bodyNode, ref inferedType, isBooleanOp, graphNode); } } }
/// <summary> /// For a given list of formal parameters, get the function end points that resolve /// </summary> /// <param name="context"></param> /// <param name="formalParams"></param> /// <param name="replicationInstructions"></param> /// <param name="stackFrame"></param> /// <param name="core"></param> /// <param name="unresolvable">The number of argument sets that couldn't be resolved</param> /// <returns></returns> public Dictionary<FunctionEndPoint, int> GetExactMatchStatistics( ProtoCore.Runtime.Context context, List<List<StackValue>> reducedFormalParams, StackFrame stackFrame, Core core, out int unresolvable) { List<ReplicationInstruction> replicationInstructions = new List<ReplicationInstruction>(); //We've already done the reduction before calling this unresolvable = 0; Dictionary<FunctionEndPoint, int> ret = new Dictionary<FunctionEndPoint, int>(); foreach (List<StackValue> formalParamSet in reducedFormalParams) { List<FunctionEndPoint> feps = GetExactTypeMatches(context, formalParamSet, replicationInstructions, stackFrame, core); if (feps.Count == 0) { //We have an arugment set that couldn't be resolved unresolvable++; } foreach (FunctionEndPoint fep in feps) { if (ret.ContainsKey(fep)) ret[fep]++; else ret.Add(fep, 1); } } return ret; }
private void UpdateType(string ident, int funcIndex, ProtoCore.Type dataType) { int symbolindex = ProtoCore.DSASM.Constants.kInvalidIndex; ProtoCore.DSASM.SymbolNode node = null; if ((int)ProtoCore.DSASM.Constants.kInvalidIndex != globalClassIndex) { symbolindex = compileState.ClassTable.ClassNodes[globalClassIndex].symbols.IndexOf(ident, globalClassIndex, funcIndex); if ((int)ProtoCore.DSASM.Constants.kInvalidIndex != symbolindex) { node = compileState.ClassTable.ClassNodes[globalClassIndex].symbols.symbolList[symbolindex]; } } else { ProtoCore.DSASM.CodeBlock searchBlock = codeBlock; symbolindex = searchBlock.symbolTable.IndexOf(ident, globalClassIndex, funcIndex); while (ProtoCore.DSASM.Constants.kInvalidIndex == symbolindex) { ProtoCore.DSASM.CodeBlock parentBlock = searchBlock.parent; if (null == parentBlock) return; searchBlock = parentBlock; symbolindex = searchBlock.symbolTable.IndexOf(ident, globalClassIndex, funcIndex); } node = searchBlock.symbolTable.symbolList[symbolindex]; } if (node != null) node.datatype = dataType; }
public static StackValue Repack(Obj obj, ProtoCore.DSASM.Heap heap) { if (obj.Type.IsIndexable) { //Unpack each of the elements DsasmArray arr = (DsasmArray)obj.Payload; StackValue[] sv = new StackValue[arr.members.Length]; //recurse over the array for (int i = 0; i < sv.Length; i++) sv[i] = Repack(arr.members[i], heap); int size = sv.Length; lock (heap.cslock) { int ptr = heap.Allocate(size); ++heap.Heaplist[ptr].Refcount; for (int n = size - 1; n >= 0; --n) { heap.Heaplist[ptr].Stack[n] = sv[n]; } StackValue overallSv = StackUtils.BuildArrayPointer(ptr); return overallSv; } } // For non-arrays, there is nothing to repack so just return the original stackvalue return obj.DsasmValue; }
public static string ExtractCommentStatementFromCode(string code, ProtoCore.AST.AssociativeAST.CommentNode cnode) { string[] lines = code.Split('\n'); int lastLine = lines.Length; int lastCol = lines[lastLine - 1].Length; string stmnt = ExtractStatementHelper(code, cnode.line, cnode.col, lastLine, lastCol); int commentLength = cnode.Value.Length; string comment = ""; if (stmnt.Length > commentLength) { comment = stmnt.Remove(commentLength); for (int i = commentLength; i < stmnt.Length; i++) { char ch = stmnt[i]; if (char.IsWhiteSpace(ch)) comment += ch.ToString(); else break; } } else comment = stmnt; return comment; }
private static void InsertBinaryOperationMethod(Core core, ProtoCore.AST.Node root, Operator op, PrimitiveType r, PrimitiveType op1, PrimitiveType op2, int retRank = 0, int op1rank = 0, int op2rank = 0) { ProtoCore.AST.AssociativeAST.FunctionDefinitionNode funcDefNode = new ProtoCore.AST.AssociativeAST.FunctionDefinitionNode(); funcDefNode.access = ProtoCore.DSASM.AccessSpecifier.kPublic; funcDefNode.IsAssocOperator = true; funcDefNode.IsBuiltIn = true; funcDefNode.Name = Op.GetOpFunction(op); funcDefNode.ReturnType = new ProtoCore.Type() { Name = core.TypeSystem.GetType((int)r), UID = (int)r, rank = retRank}; ProtoCore.AST.AssociativeAST.ArgumentSignatureNode args = new ProtoCore.AST.AssociativeAST.ArgumentSignatureNode(); args.AddArgument(new ProtoCore.AST.AssociativeAST.VarDeclNode() { memregion = ProtoCore.DSASM.MemoryRegion.kMemStack, access = ProtoCore.DSASM.AccessSpecifier.kPublic, NameNode = BuildAssocIdentifier(core, ProtoCore.DSASM.Constants.kLHS), ArgumentType = new ProtoCore.Type { Name = core.TypeSystem.GetType((int)op1), UID = (int)op1, rank = op1rank} }); args.AddArgument(new ProtoCore.AST.AssociativeAST.VarDeclNode() { memregion = ProtoCore.DSASM.MemoryRegion.kMemStack, access = ProtoCore.DSASM.AccessSpecifier.kPublic, NameNode = BuildAssocIdentifier(core, ProtoCore.DSASM.Constants.kRHS), ArgumentType = new ProtoCore.Type { Name = core.TypeSystem.GetType((int)op2), UID = (int)op2, rank = op2rank} }); funcDefNode.Signature = args; ProtoCore.AST.AssociativeAST.CodeBlockNode body = new ProtoCore.AST.AssociativeAST.CodeBlockNode(); ProtoCore.AST.AssociativeAST.IdentifierNode _return = BuildAssocIdentifier(core, ProtoCore.DSDefinitions.Keyword.Return, ProtoCore.PrimitiveType.kTypeReturn); ProtoCore.AST.AssociativeAST.IdentifierNode lhs = BuildAssocIdentifier(core, ProtoCore.DSASM.Constants.kLHS); ProtoCore.AST.AssociativeAST.IdentifierNode rhs = BuildAssocIdentifier(core, ProtoCore.DSASM.Constants.kRHS); body.Body.Add(new ProtoCore.AST.AssociativeAST.BinaryExpressionNode() { LeftNode = _return, Optr = ProtoCore.DSASM.Operator.assign, RightNode = new ProtoCore.AST.AssociativeAST.BinaryExpressionNode() { LeftNode = lhs, RightNode = rhs, Optr = op } }); funcDefNode.FunctionBody = body; (root as ProtoCore.AST.AssociativeAST.CodeBlockNode).Body.Add(funcDefNode); }
public void SetExprInterpreterProperties(int currentBlockID, ProtoCore.Runtime.RuntimeMemory memState, int watchScope, DebugProperties debugProps) { CurrentBlockId = currentBlockID; MemoryState = memState; WatchClassScope = watchScope; DebugProps = debugProps; }