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

macro_stmt() protected method

protected macro_stmt ( ) : MacroStatement
return MacroStatement
        protected MacroStatement macro_stmt()
        {
            MacroStatement returnValue;

                returnValue = null;
                MacroStatement macro = new MacroStatement();
                StatementModifier modifier = null;
                antlr.IToken id = null;

            try {      // for error handling
            id=macro_name();
            expression_list(macro.Arguments);
            {
                if ((LA(1)==COLON) && (LA(2)==INDENT||LA(2)==EOL||LA(2)==EOS))
                {
                    {
                        begin_with_doc(macro);
                        macro_block(macro.Body.Statements);
                        end(macro.Body);
                        if (0==inputState.guessing)
                        {
                            macro.Annotate("compound" );
                        }
                    }
                }
                else if ((LA(1)==COLON) && (tokenSet_20_.member(LA(2)))) {
                    macro_compound_stmt(macro.Body);
                    if (0==inputState.guessing)
                    {
                        macro.Annotate("compound");
                    }
                }
                else if ((tokenSet_21_.member(LA(1)))) {
                    {
                        {
                            switch ( LA(1) )
                            {
                            case EOL:
                            case EOS:
                            {
                                eos();
                                break;
                            }
                            case IF:
                            case UNLESS:
                            case WHILE:
                            {
                                modifier=stmt_modifier();
                                eos();
                                if (0==inputState.guessing)
                                {
                                    macro.Modifier = modifier;
                                }
                                break;
                            }
                            default:
                            {
                                throw new NoViableAltException(LT(1), getFilename());
                            }
                             }
                        }
                        docstring(macro);
                    }
                }
                else
                {
                    throw new NoViableAltException(LT(1), getFilename());
                }

            }
            if (0==inputState.guessing)
            {

                        macro.Name = id.getText();
                        macro.LexicalInfo = ToLexicalInfo(id);

                        returnValue = macro;

            }
            }
            catch (RecognitionException ex)
            {
            if (0 == inputState.guessing)
            {
                reportError(ex, "macro_stmt");
                recover(ex,tokenSet_22_);
            }
            else
            {
                throw ex;
            }
            }
            return returnValue;
        }
BooParserBase