[antlr-interest] Is it necessary to write the 'main' code inside the grammar?
Jim Idle
jimi at temporal-wave.com
Thu Nov 13 16:06:38 PST 2008
On Thu, 2008-11-13 at 17:51 -0600, Vishwanath Hawargi wrote:
> Hello,
> I am newbie to ANTLR and I am trying to implement a parser.
> I wrote a grammar file and the grammar check is fine and i can
> successfully generate either java / c code.
>
> My grammar file has only list of Literals and Parser rules. and to
> generate the C code, i have put
> options { language = Cpp;}
>
> other than these, there are no more sections.
>
> I am not able to use the generated files now. Couldnt get any sample
> code to use the lexer.c and parser. files.
> What do i have to write in the main() ? Can i write one independantly
> without writing the @init part in the grammar?
> Kindly throw some light on this... treat me as a layman and show me
> the steps please!
>
> Also, I am not able to locate C++ include files in the ANTLR site,
> could someone help me locate them?
> (trying to change the 'language' to cpp, gives a cpp.stg file error.)
>
> Eventually i want c++ code generated..
> please help
Assumign you ar suign ANTLR 3, then use language=C; but compile the
generated files as C++. I am working on C++ target reasonably actively
now in the hope to complete it before the end of the year.
Jim
>
> thanks.
> V
>
> 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