<div class="gmail_quote"><div>Sure, but I was trying to avoid sprinking [\t\r\n ]* tokens everywhere throughout my grammar. My lexer currently ignores whitespace outside of comments and string literals and my parser works off the tokens my lexer produces.</div>
<div> </div><div>If what you are saying is correct it sounds like I can't do that, which means my parser's grammar explodes with tons of 'oh and there can be whitespace here, or needs to be whitespace here' kind of tokens :(</div>
<div> </div><div>Ryan<br></div></div><div class="gmail_quote">On Tue, Dec 20, 2011 at 9:04 AM, Fred Hebert <span dir="ltr"><<a href="mailto:mononcqc@gmail.com">mononcqc@gmail.com</a>></span> wrote:<br><blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote">
It can be any whitespace, not necessarily new lines.<br><br><div class="gmail_quote"><div class="im">On Tue, Dec 20, 2011 at 11:45 AM, Ryan Molden <span dir="ltr"><<a href="mailto:ryanmolden@gmail.com" target="_blank">ryanmolden@gmail.com</a>></span> wrote:<br>
</div><blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote"><div><div></div><div class="h5"><div>I have been playing around with making a lexer/parser for Erlang using boost::spirit and using the YRL from lib\stdlib-1.17.5\src\erl_parse.yrl as my grammar. It isn't specifically called out there (or anywhere else I can find), but I assume that newlines are significant and implied as input terminators? </div>
<div> </div><div>For instance the following is accepted by the compiler (ignore the meaninglessness/infinite recursion of blah)</div><div> </div><div>-module .foo.</div><div>blah(F)->blah(F-1).</div><div> </div><div>However, if I put it all on one line, like so:</div>
<div> </div><div><div>-module .foo.blah(F)->blah(F-1).</div><div> </div><div>it is not accepted. It seems to be because .foo.blah is being parsed as a single instance of expr_900, which is defined as</div><div><font face="Consolas"><font face="Consolas"> </font></font></div>
<font face="Consolas"><font face="Consolas"><div><p>expr_900 -> '.' atom<br>expr_900 -> expr_900 '.' atom<br>expr_900 -> expr_max</p>
</div></font></font><div> </div><div>I am fine treating newlines as input terminators but it isn't clear which non-terminals require the presence of a newline and which don't.</div><span><font color="#888888"><div>
</div><div>Ryan</div>
</font></span></div>
<br></div></div><div class="im">_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></div></blockquote></div><br>
</blockquote></div><br>