# 2.11BSD#431 - /usr/src/ucb/PORT/pascal/src/error.c

##### Functions

    cerror            X
    derror            X
    error             X
    panic             X
    yysetfile         X

##### Variables

    errpfx            X
    hadsome           X
    lastname          X
    printed           X

       1: /*
       2:  * Copyright (c) 1980 Regents of the University of California.
       3:  * All rights reserved.  The Berkeley software License Agreement
       4:  * specifies the terms and conditions for redistribution.
       5:  */
       6:
       7: #ifndef lint
       8: static char sccsid[] = "@(#)error.c	5.1 (Berkeley) 6/5/85";
       9: #endif not lint
      10:
      11: #include "whoami.h"
      12: #include "0.h"
      13: #ifndef PI1
      14: #include "tree_ty.h"        /* must be included for yy.h */
      15: #include "yy.h"
      16: #endif
      17:
      18: char    errpfx  = 'E';
      19: extern  int yyline;
      20: /*
      21:  * Panic is called when impossible
      22:  * (supposedly, anyways) situations
      23:  * are encountered.
      24:  * Panic messages should be short
      25:  * as they do not go to the message
      26:  * file.
      27:  */
      28: panic(s)
      29:     char *s;
      30: {
      31:
      32: #ifdef DEBUG
      33: #ifdef PI1
      34:     printf("Snark (%s) line=%d\n", s, line);
      35:     abort();
      36: #else
      37:     printf("Snark (%s) line=%d, yyline=%d\n", s, line, yyline);
      38:     abort () ;  /* die horribly */
      39: #endif
      40: #endif
      41: #ifdef PI1
      42:     Perror( "Snark in pi1", s);
      43: #else
      44:     Perror( "Snark in pi", s);
      45: #endif
      46:     pexit(DIED);
      47: }
      48:
      49: /*
      50:  * Error is called for
      51:  * semantic errors and
      52:  * prints the error and
      53:  * a line number.
      54:  */
      55:
      56: /*VARARGS1*/
      57:
      58: error(a1, a2, a3, a4, a5)
      59:     register char *a1;
      60: {
      61:     char errbuf[256];       /* was extern. why? ...pbk */
      62:     register int i;
      63:
      64:     if (errpfx == 'w' && opt('w') != 0) {
      65:         errpfx = 'E';
      66:         return;
      67:     }
      68:     Enocascade = FALSE;
      69:     geterr((int) a1, errbuf);
      70:     a1 = errbuf;
      71:     if (line < 0)
      72:         line = -line;
      73: #ifndef PI1
      74:     if (opt('l'))
      75:         yyoutline();
      76: #endif
      77:     yysetfile(filename);
      78:     if (errpfx == ' ') {
      79:         printf("  ");
      80:         for (i = line; i >= 10; i /= 10)
      81:             pchr( ' ' );
      82:         printf("... ");
      83:     } else if (Enoline)
      84:         printf("  %c - ", errpfx);
      85:     else
      86:         printf("%c %d - ", errpfx, line);
      87:     printf(a1, a2, a3, a4, a5);
      88:     if (errpfx == 'E')
      89: #ifndef PI0
      90:         eflg = TRUE, codeoff();
      91: #else
      92:         eflg = TRUE;
      93: #endif
      94:     errpfx = 'E';
      95:     if (Eholdnl)
      96:         Eholdnl = FALSE;
      97:     else
      98:         pchr( '\n' );
      99: }
     100:
     101: /*VARARGS1*/
     102:
     103: cerror(a1, a2, a3, a4, a5)
     104:     char *a1;
     105: {
     106:
     107:     if (Enocascade)
     108:         return;
     109:     setpfx(' ');
     110:     error(a1, a2, a3, a4, a5);
     111: }
     112:
     113: #ifdef PI1
     114:
     115: /*VARARGS*/
     116:
     117: derror(a1, a2, a3, a4, a5)
     118:     char *a1, *a2, *a3, *a4, *a5;
     119: {
     120:
     121:     if (!holdderr)
     122:         error(a1, a2, a3, a4, a5);
     123:     errpfx = 'E';
     124: }
     125:
     126: char    *lastname, printed, hadsome;
     127:
     128:     /*
     129:      *	this yysetfile for PI1 only.
     130:      *	the real yysetfile is in yyput.c
     131:      */
     132: yysetfile(name)
     133:     char *name;
     134: {
     135:
     136:     if (lastname == name)
     137:         return;
     138:     printed =| 1;
     139:     gettime( name );
     140:     printf("%s  %s:\n" , myctime( &tvec ) , name );
     141:     lastname = name;
     142: }
     143: #endif

#### Defined functions

cerror defined in line 103; used 26 times

