ack/lang/m2/comp/LLmessage.c

55 lines
828 B
C
Raw Normal View History

1986-03-26 15:11:02 +00:00
/* S Y N T A X E R R O R R E P O R T I N G */
1986-05-01 19:06:53 +00:00
#ifndef NORCSID
1986-03-26 15:11:02 +00:00
static char *RcsId = "$Header$";
1986-05-01 19:06:53 +00:00
#endif
1986-03-26 15:11:02 +00:00
1986-03-20 14:52:03 +00:00
#include <alloc.h>
1986-03-26 15:11:02 +00:00
#include <em_arith.h>
1986-05-01 19:06:53 +00:00
#include <em_label.h>
1986-03-20 14:52:03 +00:00
#include "idf.h"
#include "LLlex.h"
#include "Lpars.h"
extern char *symbol2str();
1986-03-26 15:11:02 +00:00
extern struct idf *gen_anon_idf();
1986-03-20 14:52:03 +00:00
int err_occurred = 0;
LLmessage(tk)
int tk;
{
++err_occurred;
if (tk) {
error("%s missing", symbol2str(tk));
insert_token(tk);
}
else
error("%s deleted", symbol2str(dot.tk_symb));
}
insert_token(tk)
int tk;
{
aside = dot;
dot.tk_symb = tk;
switch (tk) {
/* The operands need some body */
case IDENT:
dot.TOK_IDF = gen_anon_idf();
break;
case STRING:
1986-04-04 13:47:04 +00:00
dot.TOK_SLE = 1;
1986-03-20 14:52:03 +00:00
dot.TOK_STR = Salloc("", 1);
break;
case INTEGER:
dot.TOK_INT = 1;
break;
case REAL:
dot.TOK_REL = Salloc("0.0", 4);
break;
}
}