File indexing completed on 2025-01-26 04:44:00
0001 0002 /* parser.dlg -- DLG Description of scanner 0003 * 0004 * Generated from: bibtex.g 0005 * 0006 * Terence Parr, Will Cohen, and Hank Dietz: 1989-1994 0007 * Purdue University Electrical Engineering 0008 * With AHPCRC, University of Minnesota 0009 * ANTLR Version 1.33 0010 */ 0011 0012 #include <stdio.h> 0013 #define ANTLR_VERSION 133 0014 0015 #define ZZCOL 0016 #define USER_ZZSYN 0017 0018 #include "btconfig.h" 0019 #include "btparse.h" 0020 #include "attrib.h" 0021 #include "lex_auxiliary.h" 0022 #include "error.h" 0023 /*#include "my_dmalloc.h"*/ 0024 0025 extern char * InputFilename; /* for zzcr_ast call in pccts/ast.c */ 0026 #include "antlr.h" 0027 #include "ast.h" 0028 #include "tokens.h" 0029 #include "dlgdef.h" 0030 LOOKAHEAD 0031 void zzerraction() 0032 { 0033 (*zzerr)("invalid token"); 0034 zzadvance(); 0035 zzskip(); 0036 } 0037 /* 0038 * D L G tables 0039 * 0040 * Generated from: parser.dlg 0041 * 0042 * 1989-1994 by Will Cohen, Terence Parr, and Hank Dietz 0043 * Purdue University Electrical Engineering 0044 * DLG Version 1.33 0045 */ 0046 0047 #include "mode.h" 0048 0049 0050 0051 static void act1() 0052 { 0053 NLA = 1; 0054 } 0055 0056 0057 static void act2() 0058 { 0059 NLA = AT; 0060 at_sign (); 0061 } 0062 0063 0064 static void act3() 0065 { 0066 NLA = 3; 0067 newline (); 0068 } 0069 0070 0071 static void act4() 0072 { 0073 NLA = COMMENT; 0074 comment (); 0075 } 0076 0077 0078 static void act5() 0079 { 0080 NLA = 5; 0081 zzskip (); 0082 } 0083 0084 0085 static void act6() 0086 { 0087 NLA = 6; 0088 toplevel_junk (); 0089 } 0090 0091 static unsigned char shift0[257] = { 0092 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0093 4, 2, 5, 5, 4, 5, 5, 5, 5, 5, 0094 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0095 5, 5, 5, 4, 5, 5, 5, 5, 3, 5, 0096 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0097 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0098 5, 5, 5, 5, 5, 1, 5, 5, 5, 5, 0099 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0100 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0101 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0102 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0103 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0104 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0105 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0106 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0107 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0108 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0109 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0110 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0111 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0112 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0113 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0114 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0115 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0116 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0117 5, 5, 5, 5, 5, 5, 5 0118 }; 0119 0120 0121 static void act7() 0122 { 0123 NLA = 1; 0124 } 0125 0126 0127 static void act8() 0128 { 0129 NLA = 7; 0130 newline (); 0131 } 0132 0133 0134 static void act9() 0135 { 0136 NLA = COMMENT; 0137 comment (); 0138 } 0139 0140 0141 static void act10() 0142 { 0143 NLA = 8; 0144 zzskip (); 0145 } 0146 0147 0148 static void act11() 0149 { 0150 NLA = NUMBER; 0151 } 0152 0153 0154 static void act12() 0155 { 0156 NLA = NAME; 0157 name (); 0158 } 0159 0160 0161 static void act13() 0162 { 0163 NLA = LBRACE; 0164 lbrace (); 0165 } 0166 0167 0168 static void act14() 0169 { 0170 NLA = RBRACE; 0171 rbrace (); 0172 } 0173 0174 0175 static void act15() 0176 { 0177 NLA = ENTRY_OPEN; 0178 lparen (); 0179 } 0180 0181 0182 static void act16() 0183 { 0184 NLA = ENTRY_CLOSE; 0185 rparen (); 0186 } 0187 0188 0189 static void act17() 0190 { 0191 NLA = EQUALS; 0192 } 0193 0194 0195 static void act18() 0196 { 0197 NLA = HASH; 0198 } 0199 0200 0201 static void act19() 0202 { 0203 NLA = COMMA; 0204 } 0205 0206 0207 static void act20() 0208 { 0209 NLA = 18; 0210 start_string ('"'); 0211 } 0212 0213 static unsigned char shift1[257] = { 0214 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0215 3, 1, 14, 14, 3, 14, 14, 14, 14, 14, 0216 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0217 14, 14, 14, 3, 5, 13, 11, 5, 2, 5, 0218 14, 8, 9, 5, 5, 12, 5, 5, 5, 4, 0219 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 0220 5, 5, 10, 5, 5, 14, 5, 5, 5, 5, 0221 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0222 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0223 5, 5, 5, 14, 5, 5, 5, 5, 5, 5, 0224 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0225 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0226 5, 5, 5, 5, 6, 5, 7, 14, 14, 14, 0227 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0228 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0229 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0230 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0231 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0232 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0233 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0234 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0235 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0236 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0237 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0238 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0239 14, 14, 14, 14, 14, 14, 14 0240 }; 0241 0242 0243 static void act21() 0244 { 0245 NLA = 1; 0246 } 0247 0248 0249 static void act22() 0250 { 0251 NLA = 19; 0252 check_runaway_string (); 0253 } 0254 0255 0256 static void act23() 0257 { 0258 NLA = 20; 0259 zzreplchar (' '); zzmore (); 0260 } 0261 0262 0263 static void act24() 0264 { 0265 NLA = 21; 0266 open_brace (); 0267 } 0268 0269 0270 static void act25() 0271 { 0272 NLA = 22; 0273 close_brace (); 0274 } 0275 0276 0277 static void act26() 0278 { 0279 NLA = 23; 0280 lparen_in_string (); 0281 } 0282 0283 0284 static void act27() 0285 { 0286 NLA = 24; 0287 rparen_in_string (); 0288 } 0289 0290 0291 static void act28() 0292 { 0293 NLA = STRING; 0294 quote_in_string (); 0295 } 0296 0297 0298 static void act29() 0299 { 0300 NLA = 26; 0301 zzmore (); 0302 } 0303 0304 static unsigned char shift2[257] = { 0305 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0306 2, 1, 3, 3, 2, 3, 3, 3, 3, 3, 0307 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0308 3, 3, 3, 3, 3, 8, 3, 3, 3, 3, 0309 3, 6, 7, 3, 3, 3, 3, 3, 3, 3, 0310 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0311 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0312 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0313 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0314 3, 3, 3, 9, 3, 3, 3, 3, 3, 3, 0315 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0316 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0317 3, 3, 3, 3, 4, 3, 5, 3, 3, 3, 0318 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0319 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0320 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0321 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0322 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0323 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0324 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0325 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0326 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0327 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0328 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0329 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0330 3, 3, 3, 3, 3, 3, 3 0331 }; 0332 0333 #define DfaStates 38 0334 typedef unsigned char DfaState; 0335 0336 static DfaState st0[7] = { 0337 1, 2, 3, 4, 5, 6, 38 0338 }; 0339 0340 static DfaState st1[7] = { 0341 38, 38, 38, 38, 38, 38, 38 0342 }; 0343 0344 static DfaState st2[7] = { 0345 38, 38, 38, 38, 38, 38, 38 0346 }; 0347 0348 static DfaState st3[7] = { 0349 38, 38, 38, 38, 38, 38, 38 0350 }; 0351 0352 static DfaState st4[7] = { 0353 38, 7, 8, 9, 7, 9, 38 0354 }; 0355 0356 static DfaState st5[7] = { 0357 38, 38, 38, 38, 5, 38, 38 0358 }; 0359 0360 static DfaState st6[7] = { 0361 38, 38, 38, 6, 38, 6, 38 0362 }; 0363 0364 static DfaState st7[7] = { 0365 38, 7, 8, 7, 7, 7, 38 0366 }; 0367 0368 static DfaState st8[7] = { 0369 38, 38, 38, 38, 38, 38, 38 0370 }; 0371 0372 static DfaState st9[7] = { 0373 38, 7, 8, 9, 7, 9, 38 0374 }; 0375 0376 static DfaState st10[16] = { 0377 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 0378 21, 22, 23, 24, 38, 38 0379 }; 0380 0381 static DfaState st11[16] = { 0382 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 0383 38, 38, 38, 38, 38, 38 0384 }; 0385 0386 static DfaState st12[16] = { 0387 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 0388 38, 38, 38, 38, 38, 38 0389 }; 0390 0391 static DfaState st13[16] = { 0392 38, 25, 26, 26, 26, 26, 26, 26, 26, 26, 0393 26, 26, 26, 26, 26, 38 0394 }; 0395 0396 static DfaState st14[16] = { 0397 38, 38, 38, 14, 38, 38, 38, 38, 38, 38, 0398 38, 38, 38, 38, 38, 38 0399 }; 0400 0401 static DfaState st15[16] = { 0402 38, 38, 38, 38, 15, 16, 38, 38, 38, 38, 0403 38, 38, 38, 38, 38, 38 0404 }; 0405 0406 static DfaState st16[16] = { 0407 38, 38, 38, 38, 16, 16, 38, 38, 38, 38, 0408 38, 38, 38, 38, 38, 38 0409 }; 0410 0411 static DfaState st17[16] = { 0412 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 0413 38, 38, 38, 38, 38, 38 0414 }; 0415 0416 static DfaState st18[16] = { 0417 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 0418 38, 38, 38, 38, 38, 38 0419 }; 0420 0421 static DfaState st19[16] = { 0422 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 0423 38, 38, 38, 38, 38, 38 0424 }; 0425 0426 static DfaState st20[16] = { 0427 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 0428 38, 38, 38, 38, 38, 38 0429 }; 0430 0431 static DfaState st21[16] = { 0432 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 0433 38, 38, 38, 38, 38, 38 0434 }; 0435 0436 static DfaState st22[16] = { 0437 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 0438 38, 38, 38, 38, 38, 38 0439 }; 0440 0441 static DfaState st23[16] = { 0442 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 0443 38, 38, 38, 38, 38, 38 0444 }; 0445 0446 static DfaState st24[16] = { 0447 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 0448 38, 38, 38, 38, 38, 38 0449 }; 0450 0451 static DfaState st25[16] = { 0452 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 0453 38, 38, 38, 38, 38, 38 0454 }; 0455 0456 static DfaState st26[16] = { 0457 38, 25, 26, 26, 26, 26, 26, 26, 26, 26, 0458 26, 26, 26, 26, 26, 38 0459 }; 0460 0461 static DfaState st27[11] = { 0462 28, 29, 30, 31, 32, 33, 34, 35, 36, 31, 0463 38 0464 }; 0465 0466 static DfaState st28[11] = { 0467 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 0468 38 0469 }; 0470 0471 static DfaState st29[11] = { 0472 38, 38, 37, 37, 38, 38, 38, 38, 38, 38, 0473 38 0474 }; 0475 0476 static DfaState st30[11] = { 0477 38, 38, 31, 31, 38, 38, 38, 38, 38, 31, 0478 38 0479 }; 0480 0481 static DfaState st31[11] = { 0482 38, 38, 31, 31, 38, 38, 38, 38, 38, 31, 0483 38 0484 }; 0485 0486 static DfaState st32[11] = { 0487 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 0488 38 0489 }; 0490 0491 static DfaState st33[11] = { 0492 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 0493 38 0494 }; 0495 0496 static DfaState st34[11] = { 0497 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 0498 38 0499 }; 0500 0501 static DfaState st35[11] = { 0502 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 0503 38 0504 }; 0505 0506 static DfaState st36[11] = { 0507 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 0508 38 0509 }; 0510 0511 static DfaState st37[11] = { 0512 38, 38, 37, 37, 38, 38, 38, 38, 38, 38, 0513 38 0514 }; 0515 0516 0517 DfaState *dfa[38] = { 0518 st0, 0519 st1, 0520 st2, 0521 st3, 0522 st4, 0523 st5, 0524 st6, 0525 st7, 0526 st8, 0527 st9, 0528 st10, 0529 st11, 0530 st12, 0531 st13, 0532 st14, 0533 st15, 0534 st16, 0535 st17, 0536 st18, 0537 st19, 0538 st20, 0539 st21, 0540 st22, 0541 st23, 0542 st24, 0543 st25, 0544 st26, 0545 st27, 0546 st28, 0547 st29, 0548 st30, 0549 st31, 0550 st32, 0551 st33, 0552 st34, 0553 st35, 0554 st36, 0555 st37 0556 }; 0557 0558 0559 DfaState accepts[39] = { 0560 0, 1, 2, 3, 6, 5, 6, 0, 4, 6, 0561 0, 7, 8, 0, 10, 11, 12, 13, 14, 15, 0562 16, 17, 18, 19, 20, 9, 0, 0, 21, 22, 0563 23, 29, 24, 25, 26, 27, 28, 22, 0 0564 }; 0565 0566 void (*actions[30])() = { 0567 zzerraction, 0568 act1, 0569 act2, 0570 act3, 0571 act4, 0572 act5, 0573 act6, 0574 act7, 0575 act8, 0576 act9, 0577 act10, 0578 act11, 0579 act12, 0580 act13, 0581 act14, 0582 act15, 0583 act16, 0584 act17, 0585 act18, 0586 act19, 0587 act20, 0588 act21, 0589 act22, 0590 act23, 0591 act24, 0592 act25, 0593 act26, 0594 act27, 0595 act28, 0596 act29 0597 }; 0598 0599 static DfaState dfa_base[] = { 0600 0, 0601 10, 0602 27 0603 }; 0604 0605 static unsigned char *b_class_no[] = { 0606 shift0, 0607 shift1, 0608 shift2 0609 }; 0610 0611 0612 0613 #define ZZSHIFT(c) (b_class_no[zzauto][1+c]) 0614 #define MAX_MODE 3 0615 #include "dlgauto.h"