[antlr-interest] REAL or int or Range

Alexander Gängel alexander at gaengel.de
Wed Jan 9 15:10:29 PST 2008


This is mysterious,

I tried it on another PC and still got only the 9

Some stats of the systems I tried

Both use Windows Vista Prof with java jdk1.6.0_10 and antlrworks 1.1.5
under Compiler I have set javac and Path C:\Program
Files\Java\jdk1.6.0_10\bin
for Classpath nothing is Checked

Alexander

Fırat Küçük schrieb:
> this is my antlrworks interpreter output:
>
>
>
> 2008/1/9, Alexander Gängel <alexander at gaengel.de
> <mailto:alexander at gaengel.de>>:
>
>     I have a Problem in My grammar
>
>     I try to decide if I got in Integer an Real or an Range like 0..9
>
>     It works for Int and Real but if I input 0..9 in Antlrworks in the
>     Input frame is only 9 and the Parse Tree is like ths:
>
>     Where is the Rest of my Input?
>
>     My grammar is like this:
>     grammar test;
>     start    :
>         uint_or_real
>         |(uint_or_real RANGE uint_or_real)+;
>
>     uint_or_real
>         :   
>         UINT
>         |REAL;
>
>     REAL
>             :   
>             UINT 
>                 (
>                         Exponent FloatTypeSuffix?
>                         |FloatTypeSuffix
>                             |
>                                     (DOT (UINT Exponent? FloatTypeSuffix?
>                             )
>                     )
>                 );
>
>
>     fragment
>     Exponent : ('e'|'E') ('+'|'-')? UINT ;
>     UINT : DIGIT_10+ ;
>
>     fragment DIGIT_10 : '0'..'9' ;
>
>     fragment
>     FloatTypeSuffix : ('f'|'F'|'d'|'D') ;
>
>     RANGE    :    '..';
>     DOT    :    '.';
>
>     WS    :  (' '|'\r'|'\t'|'\u000C'|'\n') {$channel=HIDDEN;};
>
>
>
>
> -- 
> Öğr. Gör. Fırat Küçük
> ADAMYO Distance Learning
> SAKARYA University / TURKEY
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080110/b044ba93/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 3680 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20080110/b044ba93/attachment.jpe 


More information about the antlr-interest mailing list