本文整理汇总了C#中Boo.Lang.Compiler.Ast.GenericParameterDeclaration类的典型用法代码示例。如果您正苦于以下问题:C# GenericParameterDeclaration类的具体用法?C# GenericParameterDeclaration怎么用?C# GenericParameterDeclaration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GenericParameterDeclaration类属于Boo.Lang.Compiler.Ast命名空间,在下文中一共展示了GenericParameterDeclaration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnGenericParameterDeclaration
public override void OnGenericParameterDeclaration(GenericParameterDeclaration node)
{
if (node.Entity == null)
{
node.Entity = new InternalGenericParameter(TypeSystemServices, node);
}
}
示例2: InternalGenericParameter
public InternalGenericParameter(TypeSystemServices tss, GenericParameterDeclaration declaration)
{
_tss = tss;
_declaration = declaration;
// Determine and remember declaring type and declaring method (if applicable)
_declaringMethod = declaration.ParentNode as Method;
_declaringType = (
_declaringMethod == null ?
declaration.ParentNode as TypeDefinition : _declaringMethod.DeclaringType);
}
示例3: InvalidTypeConstraint
public static CompilerError InvalidTypeConstraint(GenericParameterDeclaration gpd, TypeReference type)
{
return Instantiate("BCE0162", type, gpd.Name, type);
}
示例4: GenericConstraintValidator
public GenericConstraintValidator(CompilerContext context, GenericParameterDeclaration gpd)
{
_context = context;
_gpd = gpd;
}
示例5: Clone
override public object Clone()
{
GenericParameterDeclaration clone = new GenericParameterDeclaration();
clone._lexicalInfo = _lexicalInfo;
clone._endSourceLocation = _endSourceLocation;
clone._documentation = _documentation;
clone._isSynthetic = _isSynthetic;
clone._entity = _entity;
if (_annotations != null) clone._annotations = (Hashtable)_annotations.Clone();
clone._name = _name;
if (null != _baseTypes)
{
clone._baseTypes = _baseTypes.Clone() as TypeReferenceCollection;
clone._baseTypes.InitializeParent(clone);
}
clone._constraints = _constraints;
return clone;
}
示例6: InvalidTypeConstraint
public static CompilerError InvalidTypeConstraint(GenericParameterDeclaration gpd, TypeReference type)
{
return new CompilerError("BCE0162", SafeLexicalInfo(type), gpd.Name, type);
}
示例7: generic_parameter_constraints
protected void generic_parameter_constraints(
GenericParameterDeclaration gpd
) //throws RecognitionException, TokenStreamException
{
TypeReference tr = null;
try { // for error handling
{
switch ( LA(1) )
{
case CLASS:
{
match(CLASS);
if (0==inputState.guessing)
{
gpd.Constraints |= GenericParameterConstraints.ReferenceType;
}
break;
}
case STRUCT:
{
match(STRUCT);
if (0==inputState.guessing)
{
gpd.Constraints |= GenericParameterConstraints.ValueType;
}
break;
}
case CONSTRUCTOR:
{
match(CONSTRUCTOR);
if (0==inputState.guessing)
{
gpd.Constraints |= GenericParameterConstraints.Constructable;
}
break;
}
case CALLABLE:
case CHAR:
case THEN:
case LPAREN:
case ID:
case SPLICE_BEGIN:
{
tr=type_reference();
if (0==inputState.guessing)
{
gpd.BaseTypes.Add(tr);
}
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
{
switch ( LA(1) )
{
case COMMA:
{
match(COMMA);
generic_parameter_constraints(gpd);
break;
}
case RPAREN:
{
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
}
catch (RecognitionException ex)
{
if (0 == inputState.guessing)
{
reportError(ex, "generic_parameter_constraints");
recover(ex,tokenSet_53_);
}
else
{
throw ex;
}
}
//.........这里部分代码省略.........
示例8: DefineGenericParameters
void DefineGenericParameters(GenericTypeParameterBuilder[] builders, GenericParameterDeclaration[] declarations)
{
for (int i = 0; i < builders.Length; i++)
{
SetBuilder(declarations[i], builders[i]);
DefineGenericParameter(((InternalGenericParameter)declarations[i].Entity), builders[i]);
}
}
示例9: TypeConstraintConflictsWithSpecialConstraint
public static CompilerError TypeConstraintConflictsWithSpecialConstraint(GenericParameterDeclaration gpd, TypeReference type, string constraint)
{
return Instantiate("BCE0161", type, gpd.Name, type, constraint);
}
示例10: DefineGenericParameters
void DefineGenericParameters(GenericTypeParameterBuilder[] builders, GenericParameterDeclaration[] declarations)
{
// Set builders
for (int i = 0; i < builders.Length; i++)
{
SetBuilder(declarations[i], builders[i]);
}
// TODO: Set constraints
}
示例11: OnGenericParameterDeclaration
public override void OnGenericParameterDeclaration(GenericParameterDeclaration gp)
{
Write(gp.Name);
}
示例12: TypeConstraintConflictsWithSpecialConstraint
public static CompilerError TypeConstraintConflictsWithSpecialConstraint(GenericParameterDeclaration gpd, TypeReference type, string constraint)
{
return new CompilerError("BCE0161", SafeLexicalInfo(type), gpd.Name, type, constraint);
}
示例13: StructAndConstructorConstraintsConflict
public static CompilerError StructAndConstructorConstraintsConflict(GenericParameterDeclaration gpd)
{
return new CompilerError("BCE0160", SafeLexicalInfo(gpd), gpd.Name);
}
示例14: MultipleBaseTypeConstraints
public static CompilerError MultipleBaseTypeConstraints(GenericParameterDeclaration gpd, TypeReference type, TypeReference other)
{
return new CompilerError("BCE0163", SafeLexicalInfo(type), gpd.Name, type, other);
}
示例15: MultipleBaseTypeConstraints
public static CompilerError MultipleBaseTypeConstraints(GenericParameterDeclaration gpd, TypeReference type, TypeReference other)
{
return Instantiate("BCE0163", type, gpd.Name, type, other);
}