home *** CD-ROM | disk | FTP | other *** search
/ ftp.ee.lbl.gov / 2014.05.ftp.ee.lbl.gov.tar / ftp.ee.lbl.gov / bmd-1.0beta.tar.Z / bmd-1.0beta.tar / bmd-1.0beta / app / omtd / scan.c < prev    next >
C/C++ Source or Header  |  1991-03-14  |  30KB  |  1,184 lines

  1. /* A lexical scanner generated by flex */
  2.  
  3. /* scanner skeleton version:
  4.  * $Header: flex.skel,v 1.2 90/06/27 22:56:49 leres Exp $
  5.  */
  6.  
  7. #define FLEX_SCANNER
  8.  
  9. #include <stdio.h>
  10.  
  11. #ifdef __STDC__
  12.  
  13. #ifndef DONT_HAVE_STDLIB_H
  14. #include <stdlib.h>
  15. #else
  16. void *malloc( unsigned );
  17. void free( void* );
  18. #endif
  19.  
  20. #define YY_USE_PROTOS
  21. #define YY_USE_CONST
  22. #endif
  23.  
  24.  
  25. /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
  26. #ifdef c_plusplus
  27. #ifndef __cplusplus
  28. #define __cplusplus
  29. #endif
  30. #endif
  31.  
  32.  
  33. #ifdef __cplusplus
  34.  
  35. #ifndef __STDC__
  36. #include <stdlib.h>
  37. #endif
  38.  
  39. #include <osfcn.h>
  40.  
  41. /* use prototypes in function declarations */
  42. #define YY_USE_PROTOS
  43.  
  44. /* the "const" storage-class-modifier is valid */
  45. #define YY_USE_CONST
  46.  
  47. #endif
  48.  
  49.  
  50. #ifdef __TURBOC__
  51. #define YY_USE_CONST
  52. #endif
  53.  
  54.  
  55. #ifndef YY_USE_CONST
  56. #define const
  57. #endif
  58.  
  59.  
  60. #ifdef YY_USE_PROTOS
  61. #define YY_PROTO(proto) proto
  62. #else
  63. #define YY_PROTO(proto) ()
  64. /* there's no standard place to get these definitions */
  65. char *malloc();
  66. int free();
  67. int read();
  68. #endif
  69.  
  70.  
  71. /* amount of stuff to slurp up with each read */
  72. #ifndef YY_READ_BUF_SIZE
  73. #define YY_READ_BUF_SIZE 8192
  74. #endif
  75.  
  76. /* returned upon end-of-file */
  77. #define YY_END_TOK 0
  78.  
  79. /* copy whatever the last rule matched to the standard output */
  80.  
  81. /* cast to (char *) is because for 8-bit chars, yytext is (unsigned char *) */
  82. /* this used to be an fputs(), but since the string might contain NUL's,
  83.  * we now use fwrite()
  84.  */
  85. #define ECHO (void) fwrite( (char *) yytext, yyleng, 1, yyout )
  86.  
  87. /* gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
  88.  * is returned in "result".
  89.  */
  90. #define YY_INPUT(buf,result,max_size) \
  91.     if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
  92.         YY_FATAL_ERROR( "read() in flex scanner failed" );
  93. #define YY_NULL 0
  94.  
  95. /* no semi-colon after return; correct usage is to write "yyterminate();" -
  96.  * we don't want an extra ';' after the "return" because that will cause
  97.  * some compilers to complain about unreachable statements.
  98.  */
  99. #define yyterminate() return ( YY_NULL )
  100.  
  101. /* report a fatal error */
  102.  
  103. /* The funky do-while is used to turn this macro definition into
  104.  * a single C statement (which needs a semi-colon terminator).
  105.  * This avoids problems with code like:
  106.  *
  107.  *     if ( something_happens )
  108.  *        YY_FATAL_ERROR( "oops, the something happened" );
  109.  *    else
  110.  *        everything_okay();
  111.  *
  112.  * Prior to using the do-while the compiler would get upset at the
  113.  * "else" because it interpreted the "if" statement as being all
  114.  * done when it reached the ';' after the YY_FATAL_ERROR() call.
  115.  */
  116.  
  117. #define YY_FATAL_ERROR(msg) \
  118.     do \
  119.         { \
  120.         (void) fputs( msg, stderr ); \
  121.         (void) putc( '\n', stderr ); \
  122.         exit( 1 ); \
  123.         } \
  124.     while ( 0 )
  125.  
  126. /* default yywrap function - always treat EOF as an EOF */
  127. #define yywrap() 1
  128.  
  129. /* enter a start condition.  This macro really ought to take a parameter,
  130.  * but we do it the disgusting crufty way forced on us by the ()-less
  131.  * definition of BEGIN
  132.  */
  133. #define BEGIN yy_start = 1 + 2 *
  134.  
  135. /* action number for EOF rule of a given start state */
  136. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  137.  
  138. /* special action meaning "start processing a new file" */
  139. #define YY_NEW_FILE \
  140.     do \
  141.         { \
  142.         yy_init_buffer( yy_current_buffer, yyin ); \
  143.         yy_load_buffer_state(); \
  144.         } \
  145.     while ( 0 )
  146.  
  147. /* default declaration of generated scanner - a define so the user can
  148.  * easily add parameters
  149.  */
  150. #define YY_DECL int yylex YY_PROTO(( void )) 
  151.  
  152. /* code executed at the end of each rule */
  153. #define YY_BREAK break;
  154.  
  155. #define YY_END_OF_BUFFER_CHAR 0
  156.  
  157. #ifndef YY_BUF_SIZE
  158. #define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2) /* size of default input buffer */
  159. #endif
  160.  
  161. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  162.  
  163. #define YY_CHAR char
  164. # line 1 "scan.l"
  165. #define INITIAL 0
  166. # line 2 "scan.l"
  167. #include "token.h"
  168. extern char *intern();
  169.  
  170. extern YYSTYPE yylval;
  171. # line 8 "scan.l"
  172.  
  173. /* done after the current pattern has been matched and before the
  174.  * corresponding action - sets up yytext
  175.  */
  176. #define YY_DO_BEFORE_ACTION \
  177.     yytext = yy_bp; \
  178.     yyleng = yy_cp - yy_bp; \
  179.     yy_hold_char = *yy_cp; \
  180.     *yy_cp = '\0'; \
  181.     yy_c_buf_p = yy_cp;
  182.  
  183. #define EOB_ACT_CONTINUE_SCAN 0
  184. #define EOB_ACT_END_OF_FILE 1
  185. #define EOB_ACT_LAST_MATCH 2
  186.  
  187. /* return all but the first 'n' matched characters back to the input stream */
  188. #define yyless(n) \
  189.     do \
  190.         { \
  191.         /* undo effects of setting up yytext */ \
  192.         *yy_cp = yy_hold_char; \
  193.         yy_c_buf_p = yy_cp = yy_bp + n; \
  194.         YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  195.         } \
  196.     while ( 0 )
  197.  
  198. #define unput(c) yyunput( c, yytext )
  199.  
  200.  
  201. struct yy_buffer_state
  202.     {
  203.     FILE *yy_input_file;
  204.  
  205.     YY_CHAR *yy_ch_buf;        /* input buffer */
  206.     YY_CHAR *yy_buf_pos;    /* current position in input buffer */
  207.  
  208.     /* size of input buffer in bytes, not including room for EOB characters*/
  209.     int yy_buf_size;    
  210.  
  211.     /* number of characters read into yy_ch_buf, not including EOB characters */
  212.     int yy_n_chars;
  213.  
  214.     int yy_eof_status;        /* whether we've seen an EOF on this buffer */
  215. #define EOF_NOT_SEEN 0
  216.     /* "pending" happens when the EOF has been seen but there's still
  217.      * some text process
  218.      */
  219. #define EOF_PENDING 1
  220. #define EOF_DONE 2
  221.     };
  222.  
  223. static YY_BUFFER_STATE yy_current_buffer;
  224.  
  225. /* we provide macros for accessing buffer states in case in the
  226.  * future we want to put the buffer states in a more general
  227.  * "scanner state"
  228.  */
  229. #define YY_CURRENT_BUFFER yy_current_buffer
  230.  
  231.  
  232. /* yy_hold_char holds the character lost when yytext is formed */
  233. static YY_CHAR yy_hold_char;
  234.  
  235. static int yy_n_chars;        /* number of characters read into yy_ch_buf */
  236.  
  237.  
  238.  
  239. #ifndef YY_USER_ACTION
  240. #define YY_USER_ACTION
  241. #endif
  242.  
  243. #ifndef YY_USER_INIT
  244. #define YY_USER_INIT
  245. #endif
  246.  
  247. extern YY_CHAR *yytext;
  248. extern int yyleng;
  249. extern FILE *yyin, *yyout;
  250.  
  251. YY_CHAR *yytext;
  252. int yyleng;
  253.  
  254. FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
  255.  
  256. #define YY_END_OF_BUFFER 34
  257. typedef int yy_state_type;
  258. static const short int yy_accept[126] =
  259.     {   0,
  260.         0,    0,   34,   32,   28,   31,   31,   30,   29,   29,
  261.        29,   29,   29,   29,   29,   29,   29,   29,   29,   29,
  262.        29,   29,   29,   29,   28,   30,   29,   29,   29,   29,
  263.        29,   29,   29,   29,   29,   29,   29,   29,   29,   29,
  264.        29,   29,   29,   29,   29,   29,   29,   29,   29,   29,
  265.        29,   29,   29,   29,   29,   29,   29,   29,   29,   29,
  266.        29,   29,   22,    2,   29,   29,   29,    4,   29,   26,
  267.        29,   29,   29,   29,   29,   29,   29,   29,   15,   29,
  268.         9,   10,   29,   20,   29,   12,   16,   29,   29,    3,
  269.        19,   29,    5,   29,   29,   29,   29,   29,   29,    1,
  270.  
  271.        13,   29,   29,    7,    6,   29,   29,    8,   29,   25,
  272.        29,   29,   29,   14,   23,   29,   29,   21,   17,   24,
  273.        11,   29,   27,   18,    0
  274.     } ;
  275.  
  276. static const YY_CHAR yy_ec[128] =
  277.     {   0,
  278.         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
  279.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  280.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  281.         1,    2,    1,    1,    1,    1,    1,    1,    1,    1,
  282.         1,    1,    1,    4,    1,    4,    4,    5,    5,    5,
  283.         5,    5,    5,    5,    5,    5,    5,    4,    4,    1,
  284.         1,    1,    1,    1,    6,    6,    6,    6,    6,    6,
  285.         6,    6,    6,    6,    6,    6,    6,    6,    6,    6,
  286.         6,    6,    6,    6,    6,    6,    6,    6,    6,    6,
  287.         1,    1,    1,    1,    6,    1,    7,    6,    8,    9,
  288.  
  289.        10,   11,   12,   13,   14,    6,   15,   16,   17,   18,
  290.        19,   20,   21,   22,   23,   24,   25,   26,   27,    6,
  291.        28,   29,    1,    1,    1,    1,    1
  292.     } ;
  293.  
  294. static const YY_CHAR yy_meta[30] =
  295.     {   0,
  296.         1,    1,    1,    1,    2,    2,    2,    2,    2,    2,
  297.         2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
  298.         2,    2,    2,    2,    2,    2,    2,    2,    2
  299.     } ;
  300.  
  301. static const short int yy_base[127] =
  302.     {   0,
  303.         0,    0,  132,  133,  129,  133,  133,  125,    0,   17,
  304.        21,  121,  110,  108,   22,  116,  114,  102,   98,   97,
  305.        27,   28,  103,  101,  117,  113,    0,  110,   25,   96,
  306.        99,   97,  100,   89,  104,   88,   83,   84,   80,   95,
  307.        91,   35,   86,   77,   78,   82,   83,   92,   81,   81,
  308.        78,   88,   86,   65,   82,   71,   71,   79,   79,   75,
  309.        76,   75,    0,    0,   66,   65,   58,    0,   71,   56,
  310.        59,   58,   35,   52,   51,   57,   52,   58,    0,   48,
  311.         0,    0,   49,    0,   60,    0,    0,   45,   44,    0,
  312.         0,   53,    0,   47,   50,   41,   39,   45,   51,    0,
  313.  
  314.         0,   50,   35,    0,    0,   44,   39,    0,   33,    0,
  315.        45,   44,   36,    0,    0,   19,   33,    0,    0,    0,
  316.         0,   34,    0,    0,  133,   38
  317.     } ;
  318.  
  319. static const short int yy_def[127] =
  320.     {   0,
  321.       125,    1,  125,  125,  125,  125,  125,  125,  126,  126,
  322.       126,  126,  126,  126,  126,  126,  126,  126,  126,  126,
  323.       126,  126,  126,  126,  125,  125,  126,  126,  126,  126,
  324.       126,  126,  126,  126,  126,  126,  126,  126,  126,  126,
  325.       126,  126,  126,  126,  126,  126,  126,  126,  126,  126,
  326.       126,  126,  126,  126,  126,  126,  126,  126,  126,  126,
  327.       126,  126,  126,  126,  126,  126,  126,  126,  126,  126,
  328.       126,  126,  126,  126,  126,  126,  126,  126,  126,  126,
  329.       126,  126,  126,  126,  126,  126,  126,  126,  126,  126,
  330.       126,  126,  126,  126,  126,  126,  126,  126,  126,  126,
  331.  
  332.       126,  126,  126,  126,  126,  126,  126,  126,  126,  126,
  333.       126,  126,  126,  126,  126,  126,  126,  126,  126,  126,
  334.       126,  126,  126,  126,    0,  125
  335.     } ;
  336.  
  337. static const short int yy_nxt[163] =
  338.     {   0,
  339.         4,    5,    6,    7,    8,    9,    9,   10,   11,   12,
  340.         9,    9,    9,   13,    9,   14,   15,   16,   17,   18,
  341.        19,   20,   21,   22,   23,   24,    9,    9,    9,   28,
  342.        31,   36,   29,   44,   52,   30,   45,   47,   53,   27,
  343.        37,   66,   95,  124,  123,   32,   38,  122,   67,   48,
  344.        46,  121,   96,  120,  119,  118,  117,  116,  115,  114,
  345.       113,  112,  111,  110,  109,  108,  107,  106,  105,  104,
  346.       103,  102,  101,  100,   99,   98,   97,   94,   93,   92,
  347.        91,   90,   89,   88,   87,   86,   85,   84,   83,   82,
  348.        81,   80,   79,   78,   77,   76,   75,   74,   73,   72,
  349.  
  350.        71,   70,   69,   68,   65,   64,   63,   62,   61,   60,
  351.        59,   58,   57,   56,   55,   54,   51,   26,   25,   50,
  352.        49,   43,   42,   41,   40,   39,   35,   34,   33,   26,
  353.        25,  125,    3,  125,  125,  125,  125,  125,  125,  125,
  354.       125,  125,  125,  125,  125,  125,  125,  125,  125,  125,
  355.       125,  125,  125,  125,  125,  125,  125,  125,  125,  125,
  356.       125,  125
  357.     } ;
  358.  
  359. static const short int yy_chk[163] =
  360.     {   0,
  361.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  362.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  363.         1,    1,    1,    1,    1,    1,    1,    1,    1,   10,
  364.        11,   15,   10,   21,   29,   10,   21,   22,   29,  126,
  365.        15,   42,   73,  122,  117,   11,   15,  116,   42,   22,
  366.        21,  113,   73,  112,  111,  109,  107,  106,  103,  102,
  367.        99,   98,   97,   96,   95,   94,   92,   89,   88,   85,
  368.        83,   80,   78,   77,   76,   75,   74,   72,   71,   70,
  369.        69,   67,   66,   65,   62,   61,   60,   59,   58,   57,
  370.        56,   55,   54,   53,   52,   51,   50,   49,   48,   47,
  371.  
  372.        46,   45,   44,   43,   41,   40,   39,   38,   37,   36,
  373.        35,   34,   33,   32,   31,   30,   28,   26,   25,   24,
  374.        23,   20,   19,   18,   17,   16,   14,   13,   12,    8,
  375.         5,    3,  125,  125,  125,  125,  125,  125,  125,  125,
  376.       125,  125,  125,  125,  125,  125,  125,  125,  125,  125,
  377.       125,  125,  125,  125,  125,  125,  125,  125,  125,  125,
  378.       125,  125
  379.     } ;
  380.  
  381. static yy_state_type yy_last_accepting_state;
  382. static YY_CHAR *yy_last_accepting_cpos;
  383.  
  384. /* the intent behind this definition is that it'll catch
  385.  * any uses of REJECT which flex missed
  386.  */
  387. #define REJECT reject_used_but_not_detected
  388. #define yymore() yymore_used_but_not_detected
  389. #define YY_MORE_ADJ 0
  390.  
  391. /* these variables are all declared out here so that section 3 code can
  392.  * manipulate them
  393.  */
  394. /* points to current character in buffer */
  395. static YY_CHAR *yy_c_buf_p = (YY_CHAR *) 0;
  396. static int yy_init = 1;        /* whether we need to initialize */
  397. static int yy_start = 0;    /* start state number */
  398.  
  399. /* flag which is used to allow yywrap()'s to do buffer switches
  400.  * instead of setting up a fresh yyin.  A bit of a hack ...
  401.  */
  402. static int yy_did_buffer_switch_on_eof;
  403.  
  404. static yy_state_type yy_get_previous_state YY_PROTO(( void ));
  405. static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
  406. static int yy_get_next_buffer YY_PROTO(( void ));
  407. static void yyunput YY_PROTO(( YY_CHAR c, YY_CHAR *buf_ptr ));
  408. void yyrestart YY_PROTO(( FILE *input_file ));
  409. void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
  410. void yy_load_buffer_state YY_PROTO(( void ));
  411. YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
  412. void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
  413. void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
  414.  
  415. #define yy_new_buffer yy_create_buffer
  416.  
  417. #ifdef __cplusplus
  418. static int yyinput YY_PROTO(( void ));
  419. #else
  420. static int input YY_PROTO(( void ));
  421. #endif
  422.  
  423. YY_DECL
  424.     {
  425.     register yy_state_type yy_current_state;
  426.     register YY_CHAR *yy_cp, *yy_bp;
  427.     register int yy_act;
  428.  
  429.  
  430.  
  431.     if ( yy_init )
  432.     {
  433.     YY_USER_INIT;
  434.  
  435.     if ( ! yy_start )
  436.         yy_start = 1;    /* first start state */
  437.  
  438.     if ( ! yyin )
  439.         yyin = stdin;
  440.  
  441.     if ( ! yyout )
  442.         yyout = stdout;
  443.  
  444.     if ( yy_current_buffer )
  445.         yy_init_buffer( yy_current_buffer, yyin );
  446.     else
  447.         yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
  448.  
  449.     yy_load_buffer_state();
  450.  
  451.     yy_init = 0;
  452.     }
  453.  
  454.     while ( 1 )        /* loops until end-of-file is reached */
  455.     {
  456.     yy_cp = yy_c_buf_p;
  457.  
  458.     /* support of yytext */
  459.     *yy_cp = yy_hold_char;
  460.  
  461.     /* yy_bp points to the position in yy_ch_buf of the start of the
  462.      * current run.
  463.      */
  464.     yy_bp = yy_cp;
  465.  
  466.     yy_current_state = yy_start;
  467. yy_match:
  468.     do
  469.         {
  470.         register YY_CHAR yy_c = yy_ec[*yy_cp];
  471.         if ( yy_accept[yy_current_state] )
  472.         {
  473.         yy_last_accepting_state = yy_current_state;
  474.         yy_last_accepting_cpos = yy_cp;
  475.         }
  476.         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  477.         {
  478.         yy_current_state = yy_def[yy_current_state];
  479.         if ( yy_current_state >= 126 )
  480.             yy_c = yy_meta[yy_c];
  481.         }
  482.         yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  483.         ++yy_cp;
  484.         }
  485.     while ( yy_base[yy_current_state] != 133 );
  486.  
  487. yy_find_action:
  488.     yy_act = yy_accept[yy_current_state];
  489.  
  490.     YY_DO_BEFORE_ACTION;
  491.     YY_USER_ACTION;
  492.  
  493. do_action:    /* this label is used only to access EOF actions */
  494.  
  495.  
  496.     switch ( yy_act )
  497.         {
  498.         case 0: /* must backtrack */
  499.         /* undo the effects of YY_DO_BEFORE_ACTION */
  500.         *yy_cp = yy_hold_char;
  501.         yy_cp = yy_last_accepting_cpos;
  502.         yy_current_state = yy_last_accepting_state;
  503.         goto yy_find_action;
  504.  
  505. case 1:
  506. # line 9 "scan.l"
  507. return TK_CLEAR;
  508.     YY_BREAK
  509. case 2:
  510. # line 10 "scan.l"
  511. return TK_OFF;
  512.     YY_BREAK
  513. case 3:
  514. # line 11 "scan.l"
  515. return TK_QUIT;
  516.     YY_BREAK
  517. case 4:
  518. # line 12 "scan.l"
  519. return TK_RUN;
  520.     YY_BREAK
  521. case 5:
  522. # line 13 "scan.l"
  523. return TK_STOP;
  524.     YY_BREAK
  525. case 6:
  526. # line 14 "scan.l"
  527. return TK_PRINT;
  528.     YY_BREAK
  529. case 7:
  530. # line 15 "scan.l"
  531. return TK_MERGE;
  532.     YY_BREAK
  533. case 8:
  534. # line 16 "scan.l"
  535. return TK_TEMPO;
  536.     YY_BREAK
  537. case 9:
  538. # line 17 "scan.l"
  539. return TK_DUMP;
  540.     YY_BREAK
  541. case 10:
  542. # line 18 "scan.l"
  543. return TK_ECHO;
  544.     YY_BREAK
  545. case 11:
  546. # line 19 "scan.l"
  547. return TK_CHANNEL;
  548.     YY_BREAK
  549. case 12:
  550. # line 20 "scan.l"
  551. return TK_MOVE;
  552.     YY_BREAK
  553. case 13:
  554. # line 21 "scan.l"
  555. return TK_CLICK;
  556.     YY_BREAK
  557. case 14:
  558. # line 22 "scan.l"
  559. return TK_DELETE;
  560.     YY_BREAK
  561. case 15:
  562. # line 23 "scan.l"
  563. return TK_COPY;
  564.     YY_BREAK
  565. case 16:
  566. # line 24 "scan.l"
  567. return TK_MUTE;
  568.     YY_BREAK
  569. case 17:
  570. # line 25 "scan.l"
  571. return TK_UNMUTE;
  572.     YY_BREAK
  573. case 18:
  574. # line 26 "scan.l"
  575. return TK_QUANTIZE;
  576.     YY_BREAK
  577. case 19:
  578. # line 27 "scan.l"
  579. return TK_SAVE;
  580.     YY_BREAK
  581. case 20:
  582. # line 28 "scan.l"
  583. return TK_LOAD;
  584.     YY_BREAK
  585. case 21:
  586. # line 29 "scan.l"
  587. return TK_TRACKS;
  588.     YY_BREAK
  589. case 22:
  590. # line 30 "scan.l"
  591. return TK_NEW;
  592.     YY_BREAK
  593. case 23:
  594. # line 31 "scan.l"
  595. return TK_INSERT;
  596.     YY_BREAK
  597. case 24:
  598. # line 32 "scan.l"
  599. return TK_VOLUME;
  600.     YY_BREAK
  601. case 25:
  602. # line 33 "scan.l"
  603. return TK_TRANS;
  604.     YY_BREAK
  605. case 26:
  606. # line 34 "scan.l"
  607. return TK_SET;
  608.     YY_BREAK
  609. case 27:
  610. # line 35 "scan.l"
  611. return TK_SETTING;
  612.     YY_BREAK
  613. case 28:
  614. # line 36 "scan.l"
  615. ;
  616.     YY_BREAK
  617. case 29:
  618. # line 37 "scan.l"
  619. { yylval.s = intern(yytext); return TK_ID; }
  620.     YY_BREAK
  621. case 30:
  622. # line 38 "scan.l"
  623. { yylval.i = stoi(yytext); return TK_INT; }
  624.     YY_BREAK
  625. case 31:
  626. # line 39 "scan.l"
  627. { return *yytext; }
  628.     YY_BREAK
  629. case 32:
  630. # line 40 "scan.l"
  631. { lex_err(*yytext); }
  632.     YY_BREAK
  633. case 33:
  634. # line 41 "scan.l"
  635. ECHO;
  636.     YY_BREAK
  637. case YY_STATE_EOF(INITIAL):
  638.     yyterminate();
  639.  
  640.         case YY_END_OF_BUFFER:
  641.         {
  642.         /* amount of text matched not including the EOB char */
  643.         int yy_amount_of_matched_text = yy_cp - yytext - 1;
  644.  
  645.         /* undo the effects of YY_DO_BEFORE_ACTION */
  646.         *yy_cp = yy_hold_char;
  647.  
  648.         /* note that here we test for yy_c_buf_p "<=" to the position
  649.          * of the first EOB in the buffer, since yy_c_buf_p will
  650.          * already have been incremented past the NUL character
  651.          * (since all states make transitions on EOB to the end-
  652.          * of-buffer state).  Contrast this with the test in yyinput().
  653.          */
  654.         if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  655.             /* this was really a NUL */
  656.             {
  657.             yy_state_type yy_next_state;
  658.  
  659.             yy_c_buf_p = yytext + yy_amount_of_matched_text;
  660.  
  661.             yy_current_state = yy_get_previous_state();
  662.  
  663.             /* okay, we're now positioned to make the
  664.              * NUL transition.  We couldn't have
  665.              * yy_get_previous_state() go ahead and do it
  666.              * for us because it doesn't know how to deal
  667.              * with the possibility of jamming (and we
  668.              * don't want to build jamming into it because
  669.              * then it will run more slowly)
  670.              */
  671.  
  672.             yy_next_state = yy_try_NUL_trans( yy_current_state );
  673.  
  674.             yy_bp = yytext + YY_MORE_ADJ;
  675.  
  676.             if ( yy_next_state )
  677.             {
  678.             /* consume the NUL */
  679.             yy_cp = ++yy_c_buf_p;
  680.             yy_current_state = yy_next_state;
  681.             goto yy_match;
  682.             }
  683.  
  684.             else
  685.             {
  686.             goto yy_find_action;
  687.             }
  688.             }
  689.  
  690.         else switch ( yy_get_next_buffer() )
  691.             {
  692.             case EOB_ACT_END_OF_FILE:
  693.             {
  694.             yy_did_buffer_switch_on_eof = 0;
  695.  
  696.             if ( yywrap() )
  697.                 {
  698.                 /* note: because we've taken care in
  699.                  * yy_get_next_buffer() to have set up yytext,
  700.                  * we can now set up yy_c_buf_p so that if some
  701.                  * total hoser (like flex itself) wants
  702.                  * to call the scanner after we return the
  703.                  * YY_NULL, it'll still work - another YY_NULL
  704.                  * will get returned.
  705.                  */
  706.                 yy_c_buf_p = yytext + YY_MORE_ADJ;
  707.  
  708.                 yy_act = YY_STATE_EOF((yy_start - 1) / 2);
  709.                 goto do_action;
  710.                 }
  711.  
  712.             else
  713.                 {
  714.                 if ( ! yy_did_buffer_switch_on_eof )
  715.                 YY_NEW_FILE;
  716.                 }
  717.             }
  718.             break;
  719.  
  720.             case EOB_ACT_CONTINUE_SCAN:
  721.             yy_c_buf_p = yytext + yy_amount_of_matched_text;
  722.  
  723.             yy_current_state = yy_get_previous_state();
  724.  
  725.             yy_cp = yy_c_buf_p;
  726.             yy_bp = yytext + YY_MORE_ADJ;
  727.             goto yy_match;
  728.  
  729.             case EOB_ACT_LAST_MATCH:
  730.             yy_c_buf_p =
  731.                 &yy_current_buffer->yy_ch_buf[yy_n_chars];
  732.  
  733.             yy_current_state = yy_get_previous_state();
  734.  
  735.             yy_cp = yy_c_buf_p;
  736.             yy_bp = yytext + YY_MORE_ADJ;
  737.             goto yy_find_action;
  738.             }
  739.         break;
  740.         }
  741.  
  742.         default:
  743. #ifdef FLEX_DEBUG
  744.         printf( "action # %d\n", yy_act );
  745. #endif
  746.         YY_FATAL_ERROR(
  747.             "fatal flex scanner internal error--no action found" );
  748.         }
  749.     }
  750.     }
  751.  
  752.  
  753. /* yy_get_next_buffer - try to read in a new buffer
  754.  *
  755.  * synopsis
  756.  *     int yy_get_next_buffer();
  757.  *     
  758.  * returns a code representing an action
  759.  *     EOB_ACT_LAST_MATCH - 
  760.  *     EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  761.  *     EOB_ACT_END_OF_FILE - end of file
  762.  */
  763.  
  764. static int yy_get_next_buffer()
  765.  
  766.     {
  767.     register YY_CHAR *dest = yy_current_buffer->yy_ch_buf;
  768.     register YY_CHAR *source = yytext - 1; /* copy prev. char, too */
  769.     register int number_to_move, i;
  770.     int ret_val;
  771.  
  772.     if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
  773.     YY_FATAL_ERROR(
  774.         "fatal flex scanner internal error--end of buffer missed" );
  775.  
  776.     /* try to read more data */
  777.  
  778.     /* first move last chars to start of buffer */
  779.     number_to_move = yy_c_buf_p - yytext;
  780.  
  781.     for ( i = 0; i < number_to_move; ++i )
  782.     *(dest++) = *(source++);
  783.  
  784.     if ( yy_current_buffer->yy_eof_status != EOF_NOT_SEEN )
  785.     /* don't do the read, it's not guaranteed to return an EOF,
  786.      * just force an EOF
  787.      */
  788.     yy_n_chars = 0;
  789.  
  790.     else
  791.     {
  792.     int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1;
  793.  
  794.     if ( num_to_read > YY_READ_BUF_SIZE )
  795.         num_to_read = YY_READ_BUF_SIZE;
  796.  
  797.     else if ( num_to_read <= 0 )
  798.         YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" );
  799.  
  800.     /* read in more data */
  801.     YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
  802.           yy_n_chars, num_to_read );
  803.     }
  804.  
  805.     if ( yy_n_chars == 0 )
  806.     {
  807.     if ( number_to_move == 1 )
  808.         {
  809.         ret_val = EOB_ACT_END_OF_FILE;
  810.         yy_current_buffer->yy_eof_status = EOF_DONE;
  811.         }
  812.  
  813.     else
  814.         {
  815.         ret_val = EOB_ACT_LAST_MATCH;
  816.         yy_current_buffer->yy_eof_status = EOF_PENDING;
  817.         }
  818.     }
  819.  
  820.     else
  821.     ret_val = EOB_ACT_CONTINUE_SCAN;
  822.  
  823.     yy_n_chars += number_to_move;
  824.     yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  825.     yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  826.  
  827.     /* yytext begins at the second character in yy_ch_buf; the first
  828.      * character is the one which preceded it before reading in the latest
  829.      * buffer; it needs to be kept around in case it's a newline, so
  830.      * yy_get_previous_state() will have with '^' rules active
  831.      */
  832.  
  833.     yytext = &yy_current_buffer->yy_ch_buf[1];
  834.  
  835.     return ( ret_val );
  836.     }
  837.  
  838.  
  839. /* yy_get_previous_state - get the state just before the EOB char was reached
  840.  *
  841.  * synopsis
  842.  *     yy_state_type yy_get_previous_state();
  843.  */
  844.  
  845. static yy_state_type yy_get_previous_state()
  846.  
  847.     {
  848.     register yy_state_type yy_current_state;
  849.     register YY_CHAR *yy_cp;
  850.  
  851.     yy_current_state = yy_start;
  852.  
  853.     for ( yy_cp = yytext + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
  854.     {
  855.     register YY_CHAR yy_c = (*yy_cp ? yy_ec[*yy_cp] : 1);
  856.     if ( yy_accept[yy_current_state] )
  857.         {
  858.         yy_last_accepting_state = yy_current_state;
  859.         yy_last_accepting_cpos = yy_cp;
  860.         }
  861.     while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  862.         {
  863.         yy_current_state = yy_def[yy_current_state];
  864.         if ( yy_current_state >= 126 )
  865.         yy_c = yy_meta[yy_c];
  866.         }
  867.     yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  868.     }
  869.  
  870.     return ( yy_current_state );
  871.     }
  872.  
  873.  
  874. /* yy_try_NUL_trans - try to make a transition on the NUL character
  875.  *
  876.  * synopsis
  877.  *     next_state = yy_try_NUL_trans( current_state );
  878.  */
  879.  
  880. #ifdef YY_USE_PROTOS
  881. static yy_state_type yy_try_NUL_trans( register yy_state_type yy_current_state )
  882. #else
  883. static yy_state_type yy_try_NUL_trans( yy_current_state )
  884. register yy_state_type yy_current_state;
  885. #endif
  886.  
  887.     {
  888.     register int yy_is_jam;
  889.     register YY_CHAR *yy_cp = yy_c_buf_p;
  890.  
  891.     register YY_CHAR yy_c = 1;
  892.     if ( yy_accept[yy_current_state] )
  893.     {
  894.     yy_last_accepting_state = yy_current_state;
  895.     yy_last_accepting_cpos = yy_cp;
  896.     }
  897.     while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  898.     {
  899.     yy_current_state = yy_def[yy_current_state];
  900.     if ( yy_current_state >= 126 )
  901.         yy_c = yy_meta[yy_c];
  902.     }
  903.     yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  904.     yy_is_jam = (yy_base[yy_current_state] == 133);
  905.  
  906.     return ( yy_is_jam ? 0 : yy_current_state );
  907.     }
  908.  
  909.  
  910. #ifdef YY_USE_PROTOS
  911. static void yyunput( YY_CHAR c, register YY_CHAR *yy_bp )
  912. #else
  913. static void yyunput( c, yy_bp )
  914. YY_CHAR c;
  915. register YY_CHAR *yy_bp;
  916. #endif
  917.  
  918.     {
  919.     register YY_CHAR *yy_cp = yy_c_buf_p;
  920.  
  921.     /* undo effects of setting up yytext */
  922.     *yy_cp = yy_hold_char;
  923.  
  924.     if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  925.     { /* need to shift things up to make room */
  926.     register int number_to_move = yy_n_chars + 2; /* +2 for EOB chars */
  927.     register YY_CHAR *dest =
  928.         &yy_current_buffer->yy_ch_buf[yy_current_buffer->yy_buf_size + 2];
  929.     register YY_CHAR *source =
  930.         &yy_current_buffer->yy_ch_buf[number_to_move];
  931.  
  932.     while ( source > yy_current_buffer->yy_ch_buf )
  933.         *--dest = *--source;
  934.  
  935.     yy_cp += dest - source;
  936.     yy_bp += dest - source;
  937.     yy_n_chars = yy_current_buffer->yy_buf_size;
  938.  
  939.     if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  940.         YY_FATAL_ERROR( "flex scanner push-back overflow" );
  941.     }
  942.  
  943.     if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
  944.     yy_cp[-2] = '\n';
  945.  
  946.     *--yy_cp = c;
  947.  
  948.     /* note: the formal parameter *must* be called "yy_bp" for this
  949.      *       macro to now work correctly
  950.      */
  951.     YY_DO_BEFORE_ACTION; /* set up yytext again */
  952.     }
  953.  
  954.  
  955. #ifdef __cplusplus
  956. static int yyinput()
  957. #else
  958. static int input()
  959. #endif
  960.  
  961.     {
  962.     int c;
  963.     YY_CHAR *yy_cp = yy_c_buf_p;
  964.  
  965.     *yy_cp = yy_hold_char;
  966.  
  967.     if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  968.     {
  969.     /* yy_c_buf_p now points to the character we want to return.
  970.      * If this occurs *before* the EOB characters, then it's a
  971.      * valid NUL; if not, then we've hit the end of the buffer.
  972.      */
  973.     if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  974.         /* this was really a NUL */
  975.         *yy_c_buf_p = '\0';
  976.  
  977.     else
  978.         { /* need more input */
  979.         yytext = yy_c_buf_p;
  980.         ++yy_c_buf_p;
  981.  
  982.         switch ( yy_get_next_buffer() )
  983.         {
  984.         case EOB_ACT_END_OF_FILE:
  985.             {
  986.             if ( yywrap() )
  987.             {
  988.             yy_c_buf_p = yytext + YY_MORE_ADJ;
  989.             return ( EOF );
  990.             }
  991.  
  992.             YY_NEW_FILE;
  993.  
  994. #ifdef __cplusplus
  995.             return ( yyinput() );
  996. #else
  997.             return ( input() );
  998. #endif
  999.             }
  1000.             break;
  1001.  
  1002.         case EOB_ACT_CONTINUE_SCAN:
  1003.             yy_c_buf_p = yytext + YY_MORE_ADJ;
  1004.             break;
  1005.  
  1006.         case EOB_ACT_LAST_MATCH:
  1007. #ifdef __cplusplus
  1008.             YY_FATAL_ERROR( "unexpected last match in yyinput()" );
  1009. #else
  1010.             YY_FATAL_ERROR( "unexpected last match in input()" );
  1011. #endif
  1012.         }
  1013.         }
  1014.     }
  1015.  
  1016.     c = *yy_c_buf_p;
  1017.     yy_hold_char = *++yy_c_buf_p;
  1018.  
  1019.     return ( c );
  1020.     }
  1021.  
  1022.  
  1023. #ifdef YY_USE_PROTOS
  1024. void yyrestart( FILE *input_file )
  1025. #else
  1026. void yyrestart( input_file )
  1027. FILE *input_file;
  1028. #endif
  1029.  
  1030.     {
  1031.     yy_init_buffer( yy_current_buffer, input_file );
  1032.     yy_load_buffer_state();
  1033.     }
  1034.  
  1035.  
  1036. #ifdef YY_USE_PROTOS
  1037. void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
  1038. #else
  1039. void yy_switch_to_buffer( new_buffer )
  1040. YY_BUFFER_STATE new_buffer;
  1041. #endif
  1042.  
  1043.     {
  1044.     if ( yy_current_buffer == new_buffer )
  1045.     return;
  1046.  
  1047.     if ( yy_current_buffer )
  1048.     {
  1049.     /* flush out information for old buffer */
  1050.     *yy_c_buf_p = yy_hold_char;
  1051.     yy_current_buffer->yy_buf_pos = yy_c_buf_p;
  1052.     yy_current_buffer->yy_n_chars = yy_n_chars;
  1053.     }
  1054.  
  1055.     yy_current_buffer = new_buffer;
  1056.     yy_load_buffer_state();
  1057.  
  1058.     /* we don't actually know whether we did this switch during
  1059.      * EOF (yywrap()) processing, but the only time this flag
  1060.      * is looked at is after yywrap() is called, so it's safe
  1061.      * to go ahead and always set it.
  1062.      */
  1063.     yy_did_buffer_switch_on_eof = 1;
  1064.     }
  1065.  
  1066.  
  1067. #ifdef YY_USE_PROTOS
  1068. void yy_load_buffer_state( void )
  1069. #else
  1070. void yy_load_buffer_state()
  1071. #endif
  1072.  
  1073.     {
  1074.     yy_n_chars = yy_current_buffer->yy_n_chars;
  1075.     yytext = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
  1076.     yyin = yy_current_buffer->yy_input_file;
  1077.     yy_hold_char = *yy_c_buf_p;
  1078.     }
  1079.  
  1080.  
  1081. #ifdef YY_USE_PROTOS
  1082. YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
  1083. #else
  1084. YY_BUFFER_STATE yy_create_buffer( file, size )
  1085. FILE *file;
  1086. int size;
  1087. #endif
  1088.  
  1089.     {
  1090.     YY_BUFFER_STATE b;
  1091.  
  1092.     b = (YY_BUFFER_STATE) malloc( sizeof( struct yy_buffer_state ) );
  1093.  
  1094.     if ( ! b )
  1095.     YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1096.  
  1097.     b->yy_buf_size = size;
  1098.  
  1099.     /* yy_ch_buf has to be 2 characters longer than the size given because
  1100.      * we need to put in 2 end-of-buffer characters.
  1101.      */
  1102.     b->yy_ch_buf = (YY_CHAR *) malloc( (unsigned) (b->yy_buf_size + 2) );
  1103.  
  1104.     if ( ! b->yy_ch_buf )
  1105.     YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1106.  
  1107.     yy_init_buffer( b, file );
  1108.  
  1109.     return ( b );
  1110.     }
  1111.  
  1112.  
  1113. #ifdef YY_USE_PROTOS
  1114. void yy_delete_buffer( YY_BUFFER_STATE b )
  1115. #else
  1116. void yy_delete_buffer( b )
  1117. YY_BUFFER_STATE b;
  1118. #endif
  1119.  
  1120.     {
  1121.     if ( b == yy_current_buffer )
  1122.     yy_current_buffer = (YY_BUFFER_STATE) 0;
  1123.  
  1124.     free( (char *) b->yy_ch_buf );
  1125.     free( (char *) b );
  1126.     }
  1127.  
  1128.  
  1129. #ifdef YY_USE_PROTOS
  1130. void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
  1131. #else
  1132. void yy_init_buffer( b, file )
  1133. YY_BUFFER_STATE b;
  1134. FILE *file;
  1135. #endif
  1136.  
  1137.     {
  1138.     b->yy_input_file = file;
  1139.  
  1140.     /* we put in the '\n' and start reading from [1] so that an
  1141.      * initial match-at-newline will be true.
  1142.      */
  1143.  
  1144.     b->yy_ch_buf[0] = '\n';
  1145.     b->yy_n_chars = 1;
  1146.  
  1147.     /* we always need two end-of-buffer characters.  The first causes
  1148.      * a transition to the end-of-buffer state.  The second causes
  1149.      * a jam in that state.
  1150.      */
  1151.     b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  1152.     b->yy_ch_buf[2] = YY_END_OF_BUFFER_CHAR;
  1153.  
  1154.     b->yy_buf_pos = &b->yy_ch_buf[1];
  1155.  
  1156.     b->yy_eof_status = EOF_NOT_SEEN;
  1157.     }
  1158. # line 41 "scan.l"
  1159.  
  1160. lex_err(c)
  1161.     int c;
  1162. {
  1163.     if (isprint(c))
  1164.         fprintf(stderr, "lexical error on character '%c'\n", c);
  1165.     else
  1166.         fprintf(stderr, "lexical error on character '\\%c%c%c'\n",
  1167.             (unsigned)c & (8 * 2 - 1), 
  1168.             (unsigned)c & (8 * 1 - 1), 
  1169.             (unsigned)c & (8 * 0 - 1));
  1170. }
  1171. #ifndef FLEX_SCANNER
  1172. yywrap()
  1173. {
  1174.     return 1;
  1175. }
  1176. sync_scanner()
  1177. {}
  1178. #else
  1179. sync_scanner()
  1180. {
  1181.     yyrestart(yyin);
  1182. }
  1183. #endif
  1184.