"Ellery Newcomer" <[email protected]> wrote in message news:[email protected]... > > Does GOLD let you manually specify how to resolve the ambiguities? Cuz > you're going to have them with D, and murphy says they're going to be > reduce-reduce :) >
No. Reduce-reduce are errors and require adjusting the grammar accordingly, and shift-reduce require either accepting the "resolve by assuming shift" or adjusting the grammar. > All in all, she sounds pretty sweet. Maybe I'll try porting my D grammar > to GOLD when I'm past exams. > > By the way, do you know if there be any way to put conditional > productions in GOLD grammars? Like if you wanted to have a grammar that > recognizes D1 or D2 dependent on a settable flag? Not possible at this time, unfortunately. > > Wait wait wait wait, just looked on wikipedia, GOLD uses DFAs for > lexing??!!! Please tell me she can do context sensitive lexers, > otherwise how are you going to get perl-style strings let alone nesting > comments? For anything that GOLD doesn't normally support (such as nested comments, more than one pair of block-comments, or indentation increase/decrease), it has a kludge called "Virtual Terminals" ( http://www.devincook.com/goldparser/doc/meta-language/virtual-terminals.htm ). These let you declare a terminal, but then leave it up to the lex/parse engine (ex, Goldie) to identify it however it sees fit. I plan to add a number of very useful ones to Goldie (such as nested comments). I also plan to make an alternate implementation of GOLD that will fill in some of the missing features.