- in /usr/src/ucb/PORT/pascal/src/call.c line 376, 573, 582, 597, 607
- in /usr/src/ucb/PORT/pascal/src/case.c line 130
- in /usr/src/ucb/PORT/pascal/src/conv.c line 97-98(2)
- in /usr/src/ucb/PORT/pascal/src/cset.c line 215, 237, 270
- in /usr/src/ucb/PORT/pascal/src/fdec.c line 172
- in /usr/src/ucb/PORT/pascal/src/forop.c line 198, 225
- in /usr/src/ucb/PORT/pascal/src/lval.c line 323, 415-417(2)
- in /usr/src/ucb/PORT/pascal/src/pccaseop.c line 180
- in /usr/src/ucb/PORT/pascal/src/pclval.c line 390
- in /usr/src/ucb/PORT/pascal/src/pcproc.c line 399, 1268
- in /usr/src/ucb/PORT/pascal/src/proc.c line 342, 921
- in /usr/src/ucb/PORT/pascal/src/rec.c line 274
- in /usr/src/ucb/PORT/pascal/src/rval.c line 946
- in /usr/src/ucb/PORT/pascal/src/stat.c line 440

derror defined in line 117; never used
error defined in line 58; used 358 times

- in line 110, 122
- in /usr/src/ucb/PORT/pascal/src/ato.c line 27, 33
- in /usr/src/ucb/PORT/pascal/src/call.c line 209, 219, 232, 240-254(4), 287, 438, 570, 579, 594, 604
- in /usr/src/ucb/PORT/pascal/src/case.c line 62, 105, 134, 155
- in /usr/src/ucb/PORT/pascal/src/clas.c line 232-234(2)
- in /usr/src/ucb/PORT/pascal/src/const.c line 42-47(2), 54-59(2)
- in /usr/src/ucb/PORT/pascal/src/conv.c line 96
- in /usr/src/ucb/PORT/pascal/src/cset.c line 80, 105, 137-141(2), 152, 201, 224, 257
- in /usr/src/ucb/PORT/pascal/src/fdec.c line 63, 75, 82, 105, 171-176(2), 215, 229-234(2), 279
- in /usr/src/ucb/PORT/pascal/src/fend.c line 228-232(2), 238, 310-314(2)
- in /usr/src/ucb/PORT/pascal/src/fhdr.c line 83, 125, 139-142(2), 161, 183, 350-354(2), 367-369(2), 411, 429
- in /usr/src/ucb/PORT/pascal/src/flvalue.c line 45, 57, 73-78(2), 108
- in /usr/src/ucb/PORT/pascal/src/forop.c line 136-140(2), 155, 167-171(2)
- in /usr/src/ucb/PORT/pascal/src/func.c line 51, 76, 87, 104, 114, 129, 144, 156, 164, 179, 191, 197-201(2), 223, 230, 237, 244, 251
- in /usr/src/ucb/PORT/pascal/src/lab.c line 52-57(2), 64-69(2), 222, 245-249(2), 263
- in /usr/src/ucb/PORT/pascal/src/lval.c line 59, 132-137(2), 145, 164, 174, 218-228(4), 269, 278, 303, 397, 520
- in /usr/src/ucb/PORT/pascal/src/nl.c line 761-766(2), 826, 836
- in /usr/src/ucb/PORT/pascal/src/pccaseop.c line 95, 150, 184, 227
- in /usr/src/ucb/PORT/pascal/src/pcfunc.c line 58, 83, 101, 112, 133, 143, 160, 186, 197, 208, 217, 228, 253, 265, 291, 297-301(2), 329, 342, 357, 369, 380
- in /usr/src/ucb/PORT/pascal/src/pclval.c line 61, 123-128(2), 138, 157, 240, 302, 309-320(4), 345, 353
- in /usr/src/ucb/PORT/pascal/src/pcproc.c line 104, 135, 141, 152, 162, 319, 325, 343, 350-359(3), 445-448(2), 464, 493, 559, 685, 755, 876-883(3), 983, 997, 1075, 1118, 1135, 1144, 1150, 1160, 1176-1181(2), 1189, 1204, 1224, 1234, 1252-1261(3), 1275, 1299, 1308, 1317, 1330, 1339, 1347, 1359, 1368, 1377, 1386, 1397, 1406, 1414, 1423, 1433, 1464, 1477, 1488, 1499, 1511, 1528, 1534, 1541, 1550, 1565, 1585
- in /usr/src/ucb/PORT/pascal/src/proc.c line 98, 129, 135, 144, 151, 285, 291, 309, 316-325(3), 362-365(2), 382, 429, 504, 517, 543, 651-658(3), 722, 735, 780, 791, 809-813(2), 819, 826, 836-841(2), 849, 867, 885, 893, 904-913(3), 928, 940, 947, 955, 964, 971, 979, 987, 994, 1004, 1014, 1025, 1033, 1040, 1047, 1054, 1065, 1078, 1088, 1094, 1106, 1123-1127(2), 1133, 1141, 1155, 1175
- in /usr/src/ucb/PORT/pascal/src/rec.c line 177, 222, 302
- in /usr/src/ucb/PORT/pascal/src/rval.c line 216, 235, 332, 343-348(2), 411, 436, 462-466(2), 499-503(2), 556, 612, 637-644(3), 660-664(2), 840, 856, 868, 878, 895-898(2), 942, 1004, 1084-1089(2)
- in /usr/src/ucb/PORT/pascal/src/stab.c line 848
- in /usr/src/ucb/PORT/pascal/src/stat.c line 69, 265, 577, 643, 689
- in /usr/src/ucb/PORT/pascal/src/stkrval.c line 149, 168, 252, 280-285(2), 343
- in /usr/src/ucb/PORT/pascal/src/type.c line 43-48(2), 55-60(2), 156, 201, 212, 219, 226, 235, 318, 324, 330, 345, 351, 393, 400, 408
- in /usr/src/ucb/PORT/pascal/src/var.c line 50-55(2), 62-67(2)
- in /usr/src/ucb/PORT/pascal/src/yyerror.c line 105
- in /usr/src/ucb/PORT/pascal/src/yyget.c line 142, 200, 206, 222, 232

