Path: utzoo!attcan!uunet!aplcen!samsung!think!snorkelwacker!spdcc!ima!esegue!compilers-sender From: hackeron@ATHENA.MIT.EDU Newsgroups: comp.compilers Subject: Compiler with adjustable parsers Message-ID: <1990Mar1.143905.14553@esegue.segue.boston.ma.us> Date: 1 Mar 90 14:39:05 GMT Sender: compilers-sender@esegue.segue.boston.ma.us Reply-To: hackeron@ATHENA.MIT.EDU Organization: Compilers Central Lines: 28 Approved: compilers@esegue.segue.boston.ma.us 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] -- Send compilers articles to compilers@esegue.segue.boston.ma.us {spdcc | ima | lotus}!esegue. Meta-mail to compilers-request@esegue. Please send responses to the author of the message, not the poster.