<div dir="ltr">If I decided to go with the multiple lexers route to basically change "modes" while I'm in the context of parenthesis... how would one do this? Should I create an action like<div><br></div><div style>
<div>(define parameter-lexer</div><div> (lexer</div><div> [(eof) 'EOF]</div><div> [(:or "V" "Z" "B" "S" "C" "I" "J" "F" "D") (token-SIMPLE_TYPE lexeme)]</div>
<div> [className (token-CLASS_NAME lexeme)]))</div><div><br></div><div style>And </div><div style><div>(define node-lexer</div><div> (lexer</div><div> [(eof) 'EOF] </div><div> [".method" 'dirMethod]</div>
<div> ...</div><div> ["(" `(OP ,(parameter-lexer input-port))]</div><div> [")" 'CP]</div><div> ...))</div></div></div><div class="gmail_extra"><br>This would seem to create some artificial hierarchy that the parser would have to understand (a list within the existing list for example?)? Should I flatten afterwards to get rid of that?</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Would love to see a concrete example of multiple lexers in action if someone has it.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Thanks much!</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">David</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jun 8, 2013 at 10:05 PM, Jon Zeppieri <span dir="ltr"><<a href="mailto:zeppieri@gmail.com" target="_blank">zeppieri@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The results you're seeing are consistent with longest match;<br>
"ILandroid" is longer than "I." The order of the [trigger action-expr]<br>
pairs won't affect that. The order only affects which action is chosen<br>
for an ambiguous match, but this case isn't ambiguous.<br>
<br>
I don't think you can do what you're trying to do with only a (single)<br>
lexer, unless there are some additional rules that aren't expressed in<br>
your grammar (for example, "qualifiers cannot start with upper-case<br>
letters").<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
On Fri, Jun 7, 2013 at 7:44 PM, David Weinstein <<a href="mailto:dweinst@insitusec.com">dweinst@insitusec.com</a>> wrote:<br>
> Can anyone explain the behavior that is observed here with the<br>
> parser-tools/lexer. I think I'm overlooking something but both precedence<br>
> and trying to make the longest match should be creating the expected<br>
> behavior (please see comments in the .rkt). Thanks for your help!<br>
><br>
><br>
> David<br>
><br>
><br>
</div></div><div class="HOEnZb"><div class="h5">> ____________________<br>
> Racket Users list:<br>
> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
><br>
</div></div></blockquote></div><br></div></div>