[antlr-interest] New Guy Question...
Vinicius Durelli
vinicius.durelli at gmail.com
Sun Jun 5 06:37:10 PDT 2011
Hi George,
I can properly answer most of your questions, as for the tougher/trickier
one I will
1) AFAIK, yes.
2) I think Terence has been working on it.
3) AFAIK, there is just a Pascal grammar. However, you'd better wait for the
veterans' reply.
4) I would solve this like that:
call : C A L L
;
fragment C : ('c' | 'C');
fragment A : ('a' | 'A');
fragment L : ('l' | 'L');
I don't know if it is the best approach though.
Best regards,
Vinicius Durelli
On Sun, Jun 5, 2011 at 10:00 AM, George Spears <george at woh.rr.com> wrote:
>
>
> Hi everyone,
>
> Just dipping my toes in the ANTLR waters do to speak.. In other words, I
> am
> definitely new at this, so a couple quick questions.
>
> 1) Is this list/email address the best way to ask questions?
>
> 2) Any idea when "The Definitive ANTLR book" will be updated? It
> appears to be based on 3.0, whereas the ANTLR product is 3.3. I still
> purchased the book, and it is helping tremendously.
>
> 3) My language of choice is Delphi. Does anyone have a sample
> grammar
> and the Delphi equiv of Test.java that they could send me.? (George at woh
> dot rr dot com)
>
> 4) How do I handle case insensitivity? For example, assume in the
> following grammar that the token 'CALL' can be all caps, all lower letters,
> or a mix. How do I recognize it?
>
>
>
>
>
> grammar T;
>
> /** Match things like "call foo;" */
>
>
>
> CALL : 'CALL';
>
> ID : ('a'..'z'|'A'..'Z')+ ;
>
> INT : '0'..'9'+ ;
>
> NEWLINE:'\r'? '\n' ;
>
> WS : (' '|'\t')+ { $channel=HIDDEN; } ;
>
> MULT: '*';
>
> ASSIGN: '=';
>
> PLUS: '+';
>
> MINUS: '-';
>
>
>
>
>
> r : CALL ID ';' {System.out.println("invoke "+$ID.text);} ;
>
>
>
>
>
>
>
>
>
> Thanks,
>
> George Spears
>
>
>
>
> 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