本文整理汇总了C#中TypeSystem类的典型用法代码示例。如果您正苦于以下问题:C# TypeSystem类的具体用法?C# TypeSystem怎么用?C# TypeSystem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TypeSystem类属于命名空间,在下文中一共展示了TypeSystem类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: Check
/// <summary>
/// Standard check function, except that it returns a PreDAStatus data structure
/// that contains the three tables mentioned above.
/// </summary>
/// <param name="t"></param>
/// <param name="method"></param>
/// <param name="analyzer"></param>
/// <returns>A PreDAStatus data structure, or a null if error occurs. </returns>
public static PreDAStatus Check(TypeSystem t, Method method, Analyzer analyzer) {
Debug.Assert(method != null && analyzer != null);
MethodReachingDefNNArrayChecker checker = new MethodReachingDefNNArrayChecker(t, analyzer, method);
ControlFlowGraph cfg = analyzer.GetCFG(method);
if (cfg == null)
return null;
InitializedVariables iv = new InitializedVariables(analyzer);
NNArrayStatus status = new NNArrayStatus(iv);
NNArrayStatus.Checker = checker;
checker.Run(cfg, status);
// Check whether there are arrays that have been created but not committed
NNArrayStatus exitStatus2 = checker.exitState as NNArrayStatus;
if (exitStatus2 != null) {
if (Analyzer.Debug) {
Console.WriteLine("exit state of {0} is", method.FullName);
exitStatus2.Dump();
}
ArrayList notCommitted = exitStatus2.CreatedButNotInitedArrays();
if (notCommitted != null && notCommitted.Count != 0) {
foreach (object o in notCommitted) {
string offendingString = "A non null element array";
Node offendingNode = method;
if (o is Variable) {
offendingString = "Variable \'" + o + "\'";
offendingNode = o as Variable;
}
if (o is Pair<Variable, Field>) {
Pair<Variable, Field> pair = o as Pair<Variable, Field>;
Variable var = pair.Fst;
Field fld = pair.Snd;
offendingString = "Field \'" + var + "." + fld + "\'";
if (NNArrayStatus.FieldsToMB.ContainsKey(pair)) {
offendingNode = NNArrayStatus.FieldsToMB[pair] as MemberBinding;
if (offendingNode == null) {
offendingNode = fld;
} else {
MemberBinding mb = offendingNode as MemberBinding;
if (mb.TargetObject == null || mb.SourceContext.SourceText == null) {
offendingNode = fld;
}
}
}
}
checker.HandleError(offendingNode, Error.ShouldCommit, offendingString);
}
}
ArrayList notCommittedOnAllPaths = exitStatus2.CreatedButNotFullyCommittedArrays();
if (notCommittedOnAllPaths != null && notCommittedOnAllPaths.Count != 0) {
foreach (object o in notCommittedOnAllPaths) {
string offendingString = "A non-null element array";
Node offendingNode = method;
if (o is Variable) {
offendingString = "variable \'" + o + "\'";
offendingNode = o as Variable;
} else if (o is Pair<Variable, Field>) {
Pair<Variable, Field> pair = o as Pair<Variable, Field>;
Variable var = pair.Fst;
Field fld = pair.Snd;
if (NNArrayStatus.FieldsToMB.ContainsKey(pair)) {
offendingNode = NNArrayStatus.FieldsToMB[pair] as MemberBinding;
if (offendingNode == null) {
offendingNode = fld;
} else {
MemberBinding mb = offendingNode as MemberBinding;
if (mb.TargetObject == null || mb.SourceContext.SourceText==null) {
offendingNode = fld;
}
}
}
offendingString = "field \'" + var + "." + fld + "\'";
}
checker.HandleError(offendingNode, Error.ShouldCommitOnAllPaths, offendingString);
}
}
if (checker.errors != null && checker.errors.Count != 0) {
checker.HandleError();
checker.errors.Clear();
return null;
}
}
return new PreDAStatus(checker.NotCommitted, checker.Committed, checker.OKTable, checker.NonDelayArrayTable);
}
开发者ID:tapicer,项目名称:resource-contracts-.net,代码行数:95,代码来源:DefiniteAssignmentAnalysis.cs
示例17: MethodReachingDefNNArrayChecker
private MethodReachingDefNNArrayChecker(TypeSystem ts, Analyzer analyzer, Method method) {
TypeSystem = ts;
this.analyzer = analyzer;
currentMethod = method;
iVisitor = new ReachingDefNNArrayInstructionVisitor(analyzer, this);
okTable = new Hashtable();
nonDelayArrayTable = new Hashtable();
NNArrayStatus.OKAtCommit = okTable;
NNArrayStatus.NonDelayByCreation = nonDelayArrayTable;
}
开发者ID:tapicer,项目名称:resource-contracts-.net,代码行数:10,代码来源:DefiniteAssignmentAnalysis.cs
示例18: MethodDefiniteAssignmentChecker
protected MethodDefiniteAssignmentChecker(TypeSystem t, Analyzer analyzer, PreDAStatus preResult) {
typeSystem=t;
iVisitor=new DefiniteAssignmentInstructionVisitor(analyzer, this, preResult);
reportedErrors=new Hashtable();
this.analyzer = analyzer;
this.nodeExistentialTable = new NodeMaybeExistentialDelayInfo ();
}
开发者ID:tapicer,项目名称:resource-contracts-.net,代码行数:7,代码来源:DefiniteAssignmentAnalysis.cs
示例19: MethodSignatureHasVarsNeedingCallingConventionConverter_MethodSignature
public static bool MethodSignatureHasVarsNeedingCallingConventionConverter_MethodSignature(TypeSystem.MethodSignature methodSignature)
{
if (TypeHasLayoutDependentOnGenericInstantiation(methodSignature.ReturnType, HasVarsInvestigationLevel.Parameter))
return true;
for (int i = 0; i < methodSignature.Length; i++)
{
if (TypeHasLayoutDependentOnGenericInstantiation(methodSignature[i], HasVarsInvestigationLevel.Parameter))
return true;
}
return false;
}
开发者ID:justinvp,项目名称:corert,代码行数:13,代码来源:TypeLoaderEnvironment.SignatureParsing.cs
示例20: SqlConnectionString
//.........这里部分代码省略.........
if (_multiSubnetFailover) {
throw SQL.MultiSubnetFailoverWithFailoverPartner(serverProvidedFailoverPartner: false, internalConnection: null);
}
if (String.Equals(DEFAULT.Initial_Catalog, _initialCatalog, StringComparison.OrdinalIgnoreCase)) {
throw ADP.MissingConnectionOptionValue(KEY.FailoverPartner, KEY.Initial_Catalog);
}
}
// expand during construction so that CreatePermissionSet and Expand are consistent
string datadir = null;
_expandedAttachDBFilename = ExpandDataDirectory(KEY.AttachDBFilename, _attachDBFileName, ref datadir);
if (null != _expandedAttachDBFilename) {
if (0 <= _expandedAttachDBFilename.IndexOf('|')) {
throw ADP.InvalidConnectionOptionValue(KEY.AttachDBFilename);
}
ValidateValueLength(_expandedAttachDBFilename, TdsEnums.MAXLEN_ATTACHDBFILE, KEY.AttachDBFilename);
if (_localDBInstance == null)
{
// fail fast to verify LocalHost when using |DataDirectory|
// still must check again at connect time
string host = _dataSource;
string protocol = _networkLibrary;
TdsParserStaticMethods.AliasRegistryLookup(ref host, ref protocol);
VerifyLocalHostAndFixup(ref host, true, false /*don't fix-up*/);
}
}
else if (0 <= _attachDBFileName.IndexOf('|')) {
throw ADP.InvalidConnectionOptionValue(KEY.AttachDBFilename);
}
else {
ValidateValueLength(_attachDBFileName, TdsEnums.MAXLEN_ATTACHDBFILE, KEY.AttachDBFilename);
}
_typeSystemAssemblyVersion = constTypeSystemAsmVersion10;
if (true == _userInstance && !ADP.IsEmpty(_failoverPartner)) {
throw SQL.UserInstanceFailoverNotCompatible();
}
if (ADP.IsEmpty(typeSystemVersionString)) {
typeSystemVersionString = DbConnectionStringDefaults.TypeSystemVersion;
}
if (typeSystemVersionString.Equals(TYPESYSTEMVERSION.Latest, StringComparison.OrdinalIgnoreCase)) {
_typeSystemVersion = TypeSystem.Latest;
}
else if (typeSystemVersionString.Equals(TYPESYSTEMVERSION.SQL_Server_2000, StringComparison.OrdinalIgnoreCase)) {
if (_contextConnection) {
throw SQL.ContextAllowsOnlyTypeSystem2005();
}
_typeSystemVersion = TypeSystem.SQLServer2000;
}
else if (typeSystemVersionString.Equals(TYPESYSTEMVERSION.SQL_Server_2005, StringComparison.OrdinalIgnoreCase)) {
_typeSystemVersion = TypeSystem.SQLServer2005;
}
else if (typeSystemVersionString.Equals(TYPESYSTEMVERSION.SQL_Server_2008, StringComparison.OrdinalIgnoreCase)) {
_typeSystemVersion = TypeSystem.SQLServer2008;
}
else if (typeSystemVersionString.Equals(TYPESYSTEMVERSION.SQL_Server_2012, StringComparison.OrdinalIgnoreCase)) {
_typeSystemVersion = TypeSystem.SQLServer2012;
_typeSystemAssemblyVersion = constTypeSystemAsmVersion11;
}
else {
throw ADP.InvalidConnectionOptionValue(KEY.Type_System_Version);
}
if (ADP.IsEmpty(transactionBindingString)) {
transactionBindingString = DbConnectionStringDefaults.TransactionBinding;
}
if (transactionBindingString.Equals(TRANSACIONBINDING.ImplicitUnbind, StringComparison.OrdinalIgnoreCase)) {
_transactionBinding = TransactionBindingEnum.ImplicitUnbind;
}
else if (transactionBindingString.Equals(TRANSACIONBINDING.ExplicitUnbind, StringComparison.OrdinalIgnoreCase)) {
_transactionBinding = TransactionBindingEnum.ExplicitUnbind;
}
else {
throw ADP.InvalidConnectionOptionValue(KEY.TransactionBinding);
}
if (_applicationIntent == ApplicationIntent.ReadOnly && !String.IsNullOrEmpty(_failoverPartner))
throw SQL.ROR_FailoverNotSupportedConnString();
if ((_connectRetryCount<0) || (_connectRetryCount>255)) {
throw ADP.InvalidConnectRetryCountValue();
}
if ((_connectRetryInterval < 1) || (_connectRetryInterval > 60)) {
throw ADP.InvalidConnectRetryIntervalValue();
}
if (Authentication != SqlAuthenticationMethod.NotSpecified && _integratedSecurity == true) {
throw SQL.AuthenticationAndIntegratedSecurity();
}
if (Authentication == SqlClient.SqlAuthenticationMethod.ActiveDirectoryIntegrated && (HasUserIdKeyword || HasPasswordKeyword)) {
throw SQL.IntegratedWithUserIDAndPassword();
}
}
开发者ID:uQr,项目名称:referencesource,代码行数:101,代码来源:SqlConnectionString.cs
注:本文中的TypeSystem类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论