1987-03-10 17:51:10 +00:00
|
|
|
/*
|
|
|
|
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
|
|
|
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
|
|
|
*/
|
1986-03-10 13:07:55 +00:00
|
|
|
/* $Header$ */
|
|
|
|
/* PARSER ERROR ADMINISTRATION */
|
|
|
|
|
1987-01-24 00:25:56 +00:00
|
|
|
#include <alloc.h>
|
1986-09-24 13:53:16 +00:00
|
|
|
#include "nofloat.h"
|
1986-03-10 13:07:55 +00:00
|
|
|
#include "idf.h"
|
|
|
|
#include "arith.h"
|
|
|
|
#include "LLlex.h"
|
|
|
|
#include "Lpars.h"
|
|
|
|
|
|
|
|
extern char *symbol2str();
|
|
|
|
|
|
|
|
LLmessage(tk) {
|
|
|
|
err_occurred = 1;
|
1987-01-24 00:25:56 +00:00
|
|
|
if (tk < 0) {
|
|
|
|
error("end of file expected");
|
|
|
|
}
|
|
|
|
else if (tk) {
|
1989-10-30 16:19:35 +00:00
|
|
|
error("%s missing before %s", symbol2str(tk), symbol2str(DOT));
|
1986-03-10 13:07:55 +00:00
|
|
|
insert_token(tk);
|
|
|
|
}
|
1989-10-30 16:19:35 +00:00
|
|
|
else {
|
1986-03-10 13:07:55 +00:00
|
|
|
error("%s deleted", symbol2str(DOT));
|
1989-10-30 16:19:35 +00:00
|
|
|
}
|
|
|
|
tk_nmb_at_last_syn_err = token_nmb;
|
1986-03-10 13:07:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
insert_token(tk)
|
|
|
|
int tk;
|
|
|
|
{
|
|
|
|
aside = dot;
|
|
|
|
|
|
|
|
DOT = tk;
|
|
|
|
|
|
|
|
switch (tk) {
|
|
|
|
/* The operands need some body */
|
|
|
|
case IDENTIFIER:
|
|
|
|
dot.tk_idf = gen_idf();
|
|
|
|
break;
|
|
|
|
case TYPE_IDENTIFIER:
|
|
|
|
dot.tk_idf = str2idf("int");
|
|
|
|
break;
|
|
|
|
case STRING:
|
1986-03-25 16:40:43 +00:00
|
|
|
dot.tk_bts = Salloc("", 1);
|
|
|
|
dot.tk_len = 1;
|
1986-03-10 13:07:55 +00:00
|
|
|
break;
|
|
|
|
case INTEGER:
|
|
|
|
dot.tk_fund = INT;
|
|
|
|
dot.tk_ival = 1;
|
|
|
|
break;
|
1986-09-12 09:16:07 +00:00
|
|
|
#ifndef NOFLOAT
|
1986-03-10 13:07:55 +00:00
|
|
|
case FLOATING:
|
|
|
|
dot.tk_fval = Salloc("0.0", 4);
|
|
|
|
break;
|
1991-12-17 14:11:15 +00:00
|
|
|
#endif /* NOFLOAT */
|
1986-03-10 13:07:55 +00:00
|
|
|
}
|
|
|
|
}
|