I have written a C parser using JavaCC and now want to generate AST for the parser using IMP IDE. Would there be any problem with JavaCC generated parser or the IMP manages most of hand-written parsers?
uff wrote:
> I have written a C parser using JavaCC and now want to generate AST for
> the parser using IMP IDE. Would there be any problem with JavaCC
> generated parser or the IMP manages most of hand-written parsers?
IMP has no problems with JavaCC, ANTLR, or hand-written parsers.
Likewise, IMP can work with any kind of AST, but it sounds as though
you're considering using LPG for the ASTs? I'm not sure why that is,
but it might be easier to use the JavaCC-generated ASTs instead. If
on the other hand you do decide to use LPG-generated ASTs, the only
downside is having a parallel version of the grammar that LPG can
consume, just to get the ASTs. IMP itself doesn't care that one
framework generated the parser and another the AST hierarchy.
--
Cheers,
-- Bob
--------------------------------
Robert M. Fuhrer
Research Staff Member
Programming Technologies Dept.
IBM T.J. Watson Research Center
uff wrote:
> Adding one more question:
> How does the LPG parser incorporate C header files while parsing the C
> source file?
LPG has no specific support for doing preprocessing. At this moment, neither
does IMP, so people who need preprocessing roll their own by incorporating
the preprocessing inside their IParseController implementations, before
calling the "real" parser.
Hope that helps!
--
Cheers,
-- Bob
--------------------------------
Robert M. Fuhrer
Research Staff Member
Programming Technologies Dept.
IBM T.J. Watson Research Center
Likewise, IMP can work with any kind of AST, but it sounds as though
you're considering using LPG for the ASTs? I'm not sure why that is,
but it might be easier to use the JavaCC-generated ASTs instead. If
on the other hand you do decide to use LPG-generated ASTs, the only
downside is having a parallel version of the grammar that LPG can
consume, just to get the ASTs. IMP itself doesn't care that one
framework generated the parser and another the AST >hierarchy.
I didn't find any open source for AST creation using JavaCC for C Parser, so was looking for some hand-made option in form of IMP.
If you could give any pointers to open source AST, it would be helpful.
Preprocessing is a bit nasty job, I hope I am able to make it work using IParseController.
Hi uff,
i've i question for you.
I have wrote a JavaCC parser for my language but i don't know how i could integrate this in my IMP project so i wanted to ask you how you did it...