1: # include <stdio.h>
2: # include "constants.h"
3: # include "globals.h"
4: # include "y.tab.h"
5: # include <sccs.h>
6:
7: SCCSID(@(#)yyerror.c 8.1 12/31/84)
8:
9: extern int Exit_val; /* value to exit with, incremented if error found */
10:
11:
12: /*
13: ** YYERROR -- Yacc error reporting routine.
14: ** Yyerror reports on syntax errors encountered by
15: ** the yacc parser, and increments the Exit_val variable.
16: **
17: ** Parameters:
18: ** s -- a string explaining the error
19: **
20: ** Returns:
21: ** none
22: */
23:
24:
25: yyerror(s)
26: char *s;
27: {
28:
29: printf("\"%s\", line %d: ", Input_file_name, yyline);
30: if (yychar == 0)
31: printf("EOF = ");
32: if (yylval.u_dn)
33: printf("\"%s\" ", yylval.u_dn->d_elm);
34: printf("%s\n", s);
35: Exit_val++;
36: }
37: /*
38: ** YYSEMERR -- scanner error reporter
39: ** Also increments the Exit_val variable.
40: ** Parameters:
41: ** s -- string explaining the error
42: ** i -- if !0 a string which caused the error
43: **
44: ** Returns:
45: ** none
46: **
47: ** Called By:
48: ** lexical analysis routines -- if called from somewhere else,
49: ** the line number is likely to be wrong.
50: */
51:
52:
53: yysemerr(s, i)
54: char *s;
55: char *i;
56: {
57: char *str;
58:
59: printf("\"%s\", line %d: ", Input_file_name, yyline);
60: if (i)
61: printf("\"%s\": ", i);
62: printf("%s\n", s);
63: Exit_val++;
64: }
65: /*
66: ** YYSERROR -- Semantic error reportin routine
67: ** reports on an error on an entry in the symbol space,
68: ** using the line number built into the entry. Exit_val gets
69: ** incremented.
70: **
71: ** Parameters:
72: ** s -- a string explaining the error
73: ** d -- a symbol space node
74: **
75: ** Returns:
76: ** none
77: **
78: ** Called By:
79: ** semantic productions
80: */
81:
82:
83: yyserror(s, d)
84: char *s;
85: struct disp_node *d;
86: {
87: printf("\"%s\", line %d: ", Input_file_name, d->d_line);
88: printf("\"%s\": %s\n", d->d_elm, s);
89: Exit_val++;
90: }
Defined functions
yysemerr
defined in line
53; used 26 times
- in /usr/ingres/source/equel/comment.c line
55
- in /usr/ingres/source/equel/cvar.c line
48,
105-110(2),
168
- in /usr/ingres/source/equel/display.c line
70,
84,
289,
302
- in /usr/ingres/source/equel/getch.c line
81
- in /usr/ingres/source/equel/grammar.y line
655
- in /usr/ingres/source/equel/include.c line
69,
119
- in /usr/ingres/source/equel/main.c line
246,
280
- in /usr/ingres/source/equel/name.c line
65
- in /usr/ingres/source/equel/number.c line
55,
108
- in /usr/ingres/source/equel/operator.c line
86
- in /usr/ingres/source/equel/retrieve.c line
57,
84,
90
- in /usr/ingres/source/equel/string.c line
51,
58,
75,
82
yyserror
defined in line
83; used 17 times
- in /usr/ingres/source/equel/grammar.y line
167,
321-325(2),
418,
424,
623,
644-649(2),
713,
755,
786,
797,
822-825(2),
855,
865,
935