<div>Great, thanks I will give the YRL a shot (ignoring 'everything to the right of the ':' may really be all that is needed, it wasn't clear to me if that was somehow essentially in expressing what the YRL was trying to represent).</div>
<div> </div><div>Ryan<br><br></div><div class="gmail_quote">On Fri, Nov 11, 2011 at 12:38 PM, Joe Armstrong <span dir="ltr"><<a href="mailto:erlang@gmail.com">erlang@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">
I don't think there are any BNF/EBNF grammars for erlang<div>there might be grammars for subsets of the language but not the</div><div>entire language. The problem with NBF/EBNF/PEG grammars</div><div>is that decent error reporting is very difficult. In practice</div>

<div>virtual all languages use hand written recursive descent parsers</div><div>or LALR(1) parsers for which acceptable error recovery strategies exist.</div><div><br></div><div>The official grammar is: (official means this is the actual grammar used by the erlang compiler and all tools) </div>

<div><br></div><div><a href="https://github.com/erlang/otp/blob/master/lib/stdlib/src/erl_parse.yrl" target="_blank">https://github.com/erlang/otp/blob/master/lib/stdlib/src/erl_parse.yrl</a><br><br></div><div>It you look at the productions they are very similar to yacc</div>

</div><div>ie a tuple is either {} or { exprs }</div><div><br></div><div>The part after the ':' define the parse tree that</div><div>is returned if the expression is recognised.</div><div><br></div><div>A production like:</div>

<div><br></div><div>a -> b c d : {something, '$2'}</div><div><br></div><div>means is we match an 'a' then the parse</div><div>tree we want returned is {something, '$2'}</div><div><br></div><div>