|Parsers, grammars and BNF firstname.lastname@example.org (maniac) (2009-11-12)|
|Re: Parsers, grammars and BNF email@example.com (Philip Herron) (2009-11-13)|
|Re: Parsers, grammars and BNF firstname.lastname@example.org (glen herrmannsfeldt) (2009-11-16)|
|Re: Parsers, grammars and BNF cfc@shell01.TheWorld.com (Chris F Clark) (2009-11-15)|
|From:||glen herrmannsfeldt <email@example.com>|
|Date:||Mon, 16 Nov 2009 00:15:33 +0000 (UTC)|
|Organization:||California Institute of Technology, Pasadena|
|Posted-Date:||15 Nov 2009 19:28:25 EST|
Philip Herron <firstname.lastname@example.org> wrote:
> I wouldn't worry about any particular 'formula', the way i figured out
> how to do it was just writing YACC, and reading the dragon book helped
> me a lot as well as there was an o'reilley book Lex and Yacc i have it
> here somewhere it was probably the most useful out of any it shows you
> how to think about the problem easily and well + its very short you
> only need to care about the first ~100 pages the rest is one big SQL
> implementation which just gets very specific.
Many years ago (1977) I worked on a macro-processor called STEP.
Well, someone had written it, declared it finished, and then left.
I got to test it out, try some simple and not so simple problems,
and make some improvements.
As far as I know, the manual still exists but the program itself
does not. It was written in IBM Fortran IV, or maybe standard
Fortran 66. Unlike most macro-processors which recognize patterns
in text without any context, this one pretty much allowed one to
specify the exact syntax (through the SYNTAX macro) that would
be matched, and then generate the appropriate code which would then
be passed back up the parse tree.
One that I did with it was to write a parser for IBM Fortran IV,
or as close as I could get to it. (One complication is that record
boundaries are ignored on input.) It was very easy to write the
macros directly from the BNF in the IBM Fortran syntax checker
manual. (The Fortran reference manuals don't have the BNF.)
I don't know that it ever got wide distribution, but I do wonder
if anyone might still have a copy around somewhere. Otherwise,
unlike lex/yacc, but like most macro-processors, this one
was completely interpreted.
> Although i prefer having a hand-written parser since you can Taylor it
> to be more specific to your implementation, Lex and Yacc are really
> helpful when your still prototyping your language, gives you less to
> worry about when building it.
Return to the
Search the comp.compilers archives again.