Esempio n. 1
0
            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
            }