home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / nethack-3.1 / sys / share / dgn_lex.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-22  |  17.1 KB  |  915 lines

  1. # include "stdio.h"
  2. # define U(x) x
  3. # define NLSTATE yyprevious=YYNEWLINE
  4. # define BEGIN yybgin = yysvec + 1 +
  5. # define INITIAL 0
  6. # define YYLERR yysvec
  7. # define YYSTATE (yyestate-yysvec-1)
  8. # define YYOPTIM 1
  9. # define YYLMAX BUFSIZ
  10. # define output(c) putc(c,yyout)
  11. # define input() (((yytchar=yysptr>yysbuf?U(*--yysptr):getc(yyin))==10?(yylineno++,yytchar):yytchar)==EOF?0:yytchar)
  12. # define unput(c) {yytchar= (c);if(yytchar=='\n')yylineno--;*yysptr++=yytchar;}
  13. # define yymore() (yymorfg=1)
  14. # define ECHO fprintf(yyout, "%s",yytext)
  15. # define REJECT { nstr = yyreject(); goto yyfussy;}
  16. int yyleng; extern char yytext[];
  17. int yymorfg;
  18. extern char *yysptr, yysbuf[];
  19. int yytchar;
  20. FILE *yyin = {stdin}, *yyout = {stdout};
  21. extern int yylineno;
  22. struct yysvf { 
  23.     struct yywork *yystoff;
  24.     struct yysvf *yyother;
  25.     int *yystops;};
  26. struct yysvf *yyestate;
  27. extern struct yysvf yysvec[], *yybgin;
  28. /*    SCCS Id: @(#)dgn_lex.c    3.1    92/10/23    */
  29. /*    Copyright (c) 1989 by Jean-Christophe Collet */
  30. /*    Copyright (c) 1990 by M. Stephenson         */
  31. /* NetHack may be freely redistributed.  See license for details. */
  32.  
  33. #define DGN_COMP
  34.  
  35. #include "config.h"
  36. #include "dgn_comp.h"
  37. #include "dgn_file.h"
  38.  
  39. long *FDECL(alloc, (unsigned int));
  40. /*
  41.  * Most of these don't exist in flex, yywrap is macro and
  42.  * yyunput is properly declared in flex.skel.
  43.  */
  44. #ifndef FLEX_SCANNER
  45. int FDECL (yyback, (int *, int));
  46. int NDECL (yylook);
  47. int NDECL (yyinput);
  48. int NDECL (yywrap);
  49. int NDECL (yylex);
  50.     /* Traditional lexes let yyunput() and yyoutput() default to int;
  51.      * newer ones may declare them as void since they don't return
  52.      * values.  For even more fun, the lex supplied as part of the
  53.      * newer unbundled compiler for SunOS 4.x adds the void declarations
  54.      * (under __STDC__ or _cplusplus ifdefs -- otherwise they remain
  55.      * int) while the bundled lex and the one with the older unbundled
  56.      * compiler do not.  To detect this, we need help from outside --
  57.      * sys/unix/Makefile.utl.
  58.      */
  59. # if defined(NeXT) || defined(SVR4)
  60. #  define VOIDYYPUT
  61. # endif
  62. # if !defined(VOIDYYPUT)
  63. #  if defined(POSIX_TYPES) && !defined(BOS) && !defined(HISX)
  64. #   define VOIDYYPUT
  65. #  endif
  66. # endif
  67. # if !defined(VOIDYYPUT) && defined(WEIRD_LEX)
  68. #  if defined(SUNOS4) && defined(__STDC__) && (WEIRD_LEX != 0) 
  69. #   define VOIDYYPUT
  70. #  endif
  71. # endif
  72. # ifdef VOIDYYPUT
  73. void FDECL (yyunput, (int));
  74. void FDECL (yyoutput, (int));
  75. # else
  76. int FDECL (yyunput, (int));
  77. int FDECL (yyoutput, (int));
  78. # endif
  79. #endif    /* FLEX_SCANNER */
  80.  
  81. void FDECL (init_yyin, (FILE *));
  82. void FDECL (init_yyout, (FILE *));
  83.  
  84. #ifdef MICRO
  85. #undef exit
  86. extern void FDECL(exit, (int));
  87. #endif
  88.  
  89. /* this doesn't always get put in dgn_comp.h
  90.  * (esp. when using older versions of bison)
  91.  */
  92.  
  93. extern YYSTYPE yylval;
  94.  
  95. int line_number = 1;
  96. /*
  97.  *    This is a hack required by Michael Hamel to get things
  98.  *    working on the Mac.
  99.  */
  100. #if defined(applec) && !defined(FLEX_SCANNER)
  101. #undef input
  102. #undef unput
  103. #define unput(c) { yytchar = (c); if (yytchar == 10) yylineno--; *yysptr++ = yytchar; }                  
  104. # ifndef YYNEWLINE
  105. # define YYNEWLINE 10
  106. # endif
  107.  
  108. char
  109. input() {    /* Under MPW \n is chr(13)! Compensate for this. */
  110.  
  111.     if (yysptr > yysbuf) return(*--yysptr);
  112.     else {
  113.         yytchar = getc(yyin);
  114.          if (yytchar == '\n') {
  115.             yylineno++;
  116.             return(YYNEWLINE);
  117.         }
  118.         if (yytchar == EOF) return(0);
  119.         else            return(yytchar);
  120.     }
  121. }
  122. #endif    /* applec && !FLEX_SCANNER */
  123.  
  124. # define YYNEWLINE 10
  125. yylex(){
  126. int nstr; extern int yyprevious;
  127. while((nstr = yylook()) >= 0)
  128. yyfussy: switch(nstr){
  129. case 0:
  130. if(yywrap()) return(0); break;
  131. case 1:
  132.     return(A_DUNGEON);
  133. break;
  134. case 2:
  135.     { yylval.i=1; return(UP_OR_DOWN); }
  136. break;
  137. case 3:
  138.     { yylval.i=0; return(UP_OR_DOWN); }
  139. break;
  140. case 4:
  141.     return(ENTRY);
  142. break;
  143. case 5:
  144.     return(STAIR);
  145. break;
  146. case 6:
  147.     return(NO_UP);
  148. break;
  149. case 7:
  150.     return(NO_DOWN);
  151. break;
  152. case 8:
  153.     return(PORTAL);
  154. break;
  155. case 9:
  156. return(PROTOFILE);
  157. break;
  158. case 10:
  159. return(DESCRIPTION);
  160. break;
  161. case 11:
  162. return(LEVELDESC);
  163. break;
  164. case 12:
  165.       return(ALIGNMENT);
  166. break;
  167. case 13:
  168.        return(LEVALIGN);
  169. break;
  170. case 14:
  171.     { yylval.i=TOWN ; return(DESCRIPTOR); }
  172. break;
  173. case 15:
  174.     { yylval.i=HELLISH ; return(DESCRIPTOR); }
  175. break;
  176. case 16:
  177. { yylval.i=MAZELIKE ; return(DESCRIPTOR); }
  178. break;
  179. case 17:
  180. { yylval.i=ROGUELIKE ; return(DESCRIPTOR); }
  181. break;
  182. case 18:
  183.       { yylval.i=D_ALIGN_NONE ; return(DESCRIPTOR); }
  184. break;
  185. case 19:
  186.         { yylval.i=D_ALIGN_NONE ; return(DESCRIPTOR); }
  187. break;
  188. case 20:
  189.          { yylval.i=D_ALIGN_LAWFUL ; return(DESCRIPTOR); }
  190. break;
  191. case 21:
  192.         { yylval.i=D_ALIGN_NEUTRAL ; return(DESCRIPTOR); }
  193. break;
  194. case 22:
  195.         { yylval.i=D_ALIGN_CHAOTIC ; return(DESCRIPTOR); }
  196. break;
  197. case 23:
  198.     return(BRANCH);
  199. break;
  200. case 24:
  201. return(CHBRANCH);
  202. break;
  203. case 25:
  204.     return(LEVEL);
  205. break;
  206. case 26:
  207. return(RNDLEVEL);
  208. break;
  209. case 27:
  210. return(CHLEVEL);
  211. break;
  212. case 28:
  213. return(RNDCHLEVEL);
  214. break;
  215. case 29:
  216.     { yylval.i=atoi(yytext); return(INTEGER); }
  217. break;
  218. case 30:
  219. { yytext[yyleng-1] = 0; /* Discard the trailing \" */
  220.           yylval.str = (char *) alloc(strlen(yytext+1)+1);
  221.           strcpy(yylval.str, yytext+1); /* Discard the first \" */
  222.           return(STRING); }
  223. break;
  224. case 31:
  225.     { line_number++; }
  226. break;
  227. case 32:
  228.     { line_number++; }
  229. break;
  230. case 33:
  231.     ;
  232. break;
  233. case 34:
  234.     { return yytext[0]; }
  235. break;
  236. case -1:
  237. break;
  238. default:
  239. fprintf(yyout,"bad switch yylook %d",nstr);
  240. } return(0); }
  241. /* end of yylex */
  242.  
  243. /* routine to switch to another input file; needed for flex */
  244. void init_yyin( input_f )
  245. FILE *input_f;
  246. {
  247. #ifdef FLEX_SCANNER
  248.     if (yyin)
  249.         yyrestart(input_f);
  250.     else
  251. #endif
  252.         yyin = input_f;
  253. }
  254. /* analogous routine (for completeness) */
  255. void init_yyout( output_f )
  256. FILE *output_f;
  257. {
  258.     yyout = output_f;
  259. }
  260.  
  261. int yyvstop[] = {
  262. 0,
  263.  
  264. 34,
  265. 0,
  266.  
  267. 33,
  268. 34,
  269. 0,
  270.  
  271. 32,
  272. 0,
  273.  
  274. 34,
  275. 0,
  276.  
  277. 29,
  278. 34,
  279. 0,
  280.  
  281. 34,
  282. 0,
  283.  
  284. 34,
  285. 0,
  286.  
  287. 34,
  288. 0,
  289.  
  290. 34,
  291. 0,
  292.  
  293. 34,
  294. 0,
  295.  
  296. 34,
  297. 0,
  298.  
  299. 34,
  300. 0,
  301.  
  302. 34,
  303. 0,
  304.  
  305. 34,
  306. 0,
  307.  
  308. 34,
  309. 0,
  310.  
  311. 34,
  312. 0,
  313.  
  314. 34,
  315. 0,
  316.  
  317. 34,
  318. 0,
  319.  
  320. 34,
  321. 0,
  322.  
  323. 34,
  324. 0,
  325.  
  326. 34,
  327. 0,
  328.  
  329. 34,
  330. 0,
  331.  
  332. 34,
  333. 0,
  334.  
  335. 34,
  336. 0,
  337.  
  338. 34,
  339. 0,
  340.  
  341. 33,
  342. 0,
  343.  
  344. 30,
  345. 0,
  346.  
  347. 29,
  348. 0,
  349.  
  350. 2,
  351. 0,
  352.  
  353. 31,
  354. 0,
  355.  
  356. 3,
  357. 0,
  358.  
  359. 14,
  360. 0,
  361.  
  362. 4,
  363. 0,
  364.  
  365. 25,
  366. 0,
  367.  
  368. 6,
  369. 0,
  370.  
  371. 5,
  372. 0,
  373.  
  374. 23,
  375. 0,
  376.  
  377. 20,
  378. 0,
  379.  
  380. 8,
  381. 0,
  382.  
  383. 1,
  384. 0,
  385.  
  386. 22,
  387. 0,
  388.  
  389. 15,
  390. 0,
  391.  
  392. 21,
  393. 0,
  394.  
  395. 7,
  396. 0,
  397.  
  398. 19,
  399. 0,
  400.  
  401. 13,
  402. 0,
  403.  
  404. 26,
  405. 0,
  406.  
  407. 16,
  408. 0,
  409.  
  410. 12,
  411. 0,
  412.  
  413. 11,
  414. 0,
  415.  
  416. 9,
  417. 0,
  418.  
  419. 17,
  420. 0,
  421.  
  422. 18,
  423. 0,
  424.  
  425. 27,
  426. 0,
  427.  
  428. 28,
  429. 0,
  430.  
  431. 24,
  432. 0,
  433.  
  434. 10,
  435. 0,
  436. 0};
  437. # define YYTYPE int
  438. struct yywork { YYTYPE verify, advance; } yycrank[] = {
  439. 0,0,    0,0,    1,3,    0,0,    
  440. 0,0,    0,0,    6,29,    0,0,    
  441. 27,54,    0,0,    1,4,    1,5,    
  442. 0,0,    4,28,    6,29,    6,29,    
  443. 27,54,    27,55,    0,0,    0,0,    
  444. 0,0,    0,0,    0,0,    0,0,    
  445. 0,0,    0,0,    0,0,    0,0,    
  446. 0,0,    0,0,    0,0,    0,0,    
  447. 0,0,    0,0,    0,0,    1,6,    
  448. 4,28,    0,0,    0,0,    6,30,    
  449. 0,0,    27,54,    0,0,    0,0,    
  450. 0,0,    0,0,    1,7,    0,0,    
  451. 0,0,    0,0,    6,29,    0,0,    
  452. 27,54,    0,0,    0,0,    0,0,    
  453. 0,0,    2,27,    0,0,    0,0,    
  454. 0,0,    0,0,    0,0,    0,0,    
  455. 0,0,    0,0,    1,8,    1,9,    
  456. 1,10,    1,11,    1,12,    13,38,    
  457. 33,57,    10,34,    32,56,    34,58,    
  458. 11,35,    1,13,    8,32,    12,37,    
  459. 15,40,    1,14,    36,60,    1,15,    
  460. 9,33,    14,39,    35,59,    2,8,    
  461. 2,9,    2,10,    2,11,    2,12,    
  462. 11,36,    37,61,    38,62,    39,63,    
  463. 40,64,    0,0,    2,13,    19,44,    
  464. 1,16,    1,17,    2,14,    18,43,    
  465. 2,15,    1,18,    16,41,    20,45,    
  466. 41,65,    1,19,    1,20,    1,21,    
  467. 17,42,    1,22,    21,46,    1,23,    
  468. 1,24,    1,25,    1,26,    22,48,    
  469. 23,49,    2,16,    2,17,    24,50,    
  470. 21,47,    25,51,    2,18,    26,52,    
  471. 42,66,    26,53,    2,19,    2,20,    
  472. 2,21,    43,67,    2,22,    44,68,    
  473. 2,23,    2,24,    2,25,    2,26,    
  474. 7,31,    45,69,    46,70,    7,31,    
  475. 7,31,    7,31,    7,31,    7,31,    
  476. 7,31,    7,31,    7,31,    7,31,    
  477. 7,31,    47,71,    48,73,    47,72,    
  478. 49,74,    50,75,    51,76,    52,77,    
  479. 56,78,    57,79,    58,80,    59,81,    
  480. 60,82,    61,83,    62,84,    63,86,    
  481. 64,87,    65,89,    62,85,    66,90,    
  482. 67,91,    68,92,    69,93,    70,94,    
  483. 71,95,    64,88,    72,97,    73,98,    
  484. 74,99,    75,100,    76,101,    77,102,    
  485. 78,103,    79,104,    80,105,    81,106,    
  486. 82,107,    83,108,    84,109,    85,110,    
  487. 86,111,    71,96,    87,112,    88,113,    
  488. 89,114,    91,115,    92,116,    93,117,    
  489. 94,118,    95,119,    96,120,    97,121,    
  490. 98,122,    99,123,    100,124,    102,125,    
  491. 103,126,    104,127,    105,128,    106,130,    
  492. 107,131,    109,132,    110,133,    111,134,    
  493. 112,135,    113,136,    114,137,    115,138,    
  494. 105,129,    116,139,    117,140,    118,141,    
  495. 119,142,    121,143,    122,144,    123,145,    
  496. 125,146,    126,147,    128,148,    129,149,    
  497. 130,150,    131,151,    132,152,    133,153,    
  498. 134,154,    135,155,    136,156,    137,157,    
  499. 138,158,    140,159,    141,160,    142,161,    
  500. 143,162,    145,163,    146,164,    147,165,    
  501. 148,166,    149,167,    150,168,    152,169,    
  502. 153,170,    154,171,    155,172,    156,173,    
  503. 159,174,    163,175,    164,176,    165,177,    
  504. 166,178,    167,179,    168,180,    170,181,    
  505. 171,182,    172,183,    175,184,    176,185,    
  506. 178,186,    179,187,    180,188,    183,189,    
  507. 186,190,    188,191,    0,0,    0,0,    
  508. 0,0};
  509. struct yysvf yysvec[] = {
  510. 0,    0,    0,
  511. yycrank+-1,    0,        0,    
  512. yycrank+-22,    yysvec+1,    0,    
  513. yycrank+0,    0,        yyvstop+1,
  514. yycrank+4,    0,        yyvstop+3,
  515. yycrank+0,    0,        yyvstop+6,
  516. yycrank+-5,    0,        yyvstop+8,
  517. yycrank+95,    0,        yyvstop+10,
  518. yycrank+2,    0,        yyvstop+13,
  519. yycrank+2,    0,        yyvstop+15,
  520. yycrank+1,    0,        yyvstop+17,
  521. yycrank+7,    0,        yyvstop+19,
  522. yycrank+1,    0,        yyvstop+21,
  523. yycrank+2,    0,        yyvstop+23,
  524. yycrank+3,    0,        yyvstop+25,
  525. yycrank+2,    0,        yyvstop+27,
  526. yycrank+2,    0,        yyvstop+29,
  527. yycrank+1,    0,        yyvstop+31,
  528. yycrank+2,    0,        yyvstop+33,
  529. yycrank+2,    0,        yyvstop+35,
  530. yycrank+10,    0,        yyvstop+37,
  531. yycrank+13,    0,        yyvstop+39,
  532. yycrank+8,    0,        yyvstop+41,
  533. yycrank+9,    0,        yyvstop+43,
  534. yycrank+7,    0,        yyvstop+45,
  535. yycrank+14,    0,        yyvstop+47,
  536. yycrank+17,    0,        yyvstop+49,
  537. yycrank+-7,    0,        yyvstop+51,
  538. yycrank+0,    yysvec+4,    yyvstop+53,
  539. yycrank+0,    yysvec+6,    0,    
  540. yycrank+0,    0,        yyvstop+55,
  541. yycrank+0,    yysvec+7,    yyvstop+57,
  542. yycrank+1,    0,        0,    
  543. yycrank+7,    0,        0,    
  544. yycrank+10,    0,        0,    
  545. yycrank+3,    0,        0,    
  546. yycrank+4,    0,        0,    
  547. yycrank+9,    0,        0,    
  548. yycrank+8,    0,        0,    
  549. yycrank+16,    0,        0,    
  550. yycrank+28,    0,        0,    
  551. yycrank+11,    0,        0,    
  552. yycrank+9,    0,        0,    
  553. yycrank+25,    0,        0,    
  554. yycrank+16,    0,        0,    
  555. yycrank+19,    0,        0,    
  556. yycrank+25,    0,        0,    
  557. yycrank+58,    0,        0,    
  558. yycrank+40,    0,        0,    
  559. yycrank+53,    0,        0,    
  560. yycrank+60,    0,        0,    
  561. yycrank+39,    0,        0,    
  562. yycrank+62,    0,        0,    
  563. yycrank+0,    0,        yyvstop+59,
  564. yycrank+0,    yysvec+27,    0,    
  565. yycrank+0,    0,        yyvstop+61,
  566. yycrank+89,    0,        0,    
  567. yycrank+83,    0,        0,    
  568. yycrank+89,    0,        0,    
  569. yycrank+96,    0,        0,    
  570. yycrank+93,    0,        0,    
  571. yycrank+83,    0,        0,    
  572. yycrank+101,    0,        0,    
  573. yycrank+83,    0,        0,    
  574. yycrank+101,    0,        0,    
  575. yycrank+58,    0,        0,    
  576. yycrank+61,    0,        0,    
  577. yycrank+64,    0,        0,    
  578. yycrank+71,    0,        0,    
  579. yycrank+73,    0,        0,    
  580. yycrank+59,    0,        0,    
  581. yycrank+76,    0,        0,    
  582. yycrank+70,    0,        0,    
  583. yycrank+63,    0,        0,    
  584. yycrank+63,    0,        0,    
  585. yycrank+76,    0,        0,    
  586. yycrank+72,    0,        0,    
  587. yycrank+75,    0,        0,    
  588. yycrank+106,    0,        0,    
  589. yycrank+118,    0,        0,    
  590. yycrank+108,    0,        0,    
  591. yycrank+105,    0,        0,    
  592. yycrank+119,    0,        0,    
  593. yycrank+100,    0,        0,    
  594. yycrank+114,    0,        0,    
  595. yycrank+115,    0,        0,    
  596. yycrank+113,    0,        0,    
  597. yycrank+122,    0,        0,    
  598. yycrank+126,    0,        0,    
  599. yycrank+80,    0,        0,    
  600. yycrank+0,    0,        yyvstop+63,
  601. yycrank+92,    0,        0,    
  602. yycrank+81,    0,        0,    
  603. yycrank+91,    0,        0,    
  604. yycrank+86,    0,        0,    
  605. yycrank+90,    0,        0,    
  606. yycrank+90,    0,        0,    
  607. yycrank+98,    0,        0,    
  608. yycrank+107,    0,        0,    
  609. yycrank+104,    0,        0,    
  610. yycrank+92,    0,        0,    
  611. yycrank+0,    0,        yyvstop+65,
  612. yycrank+102,    0,        0,    
  613. yycrank+131,    0,        0,    
  614. yycrank+137,    0,        0,    
  615. yycrank+144,    0,        0,    
  616. yycrank+138,    0,        0,    
  617. yycrank+133,    0,        0,    
  618. yycrank+0,    0,        yyvstop+67,
  619. yycrank+140,    0,        0,    
  620. yycrank+146,    0,        yyvstop+69,
  621. yycrank+145,    0,        0,    
  622. yycrank+140,    0,        0,    
  623. yycrank+131,    0,        0,    
  624. yycrank+113,    0,        0,    
  625. yycrank+104,    0,        0,    
  626. yycrank+113,    0,        0,    
  627. yycrank+117,    0,        0,    
  628. yycrank+126,    0,        0,    
  629. yycrank+105,    0,        0,    
  630. yycrank+0,    0,        yyvstop+71,
  631. yycrank+122,    0,        0,    
  632. yycrank+118,    0,        0,    
  633. yycrank+119,    0,        0,    
  634. yycrank+0,    0,        yyvstop+73,
  635. yycrank+125,    0,        0,    
  636. yycrank+160,    0,        0,    
  637. yycrank+0,    0,        yyvstop+75,
  638. yycrank+148,    0,        0,    
  639. yycrank+162,    0,        0,    
  640. yycrank+152,    0,        0,    
  641. yycrank+155,    0,        0,    
  642. yycrank+163,    0,        0,    
  643. yycrank+166,    0,        0,    
  644. yycrank+163,    0,        0,    
  645. yycrank+168,    0,        0,    
  646. yycrank+169,    0,        0,    
  647. yycrank+140,    0,        0,    
  648. yycrank+136,    0,        0,    
  649. yycrank+0,    0,        yyvstop+77,
  650. yycrank+134,    0,        0,    
  651. yycrank+134,    0,        0,    
  652. yycrank+133,    0,        0,    
  653. yycrank+134,    0,        0,    
  654. yycrank+0,    0,        yyvstop+79,
  655. yycrank+140,    0,        0,    
  656. yycrank+136,    0,        0,    
  657. yycrank+169,    0,        0,    
  658. yycrank+183,    0,        0,    
  659. yycrank+163,    0,        0,    
  660. yycrank+166,    0,        0,    
  661. yycrank+0,    0,        yyvstop+81,
  662. yycrank+173,    0,        0,    
  663. yycrank+169,    0,        0,    
  664. yycrank+177,    0,        0,    
  665. yycrank+168,    0,        0,    
  666. yycrank+179,    0,        0,    
  667. yycrank+0,    0,        yyvstop+83,
  668. yycrank+0,    0,        yyvstop+85,
  669. yycrank+155,    0,        0,    
  670. yycrank+0,    0,        yyvstop+87,
  671. yycrank+0,    0,        yyvstop+89,
  672. yycrank+0,    0,        yyvstop+91,
  673. yycrank+150,    0,        0,    
  674. yycrank+157,    0,        0,    
  675. yycrank+175,    0,        0,    
  676. yycrank+182,    0,        0,    
  677. yycrank+192,    0,        0,    
  678. yycrank+189,    0,        0,    
  679. yycrank+0,    0,        yyvstop+93,
  680. yycrank+196,    0,        0,    
  681. yycrank+195,    0,        0,    
  682. yycrank+196,    0,        0,    
  683. yycrank+0,    0,        yyvstop+95,
  684. yycrank+0,    0,        yyvstop+97,
  685. yycrank+165,    0,        0,    
  686. yycrank+167,    0,        0,    
  687. yycrank+0,    0,        yyvstop+99,
  688. yycrank+201,    0,        0,    
  689. yycrank+193,    0,        0,    
  690. yycrank+191,    0,        0,    
  691. yycrank+0,    0,        yyvstop+101,
  692. yycrank+0,    0,        yyvstop+103,
  693. yycrank+195,    0,        0,    
  694. yycrank+0,    0,        yyvstop+105,
  695. yycrank+0,    0,        yyvstop+107,
  696. yycrank+200,    0,        0,    
  697. yycrank+0,    0,        yyvstop+109,
  698. yycrank+195,    0,        0,    
  699. yycrank+0,    0,        yyvstop+111,
  700. yycrank+0,    0,        yyvstop+113,
  701. yycrank+0,    0,        yyvstop+115,
  702. 0,    0,    0};
  703. struct yywork *yytop = yycrank+273;
  704. struct yysvf *yybgin = yysvec+1;
  705. char yymatch[] = {
  706. 00  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  707. 01  ,011 ,012 ,01  ,01  ,01  ,01  ,01  ,
  708. 01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  709. 01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  710. 011 ,01  ,'"' ,01  ,01  ,01  ,01  ,01  ,
  711. 01  ,01  ,01  ,01  ,01  ,'-' ,01  ,01  ,
  712. '-' ,'-' ,'-' ,'-' ,'-' ,'-' ,'-' ,'-' ,
  713. '-' ,'-' ,01  ,01  ,01  ,01  ,01  ,01  ,
  714. 01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  715. 01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  716. 01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  717. 01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  718. 01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  719. 01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  720. 01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  721. 01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  722. 0};
  723. char yyextra[] = {
  724. 0,0,0,0,0,0,0,0,
  725. 0,0,0,0,0,0,0,0,
  726. 0,0,0,0,0,0,0,0,
  727. 0,0,0,0,0,0,0,0,
  728. 0,0,0,0,0,0,0,0,
  729. 0};
  730. #ifndef lint
  731. static    char ncform_sccsid[] = "@(#)ncform 1.6 88/02/08 SMI"; /* from S5R2 1.2 */
  732. #endif
  733.  
  734. int yylineno =1;
  735. # define YYU(x) x
  736. # define NLSTATE yyprevious=YYNEWLINE
  737. char yytext[YYLMAX];
  738. struct yysvf *yylstate [YYLMAX], **yylsp, **yyolsp;
  739. char yysbuf[YYLMAX];
  740. char *yysptr = yysbuf;
  741. int *yyfnd;
  742. extern struct yysvf *yyestate;
  743. int yyprevious = YYNEWLINE;
  744. yylook(){
  745.     register struct yysvf *yystate, **lsp;
  746.     register struct yywork *yyt;
  747.     struct yysvf *yyz;
  748.     int yych, yyfirst;
  749.     struct yywork *yyr;
  750. # ifdef LEXDEBUG
  751.     int debug;
  752. # endif
  753.     char *yylastch;
  754.     /* start off machines */
  755. # ifdef LEXDEBUG
  756.     debug = 0;
  757. # endif
  758.     yyfirst=1;
  759.     if (!yymorfg)
  760.         yylastch = yytext;
  761.     else {
  762.         yymorfg=0;
  763.         yylastch = yytext+yyleng;
  764.         }
  765.     for(;;){
  766.         lsp = yylstate;
  767.         yyestate = yystate = yybgin;
  768.         if (yyprevious==YYNEWLINE) yystate++;
  769.         for (;;){
  770. # ifdef LEXDEBUG
  771.             if(debug)fprintf(yyout,"state %d\n",yystate-yysvec-1);
  772. # endif
  773.             yyt = yystate->yystoff;
  774.             if(yyt == yycrank && !yyfirst){  /* may not be any transitions */
  775.                 yyz = yystate->yyother;
  776.                 if(yyz == 0)break;
  777.                 if(yyz->yystoff == yycrank)break;
  778.                 }
  779.             *yylastch++ = yych = input();
  780.             yyfirst=0;
  781.         tryagain:
  782. # ifdef LEXDEBUG
  783.             if(debug){
  784.                 fprintf(yyout,"char ");
  785.                 allprint(yych);
  786.                 putchar('\n');
  787.                 }
  788. # endif
  789.             yyr = yyt;
  790.             if ( (int)yyt > (int)yycrank){
  791.                 yyt = yyr + yych;
  792.                 if (yyt <= yytop && yyt->verify+yysvec == yystate){
  793.                     if(yyt->advance+yysvec == YYLERR)    /* error transitions */
  794.                         {unput(*--yylastch);break;}
  795.                     *lsp++ = yystate = yyt->advance+yysvec;
  796.                     goto contin;
  797.                     }
  798.                 }
  799. # ifdef YYOPTIM
  800.             else if((int)yyt < (int)yycrank) {        /* r < yycrank */
  801.                 yyt = yyr = yycrank+(yycrank-yyt);
  802. # ifdef LEXDEBUG
  803.                 if(debug)fprintf(yyout,"compressed state\n");
  804. # endif
  805.                 yyt = yyt + yych;
  806.                 if(yyt <= yytop && yyt->verify+yysvec == yystate){
  807.                     if(yyt->advance+yysvec == YYLERR)    /* error transitions */
  808.                         {unput(*--yylastch);break;}
  809.                     *lsp++ = yystate = yyt->advance+yysvec;
  810.                     goto contin;
  811.                     }
  812.                 yyt = yyr + YYU(yymatch[yych]);
  813. # ifdef LEXDEBUG
  814.                 if(debug){
  815.                     fprintf(yyout,"try fall back character ");
  816.                     allprint(YYU(yymatch[yych]));
  817.                     putchar('\n');
  818.                     }
  819. # endif
  820.                 if(yyt <= yytop && yyt->verify+yysvec == yystate){
  821.                     if(yyt->advance+yysvec == YYLERR)    /* error transition */
  822.                         {unput(*--yylastch);break;}
  823.                     *lsp++ = yystate = yyt->advance+yysvec;
  824.                     goto contin;
  825.                     }
  826.                 }
  827.             if ((yystate = yystate->yyother) && (yyt= yystate->yystoff) != yycrank){
  828. # ifdef LEXDEBUG
  829.                 if(debug)fprintf(yyout,"fall back to state %d\n",yystate-yysvec-1);
  830. # endif
  831.                 goto tryagain;
  832.                 }
  833. # endif
  834.             else
  835.                 {unput(*--yylastch);break;}
  836.         contin:
  837. # ifdef LEXDEBUG
  838.             if(debug){
  839.                 fprintf(yyout,"state %d char ",yystate-yysvec-1);
  840.                 allprint(yych);
  841.                 putchar('\n');
  842.                 }
  843. # endif
  844.             ;
  845.             }
  846. # ifdef LEXDEBUG
  847.         if(debug){
  848.             fprintf(yyout,"stopped at %d with ",*(lsp-1)-yysvec-1);
  849.             allprint(yych);
  850.             putchar('\n');
  851.             }
  852. # endif
  853.         while (lsp-- > yylstate){
  854.             *yylastch-- = 0;
  855.             if (*lsp != 0 && (yyfnd= (*lsp)->yystops) && *yyfnd > 0){
  856.                 yyolsp = lsp;
  857.                 if(yyextra[*yyfnd]){        /* must backup */
  858.                     while(yyback((*lsp)->yystops,-*yyfnd) != 1 && lsp > yylstate){
  859.                         lsp--;
  860.                         unput(*yylastch--);
  861.                         }
  862.                     }
  863.                 yyprevious = YYU(*yylastch);
  864.                 yylsp = lsp;
  865.                 yyleng = yylastch-yytext+1;
  866.                 yytext[yyleng] = 0;
  867. # ifdef LEXDEBUG
  868.                 if(debug){
  869.                     fprintf(yyout,"\nmatch ");
  870.                     sprint(yytext);
  871.                     fprintf(yyout," action %d\n",*yyfnd);
  872.                     }
  873. # endif
  874.                 return(*yyfnd++);
  875.                 }
  876.             unput(*yylastch);
  877.             }
  878.         if (yytext[0] == 0  /* && feof(yyin) */)
  879.             {
  880.             yysptr=yysbuf;
  881.             return(0);
  882.             }
  883.         yyprevious = yytext[0] = input();
  884.         if (yyprevious>0)
  885.             output(yyprevious);
  886.         yylastch=yytext;
  887. # ifdef LEXDEBUG
  888.         if(debug)putchar('\n');
  889. # endif
  890.         }
  891.     }
  892. yyback(p, m)
  893.     int *p;
  894. {
  895. if (p==0) return(0);
  896. while (*p)
  897.     {
  898.     if (*p++ == m)
  899.         return(1);
  900.     }
  901. return(0);
  902. }
  903.     /* the following are only used in the lex library */
  904. yyinput(){
  905.     return(input());
  906.     }
  907. yyoutput(c)
  908.   int c; {
  909.     output(c);
  910.     }
  911. yyunput(c)
  912.    int c; {
  913.     unput(c);
  914.     }
  915.