[antlr-interest] Fwd: C++ Target - Second Version - (works with all the examples in Windows and Linux)

Gokulakannan Somasundaram gokul007 at gmail.com
Tue Feb 14 22:58:43 PST 2012


I tried sending this mail yesterday, but it has been stopped, as it has
crossed allowed mail size limit.  So i am sending the files without the
antlr-3.4.jar

Thanks,
Gokul

---------- Forwarded message ----------
From: Gokulakannan Somasundaram <gokul007 at gmail.com>
Date: Wed, Feb 15, 2012 at 4:56 AM
Subject: C++ Target - Second Version - (works with all the examples in
Windows and Linux)
To: antlr-interest at antlr.org


Hi,
   I am attaching the updated C++ Target files. I have checked with all the
examples except the first one "C". I am attaching the files for two -
dynamic_scope and composite_java. Of Course it won't work with TreeParsers.
I have tested it on a 64 bit system on Windows and Linux. (Visual Studio
2010 and g++ 4.4.6).
   I have also attached the antlr-3.4.jar built with the modified Cpp.stg
and CppTarget.java. You can use it for testing. As previously said you need
to define a Traits file. There is a second restriction that has added. In
the generated Parser, the lexer has to get included. So in all the
grammars, you have to write
@parser::include { #include <lexer.h> }

I cannot get away with it, because of the filtering mode option, which
becomes a compile time parameter. But its available only for the Lexer. So
i define it as a trait in the Lexer and in order for Parser to invoke
nextToken method, it has to access that Trait.

The C++ Target also supports island grammars. Anyone can find it how it has
been done by looking at Traits.hpp. Feel free to contact me to ask for any
other examples / help.  Looking forward for the feedback.

Terence,
      Can you please let me know, whether its possible to put it out in the
website as a C++ Target? Please let me know, the stuffs i have to complete
in order to be there. I know i have to write some readme.txt docs.


Thanks,
Gokul.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Cpp.7z
Type: application/octet-stream
Size: 121020 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20120215/d338040a/attachment.obj 


More information about the antlr-interest mailing list