<div dir="ltr">for lexing there's already dscanner we could use (while we wait for perhaps a autogenerated lexer); <div>so I think priority is on the autogenerated parser (dscanner has one but hand designed), where it's still unknown what will work well.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Nov 4, 2013 at 2:43 AM, Dmitry Olshansky <span dir="ltr"><<a href="mailto:dmitry.olsh@gmail.com" target="_blank">dmitry.olsh@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">04-Nov-2013 12:28, Robert Schadek пишет:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
On 11/04/2013 06:48 AM, Philippe Sigaud wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
On Sun, Nov 3, 2013 at 7:08 PM, Timothee Cour<br></div><div class="im">
<<a href="mailto:thelastmammoth@gmail.com" target="_blank">thelastmammoth@gmail.com</a> <mailto:<a href="mailto:thelastmammoth@gmail.com" target="_blank">thelastmammoth@gmail.<u></u>com</a>>> wrote:<br>
<br>
<br>
    On Sun, Nov 3, 2013 at 1:13 AM, Philippe Sigaud<br></div>
    <<a href="mailto:philippe.sigaud@gmail.com" target="_blank">philippe.sigaud@gmail.com</a> <mailto:<a href="mailto:philippe.sigaud@gmail.com" target="_blank">philippe.sigaud@gmail.<u></u>com</a>>>wrote:<div class="im">
<br>
<br>
<br>
        My current plan is to write different engines, and letting<br>
        either the user select them at compile-time, or to have the<br>
        parser decide which one to use, depending on the grammar. I'm<br>
        pretty sure the 'Type 3' parts of a grammar (regular<br>
        expressions) could be bone by using std.regex, for example.<br>
<br>
<br>
    even lexing can't be done with regex, eg nesting comments : /+ ... +/<br>
    Also, although it may seem cleaner at first to combine lexing and<br>
    parsing in 1 big grammar (as done in pegged), it usually is faster<br>
    do feed a (separate) lexer output into parser.<br>
<br>
<br>
Lexing, yes. I was imprecise: even in a context-free grammar, some<br>
rules are regular and could use std.regex (the ct part) as the<br>
underlying engine, just for that rule.<br>
</div></blockquote>
Lexing can not be done with regex. Think myArray[1. ] ! What is next a<br>
dot or a number.<br>
</blockquote>
<br>
You could use lookahead extension ;)<br>
<br>
In general I would not recommend ATM to use std.regex for performance-critical lexer if only because it wasn't tuned for such a use case yet.<br>
<br>
I have plans for extending std.regex capabilities in many directions, lexing being one important use case.<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Dmitry Olshansky<br>
</font></span></blockquote></div><br></div>