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

Re: help needed with grammar



Hi Pieter,

Pieter van der Spek wrote:
This gives the following error:
[474,15] class is an invalid element name.
... I don't understand why I'm getting this message. Is there anyone who can
explain this to me ?

SableCC automatically provides accessor methods for getting/setting elements of an alternative, called getName()/setName() respectively.

Unfortunately, the java.lang.Object class does provide a getClass() method with
very specific sematics, so SableCC cannot provide getClass()/setClass() accessors.

You'll have to rename your element to something other than "class", e.g.:
class = [class_token]:T.class [class_name]:identifier inheritance_clause? class_body? end [end_identifier]:identifier;

Have fun!

Etienne

--
Etienne M. Gagnon, Ph.D.             http://www.info.uqam.ca/~egagnon/
SableVM:                                       http://www.sablevm.org/
SableCC:                                       http://www.sablecc.org/