internal void AddCreator(Node upNode) { this.crtrs[new ReferenceCreator(upNode)] = true; }
public SwitchIndexOutOfRangeException(Node node) : base(node,"Switch index is out of range") { }
protected override void DispatchNode(Node node, object data) { if (node != null && node.needed == false) { node.needed = true; if (node is Block) { foreach (Node n in (node as Block).childArray) if (n is Leave) AddNextNodesToTasks(n, null); } else if (!(node is Leave)) AddNextNodesToTasks(node, null); } }
public LinkException(Node source, Node target, string msg) : base(msg) { this.source = source; this.target = target; }
public NodeException(Node node, string msg) : base(msg) { this.node = node; }
internal void removeChild(Node child) { childArray.Remove(child); }
public InvalidBranchTargetException(Node source, Node target) : base(source,target,"Invalid branch target") { }
protected internal static string FormatBranchTarget(Node target) { string result = "@"; if (target != null && target.Options.ContainsOption(BasicBlock.BASIC_BLOCK_OPTION)) { BasicBlock basicBlock = target.Options[BasicBlock.BASIC_BLOCK_OPTION] as BasicBlock; result += basicBlock.Index; } else result += "unknown"; return result; }
internal void addPrevNode(Node node, int indexInNextArray) { if (parent == null) setParent(node.NextParent); else if (parent != node.NextParent) throw new InvalidBranchTargetException(node,this); prevArray.Add(node); prevIndexes.Add(indexInNextArray); }
public void Callback(Node node) { if(node is ITypedNode) { ITypedNode theNode = node as ITypedNode; theNode.Type = mapper.Map(theNode.Type); } if(node is ManageField) { ManageField theNode = node as ManageField; theNode.Field = mapper.Map(theNode.Field); } if(node is MethodBodyBlock) { MethodBodyBlock body = node as MethodBodyBlock; foreach(Variable var in body.Variables) var.Type = mapper.Map(var.Type); body.ReturnType = mapper.Map(body.ReturnType); } if(node is CallMethod) { CallMethod call = node as CallMethod; ResidualMethod id = Specialization.GetResidualMethod(call); if(id != null) { MethodBodyBlock mbb = mapper.Holder[id]; node.Options["HasPseudoParameter"] = mapper.HasPseudoParameter(mbb); call.MethodWithParams = new MethodInfoExtention(mapper.Map(mbb), call.IsVirtCall, mapper.Map(GetParamTypes(mbb, id.IsConstructor)) ); } else call.MethodWithParams = mapper.Map(call.MethodWithParams); } if(node is NewObject) { NewObject newObj = node as NewObject; ResidualMethod id = Specialization.GetResidualMethod(node); if(id != null) { MethodBodyBlock mbb = mapper.Holder[id]; newObj.CtorWithParams = new MethodInfoExtention(mapper.Map(mbb), false, mapper.Map(GetParamTypes(mbb, id.IsConstructor))); node.Options["HasPseudoParameter"] = mapper.HasPseudoParameter(mbb); } else newObj.CtorWithParams = mapper.Map(newObj.CtorWithParams); } if(node is CreateDelegate) { CreateDelegate crDel = node as CreateDelegate; //Andrew TODO: Map this node... } // Graph should be verified AFTER the metadata is resolved }
public virtual void ReplaceByNode(Node node) { //Hy Cepera!! int prevCount = this.prevArray.Count; Node[] prevArray = new Node[prevCount]; int[] prevIndexes = new int[prevCount]; for(int i=0; i<prevCount; i++) { prevArray[i] = this.prevArray[i]; prevIndexes[i] = (int)this.prevIndexes[i]; } for (int i = 0; i < prevCount; i++) { Node prevNode = prevArray[i]; int index = prevIndexes[i]; prevNode.NextArray[index] = node; } }
protected PrimitiveCreator(Node upNode) : base(upNode) { }
internal void AddCreator(Node upNode, Variable var) { this.crtrs[new VariablePrimitiveCreator(upNode, var)] = true; }
internal void AddCreator(Node upNode, int depth) { this.crtrs[new StackPrimitiveCreator(upNode, depth)] = true; }
protected virtual void SetNode(int index, Node node) { Node oldValue = nodes[index] as Node; nodes[index] = node; if (oldValue == null && node != null) linkCount++; else if (oldValue != null && node == null) linkCount--; }
internal void removePrevNode(Node node) { int index = prevArray.IndexOf(node); prevArray.RemoveAt(index); prevIndexes.RemoveAt(index); }
internal void addChild(Node child) { childArray.Add(child); }
public NextNodeArray(Node owner, int arrayLength) : base(arrayLength) { this.owner = owner; }
public HandlerAdditionProhibitedException(Node source, Node target) : base(source,target,"Handler addition is prohibited") { }
protected override void SetNode(int index, Node node) { Node linkedNode = GetNode(index); if (linkedNode != node) { /* Clearing old link */ if (linkedNode != null) { base.SetNode(index,null); linkedNode.removePrevNode(owner); } /* Adding new link */ if (node != null) { if (! node.CanBeBranchTarget) throw new InvalidBranchTargetException(owner,node); if (owner.NextParent == null) throw new LinkAdditionProhibitedException(owner,node); node.addPrevNode(owner,index); base.SetNode(index,node); } } }
public LinkAdditionProhibitedException(Node source, Node target) : base(source,target,"Link addition is prohibited") { }
public void Add(Node node) { nodes.Add(node); if (node != null) linkCount++; }
public MbbNotAvailableException(Node node) : base(node,"MethodBodyBlock is not available") { }
public int IndexOf(Node node) { return nodes.IndexOf(node); }
public NodeReplacementProhibitedException(Node node) : base(node,"Node replacement is prohibited") { }
public void Insert(int index, Node node) { nodes.Insert(index,node); if (node != null) linkCount++; }
public VariableNotInMbbException(Node node) : base(node,"Variable is not in MethodBodyBlock") { }
public void Remove(Node node) { nodes.Remove(node); if (node != null) linkCount--; }
public override void ReplaceByNode(Node node) { throw new NodeReplacementProhibitedException(this); }
internal BTValueCreator(Node upNode) { this.UpNode = upNode; }