Scanner / Parser for D2

Arild Boes abo at dae.dk
Fri Apr 24 02:35:45 PDT 2009


Thanks.

I had not really thought about efficiency of the scanner with regards to 
realtime usage, and you are proberbly right about scanning/lexing on a 
line by line basis. Maybe the right thing to do, is to write a custom 
scanner that accomodates that. I was trying to avoid this however, 
because changes in the language, means changing the lexer obviously.
An viable alternative would be to use some scanner generator, that suits 
my needs. Now only the grammar needs to be updated.

The DCoder thing sounds interesting.

/ab

Unknown W. Brackets skrev:
> I went and rewrote the bulk of the main parser/lexer in a wa

y that was
> more VSIP-friendly, which worked out for me.  Unfortunately, it's just a 
> separate thing, and I need to update it badly at this point.
> 
> One problem is, you really want to be able to scan/lex by line.  If you 
> don't do some caching/optimization based on that in Visual Studio, 
> you'll be eating dirt.  The design of the parser and lexer in D doesn't 
> really lend itself to that, as-is.
> 
> But, I never went much farther than colored tokens and brace matching, 
> and it's been a few months since I've had time to mess with it.
> 
> You may also be interested in Dave Sieber's DCoder, which was on dsource 
> iirc, although it was built trying to use yacc/etc. for D, which didn't 
> really work out well at the time.  It was for 2003 iirc.
> 
> -[Unknown]
> 



More information about the Digitalmars-d mailing list