[antlr-interest] C++ Target First cut
Gokulakannan Somasundaram
gokul007 at gmail.com
Sat Feb 11 22:31:05 PST 2012
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: 106717 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20120212/ae7bd72d/attachment.obj
More information about the antlr-interest
mailing list