Compiler with adjustable parsers

hackeron@ATHENA.MIT.EDU
Thu, 1 Mar 90 02:01:30 -0500

          From comp.compilers

Related articles
Compiler with adjustable parsers hackeron@ATHENA.MIT.EDU (1990-03-01)
Re: Compiler with adjustable parsers grunwald@foobar.Colorado.EDU (Dirk Grunwald) (1990-03-01)
Re: Compiler with adjustable parsers arnold@audiofax.com (Arnold Robbins) (1990-03-01)
Re: Compiler with adjustable parsers steve@hubcap.clemson.edu (1990-03-01)
Re: Compiler with adjustable parsers dhw@itivax.iti.org (1990-03-02)
Re: Compiler with adjustable parsers pgl@cup.portal.com (1990-03-15)
Re: Compiler with adjustable parsers ipser@vaxa.isi.edu (Ed Ipser) (1990-03-03)
[4 later articles]
| List of all articles for this month |

From: hackeron@ATHENA.MIT.EDU
Date: Thu, 1 Mar 90 02:01:30 -0500

Does anyone know of a compiler/language that allows you to specify changes
to how the language is parsed (in part at least) from withing the program.
I'm thinking of something like having statements in the language that define
how to recognize data types. for example one could have a data type set
that is usually defined as follows:


set1 : set[real] := { 23.0 12.0 34.4 2.3 34.6 2.58 387.2 }


but have a statement in the language that changes the syntax to :


set1$set.real = ( 23.0 12.0 34.4 2.3 34.6 2.58 387.2)


where the things that change are the terminals that separate the sections and
delimit the sections of the definition.


Are there such compilers that can change their parsing grammars (or augment
them) at compile time ?


---Harris
[Fifteen years ago Ned Irons' IMP72 let you stick BNF in the middle of the
program. It worked, but led to some pretty obscure programs since everyone
redefined the syntax all over the place. The compiler was also very slow
since it had to use Earley's algorithm to handle ambiguous syntax. I don't
know if anyone does this sort of thing now. -John]





Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.