[antlr-interest] Yacc & Lex to ANTLR
Loring Craymer
craymer at warpiv.com
Mon Apr 3 15:14:01 PDT 2006
The sensible approach is probably to use the lex code directly via flex or
JLex (or any other of the lex "clones" that generates code for your desired
target language and can be interfaced with an ANTLR parser), write a
converter for yacc BNF (BNF is a _very_ simple language; translating yacc
BNF to ANTLR EBNF should be easy) that handles everything but operator
precedence (precedence could be handled, but it would take more work to
support precedence translation than it would to modify the code by hand),
and go from there.
The BNF translator should take one or two days to implement, precedence
translation might take a few days (although you can probably "steal" an
expression grammar instead of doing the translation), and glueing the
application together another day or two. You may have to do some
refactoring to get the translator to work (see Ter's comment on ANTLRWorks),
but the actual translation should not be a major effort.
--Loring
_____
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Gevik babakhani
Sent: Monday, April 03, 2006 2:09 PM
To: 'ANTLR Interest'
Subject: [antlr-interest] Yacc & Lex to ANTLR
Folks,
Does anyone any tool that can convert Yacc/Lex to ANTLR?
Regards,
Gevik.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20060403/e7740c13/attachment.html
More information about the antlr-interest
mailing list