[antlr-interest] C++ Target First cut

Gokulakannan Somasundaram gokul007 at gmail.com
Sun Feb 12 03:03:03 PST 2012


Fixed a memory leekage. Even if there are any more memory leekages, if the
user uses a memory pool for all the allocation needs of the Parser and
finally drops the memory pool at the end of parsing, the leekages can be
totally avoided.

Thanks,
Gokul.

On Sun, Feb 12, 2012 at 2:31 PM, Gokulakannan Somasundaram <
gokul007 at gmail.com> wrote:

> Hi,
>    I have made the C++ Target working for a small example. Now i need the
> help of everyone who needs a C++ Parser to test it and report me with the
> bugs. This would help us to complete the C++ Target. I have made it working
> with the dynamic scopes example, which is also present in the attachment.
> I will also test with other examples.
>   I would also welcome any suggestions that might make the usage more
> intuitive. Currently, just to work with the defaults, we need to write a
> header file like this and include it like this
>
> @lexer::includes
> {
>    #include "UserTraits.hpp"
>    #define USER_NAMESPACE User
> }
>
> @parser::includes
> {
>    #include "UserTraits.hpp"
>    #define USER_NAMESPACE User
> }
>
> Of course the namespace #define is optional. But the UserTraits is
> necessary and it looks like this for the generated lexer and parser TLexer
> and TParser.
>
>
> namespace User {
>
> //If you need to override, copy the traits here and override the necessary
> traits
> #include <antlr3traits.hpp>
>
> class TLexer;
> class TParser;
>
> typedef StreamTraits<TLexer, TParser> TTraits;
> typedef TTraits TLexerTraits;
> typedef TTraits TParserTraits;
>
>
> }
>
>
> Please let me know, if you need any clarifications. I have also fixed the
> bugs testing it with g++.
>
> Thanks,
> Gokul.
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Cpp.7z
Type: application/octet-stream
Size: 106734 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20120212/14edbd65/attachment-0001.obj 


More information about the antlr-interest mailing list