[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SableCC vs. Antlr?
I just wanted to put some relativity into some claims... It really
depends what you do with the tools;-) See below.
fidel viegas wrote:
> At the moment the drawbacks are the following:
>
> 1)Generation of efficient compilers such as the ones
> generated by JavaCC, Antlr or CUP.
This is all relative. You have to compare a JavaCC/Antlr lexer/parser
that also builds an AST, with nodes for every token, including
"comments", to SableCC. Then you might see that the difference in
efficiency is not so big. [Has anybody actually done such a
comparison?]
Also, SableCC guarantees scanning/parsing in O(souce code length + AST
size). If you use some of the features of JavaCC/Antlr, you can
generate code with worst case exponential complexity! (Although, this
ignores the constant factors which might be a little higher in SableCC).
Etienne
--
----------------------------------------------------------------------
Etienne M. Gagnon, M.Sc. e-mail: egagnon@j-meg.com
Author of SableCC: http://www.sablecc.org/
and SableVM: http://www.sablevm.org/