当前位置: 首页>>代码示例>>C#>>正文


C# TypeSystem类代码示例

本文整理汇总了C#中TypeSystem的典型用法代码示例。如果您正苦于以下问题:C# TypeSystem类的具体用法?C# TypeSystem怎么用?C# TypeSystem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TypeSystem类属于命名空间,在下文中一共展示了TypeSystem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: JintEngine

        public JintEngine()
        {
            PermissionSet = new PermissionSet(PermissionState.None);
            TypeSystem = new TypeSystem();

            _runtime = new JintRuntime(this);
        }
开发者ID:pvginkel,项目名称:Jint2,代码行数:7,代码来源:JintEngine.cs

示例2: ReferenceImporter

 public ReferenceImporter(TableStream tableStreamBuffer, SignatureComparer signatureComparer)
 {
     if (tableStreamBuffer == null)
         throw new ArgumentNullException("tableStreamBuffer");
     _tableStreamBuffer = tableStreamBuffer;
     _signatureComparer = signatureComparer;
     _typeSystem = tableStreamBuffer.StreamHeader.MetadataHeader.TypeSystem;
 }
开发者ID:JerreS,项目名称:AsmResolver,代码行数:8,代码来源:ReferenceImporter.cs

示例3: Interpreter

 public Interpreter(TypeSystem typeSystem, MethodDefinition method)
 {
     this.ExternalMethods = new HashSet<MethodReference>();
     this.StaticFieldsSet = new HashSet<FieldDefinition>();
     this.typeSystem = typeSystem;
     this.method = method;
     this.typeEvaluator = new CodeTypeEvaluator(this.typeSystem, this.method);
 }
开发者ID:JimmyJune,项目名称:DotWeb,代码行数:8,代码来源:Interpreter.cs

示例4: Initialize

 public void Initialize(TypeSystem system, ITypeSystemController controller)
 {
     TypeSystem = system;
     Controller = controller;
     Cache = new MetadataCache();
     Loader = new MetadataLoader(this);
     Resolver = new MetadataResolver(this);
 }
开发者ID:Zahovay,项目名称:MOSA-Project,代码行数:8,代码来源:CLRMetadata.cs

示例5: Checker

 internal Checker(ErrorHandler errorHandler, TypeSystem typeSystem, TrivialHashtable scopeFor, // LJW: added scopeFor
     TrivialHashtable ambiguousTypes, TrivialHashtable referencedLabels)
     : base(errorHandler, typeSystem, scopeFor, ambiguousTypes, referencedLabels)
 {
     this.validChooses = new Hashtable();
     this.validMethodCalls = new Hashtable();
     this.validSetOperations = new Hashtable();
     this.validSelfAccess = new Hashtable();
 }
开发者ID:ZingModelChecker,项目名称:Zing,代码行数:9,代码来源:ZChecker.cs

示例6: Init

 protected override void Init(TypeSystem t, Node node, bool interProcedural, bool fixpoint, int maxDepth)
 {
     base.Init(t, node, interProcedural, fixpoint, maxDepth);
     factory = new ConsistentyElementFactory(this);
     if (ContractDeserializerContainer.ContractDeserializer == null)
     {
         IContractDeserializer cd = new Omni.Parser.ContractDeserializer();
         ContractDeserializerContainer.ContractDeserializer = cd;
     }
 }
开发者ID:hesam,项目名称:SketchSharp,代码行数:10,代码来源:ObjectConsistencyAnalysis.cs

示例7: GetDefaultValueExpression

        public static Expression GetDefaultValueExpression(this TypeReference typeReference, TypeSystem typeSystem)
        {
            if (typeReference.IsPrimitive)
            {
                string typeName = typeReference.FullName;

                switch (typeName)
                {
                    case "System.Boolean":
                        {
                            return new LiteralExpression(false, typeSystem, null);
                        }
                    case "System.Char":
                        {
                            return new LiteralExpression((char)0, typeSystem, null);
                        }
                    case "System.IntPtr":
                        {
                            return new DefaultObjectExpression(typeReference, null);
                        }
                    default:
                        {
                            return new LiteralExpression(Activator.CreateInstance(Type.GetType(typeName)), typeSystem, null);
                        }
                }
            }
            if (typeReference.IsGenericParameter)
            {
                return new DefaultObjectExpression(typeReference, null);
            }
            if (typeReference.IsArray)
            {
                //return GetLiteralExpression(typeReference.GetElementType(), typeSystem);
                return new LiteralExpression(null, typeSystem, null);
            }
            if (typeReference.IsValueType)
            {
                var typeDefinition = typeReference.Resolve();
                if (typeDefinition != null && typeDefinition.IsEnum)
                {
                    return new LiteralExpression(0, typeSystem, null);
                }
                else
                {
                    return new ObjectCreationExpression(typeReference.GetEmptyConstructorReference(), typeReference, null, null);
                }
            }
            if (typeReference.IsRequiredModifier)
            {
                RequiredModifierType typeReferenceAsReqMod = typeReference as RequiredModifierType;
                return typeReferenceAsReqMod.ElementType.GetDefaultValueExpression(typeSystem);
            }

            return new LiteralExpression(null, typeSystem, null);
        }
