<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html><body style='font-family: Verdana,Geneva,sans-serif'>
<p><span style="font-family: 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;">This is how i would translate&nbsp;</span><span style="font-family: 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;">'nestedConstraint()' to a regular expression</span></p>
<p><strong>ID?</strong> ( (DOT | HASH) ID)* DOT LEFT_PARENT constraints RIGHT_PARENT</p>
<p>And this is the description in his header</p>
<p>"( ID ( DOT | HASH ) )* ID DOT LEFT_PAREN constraints RIGHT_PAREN"</p>
<p><span style="font-family: 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;">&nbsp;</span></p>
<p><span style="font-family: 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;">The difference is that 'nestedConstraint()'&nbsp;never checks if really starts with ID, so can starts with DOT or HASH, which contradicts his header.</span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>El 2014-01-30 22:18, Edson Tirelli escribi&oacute;:</p>
<blockquote type="cite" style="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px; width:100%"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->
<div dir="ltr"><br />
<div>&nbsp; &nbsp;Claudio,</div>
<div>&nbsp;</div>
<div>&nbsp; &nbsp;I am not sure I understand your question?&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp; &nbsp;I was looking into the method, and, although I would implement it in a different way myself, the current implementation looks correct to me... am I missing something?</div>
<div>&nbsp;</div>
<div>&nbsp; &nbsp;Edson</div>
</div>
<div class="gmail_extra"><br /><br />
<div class="gmail_quote">On Thu, Jan 30, 2014 at 11:16 AM, Claudio Jes&uacute;s S&aacute;nchez Casanueva <span>&lt;<a href="mailto:claudio.sanchez@andanta.es">claudio.sanchez@andanta.es</a>&gt;</span> wrote:<br />
<blockquote class="gmail_quote" style="margin: 0  0  0  .8ex; border-left: 1px  #ccc  solid; padding-left: 1ex;"><span style="text-decoration: underline;"></span>
<div style="font-family: Verdana,Geneva,sans-serif;">
<p>I am studying the drools code and i have seen strange the method 'getNestedConstraintPrefixLenght()' in DRL6Parser.java: If i translate that function to a regular expression in antlr lexer, it would be "ID? ( (DOT | HASH) ID)* DOT LEFT_PARENT", which have few sense.</p>
<p>The header of 'nestedConstraint()' describes the expected the expected result as "( ID ( DOT | HASH ) )* ID DOT LEFT_PAREN constraints RIGHT_PAREN" : it internally calls to 'getNestedConstraintPrefixLenght()', consumes the numbers of items retuned by this, calls to 'constrains()' and cosumes a RIGHT_TOKEN.<br /> For me the expected results described in the header of 'nestedConstraint()' do not correspond with the real results.</p>
<div>
<div>&nbsp;</div>
<div>&nbsp;</div>
</div>
</div>
<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">https://lists.jboss.org/mailman/listinfo/rules-dev</a></blockquote>
</div>
<br /><br clear="all" />
<div>&nbsp;</div>
-- <br />
<div dir="ltr">&nbsp; Edson Tirelli<br />&nbsp; Principal Software Engineer&nbsp;
<div>&nbsp; Red Hat Business Systems and Intelligence Group<br /><br /></div>
</div>
</div>
<br />
<pre>_______________________________________________
rules-dev mailing list
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a>
</pre>
</blockquote>
<div><br />
<div class="Section1">&nbsp;</div>
<div>
<p class="MsoNormal" style="margin-top: 6.0pt; text-align: justify;"><span style="font-size: 8.0pt; color: #7f7f7f;"><!-- o ignored --></span></p>
</div>
</div>
</body></html>