1
/************************************************************************/
5
/* Error message routines. */
9
/* 3420 NW Elmwood Dr. */
11
/* Corvallis, Oregon 97339 */
17
/* Corvallis, OR 97339 */
20
/* This program is hereby placed in the public domain. In */
21
/* contrast to other claims of "public domain", this means no */
22
/* copyright is claimed and you may do anything you like with PP, */
23
/* including selling it! As a gesture of courtesy, please retain */
24
/* the authorship information in the source code and */
27
/* Functions contained within this module: */
29
/* end_of_file Fatal for Unexpected EOF. */
30
/* fatal Print FATAL diagnostic. */
31
/* illegal_symbol Print illegal symbol diagnostic.*/
32
/* non_fatal Print normal error message. */
33
/* out_of_memory Fatal for out of memory. */
34
/* prmsg Print a error/warning message. */
35
/* warning Print a warning message. */
37
/************************************************************************/
42
/************************************************************************/
46
/* Print fatal "Unexpected EOF" message. */
48
/************************************************************************/
53
fatal("Unexpected EOF","");
56
/************************************************************************/
60
/* Print error message to standard error and abort. */
62
/************************************************************************/
69
fprintf(STDERR,"FATAL: %s%s\n",s1,s2); /* Print message */
73
/************************************************************************/
77
/* Print error message with Token as illegal symbol name. */
79
/************************************************************************/
84
non_fatal("Illegal symbol name: ",Token);
87
/************************************************************************/
91
/* Print error message to standard error and count it. */
93
/************************************************************************/
101
Errors++; /* Count the error */
104
/************************************************************************/
108
/* Print fatal "Out of memory" message. */
110
/************************************************************************/
115
fatal("Out of memory","");
118
/************************************************************************/
122
/* Print a non_fatal/warning message to standard error. */
124
/* Note: If the file stack is < 0, then all files have been */
125
/* popped off the stack. Use 0 (the original file name.) */
127
/************************************************************************/
135
fprintf(STDERR,"<%s> @ %u: %s%s%s\n",
136
Filestack[Filelevel >= 0 ? Filelevel : 0]->f_name,LLine,
140
/************************************************************************/
144
/* Print standard warning message to standard error. */
146
/************************************************************************/
153
prmsg("WARNING: ",s1,s2);