public List<AssociativeNode> GetDeltaASTList(GraphSyncData syncData) { csData = new ChangeSetData(); List<AssociativeNode> finalDeltaAstList = new List<AssociativeNode>(); finalDeltaAstList.AddRange(GetDeltaAstListDeleted(syncData.DeletedSubtrees)); finalDeltaAstList.AddRange(GetDeltaAstListAdded(syncData.AddedSubtrees)); finalDeltaAstList.AddRange(GetDeltaAstListModified(syncData.ModifiedSubtrees)); csData.ContainsDeltaAST = finalDeltaAstList.Count > 0; return finalDeltaAstList; }
private void ApplyChangeSetModified(ChangeSetData changeSet) { ClearModifiedNestedBlocks(changeSet.ModifiedNestedLangBlock); DeactivateGraphnodes(changeSet.RemovedBinaryNodesFromModification); // Set new value for modified ASTs SetValueForModifiedNodes(changeSet.ModifiedNodesForRuntimeSetValue); // Undefine a function that was removed UndefineFunctions(changeSet.RemovedFunctionDefNodesFromModification); // Mark all graphnodes dependent on the removed function as dirty ProtoCore.AssociativeEngine.Utils.MarkGraphNodesDirtyFromFunctionRedef(runtimeCore, changeSet.RemovedFunctionDefNodesFromModification); // Mark all graphnodes dependent on the modified functions as dirty ProtoCore.AssociativeEngine.Utils.MarkGraphNodesDirtyFromFunctionRedef(runtimeCore, changeSet.ModifiedFunctions); }
private void ApplyChangeSetForceExecute(ChangeSetData changeSet) { // Check if there are nodes to force execute if (changeSet.ForceExecuteASTList.Count > 0) { // Mark all graphnodes dirty which are associated with the force exec ASTs ProtoCore.AssociativeGraph.GraphNode firstDirtyNode = ProtoCore.AssociativeEngine.Utils.MarkGraphNodesDirtyAtGlobalScope (runtimeCore, changeSet.ForceExecuteASTList); Validity.Assert(firstDirtyNode != null); // If the only ASTs to execute are force exec, then set the entrypoint here. // Otherwise the entrypoint is set by the code generator when the new ASTs are compiled if (!changeSet.ContainsDeltaAST) { runtimeCore.SetStartPC(firstDirtyNode.updateBlock.startpc); } } }
public void Apply(ProtoCore.Core core, RuntimeCore runtimeCore, ChangeSetData changeSet) { Validity.Assert(null != changeSet); this.core = core; this.runtimeCore = runtimeCore; ApplyChangeSetDeleted(changeSet); ApplyChangeSetModified(changeSet); ApplyChangeSetForceExecute(changeSet); }
private void ApplyChangeSetDeleted(ChangeSetData changeSet) { DeactivateGraphnodes(changeSet.DeletedBinaryExprASTNodes); UndefineFunctions(changeSet.DeletedFunctionDefASTNodes); }
public List<AssociativeNode> GetDeltaASTList(GraphSyncData syncData) { UpdateAstCache(syncData); csData = new ChangeSetData(); List<AssociativeNode> finalDeltaAstList = new List<AssociativeNode>(); finalDeltaAstList.AddRange(GetDeltaAstListDeleted(syncData.DeletedSubtrees)); finalDeltaAstList.AddRange(GetDeltaAstListAdded(syncData.AddedSubtrees)); finalDeltaAstList.AddRange(GetDeltaAstListModified(syncData.ModifiedSubtrees)); return finalDeltaAstList; }
private void ApplyChangeSetModified(ChangeSetData changeSet) { ClearModifiedNestedBlocks(changeSet.ModifiedNestedLangBlock); DeactivateGraphnodes(changeSet.RemovedBinaryNodesFromModification); UndefineFunctions(changeSet.RemovedFunctionDefNodesFromModification); // Mark all graphnodes dependent on the modified functions as dirty ProtoCore.AssociativeEngine.Utils.MarkGraphNodesDirtyFromFunctionRedef(core, changeSet.ModifiedFunctions); }
private void ApplyChangeSetForceExecute(ChangeSetData changeSet) { // Mark all graphnodes dirty which are associated with the force exec ASTs ProtoCore.AssociativeEngine.Utils.MarkGraphNodesDirty(core, changeSet.ForceExecuteASTList); }
private void ApplyChangeSetDeleted(ChangeSetData changeSet) { MarkGraphNodesInactive(changeSet.DeletedBinaryExprASTNodes); UndefineFunctions(changeSet.DeletedFunctionDefASTNodes); }
public List<AssociativeNode> GetDeltaASTList(GraphSyncData syncData) { csData = new ChangeSetData(); var finalDeltaAstList = new List<AssociativeNode>(); var deletedDeltaAsts = GetDeltaAstListDeleted(syncData.DeletedSubtrees); finalDeltaAstList.AddRange(deletedDeltaAsts); var addedDeltaAsts = GetDeltaAstListAdded(syncData.AddedSubtrees); finalDeltaAstList.AddRange(addedDeltaAsts); var modifiedDeltaAsts = GetDeltaAstListModified(syncData.ModifiedSubtrees); finalDeltaAstList.AddRange(modifiedDeltaAsts); csData.ContainsDeltaAST = finalDeltaAstList.Any(); return finalDeltaAstList; }
private void ApplyChangeSetDeleted(ChangeSetData changeSet) { DeactivateGraphnodes(changeSet.DeletedBinaryExprASTNodes); UndefineFunctions(changeSet.DeletedFunctionDefASTNodes); ProtoCore.AssociativeEngine.Utils.MarkGraphNodesDirtyFromFunctionRedef(runtimeCore, changeSet.DeletedFunctionDefASTNodes); }
public void Apply(ProtoCore.Core core, ChangeSetData changeSet) { Validity.Assert(null != changeSet); this.core = core; ApplyChangeSetDeleted(changeSet); ApplyChangeSetModified(changeSet); }