Example #1
0
        public static GenericParameterDeclarationCollection FromArray(params Boo.Lang.Compiler.Ast.GenericParameterDeclaration[] items)
        {
            GenericParameterDeclarationCollection collection = new GenericParameterDeclarationCollection();

            collection.Extend(items);
            return(collection);
        }
Example #2
0
	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;
			}
		}
	}
Example #3
0
	protected void generic_parameter_declaration_list(
		GenericParameterDeclarationCollection c
	) //throws RecognitionException, TokenStreamException
{
		
		
		try {      // for error handling
			generic_parameter_declaration(c);
			{    // ( ... )*
				for (;;)
				{
					if ((LA(1)==COMMA))
					{
						match(COMMA);
						generic_parameter_declaration(c);
					}
					else
					{
						goto _loop233_breakloop;
					}
					
				}
_loop233_breakloop:				;
			}    // ( ... )*
		}
		catch (RecognitionException ex)
		{
			if (0 == inputState.guessing)
			{
				reportError(ex, "generic_parameter_declaration_list");
				recover(ex,tokenSet_41_);
			}
			else
			{
				throw ex;
			}
		}
	}
Example #4
0
 public Boo.Lang.Compiler.Ast.GenericParameterDeclarationCollection PopRange(int begin)
 {
     Boo.Lang.Compiler.Ast.GenericParameterDeclarationCollection range = new Boo.Lang.Compiler.Ast.GenericParameterDeclarationCollection(_parent);
     range.InnerList.Extend(InternalPopRange(begin));
     return(range);
 }
		public GenericConstraintsValidator(CompilerContext ctx, Node node, GenericParameterDeclarationCollection parameters)
		{
			_context = ctx;
			_node = node;
			_parameters = parameters;
		}
Example #6
0
        //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;
            }
            }
        }
Example #7
0
 void WriteGenericParameterList(GenericParameterDeclarationCollection items)
 {
     Write("[of ");
     WriteCommaSeparatedList(items);
     Write("]");
 }