<div><br></div>   Just to explain how the parser recovers from errors, it tries to skip a token that fail to match the construct being parsed. If that still fails, it will skip all tokens until it finds the start of a top level construct (i.e. a statement like a rule, query, declare, etc) and resynch from there. If you have too many different top level keywords, it increases the probability that there will be a keyword clash and it will fail to resynch, resulting in cobolish errors for the rest of the file... :) those who ever forgot a . in a cobol program using a compiler from the 70&#39;s-80&#39;s, that caused the generation of 983045 compilation errors raise their hand! ;)<div>
<br></div><div>   But yes, I see your point, and we might do that.</div><div><br></div><div>   Just another example, most CEP products are still based in SQL-sh languages, and they use the &quot;create&quot; keyword for everything. &quot;create window...&quot;, &quot;create schema/table...&quot; (schema/table meaning event types), etc...</div>
<div><br></div><div>    Edson<br><br><div class="gmail_quote">2011/7/27 Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 26 July 2011 21:28, Edson Tirelli <span dir="ltr">&lt;<a href="mailto:ed.tirelli@gmail.com" target="_blank">ed.tirelli@gmail.com</a>&gt;</span> wrote:<br></div><div class="gmail_quote"><div class="im"><br>
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
<div><br></div><div>QUESTION:</div><div>   As we can see above, we will need several new constructs in order to support features in our roadmap. We have the choice of making them all top level constructs, making the error recovery in the parser a lot more complicated, or we can re-use our declare construct to define these new structures as I presented in the pseudo-code above. Any pros/cons you can see in such approach?</div>


<div><br></div></blockquote></div><div><br>I doubt the &quot;a lot more complicated&quot;. I&#39;d much rather have a &quot;natural language&quot; with a lean syntax than the cobol-ish agglomeration of keywords. Structured/syntax assisted editing should take care of gross errors so that recovery isn&#39;t as important as without these aids.<br>


<br>I vote for OPTION 2. I&#39;m very much against OPTION 3.<br><font color="#888888"><br>Wolfgang<br> </font></div><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
<div class="im"><div>
</div><div>OPTION 1 (more verbose, but simpler and more stable):</div><div>&lt;epDeclaration&gt; ::= declare entry-point &lt;epName&gt; [, &lt;epName]*</div><div>&lt;windowDeclaration&gt; ::= declare window &lt;windowName&gt; &lt;restOfTheWindowDeclaration&gt; end</div>


<div>&lt;typeDeclaration&gt; ::= declare [type] &lt;typeName&gt; &lt;restOfTheTypeDeclaration&gt; end</div><div>    </div><div>OPTION 2 (makes error recovery harder, but it is less verbose):</div><div><div>
&lt;epDeclaration&gt; ::= entry-point &lt;epName&gt; [, &lt;epName]*</div><div>&lt;windowDeclaration&gt; ::= window &lt;windowName&gt; &lt;restOfTheWindowDeclaration&gt; end</div><div>&lt;typeDeclaration&gt; ::= declare &lt;typeName&gt; &lt;restOfTheTypeDeclaration&gt; end</div>


</div><div><br></div><div>OPTION 3:</div><div><div>&lt;epDeclaration&gt; ::= someOtherKeyword entry-point &lt;epName&gt; [, &lt;epName]*</div><div>&lt;windowDeclaration&gt; ::= someOtherKeyword window &lt;windowName&gt; &lt;restOfTheWindowDeclaration&gt; end</div>


<div>&lt;typeDeclaration&gt; ::= declare [type] &lt;typeName&gt; &lt;restOfTheTypeDeclaration&gt; end</div><div><br></div><div><br></div><div>   Edson</div><div><br></div>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>


  JBoss by Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>
</div>
<br></div><div class="im">_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org" target="_blank">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
<br></div></blockquote></div><br>
<br>_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>
</div>