[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
%prec using undefined token
From: |
Florian Krohm |
Subject: |
%prec using undefined token |
Date: |
Tue, 29 Dec 2009 19:03:55 -0500 |
User-agent: |
KMail/1.12.2 (Linux/2.6.31-16-generic; KDE/4.3.2; i686; ; ) |
Hello,
I was debugging shift/reduce conflicts in a grammar and tracked
down the problem to a typo. I had misspelled a token name in a
%prec directive. The misspelled token name was an undefined token.
Like so:
%token INT
%left '-'
%left UMINUS
%%
expr: term
| expr '-' expr
| '-' expr %prec UNINUS
;
term: INT
| '(' expr ')'
;
bison 2.4.1 was silent about it even with --warnings=all
It would be consistent to issue an error about this situation.
After all one cannot use an undefined token elsewhere in a rule.
So why should this be allowed in %prec?
Florian
- %prec using undefined token,
Florian Krohm <=