本文整理汇总了C#中Boo.Lang.Compiler.Ast.GenericParameterDeclaration类的典型用法代码示例。如果您正苦于以下问题:C# GenericParameterDeclaration类的具体用法?C# GenericParameterDeclaration怎么用?C# GenericParameterDeclaration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GenericParameterDeclaration类属于Boo.Lang.Compiler.Ast命名空间,在下文中一共展示了GenericParameterDeclaration类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnGenericParameterDeclaration
public override void OnGenericParameterDeclaration(GenericParameterDeclaration node)
{
if (node.Entity == null)
{
node.Entity = new InternalGenericParameter(TypeSystemServices, node);
}
}
开发者ID:w4x,项目名称:boolangstudio,代码行数:7,代码来源:BindGenericParameters.cs
示例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);
}
开发者ID:w4x,项目名称:boolangstudio,代码行数:11,代码来源:InternalGenericParameter.cs
示例3: InvalidTypeConstraint
public static CompilerError InvalidTypeConstraint(GenericParameterDeclaration gpd, TypeReference type)
{
return Instantiate("BCE0162", type, gpd.Name, type);
}
开发者ID:neonux,项目名称:boo,代码行数:4,代码来源:CompilerErrorFactory.cs
示例4: GenericConstraintValidator
public GenericConstraintValidator(CompilerContext context, GenericParameterDeclaration gpd)
{
_context = context;
_gpd = gpd;
}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:5,代码来源:GenericConstraintsValidator.cs
示例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;
}
开发者ID:Rfvgyhn,项目名称:boo,代码行数:21,代码来源:GenericParameterDeclarationImpl.cs
示例6: InvalidTypeConstraint
public static CompilerError InvalidTypeConstraint(GenericParameterDeclaration gpd, TypeReference type)
{
return new CompilerError("BCE0162", SafeLexicalInfo(type), gpd.Name, type);
}
开发者ID:boo,项目名称:boo-lang,代码行数:4,代码来源:CompilerErrorFactory.cs
示例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;
}
}
//.........这里部分代码省略.........
开发者ID:hlizard,项目名称:boo,代码行数:101,代码来源:BooParserBase.cs
示例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]);
}
}
开发者ID:Bombadil77,项目名称:boo,代码行数:8,代码来源:EmitAssembly.cs
示例9: TypeConstraintConflictsWithSpecialConstraint
public static CompilerError TypeConstraintConflictsWithSpecialConstraint(GenericParameterDeclaration gpd, TypeReference type, string constraint)
{
return Instantiate("BCE0161", type, gpd.Name, type, constraint);
}
开发者ID:neonux,项目名称:boo,代码行数:4,代码来源:CompilerErrorFactory.cs
示例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
}
开发者ID:w4x,项目名称:boolangstudio,代码行数:10,代码来源:EmitAssembly.cs
示例11: OnGenericParameterDeclaration
public override void OnGenericParameterDeclaration(GenericParameterDeclaration gp)
{
Write(gp.Name);
}
开发者ID:w4x,项目名称:boolangstudio,代码行数:4,代码来源:BooPrinterVisitor.cs
示例12: TypeConstraintConflictsWithSpecialConstraint
public static CompilerError TypeConstraintConflictsWithSpecialConstraint(GenericParameterDeclaration gpd, TypeReference type, string constraint)
{
return new CompilerError("BCE0161", SafeLexicalInfo(type), gpd.Name, type, constraint);
}
开发者ID:boo,项目名称:boo-lang,代码行数:4,代码来源:CompilerErrorFactory.cs
示例13: StructAndConstructorConstraintsConflict
public static CompilerError StructAndConstructorConstraintsConflict(GenericParameterDeclaration gpd)
{
return new CompilerError("BCE0160", SafeLexicalInfo(gpd), gpd.Name);
}
开发者ID:boo,项目名称:boo-lang,代码行数:4,代码来源:CompilerErrorFactory.cs
示例14: MultipleBaseTypeConstraints
public static CompilerError MultipleBaseTypeConstraints(GenericParameterDeclaration gpd, TypeReference type, TypeReference other)
{
return new CompilerError("BCE0163", SafeLexicalInfo(type), gpd.Name, type, other);
}
开发者ID:boo,项目名称:boo-lang,代码行数:4,代码来源:CompilerErrorFactory.cs
示例15: MultipleBaseTypeConstraints
public static CompilerError MultipleBaseTypeConstraints(GenericParameterDeclaration gpd, TypeReference type, TypeReference other)
{
return Instantiate("BCE0163", type, gpd.Name, type, other);
}
开发者ID:neonux,项目名称:boo,代码行数:4,代码来源:CompilerErrorFactory.cs
示例16: StructAndConstructorConstraintsConflict
public static CompilerError StructAndConstructorConstraintsConflict(GenericParameterDeclaration gpd)
{
return Instantiate("BCE0160", gpd, gpd.Name);
}
开发者ID:neonux,项目名称:boo,代码行数:4,代码来源:CompilerErrorFactory.cs
示例17: generic_parameter_declaration
//throws RecognitionException, TokenStreamException
protected void generic_parameter_declaration(
GenericParameterDeclarationCollection c
)
{
IToken id = null;
try { // for error handling
id = LT(1);
match(ID);
if (0==inputState.guessing)
{
GenericParameterDeclaration gpd = new GenericParameterDeclaration(SourceLocationFactory.ToLexicalInfo(id));
gpd.Name = id.getText();
c.Add(gpd);
}
}
catch (RecognitionException ex)
{
if (0 == inputState.guessing)
{
reportError(ex);
recover(ex,tokenSet_25_);
}
else
{
throw ex;
}
}
}
开发者ID:w4x,项目名称:boolangstudio,代码行数:32,代码来源:WSABooParserBase.cs
示例18: InternalGenericParameter
public InternalGenericParameter(TypeSystemServices tss, GenericParameterDeclaration declaration) : base(tss)
{
_declaration = declaration;
}
开发者ID:Rfvgyhn,项目名称:boo,代码行数:4,代码来源:InternalGenericParameter.cs
示例19: generic_parameter_declaration
protected void generic_parameter_declaration(
GenericParameterDeclarationCollection c
) //throws RecognitionException, TokenStreamException
{
IToken id = null;
GenericParameterDeclaration gpd = null;
try { // for error handling
id = LT(1);
match(ID);
if (0==inputState.guessing)
{
gpd = new GenericParameterDeclaration(ToLexicalInfo(id));
gpd.Name = id.getText();
c.Add(gpd);
}
{
if ((LA(1)==LPAREN) && (tokenSet_59_.member(LA(2))))
{
match(LPAREN);
generic_parameter_constraints(gpd);
match(RPAREN);
}
else if ((LA(1)==LPAREN||LA(1)==RBRACK||LA(1)==COMMA) && (tokenSet_60_.member(LA(2)))) {
}
else
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
catch (RecognitionException ex)
{
if (0 == inputState.guessing)
{
reportError(ex, "generic_parameter_declaration");
recover(ex,tokenSet_61_);
}
else
{
throw ex;
}
}
}
开发者ID:hlizard,项目名称:boo,代码行数:50,代码来源:BooParserBase.cs
示例20: CreateGenericParameterDeclaration
//TODO: >=0.9, support constraints here
public GenericParameterDeclaration CreateGenericParameterDeclaration(int index, string name)
{
GenericParameterDeclaration p = new GenericParameterDeclaration(name);
p.Entity = new InternalGenericParameter(_tss, p, index);
return p;
}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:7,代码来源:BooCodeBuilder.cs
注:本文中的Boo.Lang.Compiler.Ast.GenericParameterDeclaration类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论