Boo.Lang.Parser.BooParserBase.parameter_declaration C# (CSharp) Method

parameter_declaration() protected method

protected parameter_declaration ( ParameterDeclarationCollection c ) : bool
c ParameterDeclarationCollection
return bool
        protected bool parameter_declaration(
		ParameterDeclarationCollection c
	)
        {
            bool variableArguments;

            IToken  id1 = null;
            IToken  begin1 = null;
            IToken  id2 = null;
            IToken  begin2 = null;

                IToken id = null;
                TypeReference tr = null;
                ParameterModifiers pm = ParameterModifiers.None;
                variableArguments = false;
                Expression nameSplice = null;

            try {      // for error handling
            attributes();
            {
                switch ( LA(1) )
                {
                case MULTIPLY:
                {
                    {
                        match(MULTIPLY);
                        if (0==inputState.guessing)
                        {
                            variableArguments=true;
                        }
                        {
                            switch ( LA(1) )
                            {
                            case ID:
                            {
                                id1 = LT(1);
                                match(ID);
                                if (0==inputState.guessing)
                                {
                                    id = id1;
                                }
                                break;
                            }
                            case SPLICE_BEGIN:
                            {
                                begin1 = LT(1);
                                match(SPLICE_BEGIN);
                                nameSplice=atom();
                                if (0==inputState.guessing)
                                {
                                    id = begin1;
                                }
                                break;
                            }
                            default:
                            {
                                throw new NoViableAltException(LT(1), getFilename());
                            }
                             }
                        }
                        {
                            switch ( LA(1) )
                            {
                            case AS:
                            {
                                match(AS);
                                tr=array_type_reference();
                                break;
                            }
                            case RPAREN:
                            case RBRACK:
                            case COMMA:
                            case BITWISE_OR:
                            {
                                break;
                            }
                            default:
                            {
                                throw new NoViableAltException(LT(1), getFilename());
                            }
                             }
                        }
                    }
                    break;
                }
                case REF:
                case ID:
                case SPLICE_BEGIN:
                {
                    {
                        {
                            switch ( LA(1) )
                            {
                            case REF:
                            {
                                pm=parameter_modifier();
                                break;
                            }
                            case ID:
                            case SPLICE_BEGIN:
                            {
                                break;
                            }
                            default:
                            {
                                throw new NoViableAltException(LT(1), getFilename());
                            }
                             }
                        }
                        {
                            switch ( LA(1) )
                            {
                            case ID:
                            {
                                id2 = LT(1);
                                match(ID);
                                if (0==inputState.guessing)
                                {
                                    id = id2;
                                }
                                break;
                            }
                            case SPLICE_BEGIN:
                            {
                                begin2 = LT(1);
                                match(SPLICE_BEGIN);
                                nameSplice=atom();
                                if (0==inputState.guessing)
                                {
                                    id = begin2;
                                }
                                break;
                            }
                            default:
                            {
                                throw new NoViableAltException(LT(1), getFilename());
                            }
                             }
                        }
                        {
                            switch ( LA(1) )
                            {
                            case AS:
                            {
                                match(AS);
                                tr=type_reference();
                                break;
                            }
                            case RPAREN:
                            case RBRACK:
                            case COMMA:
                            case BITWISE_OR:
                            {
                                break;
                            }
                            default:
                            {
                                throw new NoViableAltException(LT(1), getFilename());
                            }
                             }
                        }
                    }
                    break;
                }
                default:
                {
                    throw new NoViableAltException(LT(1), getFilename());
                }
                 }
            }
            if (0==inputState.guessing)
            {

                        ParameterDeclaration pd = new ParameterDeclaration(ToLexicalInfo(id));
                        pd.Name = id.getText();
                        pd.Type = tr;
                        pd.Modifiers = pm;
                        AddAttributes(pd.Attributes);

                        c.Add(
                            nameSplice != null
                            ? new SpliceParameterDeclaration(pd, nameSplice)
                            : pd);

            }
            }
            catch (RecognitionException ex)
            {
            if (0 == inputState.guessing)
            {
                reportError(ex, "parameter_declaration");
                recover(ex,tokenSet_84_);
            }
            else
            {
                throw ex;
            }
            }
            return variableArguments;
        }
BooParserBase