开发者ID:juancarlosbaezpozos,项目名称:JustDecompileEngine,代码行数:55,代码来源:TypeReferenceExtensions.cs

示例8: Normalizer

 public Normalizer(TypeSystem typeSystem){
   this.typeSystem = typeSystem;
   this.exitTargets = new StatementList();
   this.continueTargets = new StatementList();
   this.currentTryStatements = new Stack();
   this.exceptionBlockFor = new TrivialHashtable();
   this.visitedCompleteTypes = new TrivialHashtable();
   this.EndIfLabel = new TrivialHashtable();
   this.foreachLength = 7;
   this.WrapToBlockExpression = true;
   this.useGenerics = TargetPlatform.UseGenerics;
 }
开发者ID:dbremner,项目名称:specsharp,代码行数:12,代码来源:Normalizer.cs

示例9: Checker

 public Checker(ErrorHandler errorHandler, TypeSystem typeSystem, TrivialHashtable scopeFor, TrivialHashtable ambiguousTypes, TrivialHashtable referencedLabels)
   : base(errorHandler) {
   this.typeSystem = typeSystem;
   this.Errors = errorHandler == null ? null : errorHandler.Errors;
   this.scopeFor = scopeFor;
   this.ambiguousTypes = ambiguousTypes;
   this.referencedLabels = referencedLabels;
   this.MayNotReferenceThisFromFieldInitializer = true;
   this.allowedExceptions = new TypeNodeList();
   this.useGenerics = TargetPlatform.UseGenerics;
   this.AllowPropertiesIndexersAsRef = true;
 }
开发者ID:hesam,项目名称:SketchSharp,代码行数:12,代码来源:Checker.cs

示例10: Analyzer

        public Analyzer(TypeSystem t, Compilation c)
            : base(t, c)
        {
            if (c != null)
            {
                SpecSharpCompilerOptions ssco = c.CompilerParameters as SpecSharpCompilerOptions;
                if (ssco != null)
                {
                    if (ssco.Compatibility)
                        this.NonNullChecking = false; // i.e., turn it off if we need to be compatible
                    this.WeakPurityAnalysis = ssco.CheckPurity;
                    // Diego said it is important that the same instance of the purity analysis is used across all
                    // methods in the compilation unit. So create it here and just call it for each method in 
                    // the override for language specific analysis.
                    // PointsToAnalysis.verbose = true;
                    if (this.WeakPurityAnalysis)
                    {
                        
                        // InterProcedural bottom up traversal with fixpoint
                        //this.WeakPurityAnalyzer = new WeakPurityAndWriteEffectsAnalysis(this,typeSystem, c,true,true);
                        
                        // Only Intraprocedural (in this mode doesnot support delegates...)
                        //this.WeakPurityAnalyzer = new WeakPurityAndWriteEffectsAnalysis(this, typeSystem, c, false);
                        
                        // Interprocedural top-down inlining simulation (with max-depth)
                        this.WeakPurityAnalyzer = new WeakPurityAndWriteEffectsAnalysis(this, typeSystem, c, true,false,2);

                        this.WeakPurityAnalyzer.StandAloneApp = false;
                        this.WeakPurityAnalyzer.BoogieMode = true;
                    }
                    
                    /// Reentrancy ANALYSIS
                    
                    this.ObjectExposureAnalysis = false;
                    ObjectConsistencyAnalysis.verbose = false;
                    if (ObjectExposureAnalysis)
                    {
                        this.ObjectExposureAnalyzer = new ObjectExposureAnalysis(this, typeSystem, c, true, false, 4);
                    }
                    this.ReentrancyAnalysis = false;
                    if (ReentrancyAnalysis)
                    {
                        this.ReentrancyAnalyzer = new ReentrancyAnalysis(this, typeSystem, c, true, false, 4);
                    }
                    
                }
            }
        }
开发者ID:hesam,项目名称:SketchSharp,代码行数:48,代码来源:Analyzer.cs

示例11: AddProgramVerifierPlugin

    public void AddProgramVerifierPlugin(TypeSystem typeSystem, Compilation compilation){
#if Exp
      string boogieDir = System.Environment.GetEnvironmentVariable("BOOGIE");
      if (boogieDir == null)
        boogieDir = "C:\\boogie";
      string boogiePlugin = boogieDir + "\\Binaries\\BoogiePlugin.dll";
      string errorInfo = boogiePlugin + " (Set BOOGIE environment variable)";
#else
      string codebase = System.Reflection.Assembly.GetExecutingAssembly().CodeBase;
      codebase = codebase.Replace("#", "%23");
      Uri codebaseUri = new Uri(codebase);
      Uri uri = new Uri(codebaseUri, "BoogiePlugin.dll");
      string boogiePlugin = uri.LocalPath;
      string errorInfo = boogiePlugin;
#endif
      this.AddPlugin(boogiePlugin, "Microsoft.Boogie.BoogiePlugin", "Microsoft.Boogie.BoogiePlugin from assembly " + errorInfo, typeSystem, compilation);
    }
