error("end of file expected");
}
else if (tk) {
+#ifndef LLNONCORR
error("%s missing before %s", symbol2str(tk), symbol2str(DOT));
+#endif
insert_token(tk);
}
else {
+#ifndef LLNONCORR
error("%s deleted", symbol2str(DOT));
+#else
+ error("%s not expected", symbol2str(DOT));
+#endif
}
tk_nmb_at_last_syn_err = token_nmb;
}
ds->ds_typedef = 1;
}
|
+ %erroneous
IDENTIFIER
{
error("%s is not a type identifier", dot.tk_idf->id_text);
dot.tk_idf->id_def->df_sc = TYPEDEF;
}
}
+|
+ %illegal
+ IDENTIFIER
|
struct_or_union_specifier(&ds->ds_type)
|
TABGEN= $(UTIL_BIN)/tabgen
LLGEN = $(UTIL_BIN)/LLgen
LLGENOPTIONS = \
- -v
+ -n
SRC_G = $(SRC_DIR)/program.g $(SRC_DIR)/declar.g \
$(SRC_DIR)/expression.g $(SRC_DIR)/statement.g $(SRC_DIR)/ival.g
$(SRC_DIR)/type.c \
$(SRC_DIR)/util.c
GEN_C = tokenfile.c program.c declar.c expression.c statement.c ival.c \
- symbol2str.c char.c Lpars.c next.c
+ symbol2str.c char.c Lpars.c next.c Lncor.c
CFILES= $(SRC_C) $(GEN_C)
SRC_H = \
LLfiles: $(GFILES)
$(LLGEN) $(LLGENOPTIONS) $(GFILES)
@touch LLfiles
+ @if [ -f Lncor.c ] ; then : ; else touch Lncor.c ; fi
hfiles: Parameters $(SRC_DIR)/make.hfiles
$(SRC_DIR)/make.hfiles Parameters
error("end of file expected");
}
else if (tk) {
+#ifndef LLNONCORR
error("%s missing before %s", symbol2str(tk), symbol2str(DOT));
+#endif
insert_token(tk);
}
else {
+#ifndef LLNONCORR
error("%s deleted", symbol2str(DOT));
+#else
+ error("%s not expected", symbol2str(DOT));
+#endif
}
tk_nmb_at_last_syn_err = token_nmb;
}
%default TYPE_IDENTIFIER /* this includes INT, CHAR, etc. */
{idf2type(dot.tk_idf, &ds->ds_type);}
|
+ %erroneous
IDENTIFIER
{
error("%s is not a type identifier", dot.tk_idf->id_text);
dot.tk_idf->id_def->df_sc = TYPEDEF;
}
}
+|
+ %illegal
+ IDENTIFIER
|
struct_or_union_specifier(&ds->ds_type)
|
primary(register struct expr **expp;) :
IDENTIFIER
{dot2expr(expp);}
+|
+ %illegal TYPE_IDENTIFIER
|
constant(expp)
|
TABGEN= $(UTIL_BIN)/tabgen
LLGEN = $(UTIL_BIN)/LLgen
LLGENOPTIONS = \
- -v
+ -n
SRC_G = $(SRC_DIR)/program.g $(SRC_DIR)/declar.g \
$(SRC_DIR)/expression.g $(SRC_DIR)/statement.g $(SRC_DIR)/ival.g
$(SRC_DIR)/stab.c
GEN_C = tokenfile.c program.c declar.c expression.c statement.c ival.c \
- symbol2str.c char.c Lpars.c next.c
+ symbol2str.c char.c Lpars.c next.c Lncor.c
CFILES= $(SRC_C) $(GEN_C)
SRC_H = \
LLfiles: $(GFILES)
$(LLGEN) $(LLGENOPTIONS) $(GFILES)
@touch LLfiles
+ @if [ -f Lncor.c ] ; then : ; else touch Lncor.c ; fi
hfiles: Parameters $(SRC_DIR)/make.hfiles
$(SRC_DIR)/make.hfiles Parameters
*/
register t_token *dotp = ˙
+#ifndef LLNONCORR
error("%s missing before %s", symbol2str(tk), symbol2str(dotp->tk_symb));
+#endif
aside = *dotp;
}
}
else if (tk < 0) {
- error("garbage at end of program");
+ error("end of file expected");
+ }
+ else {
+#ifndef LLNONCORR
+ error("%s deleted", symbol2str(dot.tk_symb));
+#else
+ error("%s not expected", symbol2str(dot.tk_symb));
+#endif
}
- else error("%s deleted", symbol2str(dot.tk_symb));
tk_nmb_at_last_syn_err = token_nmb;
}
name, otherwise the names in the import list are module names.
*/
[ FROM
- IDENT { FromId = dot2leaf(Name);
+ IDENT
+ %substart DefinitionModule;
+ { FromId = dot2leaf(Name);
if (local) {
df = lookfor(FromId,enclosing(CurrVis),0,D_USED);
}
}
]?
IMPORT IdentList(&ImportList) ';'
+ %substart DefinitionModule;
{ if (FromId) {
EnterFromImportList(ImportList, df, FromId);
}
register t_def *df;
} :
MODULE
- IDENT {
+ IDENT
+ %substart DefinitionModule;
+ {
if (state == IMPLEMENTATION) {
int len = strlen(dot.TOK_IDF->id_text);
TABGEN= $(UTIL_BIN)/tabgen
LLGEN = $(UTIL_BIN)/LLgen
LLGENOPTIONS = \
- -v
+ -n
SRC_G = $(SRC_DIR)/program.g $(SRC_DIR)/declar.g \
$(SRC_DIR)/expression.g $(SRC_DIR)/statement.g
$(SRC_DIR)/desig.c $(SRC_DIR)/code.c $(SRC_DIR)/lookup.c \
$(SRC_DIR)/stab.c
GEN_C = tokenfile.c program.c declar.c expression.c statement.c \
- symbol2str.c char.c Lpars.c casestat.c tmpvar.c scope.c next.c
+ symbol2str.c char.c Lpars.c Lncor.c casestat.c tmpvar.c scope.c next.c
CFILES= $(SRC_C) $(GEN_C)
SRC_H = $(SRC_DIR)/LLlex.h $(SRC_DIR)/chk_expr.h $(SRC_DIR)/class.h \
LLfiles: $(GFILES)
$(LLGEN) $(LLGENOPTIONS) $(GFILES)
@touch LLfiles
+ @if [ -f Lncor.c ] ; then : ; else touch Lncor.c ; fi
hfiles: Parameters $(SRC_DIR)/make.hfiles
$(SRC_DIR)/make.hfiles Parameters
ActualParameters(&(nd->nd_RIGHT))?
|
[ BECOMES
- | '=' { error("':=' expected instead of '='");
+ | %erroneous '='
+ { error("':=' expected instead of '='");
DOT = BECOMES;
}
]