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


C# Ast.GenericParameterDeclaration类代码示例

本文整理汇总了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);
     }
 }
开发者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


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