[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

name conflicts

-----Original Message-----
From: Navindra Umanee [mailto:navindra@cs.mcgill.ca]
Sent: Wednesday, May 27, 1998 8:40 AM
To: sablecc-list@sable.mcgill.ca
Subject: name conflicts

Montreal Tue May 26 20:20:27 1998

statement =
  {if_then}                      /* Node is called AIfThenStatement */
    if_then_statement |

  {while}                        /* Node is called AWhileStatement */

if_then_statement =              /* Node is called AIfThenStatement */

while_statement =               /* Node is called AWhileStatement */

Wouldn't it be nice if SableCC didn't generate such conflicts?  Maybe
it would be nice if productions with single alternatives had a
different prefix as opposed to productions with multiple alternatives
(right now the prefix is A in both cases).


But what happens if 'if_then_statement' acquires an alternative other than 'blah'? (Like an 'if' without a 'then'.) You have to change your references to SIfThenStatement (say) to AIfThenStatement (or whatever) anyway.

And (I ask genuinely) why break out the if and while statements (the blahs and blehs) from the 'statement' production, if there is only one alternative?

BTW, when you say AFooStatement to yourself, do you think 'alternative production type foo statement' or do you think 'a foo statement'? I do the latter, which makes me wish for AnIfStatement...


Get free e-mail and a permanent address at http://www.netaddress.com/?N=1