Actually that's an interesting point. Is there really no other place in the Erlang grammar where whitespace is required? My gut instinct tells me there must be a few, because every language has a few right? I mean, if nothing else to separate two identifiers? But thinking a little more, I realize Erlang doesn't have "identifiers" in the sense most other languages do and even then, there's always some sort of punctuation. Is this period business the only exception? <div>
<br></div><div>dan<br><br><div class="gmail_quote">On Tue, Dec 20, 2011 at 12:33 PM, Ryan Molden <span dir="ltr"><<a href="mailto:ryanmolden@gmail.com">ryanmolden@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<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>
<span class="HOEnZb"><font color="#888888">
<div> </div><div>Ryan<br></div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_quote">On Tue, Dec 20, 2011 at 9:04 AM, Fred Hebert <span dir="ltr"><<a href="mailto:mononcqc@gmail.com" target="_blank">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>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><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>_______________________________________________<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>
</div></div><br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">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></blockquote></div><br></div>