public ILBlockTranslator(AssemblyTranslator translator, DecompilerContext context, MethodReference methodReference, MethodDefinition methodDefinition, ILBlock ilb, IEnumerable<ILVariable> parameters, IEnumerable<ILVariable> allVariables) { Translator = translator; Context = context; ThisMethodReference = methodReference; ThisMethod = methodDefinition; Block = ilb; JS = new JSSpecialIdentifiers(TypeSystem); JSIL = new JSILIdentifier(TypeSystem, JS); CLR = new CLRSpecialIdentifiers(TypeSystem); if (methodReference.HasThis) Variables.Add("this", JSThisParameter.New(methodReference.DeclaringType)); foreach (var parameter in parameters) { if ((parameter.Name == "this") && (parameter.OriginalParameter.Index == -1)) continue; ParameterNames.Add(parameter.Name); Variables.Add(parameter.Name, new JSParameter(parameter.Name, parameter.Type)); } foreach (var variable in allVariables) { var v = JSVariable.New(variable); if (Variables.ContainsKey(v.Identifier)) { v = new JSVariable(variable.OriginalVariable.Name, variable.Type); RenamedVariables[variable] = v; Variables.Add(v.Identifier, v); } else { Variables.Add(v.Identifier, v); } } }
public SpecialIdentifiers(MethodTypeFactory methodTypes, TypeSystem typeSystem, ITypeInfoSource typeInfo) { TypeSystem = typeSystem; JS = new JSSpecialIdentifiers(methodTypes, typeSystem); CLR = new CLRSpecialIdentifiers(typeSystem); JSIL = new JSILIdentifier(methodTypes, typeSystem, typeInfo, JS); }
public SpecialIdentifiers(MethodTypeFactory methodTypes, TypeSystem typeSystem) { TypeSystem = typeSystem; JS = new JSSpecialIdentifiers(methodTypes, typeSystem); CLR = new CLRSpecialIdentifiers(typeSystem); JSIL = new JSILIdentifier(methodTypes, typeSystem, JS); }
public SpecialIdentifiers(TypeSystem typeSystem) { TypeSystem = typeSystem; JS = new JSSpecialIdentifiers(typeSystem); CLR = new CLRSpecialIdentifiers(typeSystem); JSIL = new JSILIdentifier(typeSystem, JS); }