开发者ID:hesam,项目名称:SketchSharp,代码行数:17,代码来源:Compiler.cs

示例12: Compile

        private static object Compile(string script)
        {
            var program = JintEngine.ParseProgram(script);

            if (program == null)
                return JsUndefined.Instance;

            var typeSystem = new TypeSystem();
            var scriptBuilder = typeSystem.CreateScriptBuilder(null);
            var bindingVisitor = new BindingVisitor(scriptBuilder);

            program.Accept(bindingVisitor);

            var boundProgram = bindingVisitor.Program;

            var interpreter = new JsonInterpreter(new JintEngine().Global);
            if (boundProgram.Body.Accept(interpreter))
                return interpreter.Result;

            return null;
        }
开发者ID:pvginkel,项目名称:Jint2,代码行数:21,代码来源:JsonInterpretingFixture.Support.cs

示例13: Looker

 public Looker(Scope scope, ErrorHandler errorHandler, TrivialHashtable scopeFor, TypeSystem typeSystem, TrivialHashtable ambiguousTypes, TrivialHashtable referencedLabels)
   : base(errorHandler){
   //TODO: verify that crucial system types have either been imported or defined by the Parser
   this.scope = scope;
   this.AddToAllScopes(this.scope);
   this.scopeFor = scopeFor;
   this.ambiguousTypes = ambiguousTypes;
   this.referencedLabels = referencedLabels;
   this.alreadyReported = new TrivialHashtable();
   this.hasExplicitBaseClass = new TrivialHashtable();
   this.typesToKeepUninstantiated = new TrivialHashtable();
   this.UsedNamespaces = new UsedNamespaceList();
   this.targetFor = new TrivialHashtable();
   this.labelList = new IdentifierList();
   this.AbstractSealedUsedAsType = Error.NotAType;
   Debug.Assert(typeSystem != null);
   this.typeSystem = typeSystem;
   this.useGenerics = TargetPlatform.UseGenerics;
   this.inMethodParameter = false;
   this.inEventContext = false;
 }
开发者ID:tapicer,项目名称:resource-contracts-.net,代码行数:21,代码来源:Looker.cs

示例14: BuiltInTypes

 public BuiltInTypes(TypeSystem typeSystem, MosaModule corlib)
 {
     Void = typeSystem.GetTypeByName(corlib, "System", "Void");
     Boolean = typeSystem.GetTypeByName(corlib, "System", "Boolean");
     Char = typeSystem.GetTypeByName(corlib, "System", "Char");
     I1 = typeSystem.GetTypeByName(corlib, "System", "SByte");
     U1 = typeSystem.GetTypeByName(corlib, "System", "Byte");
     I2 = typeSystem.GetTypeByName(corlib, "System", "Int16");
     U2 = typeSystem.GetTypeByName(corlib, "System", "UInt16");
     I4 = typeSystem.GetTypeByName(corlib, "System", "Int32");
     U4 = typeSystem.GetTypeByName(corlib, "System", "UInt32");
     I8 = typeSystem.GetTypeByName(corlib, "System", "Int64");
     U8 = typeSystem.GetTypeByName(corlib, "System", "UInt64");
     R4 = typeSystem.GetTypeByName(corlib, "System", "Single");
     R8 = typeSystem.GetTypeByName(corlib, "System", "Double");
     String = typeSystem.GetTypeByName(corlib, "System", "String");
     Object = typeSystem.GetTypeByName(corlib, "System", "Object");
     I = typeSystem.GetTypeByName(corlib, "System", "IntPtr");
     U = typeSystem.GetTypeByName(corlib, "System", "UIntPtr");
     TypedRef = typeSystem.GetTypeByName(corlib, "System", "TypedReference");
     Pointer = Void.ToUnmanagedPointer();
 }
开发者ID:Zahovay,项目名称:MOSA-Project,代码行数:22,代码来源:BuiltInTypes.cs

示例15: EmitAssignedButNotReferencedErrors

 public void EmitAssignedButNotReferencedErrors(TypeSystem ts) {
   IWorkList wl = this.Variables;
   while ( !wl.IsEmpty()) {
     Variable v = (Variable)wl.Pull();
     if (v is Local && v.Name != StandardIds.NewObj && ((RStatus)this.referenceStatus[v]) == RStatus.Assigned) {
       ts.HandleError(v,Error.UnreferencedVarAssg,v.Name.Name);
     }
   }
 }
开发者ID:tapicer,项目名称:resource-contracts-.net,代码行数:9,代码来源:DefiniteAssignmentAnalysis.cs


注:本文中的TypeSystem类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。