1 /* S Y N T A X E R R O R R E P O R T I N G */
3 /* Defines the LLmessage routine. LLgen-generated parsers require the
4 existence of a routine of that name.
5 The routine must do syntax-error reporting and must be able to
6 insert tokens in the token stream.
18 extern char *symbol2str();
19 extern char *Malloc(), *Salloc();
20 extern struct idf *gen_anon_idf();
21 extern int expect_label;
27 /* if( tk > 0 ), it represents the token to be inserted.
29 register struct token *dotp = ˙
31 error("%s missing before %s", symbol2str(tk), symbol2str(dotp->tk_symb));
39 /* The operands need some body */
41 dotp->TOK_IDF = gen_anon_idf();
44 dotp->tk_data.tk_str = (struct string *)
45 Malloc(sizeof (struct string));
47 dotp->TOK_STR = Salloc("", 1);
48 toktype = standard_type(T_STRINGCONST, 1, (arith) 1);
58 dotp->tk_data.tk_real = (struct real *)
59 Malloc(sizeof(struct real));
61 dotp->TOK_RIV = (struct real *)
62 Malloc(sizeof(struct real));
63 dotp->TOK_RIV->r_inverse = dotp->tk_data.tk_real;
65 dotp->TOK_REL = Salloc("0.0", 4);
66 dotp->TOK_RIV->r_real = dotp->TOK_REL;
71 else if( tk < 0 ) error("garbage at end of program");
72 else error("%s deleted", symbol2str(dot.tk_symb));