* src/reader.c (grammar_current_rule_prec_set).

(grammar_current_rule_check): New, eved out from...
(readgram): here.
Remove `xaction', `first_rhs': useless.
* tests/input.at (Type clashes): New.
* tests/existing.at (GNU Cim Grammar): Adjust.
This commit is contained in:
Akim Demaille
2002-06-11 08:08:22 +00:00
parent 1485e106a4
commit 9af3fbce7c
5 changed files with 95 additions and 37 deletions

View File

@@ -907,7 +907,7 @@ MBEE_LISTV : /*EMPT*/
LISTV : HIDENTIFIER { regDecl($1, type, KNOKD, CDEFLT);}
| FPP_CATEG HDOTDOTDOT { regDecl(varargsid, TVARARGS, KNOKD, categ);}
| HIDENTIFIER { regDecl($1, type, KNOKD, CDEFLT);}
HPAREXPSEPARATOR LISTV
HPAREXPSEPARATOR LISTV {}
| FPP_SPEC
| FPP_SPEC
HPAREXPSEPARATOR LISTV
@@ -947,7 +947,7 @@ FPP_PROC_DECL_IN_SPEC: MBEE_TYPE HPROCEDURE
IDENTIFIER_LISTV: HIDENTIFIER { regDecl($1, type, kind, categ);}
| HDOTDOTDOT { regDecl(varargsid, TVARARGS, kind, categ);}
| HIDENTIFIER { regDecl($1, type, kind, categ);}
HPAREXPSEPARATOR IDENTIFIER_LISTV
HPAREXPSEPARATOR IDENTIFIER_LISTV {}
;
MBEE_MODE_PART : /*EMPT*/
| MODE_PART
@@ -1153,7 +1153,7 @@ EXPRESSION_SIMP : EXPRESSION_SIMP
| HNONE { mout(MNONE);$$=NULL;}
| HIDENTIFIER
{ $<ident>$=$1;}
MBEE_ARG_R_PT
MBEE_ARG_R_PT {}
| HTHIS HIDENTIFIER { mout(MTHIS);
moutId($2);$$=NULL;}
| HNEW

View File

@@ -24,7 +24,6 @@ AT_BANNER([[Input Processing.]])
## Invalid $n. ##
## ------------ ##
AT_SETUP([Invalid $n])
AT_DATA([input.y],
@@ -43,7 +42,6 @@ AT_CLEANUP
## Invalid @n. ##
## ------------ ##
AT_SETUP([Invalid @n])
AT_DATA([input.y],
@@ -56,3 +54,28 @@ AT_CHECK([bison input.y], [1], [],
]])
AT_CLEANUP
## -------------- ##
## Type clashes. ##
## -------------- ##
AT_SETUP([Type clashes])
AT_DATA([input.y],
[[%token foo
%type <bar> exp
%%
exp: foo {} foo
| foo
| /* Empty. */
;
]])
AT_CHECK([bison input.y], [1], [],
[[input.y:5: type clash (`bar' `') on default action
input.y:6: type clash (`bar' `') on default action
input.y:7: empty rule for typed nonterminal, and no action
]])
AT_CLEANUP