On Sun, Nov 3, 2013 at 7:08 PM, Timothee Cour <[email protected]>wrote:
> > On Sun, Nov 3, 2013 at 1:13 AM, Philippe Sigaud <[email protected] > > wrote: > >> >> My current plan is to write different engines, and letting either the >> user select them at compile-time, or to have the parser decide which one to >> use, depending on the grammar. I'm pretty sure the 'Type 3' parts of a >> grammar (regular expressions) could be bone by using std.regex, for example. >> > > even lexing can't be done with regex, eg nesting comments : /+ ... +/ > Also, although it may seem cleaner at first to combine lexing and parsing > in 1 big grammar (as done in pegged), it usually is faster do feed a > (separate) lexer output into parser. > Lexing, yes. I was imprecise: even in a context-free grammar, some rules are regular and could use std.regex (the ct part) as the underlying engine, just for that rule.