panic defined in line 28; used 75 times

- in /usr/src/ucb/PORT/pascal/src/call.c line 197, 422, 647
- in /usr/src/ucb/PORT/pascal/src/clas.c line 84, 93, 186, 260
- in /usr/src/ucb/PORT/pascal/src/const.c line 151, 187
- in /usr/src/ucb/PORT/pascal/src/conv.c line 53, 220, 227, 273, 333
- in /usr/src/ucb/PORT/pascal/src/cset.c line 98, 147, 436
- in /usr/src/ucb/PORT/pascal/src/fend.c line 500
- in /usr/src/ucb/PORT/pascal/src/fhdr.c line 169, 363
- in /usr/src/ucb/PORT/pascal/src/func.c line 131
- in /usr/src/ucb/PORT/pascal/src/gen.c line 178
- in /usr/src/ucb/PORT/pascal/src/lab.c line 292
- in /usr/src/ucb/PORT/pascal/src/lval.c line 299, 348
- in /usr/src/ucb/PORT/pascal/src/nl.c line 433
- in /usr/src/ucb/PORT/pascal/src/p2put.c line 72, 180, 239, 255, 281, 296, 462, 514, 756
- in /usr/src/ucb/PORT/pascal/src/pcfunc.c line 162
- in /usr/src/ucb/PORT/pascal/src/pclval.c line 236, 364
- in /usr/src/ucb/PORT/pascal/src/pcproc.c line 480, 567, 803, 1589
- in /usr/src/ucb/PORT/pascal/src/proc.c line 404, 588, 1179
- in /usr/src/ucb/PORT/pascal/src/put.c line 69, 701
- in /usr/src/ucb/PORT/pascal/src/rec.c line 361
- in /usr/src/ucb/PORT/pascal/src/rval.c line 322, 351, 886, 987
- in /usr/src/ucb/PORT/pascal/src/stab.c line 254, 680
- in /usr/src/ucb/PORT/pascal/src/stat.c line 95
- in /usr/src/ucb/PORT/pascal/src/stkrval.c line 229, 288, 327
- in /usr/src/ucb/PORT/pascal/src/string.c line 128, 139-146(3)
- in /usr/src/ucb/PORT/pascal/src/tree.c line 162
- in /usr/src/ucb/PORT/pascal/src/type.c line 147
- in /usr/src/ucb/PORT/pascal/src/var.c line 231, 238, 313, 353, 419, 445, 468
- in /usr/src/ucb/PORT/pascal/src/yylex.c line 30
- in /usr/src/ucb/PORT/pascal/src/yymain.c line 165
- in /usr/src/ucb/PORT/pascal/src/yyparse.c line 211
- in /usr/src/ucb/PORT/pascal/src/yyrecover.c line 800

yysetfile defined in line 132; used 1 times

- in line 77

#### Defined variables

errpfx defined in line 18; used 8 times

- in line 64-65(2), 78, 84-88(3), 94, 123

hadsome defined in line 126; never used
lastname defined in line 126; used 2 times

- in line 136-141(2)

printed defined in line 126; used 1 times

- in line 138

sccsid defined in line 8; never used

Last modified: 1985-06-05 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 869 |