|bison and/or antlr ? firstname.lastname@example.org (SomeDeveloper) (2007-06-30)|
|Re: bison and/or antlr ? email@example.com (George Neuner) (2007-06-30)|
|Re: bison and/or antlr ? firstname.lastname@example.org (Ron AF Greve) (2007-07-01)|
|Re: bison and/or antlr ? cfc@shell01.TheWorld.com (Chris F Clark) (2007-07-02)|
|Re: bison and/or antlr ? email@example.com (Tom Copeland) (2007-07-03)|
|Re: bison and/or antlr ? firstname.lastname@example.org (George Neuner) (2007-07-04)|
|Re: bison and/or antlr ? cfc@shell01.TheWorld.com (Chris F Clark) (2007-07-07)|
|Re: bison and/or antlr ? email@example.com (George Neuner) (2007-07-09)|
|[2 later articles]|
|From:||George Neuner <firstname.lastname@example.org>|
|Date:||Sat, 30 Jun 2007 22:44:34 -0400|
|Posted-Date:||01 Jul 2007 21:51:14 EDT|
On Sat, 30 Jun 2007 11:24:33 -0000, SomeDeveloper
>I'm new to the (wonderful) world of compilers.
>1. If I could learn / master ONLY ONE of these two tools, which one
>2. If I could learn / master BOTH, which one should I pick first?
Bison. Antlr is easier for a novice to use and has other conveniences
for more experienced users, but for purely educational reasons you
should bang your head against ... err, I mean learn ... Bison first.
Bison's GLR parsers and Antlr's predicated LL(K>=1) parsers are
roughly equal in capability (Bison has a slim advantage for certain
hideously complex grammars that you will likely never encounter). The
major drawback to Bison is that it does not also produce scanners,
requiring use of another tool called Flex.
Antlr provides one-stop shopping, producing both parsers and scanners
and also targets more programming languages - Bison/Flex targets only
C or C++, Antlr targets C,C++,C#,Java,Python,Ruby & others. Antlr's
own generated scanners are a bit slower than Flex's, but for advanced
users Antlr offers a way to substitute other scanners (depends on
>For theory / concepts... I'm intending to refer to the 1st edition of
>the Dragon Book, even though the 2nd, completely rewritten edition is
>now available. This is because I don't have a need to write a very
>sophisticated compiler, rather only a simple/crude one for our in-
>house development needs. I will be more than happy as long as I can
>transform language A to language B. Thus...
>3. ...for my simple compiler writing needs, can I confidently rely on
>just one book: the Dragon Book 1st edition?
There are 3 "dragon" books:
Principles of Compiler Design (1977) - "green dragon"
Compilers: Principles, Techniques, and Tools (1986) - "red dragon"
Compilers: Principles, Techniques, and Tools, 2nd ed. (2006) - "purple
The green book is hopelessly out of date. The red book is okay for
parsing and basic IR manipulation but does not cover modern IR
representations like SSA or value numbering and IR optimizations that
depend on their use. Likewise the red book covers only basic code
generation and optimization.
If you only want one book, get the new purple dragon or go some other
way. For basic to intermediate coverage I happen to like Cooper &
Torczon's "Engineering a Compiler", ISBN 9781558606982. The topic of
books comes up periodically so you should be able to Google some of
the discussions for other recommendations.
Return to the
Search the comp.compilers archives again.