An idea for an extensible, Lexer/Parser/Framework for compilers.

BCS BCS at pathlink.com
Thu Mar 6 14:09:55 PST 2008


Ryan Bloomfield wrote:

> The generator could then scan all the classes and 
 > generate a grammer description that could be used
 > to make the lexer and parser.

with respect to the above, take a look at this:

http://www.dsource.org/projects/scrapple/browser/trunk/dparser/dparse.d

it doesn't do lexing but it is a fully functional parser generator that 
does it's processing in-language using templates and string precessing. 
The input is a BNF text string.

It's very limited at this time because it generates huge symbols (it 
takes 700MB of ram to compile a ~50 rule grammar) but I have some ideas 
on how to fix much of that and another idea on how to make it easier to 
build in common actions.

Is that something along the lines of what you are thinking of?



More information about the Digitalmars-d mailing list