home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / gwm18a.zip / lex.yy.c < prev    next >
Text File  |  1995-07-03  |  17KB  |  844 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.  
  29. /* to have always at least MAX_TOKEN_LENGTH chars in all lexes */
  30. #undef YYLMAX
  31. #define YYLMAX MAX_TOKEN_LENGTH
  32.  
  33. /* here goes the definition of lex I/O, as macros for efficiency */
  34.  
  35. /* first, we forget the previous definitions, */
  36. #undef output
  37. #undef input
  38. #undef unput
  39. /* which were :
  40. #define output(c) putc(c,yyout)
  41. #define input() (((yytchar=yysptr>yysbuf?U(*--yysptr):\
  42. getc(yyin))==10?(yylineno++,yytchar):yytchar)==EOF?0:yytchar)
  43. # define unput(c) {yytchar= (c);if(yytchar=='\n')yylineno--;\
  44. *yysptr++=yytchar;}
  45. */
  46.  
  47. /* So here are OUR macros */
  48.  
  49. static int yyin_is_string;    /* 0 ==> reading from STREAM yyin */
  50.                 /* 1 ==> reading from STRING yystrin */
  51. static int yyout_is_string;    /* 0 ==> printing on STREAM yyout */
  52.         /* 1 ==> printing on WOOL_STRING_STREAM yystrout */
  53. static char *yystrin;        /* current pointer on input string */
  54. static WOOL_STRING_STREAM yystrout; /* current wool output stream */
  55.  
  56. #define output(c) {\
  57.     if(yyout_is_string){\
  58.         *(yystrout->ptr)++ = c;\
  59.         *(yystrout->ptr) = '\0';\
  60.         if((yystrout->ptr) >= (yystrout->last)){\
  61.         yyoutflush();\
  62.     }\
  63.     }else{\
  64.     putc(c,yyout);\
  65.     }\
  66. }
  67.  
  68. #define input() (((\
  69.         yytchar =\
  70.         (yysptr>yysbuf ?\
  71.         U(*--yysptr)\
  72.     :   (yyin_is_string ?\
  73.             ( *yystrin ? *yystrin++ : 0)\
  74.         :   getc(yyin))))\
  75.     ==10 ?\
  76.         (yylineno++,yytchar)\
  77.     :   yytchar)\
  78.     ==EOF ?\
  79.         0\
  80.     :   yytchar)
  81.  
  82. #define unput(c) {\
  83.     yytchar= (c);\
  84.     if(yytchar=='\n')\
  85.         yylineno--;\
  86.     *yysptr++=yytchar;\
  87. }
  88.  
  89. /* externally callable function for unput:
  90.  */
  91.  
  92. wool_unput(buffer)
  93. char *buffer;
  94. {
  95.     while (*buffer) {
  96.     unput(*buffer);
  97.     buffer++;
  98.     }
  99. }
  100.  
  101. /* counting the parentheses -- hack for wool_pool */
  102.  
  103. #define INC_PAR wool_pool_parentheses_level++
  104. #define DEC_PAR if(wool_pool_parentheses_level)wool_pool_parentheses_level--
  105. # define YYNEWLINE 10
  106. yylex(){
  107. int nstr; extern int yyprevious;
  108. while((nstr = yylook()) >= 0)
  109. yyfussy: switch(nstr){
  110. case 0:
  111. if(yywrap()) return(0); break;
  112. case 1:
  113.     ;
  114. break;
  115. case 2:
  116.     ;
  117. break;
  118. case 3:
  119.  return(STRING);
  120. break;
  121. case 4:
  122.  return(NON_CLOSED_STRING);
  123. break;
  124. case 5:
  125.     ;
  126. break;
  127. case 6:
  128. return(NUMBER);
  129. break;
  130. case 7:
  131. return(HEX_NUMBER);
  132. break;
  133. case 8:
  134.     {INC_PAR; return(LEFTPAR);}
  135. break;
  136. case 9:
  137.     {DEC_PAR; return(RIGHTPAR);}
  138. break;
  139. case 10:
  140.     return(QUOTECHAR);
  141. break;
  142. case 11:
  143.     {INC_PAR; return(LEFTBRA);}
  144. break;
  145. case 12:
  146.     {DEC_PAR; return(RIGHTBRA);}
  147. break;
  148. case 13:
  149. return (NAME);
  150. break;
  151. case 14:
  152. return (NAME);
  153. break;
  154. case 15:
  155.     return (NAME);
  156. break;
  157. case 16:
  158.     ;
  159. break;
  160. case 17:
  161.     return(END_OF_FILE);
  162. break;
  163. case 18:
  164.     ;
  165. break;
  166. case -1:
  167. break;
  168. default:
  169. fprintf(yyout,"bad switch yylook %d",nstr);
  170. } return(0); }
  171. /* end of yylex */
  172.  
  173. /**********************\
  174. *                *
  175. *  WOOL's I/O package  *
  176. *                *
  177. \**********************/
  178.  
  179. /* 
  180.  * yywrap
  181.  * we treat EOF (or EOString) as a TOKEN, for yacc.
  182.  */
  183.  
  184. yywrap(){        /* to make EOF a "normal" character */
  185.     unput('\004');    /* EOF is pushed back on the input as ^D */
  186.     return 0;        /* tell Lex there is more to read */
  187. }
  188.  
  189. /*
  190.  * yyinflush
  191.  * to flush wool input buffers (i.e. the unput buffer)
  192.  * stores old input buffer in arg (should be ~ 16) if not NULL
  193.  */
  194.  
  195. void
  196. yyinflush(wool_old_unput_buffer)
  197. char *wool_old_unput_buffer;
  198. {
  199.     if (wool_old_unput_buffer) {
  200.     if (yysptr != yysbuf)
  201.         strncpy(wool_old_unput_buffer, yysbuf, yysptr - yysbuf);
  202.     wool_old_unput_buffer[yysptr - yysbuf] = '\0';
  203.     }
  204.     yysptr = yysbuf;
  205. }
  206.  
  207. /*
  208.  * yyoutflush
  209.  * to flush wool output buffer.
  210.  */
  211.  
  212. void
  213. yyoutflush(){
  214.     if(yyout_is_string){
  215.     ASSERT(yystrout->overflow_handler);
  216. /*XXX-UWE-XXX*/
  217.     (*(yystrout->overflow_handler))(yystrout);
  218.     /* yystrout->ptr = yystrout-> buffer; */
  219. /*XXX-UWE-XXX*/
  220.     }else{
  221.     fflush(yyout);
  222.     }
  223. }
  224.  
  225. /*
  226.  * wool_input_redirect
  227.  * to set wool's parsing to the stream or string argument.
  228.  * arg1 = type (0 = string, 1 = stream);
  229.  * arg2 = stream or string
  230.  * arg3 = POINTER to (FILE *) or (char *) where will go the old stream
  231.  *        (if NULL not set)(returns the old type)
  232.  * arg4 = where to save contents of unput buffer (if not NULL)
  233.  */
  234.  
  235. int wool_input_redirect(type, stream, oldstream_p, old_buffer_contents)
  236. int type;
  237. char *stream;
  238. char **oldstream_p;
  239. char *old_buffer_contents;
  240. {
  241.     int oldtype = yyin_is_string;
  242.     if(oldstream_p) *oldstream_p =
  243.         (oldtype ? (char *) yystrin : (char *) yyin);
  244.     yyinflush(old_buffer_contents);
  245.     if(yyin_is_string = type){
  246.     yystrin = stream;
  247.     }else{
  248.     yyin = (FILE *) stream;
  249.     }
  250.     return oldtype;
  251. }
  252.  
  253. /*
  254.  * wool_output_redirect
  255.  * to set wool's outputs to the stream or string argument.
  256.  * arg1 = type (0 = string, 1 = stream);
  257.  * arg2 = stream or string
  258.  * arg4 = POINTER to (FILE *) or WOOL_STRING_STREAM tu put the old stream
  259.  *        (if NULL not set)(returns the old type)
  260.  */
  261.  
  262. wool_output_redirect(type, stream, oldstream_p)
  263. int type;
  264. char *stream;
  265. char **oldstream_p;
  266. {
  267.     int oldtype = yyout_is_string;
  268.     if(oldstream_p) *oldstream_p =
  269.         (oldtype ? (char *) yystrout : (char *) yyout);
  270.     yyoutflush();
  271.     if(yyout_is_string = type){
  272.     yystrout = (WOOL_STRING_STREAM) stream;
  273.     }else{
  274.     yyout = (FILE *) stream;
  275.     }
  276.     return oldtype;
  277. }
  278.  
  279. /*
  280.  * now, some functions to provide a printf - like service on wool's output.
  281.  */
  282.  
  283. /* prints a string */
  284.  
  285. void
  286. wool_puts(string)
  287. register char *string;
  288. {
  289.     while(*string) output(*string++);
  290. }
  291.  
  292. /* put a newline */
  293.  
  294. wool_newline()
  295. {
  296.     output('\n');
  297. }
  298.  
  299. /* does a format with ONE arg. */
  300.  
  301. wool_printf(string, arg)
  302. register char *string;
  303. char *arg;
  304. {
  305.     static char wool_temp_string[MAX_TEMP_STRING_SIZE];
  306.     sprintf(wool_temp_string, string, arg);
  307.     wool_puts(wool_temp_string);
  308. }
  309.  
  310. /* prints a char */
  311.  
  312. void
  313. wool_putchar(c)
  314. char c;
  315. {
  316.     output(c);
  317. }
  318.  
  319. /*
  320.  * function to make a WOOL_STRING_STREAM of a given capacity
  321.  * arg1 = capactity in bytes
  322.  * arg2 = user function to be called on buffer when overflow occurs
  323.  */
  324.  
  325. WOOL_STRING_STREAM WOOL_STRING_STREAM_make(nbytes, handler)
  326. int nbytes;
  327. int (* handler)();
  328. {
  329.     WOOL_STRING_STREAM str = (WOOL_STRING_STREAM)
  330.         Malloc(sizeof(struct _WOOL_STRING_STREAM));
  331.     str->buffer = (char *) Malloc(nbytes);
  332.     *str->buffer = '\0';        /*XXX-UWE-XXX*/
  333.     str->ptr = str->buffer;
  334.     str->last = str->buffer + nbytes -1;
  335.     str->overflow_handler = handler;
  336.     return str;
  337. }
  338.  
  339. /* 
  340.  * and the function to free a stream
  341.  */
  342.  
  343. WOOL_STRING_STREAM_free (str)
  344. WOOL_STRING_STREAM str;
  345. {
  346.     Free(str->buffer);
  347.     Free(str);
  348. }
  349. int yyvstop[] = {
  350. 0,
  351.  
  352. 13,
  353. 18,
  354. 0,
  355.  
  356. 17,
  357. 18,
  358. 0,
  359.  
  360. 16,
  361. 18,
  362. 0,
  363.  
  364. 16,
  365. 0,
  366.  
  367. 18,
  368. 0,
  369.  
  370. 10,
  371. 18,
  372. 0,
  373.  
  374. 8,
  375. 18,
  376. 0,
  377.  
  378. 9,
  379. 18,
  380. 0,
  381.  
  382. 15,
  383. 18,
  384. 0,
  385.  
  386. 6,
  387. 18,
  388. 0,
  389.  
  390. 6,
  391. 18,
  392. 0,
  393.  
  394. 13,
  395. 18,
  396. 0,
  397.  
  398. 11,
  399. 13,
  400. 18,
  401. 0,
  402.  
  403. 12,
  404. 13,
  405. 18,
  406. 0,
  407.  
  408. 13,
  409. 0,
  410.  
  411. 1,
  412. 13,
  413. 0,
  414.  
  415. 2,
  416. 13,
  417. 0,
  418.  
  419. 1,
  420. 0,
  421.  
  422. 2,
  423. 0,
  424.  
  425. 1,
  426. 0,
  427.  
  428. 4,
  429. 0,
  430.  
  431. 3,
  432. 0,
  433.  
  434. 2,
  435. 0,
  436.  
  437. 14,
  438. 0,
  439.  
  440. 1,
  441. 14,
  442. 0,
  443.  
  444. 6,
  445. 0,
  446.  
  447. 2,
  448. 14,
  449. 0,
  450.  
  451. 13,
  452. 0,
  453.  
  454. 1,
  455. 13,
  456. 0,
  457.  
  458. 5,
  459. 0,
  460.  
  461. 2,
  462. 13,
  463. 0,
  464.  
  465. 7,
  466. 0,
  467. 0};
  468. # define YYTYPE char
  469. struct yywork { YYTYPE verify, advance; } yycrank[] = {
  470. 0,0,    0,0,    1,3,    0,0,    
  471. 0,0,    1,4,    0,0,    0,0,    
  472. 0,0,    1,3,    1,5,    1,6,    
  473. 4,20,    0,0,    22,22,    0,0,    
  474. 0,0,    0,0,    23,22,    27,22,    
  475. 33,33,    35,33,    0,0,    37,33,    
  476. 0,0,    0,0,    0,0,    0,0,    
  477. 0,0,    0,0,    0,0,    0,0,    
  478. 0,0,    0,0,    0,0,    1,7,    
  479. 0,0,    0,0,    0,0,    0,0,    
  480. 1,8,    1,9,    1,10,    0,0,    
  481. 1,11,    25,22,    0,0,    0,0,    
  482. 0,0,    1,12,    1,13,    1,13,    
  483. 1,13,    1,13,    1,13,    1,13,    
  484. 1,13,    1,13,    1,13,    0,0,    
  485. 1,14,    2,9,    2,10,    0,0,    
  486. 13,20,    0,0,    1,3,    0,0,    
  487. 0,0,    0,0,    2,13,    2,13,    
  488. 2,13,    2,13,    2,13,    2,13,    
  489. 2,13,    2,13,    2,13,    0,0,    
  490. 2,14,    0,0,    0,0,    3,17,    
  491. 0,0,    0,0,    3,0,    0,0,    
  492. 0,0,    1,3,    3,18,    3,0,    
  493. 3,0,    1,3,    7,22,    0,0,    
  494. 0,0,    7,22,    0,0,    0,0,    
  495. 0,0,    7,23,    7,22,    7,24,    
  496. 13,30,    13,30,    13,30,    13,30,    
  497. 13,30,    13,30,    13,30,    13,30,    
  498. 13,30,    13,30,    3,0,    0,0,    
  499. 3,0,    26,22,    0,0,    26,22,    
  500. 0,0,    3,0,    3,0,    3,0,    
  501. 1,15,    3,17,    1,16,    7,25,    
  502. 1,3,    15,0,    3,17,    4,21,    
  503. 7,22,    22,22,    15,0,    15,0,    
  504. 7,22,    23,22,    27,22,    33,33,    
  505. 35,33,    7,22,    37,33,    26,22,    
  506. 2,15,    0,0,    2,16,    3,17,    
  507. 0,0,    0,0,    0,0,    0,0,    
  508. 0,0,    11,28,    0,0,    0,0,    
  509. 11,0,    15,0,    7,22,    15,0,    
  510. 11,29,    11,0,    11,0,    0,0,    
  511. 15,0,    15,0,    15,0,    0,0,    
  512. 0,0,    14,33,    3,17,    0,0,    
  513. 14,34,    0,0,    3,17,    0,0,    
  514. 14,35,    14,34,    14,36,    0,0,    
  515. 0,0,    7,22,    12,20,    13,21,    
  516. 11,0,    7,26,    11,0,    0,0,    
  517. 0,0,    0,0,    0,0,    11,0,    
  518. 11,0,    11,0,    0,0,    11,28,    
  519. 0,0,    0,0,    0,0,    0,0,    
  520. 11,30,    26,22,    14,34,    0,0,    
  521. 0,0,    0,0,    0,0,    14,34,    
  522. 0,0,    3,19,    0,0,    14,33,    
  523. 0,0,    16,0,    0,0,    0,0,    
  524. 14,33,    11,28,    16,0,    16,0,    
  525. 7,27,    0,0,    12,30,    12,30,    
  526. 12,30,    12,30,    12,30,    12,30,    
  527. 12,30,    12,30,    12,30,    12,30,    
  528. 0,0,    14,33,    0,0,    0,0,    
  529. 26,22,    0,0,    0,0,    0,0,    
  530. 11,28,    16,0,    0,0,    16,0,    
  531. 11,28,    0,0,    0,0,    17,0,    
  532. 16,0,    16,0,    16,0,    17,17,    
  533. 17,0,    17,0,    0,0,    0,0,    
  534. 14,33,    0,0,    0,0,    0,0,    
  535. 14,33,    18,0,    12,32,    0,0,    
  536. 0,0,    18,17,    18,0,    18,0,    
  537. 0,0,    0,0,    0,0,    0,0,    
  538. 0,0,    0,0,    0,0,    17,0,    
  539. 0,0,    17,0,    0,0,    11,31,    
  540. 0,0,    19,0,    17,0,    17,0,    
  541. 17,0,    19,17,    19,0,    19,0,    
  542. 0,0,    18,0,    0,0,    18,0,    
  543. 0,0,    0,0,    12,32,    14,37,    
  544. 18,0,    18,0,    18,0,    28,0,    
  545. 0,0,    12,21,    29,0,    28,28,    
  546. 28,0,    28,0,    29,28,    29,0,    
  547. 29,0,    19,0,    0,0,    19,0,    
  548. 0,0,    0,0,    0,0,    0,0,    
  549. 19,0,    19,0,    19,0,    0,0,    
  550. 0,0,    0,0,    0,0,    0,0,    
  551. 0,0,    0,0,    0,0,    28,0,    
  552. 0,0,    28,0,    29,0,    0,0,    
  553. 29,0,    0,0,    28,0,    28,0,    
  554. 28,0,    29,0,    29,0,    29,0,    
  555. 0,0,    0,0,    0,0,    28,28,    
  556. 0,0,    0,0,    29,28,    30,30,    
  557. 30,30,    30,30,    30,30,    30,30,    
  558. 30,30,    30,30,    30,30,    30,30,    
  559. 30,30,    31,0,    0,0,    0,0,    
  560. 34,34,    31,28,    31,0,    31,0,    
  561. 0,0,    0,0,    0,0,    34,34,    
  562. 0,0,    0,0,    17,17,    0,0,    
  563. 0,0,    0,0,    0,0,    0,0,    
  564. 0,0,    0,0,    0,0,    0,0,    
  565. 0,0,    0,0,    0,0,    0,0,    
  566. 18,17,    31,0,    0,0,    31,0,    
  567. 0,0,    0,0,    0,0,    0,0,    
  568. 31,0,    31,0,    31,0,    0,0,    
  569. 0,0,    0,0,    0,0,    0,0,    
  570. 0,0,    31,28,    34,34,    0,0,    
  571. 19,17,    0,0,    0,0,    34,34,    
  572. 0,0,    32,38,    32,38,    32,38,    
  573. 32,38,    32,38,    32,38,    32,38,    
  574. 32,38,    32,38,    32,38,    0,0,    
  575. 0,0,    0,0,    28,28,    0,0,    
  576. 34,34,    29,28,    32,38,    32,38,    
  577. 32,38,    32,38,    32,38,    32,38,    
  578. 0,0,    0,0,    0,0,    0,0,    
  579. 0,0,    0,0,    0,0,    0,0,    
  580. 0,0,    0,0,    0,0,    0,0,    
  581. 0,0,    0,0,    0,0,    34,34,    
  582. 0,0,    0,0,    0,0,    34,34,    
  583. 0,0,    0,0,    0,0,    0,0,    
  584. 0,0,    0,0,    32,38,    32,38,    
  585. 32,38,    32,38,    32,38,    32,38,    
  586. 0,0,    0,0,    0,0,    0,0,    
  587. 0,0,    0,0,    0,0,    0,0,    
  588. 0,0,    0,0,    0,0,    0,0,    
  589. 0,0,    0,0,    0,0,    0,0,    
  590. 31,28,    0,0,    0,0,    0,0,    
  591. 0,0,    0,0,    34,34,    0,0,    
  592. 0,0};
  593. struct yysvf yysvec[] = {
  594. 0,    0,    0,
  595. yycrank+-1,    0,        0,    
  596. yycrank+-21,    yysvec+1,    0,    
  597. yycrank+-82,    0,        yyvstop+1,
  598. yycrank+4,    0,        yyvstop+4,
  599. yycrank+0,    yysvec+4,    yyvstop+7,
  600. yycrank+0,    0,        yyvstop+10,
  601. yycrank+-93,    0,        yyvstop+12,
  602. yycrank+0,    yysvec+4,    yyvstop+14,
  603. yycrank+0,    yysvec+4,    yyvstop+17,
  604. yycrank+0,    yysvec+4,    yyvstop+20,
  605. yycrank+-152,    0,        yyvstop+23,
  606. yycrank+174,    0,        yyvstop+26,
  607. yycrank+56,    0,        yyvstop+29,
  608. yycrank+-168,    0,        yyvstop+32,
  609. yycrank+-125,    yysvec+3,    yyvstop+35,
  610. yycrank+-209,    yysvec+3,    yyvstop+39,
  611. yycrank+-243,    yysvec+3,    yyvstop+43,
  612. yycrank+-257,    yysvec+3,    yyvstop+45,
  613. yycrank+-277,    yysvec+3,    yyvstop+48,
  614. yycrank+0,    0,        yyvstop+51,
  615. yycrank+0,    0,        yyvstop+53,
  616. yycrank+-6,    yysvec+7,    0,    
  617. yycrank+-10,    yysvec+7,    yyvstop+55,
  618. yycrank+0,    0,        yyvstop+57,
  619. yycrank+11,    0,        yyvstop+59,
  620. yycrank+-109,    yysvec+7,    0,    
  621. yycrank+-11,    yysvec+7,    yyvstop+61,
  622. yycrank+-295,    yysvec+11,    yyvstop+63,
  623. yycrank+-298,    yysvec+11,    yyvstop+65,
  624. yycrank+299,    0,        yyvstop+68,
  625. yycrank+-353,    yysvec+11,    yyvstop+70,
  626. yycrank+361,    0,        0,    
  627. yycrank+-12,    yysvec+14,    yyvstop+73,
  628. yycrank+-359,    yysvec+14,    0,    
  629. yycrank+-13,    yysvec+14,    yyvstop+75,
  630. yycrank+0,    0,        yyvstop+78,
  631. yycrank+-15,    yysvec+14,    yyvstop+80,
  632. yycrank+0,    yysvec+32,    yyvstop+83,
  633. 0,    0,    0};
  634. struct yywork *yytop = yycrank+486;
  635. struct yysvf *yybgin = yysvec+1;
  636. char yymatch[] = {
  637. 00  ,01  ,01  ,01  ,04  ,01  ,01  ,01  ,
  638. 010 ,011 ,012 ,01  ,01  ,01  ,01  ,01  ,
  639. 01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  640. 01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  641. 011 ,01  ,'"' ,01  ,01  ,01  ,01  ,047 ,
  642. 047 ,047 ,01  ,'+' ,01  ,'+' ,01  ,01  ,
  643. '0' ,'0' ,'0' ,'0' ,'0' ,'0' ,'0' ,'0' ,
  644. '0' ,'0' ,01  ,01  ,01  ,01  ,01  ,01  ,
  645. 01  ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,01  ,
  646. 01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  647. 01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  648. 'X' ,01  ,01  ,01  ,0134,01  ,01  ,01  ,
  649. 01  ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,01  ,
  650. 01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  651. 01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  652. 'X' ,01  ,01  ,01  ,01  ,01  ,01  ,0177,
  653. 0};
  654. char yyextra[] = {
  655. 0,0,0,0,0,0,0,0,
  656. 0,0,0,0,0,0,0,0,
  657. 0,0,0,0,0,0,0,0,
  658. 0};
  659. #ifndef lint
  660. static    char ncform_sccsid[] = "@(#)ncform 1.6 88/02/08 SMI"; /* from S5R2 1.2 */
  661. #endif
  662.  
  663. int yylineno =1;
  664. # define YYU(x) x
  665. # define NLSTATE yyprevious=YYNEWLINE
  666. char yytext[YYLMAX];
  667. struct yysvf *yylstate [YYLMAX], **yylsp, **yyolsp;
  668. char yysbuf[YYLMAX];
  669. char *yysptr = yysbuf;
  670. int *yyfnd;
  671. extern struct yysvf *yyestate;
  672. int yyprevious = YYNEWLINE;
  673. yylook(){
  674.     register struct yysvf *yystate, **lsp;
  675.     register struct yywork *yyt;
  676.     struct yysvf *yyz;
  677.     int yych, yyfirst;
  678.     struct yywork *yyr;
  679. # ifdef LEXDEBUG
  680.     int debug;
  681. # endif
  682.     char *yylastch;
  683.     /* start off machines */
  684. # ifdef LEXDEBUG
  685.     debug = 0;
  686. # endif
  687.     yyfirst=1;
  688.     if (!yymorfg)
  689.         yylastch = yytext;
  690.     else {
  691.         yymorfg=0;
  692.         yylastch = yytext+yyleng;
  693.         }
  694.     for(;;){
  695.         lsp = yylstate;
  696.         yyestate = yystate = yybgin;
  697.         if (yyprevious==YYNEWLINE) yystate++;
  698.         for (;;){
  699. # ifdef LEXDEBUG
  700.             if(debug)fprintf(yyout,"state %d\n",yystate-yysvec-1);
  701. # endif
  702.             yyt = yystate->yystoff;
  703.             if(yyt == yycrank && !yyfirst){  /* may not be any transitions */
  704.                 yyz = yystate->yyother;
  705.                 if(yyz == 0)break;
  706.                 if(yyz->yystoff == yycrank)break;
  707.                 }
  708.             *yylastch++ = yych = input();
  709.             yyfirst=0;
  710.         tryagain:
  711. # ifdef LEXDEBUG
  712.             if(debug){
  713.                 fprintf(yyout,"char ");
  714.                 allprint(yych);
  715.                 putchar('\n');
  716.                 }
  717. # endif
  718.             yyr = yyt;
  719.             if ( (int)yyt > (int)yycrank){
  720.                 yyt = yyr + yych;
  721.                 if (yyt <= yytop && yyt->verify+yysvec == yystate){
  722.                     if(yyt->advance+yysvec == YYLERR)    /* error transitions */
  723.                         {unput(*--yylastch);break;}
  724.                     *lsp++ = yystate = yyt->advance+yysvec;
  725.                     goto contin;
  726.                     }
  727.                 }
  728. # ifdef YYOPTIM
  729.             else if((int)yyt < (int)yycrank) {        /* r < yycrank */
  730.                 yyt = yyr = yycrank+(yycrank-yyt);
  731. # ifdef LEXDEBUG
  732.                 if(debug)fprintf(yyout,"compressed state\n");
  733. # endif
  734.                 yyt = yyt + yych;
  735.                 if(yyt <= yytop && yyt->verify+yysvec == yystate){
  736.                     if(yyt->advance+yysvec == YYLERR)    /* error transitions */
  737.                         {unput(*--yylastch);break;}
  738.                     *lsp++ = yystate = yyt->advance+yysvec;
  739.                     goto contin;
  740.                     }
  741.                 yyt = yyr + YYU(yymatch[yych]);
  742. # ifdef LEXDEBUG
  743.                 if(debug){
  744.                     fprintf(yyout,"try fall back character ");
  745.                     allprint(YYU(yymatch[yych]));
  746.                     putchar('\n');
  747.                     }
  748. # endif
  749.                 if(yyt <= yytop && yyt->verify+yysvec == yystate){
  750.                     if(yyt->advance+yysvec == YYLERR)    /* error transition */
  751.                         {unput(*--yylastch);break;}
  752.                     *lsp++ = yystate = yyt->advance+yysvec;
  753.                     goto contin;
  754.                     }
  755.                 }
  756.             if ((yystate = yystate->yyother) && (yyt= yystate->yystoff) != yycrank){
  757. # ifdef LEXDEBUG
  758.                 if(debug)fprintf(yyout,"fall back to state %d\n",yystate-yysvec-1);
  759. # endif
  760.                 goto tryagain;
  761.                 }
  762. # endif
  763.             else
  764.                 {unput(*--yylastch);break;}
  765.         contin:
  766. # ifdef LEXDEBUG
  767.             if(debug){
  768.                 fprintf(yyout,"state %d char ",yystate-yysvec-1);
  769.                 allprint(yych);
  770.                 putchar('\n');
  771.                 }
  772. # endif
  773.             ;
  774.             }
  775. # ifdef LEXDEBUG
  776.         if(debug){
  777.             fprintf(yyout,"stopped at %d with ",*(lsp-1)-yysvec-1);
  778.             allprint(yych);
  779.             putchar('\n');
  780.             }
  781. # endif
  782.         while (lsp-- > yylstate){
  783.             *yylastch-- = 0;
  784.             if (*lsp != 0 && (yyfnd= (*lsp)->yystops) && *yyfnd > 0){
  785.                 yyolsp = lsp;
  786.                 if(yyextra[*yyfnd]){        /* must backup */
  787.                     while(yyback((*lsp)->yystops,-*yyfnd) != 1 && lsp > yylstate){
  788.                         lsp--;
  789.                         unput(*yylastch--);
  790.                         }
  791.                     }
  792.                 yyprevious = YYU(*yylastch);
  793.                 yylsp = lsp;
  794.                 yyleng = yylastch-yytext+1;
  795.                 yytext[yyleng] = 0;
  796. # ifdef LEXDEBUG
  797.                 if(debug){
  798.                     fprintf(yyout,"\nmatch ");
  799.                     sprint(yytext);
  800.                     fprintf(yyout," action %d\n",*yyfnd);
  801.                     }
  802. # endif
  803.                 return(*yyfnd++);
  804.                 }
  805.             unput(*yylastch);
  806.             }
  807.         if (yytext[0] == 0  /* && feof(yyin) */)
  808.             {
  809.             yysptr=yysbuf;
  810.             return(0);
  811.             }
  812.         yyprevious = yytext[0] = input();
  813.         if (yyprevious>0)
  814.             output(yyprevious);
  815.         yylastch=yytext;
  816. # ifdef LEXDEBUG
  817.         if(debug)putchar('\n');
  818. # endif
  819.         }
  820.     }
  821. yyback(p, m)
  822.     int *p;
  823. {
  824. if (p==0) return(0);
  825. while (*p)
  826.     {
  827.     if (*p++ == m)
  828.         return(1);
  829.     }
  830. return(0);
  831. }
  832.     /* the following are only used in the lex library */
  833. yyinput(){
  834.     return(input());
  835.     }
  836. yyoutput(c)
  837.   int c; {
  838.     output(c);
  839.     }
  840. yyunput(c)
  841.    int c; {
  842.     unput(c);
  843.     }
  844.