[TCS] unused binary operators [message #7397] |
Tue, 25 March 2008 08:23  |
Eclipse User |
|
|
|
Hi,
Assuming I have defined several operators in my TCS file, among these:
operators {
priority 0 { -- highest priority
opSlash = slash, 2;
}
...
And assumin my operatorTemplate does use other operators but not the given
one above, "opSlash", my generated grammar will look like this:
priority_0 returns[Object ret2] @init {java.lang.String opName=null;
org.antlr.runtime.Token firstToken=input.LT(1);}
: (ret=primary_expression ((SLASH {opName = "/";} ()))*)
{
ret2=ret;
}
This means any number of trailing slashes would be allowed, even though I
would think the intention of not using this operator in the
operatorTemplate would indicate this not to be wished.
Is this a bug, or would the TCS be invalid in this case (Meaning in the
future there might be an error:"Unused operator in OperatorList")?
|
|
|
Re: [TCS] unused binary operators [message #7410 is a reply to message #7397] |
Tue, 25 March 2008 18:33  |
Eclipse User |
|
|
|
Hello,
> Is this a bug, or would the TCS be invalid in this case (Meaning in the
> future there might be an error:"Unused operator in OperatorList")?
There will be an error marker: "Unused operator: <operator-name>" on the
operator.
Thanks for reporting this.
Regards,
Frédéric Jouault
|
|
|
Powered by
FUDForum. Page generated in 0.04212 seconds