2 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
3 * See the copyright notice in the ACK home directory, in the file "Copyright".
5 * Author: Ceriel J.H. Jacobs
8 /* S Y N T A X E R R O R R E P O R T I N G */
10 /* $Id: LLmessage.c,v 1.18 1997/02/21 17:10:11 ceriel Exp $ */
12 /* Defines the LLmessage routine. LLgen-generated parsers require the
13 existence of a routine of that name.
14 The routine must do syntax-error reporting and must be able to
15 insert tokens in the token stream.
26 extern char *symbol2str();
27 extern t_idf *gen_anon_idf();
33 /* if (tk > 0), it represents the token to be inserted.
35 register t_token *dotp = ˙
38 error("%s missing before %s", symbol2str(tk), symbol2str(dotp->tk_symb));
46 /* The operands need some body */
48 dotp->TOK_IDF = gen_anon_idf();
51 dotp->tk_data.tk_str = (struct string *)
52 Malloc(sizeof (struct string));
54 dotp->TOK_STR = Salloc("", 1);
60 dotp->tk_data.tk_real = new_real();
61 dotp->TOK_RSTR = Salloc("0.0", 4);
62 flt_str2flt(dotp->TOK_RSTR, &dotp->TOK_RVAL);
67 error("end of file expected");
71 error("%s deleted", symbol2str(dot.tk_symb));
73 error("%s not expected", symbol2str(dot.tk_symb));
76 tk_nmb_at_last_syn_err = token_nmb;