[antlr-interest] Error in the method specialStateTransition(int, IntStream)

Jim Idle jimi at temporal-wave.com
Fri May 20 09:04:45 PDT 2011


SPL_CHARS  :  ('\U0000' .. '\UFFFF')+;


The '+' in this means match everything and keep matching everything. You
cannot use + here, you need:

SPL_CHARS  : .;

Then use SPL_CHARS+ in your grammar not (.)+

Though I think you would be better writing a small piece of code to
process this really; ANTLR is a bit overkill for "set x y"

Jim

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of preitz sharma
> Sent: Friday, May 20, 2011 1:28 AM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] Error in the method
> specialStateTransition(int, IntStream)
>
> Hi,
> I need to develop a grammar with the following structure:
>
> set <Param-Name> <Param-Val>
>
> The grammar which I have developed is working fine except for one
> Problem:
>
> -> If the Param-Val does not match the constraints defined for certain
> Param_Name, then I need to throw an error.
>
>     I am doing it like this:
>
>     command:    SET ARRAYSIZE ( Int  {/*Process the arraysize*/}
>                     | (.)+ {/*Display eror message*/})
>                   ;
>     Int:    ('0'..'9')+;
>     Char:    ('a'..'z');
>     SPL_CHARS  :  ('\U0000' .. '\UFFFF')+;
>
> The problem is that I am getting an error: "The code of method
> specialStateTransition(int, IntStream) is exceeding the 65535 bytes
> limit"
> What should I do?
> PS: The grammar which I have to write is pretty big.. If I make
> SPL_CHARS
> :  ('\U0000' .. '\UFFFF')  then its working fine Please suggest some
> solution..
>
> Thanks
> Preeti Sharma
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
> email-address


More information about the antlr-interest mailing list