How do I write a "lexer or parser generators"

Daniel Murphy yebbliesnospam at gmail.com
Thu Jan 23 01:06:34 PST 2014


> "OP"  wrote in message news:qtjpbqxlabjerowdlkfo at forum.dlang.org... I just 
> looked at parse.c and I had no idea there is a precedence table. Why is 
> there one rather than it being embedded like a switch statement which 
> tries to handle all the higher precedence operations calling a function 
> running the next set of precedence? I guess that does sound like a 
> loop/table but I imagined it in switch statements.

The precedence table is mostly just used for leaving off redundant parens 
when printing expressions, not for parsing. 



More information about the Digitalmars-d mailing list