Exemplo n.º 1
0
        //throws RecognitionException, TokenStreamException
        public void group(
		StringTemplateGroup g
	)
        {
            IToken  name = null;

            try {      // for error handling
            match(LITERAL_group);
            name = LT(1);
            match(ID);
            g.setName(name.getText());
            match(SEMI);
            {    // ( ... )*
                for (;;)
                {
                    if ((LA(1)==ID))
                    {
                        template(g);
                    }
                    else
                    {
                        goto _loop3_breakloop;
                    }

                }
            _loop3_breakloop:				;
            }    // ( ... )*
            }
            catch (RecognitionException ex)
            {
            reportError(ex);
            recover(ex,tokenSet_0_);
            }
        }
Exemplo n.º 2
0
        //throws RecognitionException, TokenStreamException
        public void group(
		StringTemplateGroup g
	)
        {
            IToken  name = null;

            try {      // for error handling
            match(LITERAL_group);
            name = LT(1);
            match(ID);
            g.setName(name.getText());
            match(SEMI);
            { // ( ... )+
                int _cnt3=0;
                for (;;)
                {
                    if ((LA(1)==ID) && (LA(2)==LPAREN||LA(2)==DEFINED_TO_BE) && (LA(3)==ID||LA(3)==RPAREN))
                    {
                        template(g);
                    }
                    else if ((LA(1)==ID) && (LA(2)==DEFINED_TO_BE) && (LA(3)==LBRACK)) {
                        mapdef(g);
                    }
                    else
                    {
                        if (_cnt3 >= 1) { goto _loop3_breakloop; } else { throw new NoViableAltException(LT(1), getFilename());; }
                    }

                    _cnt3++;
                }
            _loop3_breakloop:				;
            }    // ( ... )+
            }
            catch (RecognitionException ex)
            {
            reportError(ex);
            recover(ex,tokenSet_0_);
            }
        }