Mail Archives: djgpp/1999/06/10/10:46:55
>
>I actually found it to be easier to just write my own lexical parser and
>such. The time it would take to learn Bison and Flex would take longer
than
>to just write your own anyhows.
>
>Sean Middleditch
you only have to learn Bison and Flex once. then you can right LALR
grammars to your heart's content. it's faster, easier, and tons more
efficient since compiler design IS one area that tremndoes R&D has been
applied. GCC is an exampe of this.
the other point is that, Bison and Flex come from Lex and YACC, so if you
write your grammars in them, odds are very good that they'll be VERY
portable. in addition, my Lex grammar for a compiled scripting langauge I
wrote is about 80 lines. I don't think that you're going to duplicate that
using a hand-coded lexer.
a final point is efficiency. there are things that make program-generated
parsers and lexers a tremendous advantage over hand-coding: plain speed and
flexibility.
the only real benefit hand-coding gives is control over size: e.g. the
calculator in RHIDE.
-={C}=-
- Raw text -