コード例 #1
0
ファイル: ILBlockTranslator.cs プロジェクト: berkus/JSIL
        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);
                }
            }
        }
コード例 #2
0
 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);
 }
コード例 #3
0
ファイル: SpecialIdentifiers.cs プロジェクト: c444b774/JSIL
 public SpecialIdentifiers(MethodTypeFactory methodTypes, TypeSystem typeSystem)
 {
     TypeSystem = typeSystem;
     JS = new JSSpecialIdentifiers(methodTypes, typeSystem);
     CLR = new CLRSpecialIdentifiers(typeSystem);
     JSIL = new JSILIdentifier(methodTypes, typeSystem, JS);
 }
コード例 #4
0
ファイル: SpecialIdentifiers.cs プロジェクト: robashton/JSIL
 public SpecialIdentifiers(TypeSystem typeSystem)
 {
     TypeSystem = typeSystem;
     JS = new JSSpecialIdentifiers(typeSystem);
     CLR = new CLRSpecialIdentifiers(typeSystem);
     JSIL = new JSILIdentifier(typeSystem, JS);
 }