1: #
2: /*
3: * pi - Pascal interpreter code translator
4: *
5: * Charles Haley, Bill Joy UCB
6: * Version 1.2 January 1979
7: *
8: *
9: * pxp - Pascal execution profiler
10: *
11: * Bill Joy UCB
12: * Version 1.2 January 1979
13: */
14:
15: #include "0.h"
16: #include "yy.h"
17:
18: /*
19: * Yerror prints an error
20: * message and then returns
21: * NIL for the tree if needed.
22: * The error is flagged on the
23: * current line which is printed
24: * if the listing is turned off.
25: #ifdef PXP
26: *
27: * As is obvious from the fooling around
28: * with fout below, the Pascal system should
29: * be changed to use the new library "lS".
30: #endif
31: */
32: yerror(s, a1, a2, a3, a4, a5)
33: char *s;
34: {
35: #ifdef PI
36: char buf[256];
37: #endif
38: register int i, j;
39: static yySerrs;
40: #ifdef PXP
41: int ofout;
42: #endif
43:
44: if (errpfx == 'w' && opt('w') != 0)
45: return;
46: #ifdef PXP
47: flush();
48: ofout = fout[0];
49: fout[0] = errout;
50: #endif
51: yyResume = 0;
52: #ifdef PI
53: geterr(s, buf);
54: s = buf;
55: #endif
56: yysync();
57: putchar(errpfx);
58: putchar(' ');
59: for (i = 3; i < yyecol; i++)
60: putchar('-');
61: printf("^--- ");
62: /*
63: if (yyecol > 60)
64: printf("\n\t");
65: */
66: printf(s, a1, a2, a3, a4, a5);
67: putchar('\n');
68: if (errpfx == 'E')
69: #ifdef PI
70: eflg++, cgenflg++;
71: #endif
72: #ifdef PXP
73: eflg++;
74: #endif
75: errpfx = 'E';
76: yySerrs++;
77: if (yySerrs >= MAXSYNERR) {
78: yySerrs = 0;
79: yerror("Too many syntax errors - QUIT");
80: pexit(ERRS);
81: }
82: #ifdef PXP
83: flush();
84: fout[0] = ofout;
85: return (0);
86: #endif
87: }
88:
89: /*
90: * A bracketing error message
91: */
92: brerror(where, what)
93: int where;
94: char *what;
95: {
96:
97: if (where == 0) {
98: line = yyeline;
99: setpfx(' ');
100: error("End matched %s on line %d", what, where);
101: return;
102: }
103: if (where < 0)
104: where = -where;
105: yerror("Inserted keyword end matching %s on line %d", what, where);
106: }
Defined functions
yerror
defined in line
32; used 37 times
- in line 79,
105
- in /usr/src/ucb/pascal/pxp/hash.c line
148,
186
- in /usr/src/ucb/pascal/pxp/pas.y line
506
- in /usr/src/ucb/pascal/pxp/string.c line
42
- in /usr/src/ucb/pascal/pxp/tree.c line
119,
125
- in /usr/src/ucb/pascal/pxp/yycomm.c line
216
- in /usr/src/ucb/pascal/pxp/yylex.c line
127,
147,
166,
187,
196,
207,
220,
241,
263,
269
- in /usr/src/ucb/pascal/pxp/yypanic.c line
49,
72,
84,
137,
143
- in /usr/src/ucb/pascal/pxp/yyparse.c line
69,
207
- in /usr/src/ucb/pascal/pxp/yyrecover.c line
207,
377-379(2),
400,
413,
430,
441,
459,
467,
502,
509