本文整理汇总了C#中Microsoft.CSharp.RuntimeBinder.Syntax.Name类的典型用法代码示例。如果您正苦于以下问题:C# Name类的具体用法?C# Name怎么用?C# Name使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Name类属于Microsoft.CSharp.RuntimeBinder.Syntax命名空间,在下文中一共展示了Name类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CreateNamespace
// Namespace
public NamespaceSymbol CreateNamespace(Name name, NamespaceSymbol parent)
{
NamespaceSymbol sym = newBasicSym(SYMKIND.SK_NamespaceSymbol, name, parent).AsNamespaceSymbol();
sym.SetAccess(ACCESS.ACC_PUBLIC);
return (sym);
}
开发者ID:noahfalk,项目名称:corefx,代码行数:8,代码来源:SymFactory.cs
示例2: CMethodIterator
public CMethodIterator(CSemanticChecker checker, SymbolLoader symLoader, Name name, TypeArray containingTypes, CType @object, CType qualifyingType, Declaration context, bool allowBogusAndInaccessible, bool allowExtensionMethods, int arity, EXPRFLAG flags, symbmask_t mask)
{
Debug.Assert(name != null);
Debug.Assert(symLoader != null);
Debug.Assert(checker != null);
Debug.Assert(containingTypes != null);
_pSemanticChecker = checker;
_pSymbolLoader = symLoader;
_pCurrentType = null;
_pCurrentSym = null;
_pName = name;
_pContainingTypes = containingTypes;
_pQualifyingType = qualifyingType;
_pContext = context;
_bAllowBogusAndInaccessible = allowBogusAndInaccessible;
_bAllowExtensionMethods = allowExtensionMethods;
_nArity = arity;
_flags = flags;
_mask = mask;
_nCurrentTypeCount = 0;
_bIsCheckingInstanceMethods = true;
_bAtEnd = false;
_bCurrentSymIsBogus = false;
_bCurrentSymIsInaccessible = false;
_bcanIncludeExtensionsInResults = _bAllowExtensionMethods;
_bEndIterationAtCurrentExtensionList = false;
}
开发者ID:noahfalk,项目名称:corefx,代码行数:27,代码来源:MethodIterator.cs
示例3: CreateAggregate
/////////////////////////////////////////////////////////////////////////////////
public AggregateSymbol CreateAggregate(Name name, NamespaceOrAggregateSymbol parent, InputFile infile, TypeManager typeManager)
{
if (name == null || parent == null || infile == null || typeManager == null)
{
throw Error.InternalCompilerError();
}
AggregateSymbol sym = null;
if (infile.GetAssemblyID() == KAID.kaidUnresolved)
{
// Unresolved aggs need extra storage.
sym = CreateUnresolvedAggregate(name, parent, typeManager);
}
else
{
sym = newBasicSym(SYMKIND.SK_AggregateSymbol, name, parent).AsAggregateSymbol();
sym.name = name;
sym.SetTypeManager(typeManager);
sym.SetSealed(false);
sym.SetAccess(ACCESS.ACC_UNKNOWN);
sym.initBogus();
sym.SetIfaces(null);
sym.SetIfacesAll(null);
sym.SetTypeVars(null);
}
sym.InitFromInfile(infile);
return sym;
}
开发者ID:noahfalk,项目名称:corefx,代码行数:30,代码来源:SymFactory.cs
示例4: CreateNamespaceAid
public AssemblyQualifiedNamespaceSymbol CreateNamespaceAid(Name name, ParentSymbol parent, KAID assemblyID)
{
Debug.Assert(name != null);
AssemblyQualifiedNamespaceSymbol sym = newBasicSym(SYMKIND.SK_AssemblyQualifiedNamespaceSymbol, name, parent).AsAssemblyQualifiedNamespaceSymbol();
Debug.Assert(sym != null);
return sym;
}
开发者ID:noahfalk,项目名称:corefx,代码行数:9,代码来源:SymFactory.cs
示例5: CreateIndexer
public IndexerSymbol CreateIndexer(Name name, ParentSymbol parent, Name realName, AggregateDeclaration declaration)
{
IndexerSymbol sym = (IndexerSymbol)newBasicSym(SYMKIND.SK_IndexerSymbol, name, parent);
sym.setKind(SYMKIND.SK_PropertySymbol);
sym.isOperator = true;
sym.declaration = declaration;
Debug.Assert(sym != null);
return sym;
}
开发者ID:noahfalk,项目名称:corefx,代码行数:10,代码来源:MiscSymFactory.cs
示例6: CMemberLookupResults
public CMemberLookupResults(
TypeArray containingTypes,
Name name)
{
_pName = name;
ContainingTypes = containingTypes;
if (ContainingTypes == null)
{
ContainingTypes = BSYMMGR.EmptyTypeArray();
}
}
开发者ID:dotnet,项目名称:corefx,代码行数:11,代码来源:MemberLookupResults.cs
示例7: LookupSym
public Symbol LookupSym(Name name, ParentSymbol parent, symbmask_t kindmask)
{
Key k = new Key(name, parent);
Symbol sym;
if (_dictionary.TryGetValue(k, out sym))
{
return FindCorrectKind(sym, kindmask);
}
return null;
}
开发者ID:ChuangYang,项目名称:corefx,代码行数:12,代码来源:SymbolTable.cs
示例8: CreateAggregateType
// Aggregate
public AggregateType CreateAggregateType(
Name name,
AggregateSymbol parent,
TypeArray typeArgsThis,
AggregateType outerType)
{
AggregateType type = new AggregateType();
type.outerType = outerType;
type.SetOwningAggregate(parent);
type.SetTypeArgsThis(typeArgsThis);
type.SetName(name);
type.SetTypeKind(TypeKind.TK_AggregateType);
return type;
}
开发者ID:Rayislandstyle,项目名称:corefx,代码行数:17,代码来源:TypeFactory.cs
示例9: CreateUnresolvedAggregate
public AggregateSymbol CreateUnresolvedAggregate(Name name, ParentSymbol parent, TypeManager typeManager)
{
Debug.Assert(name != null);
Symbol sym = newBasicSym(SYMKIND.SK_UnresolvedAggregateSymbol, name, parent);
AggregateSymbol AggregateSymbol = null;
// Unresolved Aggs need extra storage, but are still considered Aggs.
sym.setKind(SYMKIND.SK_AggregateSymbol);
AggregateSymbol = sym.AsAggregateSymbol();
AggregateSymbol.SetTypeManager(typeManager);
Debug.Assert(AggregateSymbol != null);
return (AggregateSymbol);
}
开发者ID:noahfalk,项目名称:corefx,代码行数:16,代码来源:SymFactory.cs
示例10: FindArgumentWithName
/////////////////////////////////////////////////////////////////////////////////
private static EXPR FindArgumentWithName(ArgInfos pArguments, Name pName)
{
for (int i = 0; i < pArguments.carg; i++)
{
if (pArguments.prgexpr[i].isNamedArgumentSpecification() &&
pArguments.prgexpr[i].asNamedArgumentSpecification().Name == pName)
{
return pArguments.prgexpr[i];
}
}
return null;
}
开发者ID:er0dr1guez,项目名称:corefx,代码行数:14,代码来源:GroupToArgsBinder.cs
示例11: NamedArgumentNamesAppearInParameterList
/////////////////////////////////////////////////////////////////////////////////
private bool NamedArgumentNamesAppearInParameterList(
MethodOrPropertySymbol methprop)
{
// Keep track of the current position in the parameter list so that we can check
// containment from this point onwards as well as complete containment. This is
// for error reporting. The user cannot specify a named argument for a parameter
// that has a fixed argument value.
List<Name> currentPosition = methprop.ParameterNames;
HashSet<Name> names = new HashSet<Name>();
for (int i = 0; i < _pArguments.carg; i++)
{
if (!_pArguments.prgexpr[i].isNamedArgumentSpecification())
{
if (!currentPosition.IsEmpty())
{
currentPosition = currentPosition.Tail();
}
continue;
}
Name name = _pArguments.prgexpr[i].asNamedArgumentSpecification().Name;
if (!methprop.ParameterNames.Contains(name))
{
if (_pInvalidSpecifiedName == null)
{
_pInvalidSpecifiedName = name;
}
return false;
}
else if (!currentPosition.Contains(name))
{
if (_pNameUsedInPositionalArgument == null)
{
_pNameUsedInPositionalArgument = name;
}
return false;
}
if (names.Contains(name))
{
if (_pDuplicateSpecifiedName == null)
{
_pDuplicateSpecifiedName = name;
}
return false;
}
names.Add(name);
}
return true;
}
开发者ID:er0dr1guez,项目名称:corefx,代码行数:51,代码来源:GroupToArgsBinder.cs
示例12: CreateClassTypeParameter
public TypeParameterSymbol CreateClassTypeParameter(Name pName, AggregateSymbol pParent, int index, int indexTotal)
{
TypeParameterSymbol pResult = newBasicSym(SYMKIND.SK_TypeParameterSymbol, pName, pParent).AsTypeParameterSymbol();
pResult.SetIndexInOwnParameters(index);
pResult.SetIndexInTotalParameters(indexTotal);
pResult.SetIsMethodTypeParameter(false);
pResult.SetAccess(ACCESS.ACC_PRIVATE); // Always private - not accessible anywhere except their own type.
return pResult;
}
开发者ID:noahfalk,项目名称:corefx,代码行数:11,代码来源:SymFactory.cs
示例13: CreateEvent
public EventSymbol CreateEvent(Name name, ParentSymbol parent, AggregateDeclaration declaration)
{
EventSymbol sym = newBasicSym(SYMKIND.SK_EventSymbol, name, parent).AsEventSymbol();
sym.declaration = declaration;
Debug.Assert(sym != null);
return (sym);
}
开发者ID:noahfalk,项目名称:corefx,代码行数:8,代码来源:SymFactory.cs
示例14: CreateArray
// Derived types - parent is base type
public ArrayType CreateArray(Name name, CType pElementType, int rank)
{
ArrayType type = new ArrayType();
type.SetName(name);
type.rank = rank;
type.SetElementType(pElementType);
type.SetTypeKind(TypeKind.TK_ArrayType);
return type;
}
开发者ID:Rayislandstyle,项目名称:corefx,代码行数:12,代码来源:TypeFactory.cs
示例15: FindPredefinedTypeCore
private AggregateSymbol FindPredefinedTypeCore(Name name, NamespaceOrAggregateSymbol bag, KAID aid, AggKindEnum aggKind, int arity,
out AggregateSymbol paggAmbig, out AggregateSymbol paggBad)
{
AggregateSymbol aggFound = null;
paggAmbig = null;
paggBad = null;
for (AggregateSymbol aggCur = _pBSymmgr.LookupGlobalSymCore(name, bag, symbmask_t.MASK_AggregateSymbol).AsAggregateSymbol();
aggCur != null;
aggCur = BSYMMGR.LookupNextSym(aggCur, bag, symbmask_t.MASK_AggregateSymbol).AsAggregateSymbol())
{
if (!aggCur.InAlias(aid) || aggCur.GetTypeVarsAll().size != arity)
{
continue;
}
if (aggCur.AggKind() != aggKind)
{
if (paggBad == null)
{
paggBad = aggCur;
}
continue;
}
if (aggFound != null)
{
Debug.Assert(paggAmbig == null);
paggAmbig = aggCur;
break;
}
aggFound = aggCur;
if (paggAmbig == null)
{
break;
}
}
return aggFound;
}
开发者ID:noahfalk,项目名称:corefx,代码行数:38,代码来源:PredefinedTypes.cs
示例16: AddPredefinedPropertyToSymbolTable
/////////////////////////////////////////////////////////////////////////////////
internal void AddPredefinedPropertyToSymbolTable(AggregateSymbol type, Name property)
{
AggregateType aggtype = type.getThisType();
Type t = aggtype.AssociatedSystemType;
var props = Enumerable.Where(t.GetRuntimeProperties(), x => x.Name == property.Text);
foreach (PropertyInfo pi in props)
{
AddPropertyToSymbolTable(pi, type);
}
}
开发者ID:ChuangYang,项目名称:corefx,代码行数:14,代码来源:SymbolTable.cs
示例17: LoadMethod
private MethodSymbol LoadMethod(
AggregateSymbol type,
int[] signature,
int cMethodTyVars,
Name methodName,
ACCESS methodAccess,
bool isStatic,
bool isVirtual
)
{
Debug.Assert(signature != null);
Debug.Assert(cMethodTyVars >= 0);
Debug.Assert(methodName != null);
if (type == null)
{
return null;
}
TypeArray classTyVars = type.GetTypeVarsAll();
int index = 0;
CType returnType = LoadTypeFromSignature(signature, ref index, classTyVars);
if (returnType == null)
{
return null;
}
TypeArray argumentTypes = LoadTypeArrayFromSignature(signature, ref index, classTyVars);
if (argumentTypes == null)
{
return null;
}
TypeArray standardMethodTyVars = GetTypeManager().GetStdMethTyVarArray(cMethodTyVars);
MethodSymbol ret = LookupMethodWhileLoading(type, cMethodTyVars, methodName, methodAccess, isStatic, isVirtual, returnType, argumentTypes);
if (ret == null)
{
RuntimeBinderSymbolTable.AddPredefinedMethodToSymbolTable(type, methodName);
ret = LookupMethodWhileLoading(type, cMethodTyVars, methodName, methodAccess, isStatic, isVirtual, returnType, argumentTypes);
}
return ret;
}
开发者ID:Rayislandstyle,项目名称:corefx,代码行数:42,代码来源:PredefinedMembers.cs
示例18: CreateNullable
public NullableType CreateNullable(Name name, CType pUnderlyingType, BSYMMGR symmgr, TypeManager typeManager)
{
NullableType type = new NullableType();
type.SetName(name);
type.SetUnderlyingType(pUnderlyingType);
type.symmgr = symmgr;
type.typeManager = typeManager;
type.SetTypeKind(TypeKind.TK_NullableType);
return type;
}
开发者ID:Rayislandstyle,项目名称:corefx,代码行数:11,代码来源:TypeFactory.cs
示例19: CreateParameterModifier
public ParameterModifierType CreateParameterModifier(Name name, CType pParameterType)
{
ParameterModifierType type = new ParameterModifierType();
type.SetName(name);
type.SetParameterType(pParameterType);
type.SetTypeKind(TypeKind.TK_ParameterModifierType);
return type;
}
开发者ID:Rayislandstyle,项目名称:corefx,代码行数:9,代码来源:TypeFactory.cs
示例20: CreatePointer
public PointerType CreatePointer(Name name, CType pReferentType)
{
PointerType type = new PointerType();
type.SetName(name);
type.SetReferentType(pReferentType);
type.SetTypeKind(TypeKind.TK_PointerType);
return type;
}
开发者ID:Rayislandstyle,项目名称:corefx,代码行数:9,代码来源:TypeFactory.cs
注:本文中的Microsoft.CSharp.RuntimeBinder.Syntax.Name类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论