Using ANTLR
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Kevin_Szerszen
Posted On:   Sunday, March 25, 2001 07:13 AM

I am a total beginner using tools like YACC, JavaCC and ANTLR. Can any expert show me how I can use ANTLR to create compiler for an EASY grammar like so..  := PROGRAM BEGIN END  := id  := | ;  := |  := id :=  := | + | -    More>>

I am a total beginner using tools like YACC, JavaCC and ANTLR. Can any expert show me how I can use ANTLR to create compiler for an EASY grammar like so..




























































 := PROGRAM BEGIN
END
 := id
 := |
;
 := |
 := id :=
 := | + |
-
 := | *
| DIV
 := digit | (expr) | id
 := FOR DO
 := id := to
 := | BEGIN END



I have tried to read through the users manual, and even a tutorial on it using a different grammar. I am not doing ver well with this at all. Please help.    <<Less

Re: Using ANTLR

Posted By:   Claus_Hirth  
Posted On:   Sunday, April 8, 2001 12:59 AM

Hi Kevin, I have used other tools years ago, such as flex/bison, and coco/r. If you would like to, we could join forces in learning ANTLR. Just email me about it: Claus.Hirth@swissonline.ch

Re: Using ANTLR

Posted By:   Terence_Parr  
Posted On:   Friday, March 30, 2001 08:31 PM

Hi there. That grammar is almost ready to go! Just convert to rule and PROGRAM to "program" or something and you're very close.


Have you seen the simple examples in the grammar or the tutorials at http://www.antlr.org?

About | Sitemap | Contact