<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Dear all,<DIV><BR class="khtml-block-placeholder"></DIV><DIV>I bumped into a conflict while writing a small grammar. Would be great to know why. The problem seems to come from the Assignment</DIV><DIV>I wish to parse the following:</DIV><DIV>myfunction (a, b, c){ </DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>3 + 10</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>var z</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>z = 50 + foo() </DIV><DIV>}</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Parser:</DIV><DIV>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=</DIV><DIV>Program : FunctionDefinition * {SPProgram new functions: '1'};</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>FunctionDefinition :</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>Id Arguments "{"</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>ExpressionList</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>"}" {SPFunction new name: '1'; arguments: ('2' select: [:o| (o isKindOf: SmaCCToken) not]); expressions: '4'};</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Arguments : "(" ArgumentList ")" {'2'};</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>ArgumentList : ArgumentList "," Id </DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">                </SPAN>| Id </DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">                </SPAN>| ; </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>ExpressionList:</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>Expression ExpressionList</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>| ;</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN></DIV><DIV>Expression : </DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">                </SPAN>FunctionCall<SPAN class="Apple-tab-span" style="white-space:pre">                                </SPAN></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>   | VariableDefinition</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>   | Id "=" ExpressionWithValue {SPAssignment new name: '1'; expression: '3'}</DIV><DIV>        | Expression "+" Number <SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>{SPAddition new left: '1'; right: '3'}</DIV><DIV>        | Expression "-" Number <SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>{SPMinus new left: '1'; right: '3'}</DIV><DIV>        | Number {'1'};</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>FunctionCall :</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>Id ArgumentsInCall <SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>{SPFunctionCall new name: '1'; arguments: '2'};</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>ArgumentsInCall :</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>"(" ArgumentsListInCall ")" {'2' select: [:o| (o isKindOf: SmaCCToken) not]};</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN></DIV><DIV>ArgumentsListInCall :</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>ArgumentsListInCall "," Expression </DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>| Expression</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>| ;</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN></DIV><DIV>VariableDefinition :</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>"var" Id {SPVariableDefinition new name: '2'};</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">                </SPAN></DIV><DIV>ExpressionWithValue :<SPAN class="Apple-tab-span" style="white-space:pre">                                </SPAN></DIV><DIV>        ExpressionWithValue "+" Number <SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>{SPAddition new left: '1'; right: '3'}</DIV><DIV>        | ExpressionWithValue "-" Number <SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>{SPMinus new left: '1'; right: '3'}</DIV><DIV>        | Number {'1'};</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Number : &lt;number&gt; {'1' value asNumber} ;</DIV><DIV>Id : &lt;variable&gt; {'1' value asString} ;</DIV><DIV>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Scanner:</DIV><DIV>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=</DIV><DIV>&lt;number&gt;        :       [0-9]+; </DIV><DIV>&lt;whitespace&gt;    :       \s+; </DIV><DIV>&lt;variable&gt;<SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>: [a-zA-Z] \w* ;</DIV><DIV>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<BR class="Apple-interchange-newline"> <BR></DIV><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Regards,</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Alexandre</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><BR class="khtml-block-placeholder"></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">-- </DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Alexandre Bergel <SPAN class="Apple-converted-space"> <A href="http://www.software-artist.eu">http://www.software-artist.eu</A></SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><BR class="khtml-block-placeholder"></DIV><BR class="Apple-interchange-newline"></SPAN></SPAN></SPAN> </DIV><BR></BODY></HTML>