Related articles |
---|
Using Bison and Delphi mikehahn@rogers.com (Mike Hahn) (2004-11-17) |
Re: Using Bison and Delphi vbdis@aol.com (2004-11-19) |
Re: Using Bison and Delphi mikehahn@rogers.com (Mike Hahn) (2004-11-20) |
Re: Using Bison and Delphi vbdis@aol.com (2004-11-26) |
Re: Using Bison and Delphi vbdis@aol.com (2004-11-28) |
Re: Using Bison and Delphi jeremy.wright@microfocus.com (Jeremy Wright) (2004-11-28) |
Re: Using Bison and Delphi mikehahn@rogers.com (Mike Hahn) (2004-12-05) |
Re: Using Bison and Delphi strohm@airmail.net (John R. Strohm) (2004-12-06) |
From: | vbdis@aol.com (VBDis) |
Newsgroups: | comp.compilers |
Date: | 19 Nov 2004 00:53:27 -0500 |
Organization: | AOL Bertelsmann Online GmbH & Co. KG http://www.germany.aol.com |
References: | 04-11-060 |
Keywords: | Pascal, parse |
Posted-Date: | 19 Nov 2004 00:53:27 EST |
"Mike Hahn" <mikehahn@rogers.com> schreibt:
>I would like to know if it's a good idea to use Bison to generate the
>parser, and then translate Bison's output, either using some tool or
>by hand, into Object Pascal. I am a complete newbie when it comes to
>writing compilers.
Perhaps you should try CoCo/R for your parser, to get Pascal code
immediately. Since CoCo creates recursive descent parsers, you can
step through the created code when debugging your grammar. Bottom-up
parsers (automatons) are not so easy to debug - if ever. At least I
recommend that you start with a recursive descent parser, to collect
some experience before you go on with bottom-up parsers.
BTW there exist Lex/Yacc (Flex/Bison) ports to Pascal, like tply41a
(Turbo Pascal) or dyacclex (Delphi).
The omission of punctuation between identifiers (dot operator,
argument list separator...) may cause more trouble than it's worth -
worth what at all? Since all tokens (identifiers...) must be separated
somehow, it doesn't make a big difference whether the separation
character is a space, dot, comma or whatsoever. Distinct separation
characters, instead of only whitespace, also allow for easier parsing
(less lookahead) and better diagnostics and error recovery.
DoDi
Return to the
comp.compilers page.
Search the
comp.compilers archives again.