Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. #line 2 "glsl_lexer.cpp"
  2.  
  3. #line 4 "glsl_lexer.cpp"
  4.  
  5. #define  YY_INT_ALIGNED short int
  6.  
  7. /* A lexical scanner generated by flex */
  8.  
  9. #define FLEX_SCANNER
  10. #define YY_FLEX_MAJOR_VERSION 2
  11. #define YY_FLEX_MINOR_VERSION 5
  12. #define YY_FLEX_SUBMINOR_VERSION 35
  13. #if YY_FLEX_SUBMINOR_VERSION > 0
  14. #define FLEX_BETA
  15. #endif
  16.  
  17. /* First, we deal with  platform-specific or compiler-specific issues. */
  18.  
  19. /* begin standard C headers. */
  20. #include <stdio.h>
  21. #include <string.h>
  22. #include <errno.h>
  23. #include <stdlib.h>
  24.  
  25. /* end standard C headers. */
  26.  
  27. /* flex integer type definitions */
  28.  
  29. #ifndef FLEXINT_H
  30. #define FLEXINT_H
  31.  
  32. /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
  33.  
  34. #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  35.  
  36. /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
  37.  * if you want the limit (max/min) macros for int types.
  38.  */
  39. #ifndef __STDC_LIMIT_MACROS
  40. #define __STDC_LIMIT_MACROS 1
  41. #endif
  42.  
  43. #include <inttypes.h>
  44. typedef int8_t flex_int8_t;
  45. typedef uint8_t flex_uint8_t;
  46. typedef int16_t flex_int16_t;
  47. typedef uint16_t flex_uint16_t;
  48. typedef int32_t flex_int32_t;
  49. typedef uint32_t flex_uint32_t;
  50. #else
  51. typedef signed char flex_int8_t;
  52. typedef short int flex_int16_t;
  53. typedef int flex_int32_t;
  54. typedef unsigned char flex_uint8_t;
  55. typedef unsigned short int flex_uint16_t;
  56. typedef unsigned int flex_uint32_t;
  57.  
  58. /* Limits of integral types. */
  59. #ifndef INT8_MIN
  60. #define INT8_MIN               (-128)
  61. #endif
  62. #ifndef INT16_MIN
  63. #define INT16_MIN              (-32767-1)
  64. #endif
  65. #ifndef INT32_MIN
  66. #define INT32_MIN              (-2147483647-1)
  67. #endif
  68. #ifndef INT8_MAX
  69. #define INT8_MAX               (127)
  70. #endif
  71. #ifndef INT16_MAX
  72. #define INT16_MAX              (32767)
  73. #endif
  74. #ifndef INT32_MAX
  75. #define INT32_MAX              (2147483647)
  76. #endif
  77. #ifndef UINT8_MAX
  78. #define UINT8_MAX              (255U)
  79. #endif
  80. #ifndef UINT16_MAX
  81. #define UINT16_MAX             (65535U)
  82. #endif
  83. #ifndef UINT32_MAX
  84. #define UINT32_MAX             (4294967295U)
  85. #endif
  86.  
  87. #endif /* ! C99 */
  88.  
  89. #endif /* ! FLEXINT_H */
  90.  
  91. #ifdef __cplusplus
  92.  
  93. /* The "const" storage-class-modifier is valid. */
  94. #define YY_USE_CONST
  95.  
  96. #else   /* ! __cplusplus */
  97.  
  98. /* C99 requires __STDC__ to be defined as 1. */
  99. #if defined (__STDC__)
  100.  
  101. #define YY_USE_CONST
  102.  
  103. #endif  /* defined (__STDC__) */
  104. #endif  /* ! __cplusplus */
  105.  
  106. #ifdef YY_USE_CONST
  107. #define yyconst const
  108. #else
  109. #define yyconst
  110. #endif
  111.  
  112. /* Returned upon end-of-file. */
  113. #define YY_NULL 0
  114.  
  115. /* Promotes a possibly negative, possibly signed char to an unsigned
  116.  * integer for use as an array index.  If the signed char is negative,
  117.  * we want to instead treat it as an 8-bit unsigned char, hence the
  118.  * double cast.
  119.  */
  120. #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
  121.  
  122. /* An opaque pointer. */
  123. #ifndef YY_TYPEDEF_YY_SCANNER_T
  124. #define YY_TYPEDEF_YY_SCANNER_T
  125. typedef void* yyscan_t;
  126. #endif
  127.  
  128. /* For convenience, these vars (plus the bison vars far below)
  129.    are macros in the reentrant scanner. */
  130. #define yyin yyg->yyin_r
  131. #define yyout yyg->yyout_r
  132. #define yyextra yyg->yyextra_r
  133. #define yyleng yyg->yyleng_r
  134. #define yytext yyg->yytext_r
  135. #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
  136. #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
  137. #define yy_flex_debug yyg->yy_flex_debug_r
  138.  
  139. /* Enter a start condition.  This macro really ought to take a parameter,
  140.  * but we do it the disgusting crufty way forced on us by the ()-less
  141.  * definition of BEGIN.
  142.  */
  143. #define BEGIN yyg->yy_start = 1 + 2 *
  144.  
  145. /* Translate the current start state into a value that can be later handed
  146.  * to BEGIN to return to the state.  The YYSTATE alias is for lex
  147.  * compatibility.
  148.  */
  149. #define YY_START ((yyg->yy_start - 1) / 2)
  150. #define YYSTATE YY_START
  151.  
  152. /* Action number for EOF rule of a given start state. */
  153. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  154.  
  155. /* Special action meaning "start processing a new file". */
  156. #define YY_NEW_FILE _mesa_glsl_lexer_restart(yyin ,yyscanner )
  157.  
  158. #define YY_END_OF_BUFFER_CHAR 0
  159.  
  160. /* Size of default input buffer. */
  161. #ifndef YY_BUF_SIZE
  162. #ifdef __ia64__
  163. /* On IA-64, the buffer size is 16k, not 8k.
  164.  * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
  165.  * Ditto for the __ia64__ case accordingly.
  166.  */
  167. #define YY_BUF_SIZE 32768
  168. #else
  169. #define YY_BUF_SIZE 16384
  170. #endif /* __ia64__ */
  171. #endif
  172.  
  173. /* The state buf must be large enough to hold one state per character in the main buffer.
  174.  */
  175. #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
  176.  
  177. #ifndef YY_TYPEDEF_YY_BUFFER_STATE
  178. #define YY_TYPEDEF_YY_BUFFER_STATE
  179. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  180. #endif
  181.  
  182. #define EOB_ACT_CONTINUE_SCAN 0
  183. #define EOB_ACT_END_OF_FILE 1
  184. #define EOB_ACT_LAST_MATCH 2
  185.  
  186.     #define YY_LESS_LINENO(n)
  187.    
  188. /* Return all but the first "n" matched characters back to the input stream. */
  189. #define yyless(n) \
  190.         do \
  191.                 { \
  192.                 /* Undo effects of setting up yytext. */ \
  193.         int yyless_macro_arg = (n); \
  194.         YY_LESS_LINENO(yyless_macro_arg);\
  195.                 *yy_cp = yyg->yy_hold_char; \
  196.                 YY_RESTORE_YY_MORE_OFFSET \
  197.                 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
  198.                 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  199.                 } \
  200.         while ( 0 )
  201.  
  202. #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
  203.  
  204. #ifndef YY_TYPEDEF_YY_SIZE_T
  205. #define YY_TYPEDEF_YY_SIZE_T
  206. typedef size_t yy_size_t;
  207. #endif
  208.  
  209. #ifndef YY_STRUCT_YY_BUFFER_STATE
  210. #define YY_STRUCT_YY_BUFFER_STATE
  211. struct yy_buffer_state
  212.         {
  213.         FILE *yy_input_file;
  214.  
  215.         char *yy_ch_buf;                /* input buffer */
  216.         char *yy_buf_pos;               /* current position in input buffer */
  217.  
  218.         /* Size of input buffer in bytes, not including room for EOB
  219.          * characters.
  220.          */
  221.         yy_size_t yy_buf_size;
  222.  
  223.         /* Number of characters read into yy_ch_buf, not including EOB
  224.          * characters.
  225.          */
  226.         int yy_n_chars;
  227.  
  228.         /* Whether we "own" the buffer - i.e., we know we created it,
  229.          * and can realloc() it to grow it, and should free() it to
  230.          * delete it.
  231.          */
  232.         int yy_is_our_buffer;
  233.  
  234.         /* Whether this is an "interactive" input source; if so, and
  235.          * if we're using stdio for input, then we want to use getc()
  236.          * instead of fread(), to make sure we stop fetching input after
  237.          * each newline.
  238.          */
  239.         int yy_is_interactive;
  240.  
  241.         /* Whether we're considered to be at the beginning of a line.
  242.          * If so, '^' rules will be active on the next match, otherwise
  243.          * not.
  244.          */
  245.         int yy_at_bol;
  246.  
  247.     int yy_bs_lineno; /**< The line count. */
  248.     int yy_bs_column; /**< The column count. */
  249.    
  250.         /* Whether to try to fill the input buffer when we reach the
  251.          * end of it.
  252.          */
  253.         int yy_fill_buffer;
  254.  
  255.         int yy_buffer_status;
  256.  
  257. #define YY_BUFFER_NEW 0
  258. #define YY_BUFFER_NORMAL 1
  259.         /* When an EOF's been seen but there's still some text to process
  260.          * then we mark the buffer as YY_EOF_PENDING, to indicate that we
  261.          * shouldn't try reading from the input source any more.  We might
  262.          * still have a bunch of tokens to match, though, because of
  263.          * possible backing-up.
  264.          *
  265.          * When we actually see the EOF, we change the status to "new"
  266.          * (via _mesa_glsl_lexer_restart()), so that the user can continue scanning by
  267.          * just pointing yyin at a new input file.
  268.          */
  269. #define YY_BUFFER_EOF_PENDING 2
  270.  
  271.         };
  272. #endif /* !YY_STRUCT_YY_BUFFER_STATE */
  273.  
  274. /* We provide macros for accessing buffer states in case in the
  275.  * future we want to put the buffer states in a more general
  276.  * "scanner state".
  277.  *
  278.  * Returns the top of the stack, or NULL.
  279.  */
  280. #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
  281.                           ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
  282.                           : NULL)
  283.  
  284. /* Same as previous macro, but useful when we know that the buffer stack is not
  285.  * NULL or when we need an lvalue. For internal use only.
  286.  */
  287. #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
  288.  
  289. void _mesa_glsl_lexer_restart (FILE *input_file ,yyscan_t yyscanner );
  290. void _mesa_glsl_lexer__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
  291. YY_BUFFER_STATE _mesa_glsl_lexer__create_buffer (FILE *file,int size ,yyscan_t yyscanner );
  292. void _mesa_glsl_lexer__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
  293. void _mesa_glsl_lexer__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
  294. void _mesa_glsl_lexer_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
  295. void _mesa_glsl_lexer_pop_buffer_state (yyscan_t yyscanner );
  296.  
  297. static void _mesa_glsl_lexer_ensure_buffer_stack (yyscan_t yyscanner );
  298. static void _mesa_glsl_lexer__load_buffer_state (yyscan_t yyscanner );
  299. static void _mesa_glsl_lexer__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
  300.  
  301. #define YY_FLUSH_BUFFER _mesa_glsl_lexer__flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
  302.  
  303. YY_BUFFER_STATE _mesa_glsl_lexer__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
  304. YY_BUFFER_STATE _mesa_glsl_lexer__scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
  305. YY_BUFFER_STATE _mesa_glsl_lexer__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
  306.  
  307. void *_mesa_glsl_lexer_alloc (yy_size_t ,yyscan_t yyscanner );
  308. void *_mesa_glsl_lexer_realloc (void *,yy_size_t ,yyscan_t yyscanner );
  309. void _mesa_glsl_lexer_free (void * ,yyscan_t yyscanner );
  310.  
  311. #define yy_new_buffer _mesa_glsl_lexer__create_buffer
  312.  
  313. #define yy_set_interactive(is_interactive) \
  314.         { \
  315.         if ( ! YY_CURRENT_BUFFER ){ \
  316.         _mesa_glsl_lexer_ensure_buffer_stack (yyscanner); \
  317.                 YY_CURRENT_BUFFER_LVALUE =    \
  318.             _mesa_glsl_lexer__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
  319.         } \
  320.         YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
  321.         }
  322.  
  323. #define yy_set_bol(at_bol) \
  324.         { \
  325.         if ( ! YY_CURRENT_BUFFER ){\
  326.         _mesa_glsl_lexer_ensure_buffer_stack (yyscanner); \
  327.                 YY_CURRENT_BUFFER_LVALUE =    \
  328.             _mesa_glsl_lexer__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
  329.         } \
  330.         YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
  331.         }
  332.  
  333. #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
  334.  
  335. /* Begin user sect3 */
  336.  
  337. #define _mesa_glsl_lexer_wrap(n) 1
  338. #define YY_SKIP_YYWRAP
  339.  
  340. typedef unsigned char YY_CHAR;
  341.  
  342. typedef int yy_state_type;
  343.  
  344. #define yytext_ptr yytext_r
  345.  
  346. static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
  347. static yy_state_type yy_try_NUL_trans (yy_state_type current_state  ,yyscan_t yyscanner);
  348. static int yy_get_next_buffer (yyscan_t yyscanner );
  349. static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
  350.  
  351. /* Done after the current pattern has been matched and before the
  352.  * corresponding action - sets up yytext.
  353.  */
  354. #define YY_DO_BEFORE_ACTION \
  355.         yyg->yytext_ptr = yy_bp; \
  356.         yyleng = (size_t) (yy_cp - yy_bp); \
  357.         yyg->yy_hold_char = *yy_cp; \
  358.         *yy_cp = '\0'; \
  359.         yyg->yy_c_buf_p = yy_cp;
  360.  
  361. #define YY_NUM_RULES 234
  362. #define YY_END_OF_BUFFER 235
  363. /* This struct is not used in this scanner,
  364.    but its presence is necessary. */
  365. struct yy_trans_info
  366.         {
  367.         flex_int32_t yy_verify;
  368.         flex_int32_t yy_nxt;
  369.         };
  370. static yyconst flex_int16_t yy_accept[960] =
  371.     {   0,
  372.         0,    0,   16,   16,    0,    0,  235,  233,    1,   21,
  373.       233,  233,  233,  233,  233,  233,  233,  233,  131,  129,
  374.       233,  233,  233,  232,  233,  232,  232,  232,  232,  232,
  375.       232,  232,  232,  232,  232,  232,  232,  232,  232,  232,
  376.       232,  232,  232,  232,  232,  233,    1,  233,  234,   16,
  377.        20,  234,   19,   17,   18,   14,   13,    1,  113,  122,
  378.       114,  125,  119,  108,  121,  109,  128,  133,  120,  134,
  379.       131,    0,    0,  136,  131,    0,  129,  129,  117,  110,
  380.       112,  111,  118,  232,  126,  116,  232,  232,  232,  232,
  381.       232,  232,  232,  232,  232,  232,  232,  232,   30,  232,
  382.  
  383.       232,  232,  232,  232,  232,  232,  232,  232,  232,  232,
  384.       232,  232,   34,  232,  232,   61,  232,  232,  232,  232,
  385.       232,  232,  232,  232,  232,  232,  232,  232,  232,  232,
  386.       232,  232,  232,  232,  232,  232,  232,  232,  232,  232,
  387.       232,  232,  232,  232,  232,  232,  232,  232,  232,  232,
  388.       127,  115,    1,    0,    0,    2,    0,    0,    0,    0,
  389.        16,   15,   19,   18,    0,  133,  132,    0,  134,    0,
  390.       135,  130,  123,  124,  232,  139,  232,  232,  232,  232,
  391.       232,  232,  232,  232,  232,  232,  232,  232,  232,  232,
  392.       232,  232,  232,  232,  232,  232,  232,  232,  232,   33,
  393.  
  394.       232,  232,  232,  232,  232,  232,  232,  232,  232,  232,
  395.        26,  232,  232,  232,  232,  232,  232,  232,  232,  232,
  396.       232,  232,   62,  232,  232,  232,  232,  232,  232,  232,
  397.       232,  232,  232,  232,  232,  232,  232,  232,  232,  232,
  398.       232,  232,  232,  232,  232,  232,  232,  232,  232,  232,
  399.       232,  232,  232,  232,  232,  232,  232,  232,    0,    0,
  400.         0,    0,   15,    0,  133,    0,  132,    0,  134,  135,
  401.       130,  232,  232,  232,   24,  232,  232,  186,  179,  232,
  402.       232,  232,  232,  232,  232,  232,  232,  232,  232,   32,
  403.       142,  232,  232,  232,  232,   68,  232,  232,  147,  161,
  404.  
  405.       232,  232,  232,  232,  232,  232,  232,  232,  232,  232,
  406.       232,  232,  158,  182,   49,   50,   51,  232,  232,  232,
  407.       232,  232,  232,  232,  232,  232,  232,  232,  232,  232,
  408.       232,  232,  232,  232,  232,  232,  232,  232,  232,  232,
  409.       232,  232,  145,  137,  232,  232,   27,  232,  232,  232,
  410.       232,  232,  232,  232,   46,   47,   48,  106,  232,  232,
  411.       232,    0,    0,    0,    0,    0,  132,  232,  232,  232,
  412.        28,   37,   38,   39,  232,  140,  232,  232,   23,  232,
  413.       232,  232,  232,  169,  170,  171,  232,  138,  232,  162,
  414.        25,  172,  173,  174,  184,  166,  167,  168,  232,  232,
  415.  
  416.       232,   63,  164,  232,  232,  232,   40,   41,   42,  232,
  417.       232,  232,  232,  232,  232,  232,  232,  232,  232,  232,
  418.       229,  232,  232,  232,  232,  232,  232,  232,  232,  159,
  419.       232,  232,  232,  232,  232,  232,  232,  232,  232,  232,
  420.       232,  141,  232,  232,  181,   43,   44,   45,  232,  232,
  421.        31,  232,    0,    0,    0,    0,  189,  232,  232,  232,
  422.       232,  187,  232,  232,  232,  160,  155,  192,  232,  232,
  423.       232,  232,  232,  232,  150,  232,  232,  232,  107,   52,
  424.        53,   54,   55,   56,   57,   58,   59,   60,  232,  232,
  425.       232,  232,  165,  146,  232,  232,  153,  232,  232,  232,
  426.  
  427.        36,  232,  230,  178,   69,  154,  105,  232,  190,  148,
  428.       232,  232,  232,  232,  232,  232,  232,  232,  232,    0,
  429.         0,    0,    0,  232,  232,  232,  232,  232,  149,   35,
  430.       232,  232,  232,  232,  232,  232,  193,  194,  195,  232,
  431.       232,  232,  232,  232,  183,  232,  232,  232,  232,  232,
  432.       232,  232,  232,  232,  232,  232,  232,  143,  232,  232,
  433.       232,  232,  232,   64,  232,  232,   65,  232,  232,    0,
  434.         0,    0,    0,    0,  232,  232,   66,  223,   29,  156,
  435.       197,  198,  199,  232,  232,  232,  232,  232,  232,  232,
  436.       232,  232,  232,  232,  232,  151,  232,  232,  232,  225,
  437.  
  438.       227,  224,  232,  232,  232,  232,  232,  232,  232,  232,
  439.       144,  201,  202,  203,  232,  232,  163,  232,  152,  232,
  440.         0,    0,    6,    0,    0,    0,   12,    3,  232,   22,
  441.       232,  232,  232,  232,  232,  232,  232,  232,  232,  196,
  442.       157,   67,  232,  232,  232,  232,  232,  180,  232,  188,
  443.       185,  218,   71,   72,   73,  232,  232,  232,  232,  232,
  444.       232,  232,  232,  232,  232,  232,  232,  232,  226,    0,
  445.         0,    0,    0,    0,    0,    0,  232,  232,  232,  232,
  446.       200,  232,  232,  232,  232,  232,   82,   83,   84,  232,
  447.       232,  232,  232,  232,  232,  232,  232,  232,  232,  232,
  448.  
  449.       232,  232,  231,  232,  232,  232,  204,   88,   89,   90,
  450.       232,  232,    4,    0,    5,    0,    0,    0,    0,    0,
  451.         0,  228,  232,  232,  232,  232,  232,  232,  232,  215,
  452.       232,  232,  232,  232,  232,  232,  232,  232,  232,  232,
  453.        94,  232,  232,  232,  232,   74,  232,  232,  232,  232,
  454.       232,  232,  232,  232,  232,  232,    0,    0,    0,    0,
  455.       232,  232,  216,  205,  232,  206,  232,  232,  232,   95,
  456.       232,  232,   85,  232,  232,  232,  232,  232,  232,  232,
  457.       232,  232,  232,  232,  232,  232,  232,  217,  232,  232,
  458.        96,  232,  232,   91,    0,    0,    0,  207,  208,  232,
  459.  
  460.       211,  232,  212,  232,  232,  232,  232,  232,  232,   70,
  461.       232,  232,  232,  232,  175,  232,  176,  191,  232,  232,
  462.       232,  209,  210,  232,  232,  232,  232,  232,  232,    0,
  463.         0,    0,  232,  232,  232,  232,  232,  219,  221,  232,
  464.        75,  232,   76,  232,  232,  232,  232,  232,  232,  232,
  465.       232,  232,  220,  222,  232,    0,    0,    0,    0,  232,
  466.       232,   86,   87,  232,  232,  232,   77,  232,  232,  232,
  467.        78,  232,  232,  232,   92,   93,  232,  232,    0,    0,
  468.         0,    0,  232,  232,  232,  232,  232,  232,   97,  232,
  469.       100,  232,  232,  232,  232,    0,    0,    0,    0,  232,
  470.  
  471.       232,   98,  101,  232,  232,  232,  232,   79,  232,   99,
  472.       102,    0,    0,    0,    7,    0,    0,  213,  214,  232,
  473.       232,  232,  232,  104,    0,    0,    8,    0,    0,  232,
  474.       232,  177,  232,    0,    0,    0,   80,   81,  232,    0,
  475.         0,    0,    9,  232,    0,    0,   10,  103,    0,    0,
  476.         0,    0,    0,    0,    0,    0,    0,   11,    0
  477.     } ;
  478.  
  479. static yyconst flex_int32_t yy_ec[256] =
  480.     {   0,
  481.         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
  482.         1,    1,    4,    1,    1,    1,    1,    1,    1,    1,
  483.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  484.         1,    2,    5,    1,    6,    1,    7,    8,    1,    9,
  485.        10,   11,   12,    1,   13,   14,   15,   16,   17,   18,
  486.        19,   20,   21,   21,   21,   22,   22,   23,    1,   24,
  487.        25,   26,    1,    1,   27,   28,   29,   30,   31,   32,
  488.        33,   34,   34,   34,   34,   35,   36,   34,   37,   34,
  489.        34,   38,   39,   40,   41,   34,   34,   42,   34,   34,
  490.         1,    1,    1,   43,   44,    1,   45,   46,   47,   48,
  491.  
  492.        49,   50,   51,   52,   53,   54,   55,   56,   57,   58,
  493.        59,   60,   34,   61,   62,   63,   64,   65,   66,   67,
  494.        68,   69,    1,   70,    1,    1,    1,    1,    1,    1,
  495.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  496.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  497.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  498.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  499.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  500.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  501.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  502.  
  503.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  504.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  505.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  506.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  507.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  508.         1,    1,    1,    1,    1
  509.     } ;
  510.  
  511. static yyconst flex_int32_t yy_meta[71] =
  512.     {   0,
  513.         1,    1,    2,    1,    1,    1,    1,    1,    1,    1,
  514.         1,    1,    1,    1,    1,    3,    3,    3,    3,    3,
  515.         3,    3,    1,    1,    1,    1,    4,    4,    4,    4,
  516.         3,    3,    5,    5,    5,    5,    5,    5,    5,    5,
  517.         5,    5,    1,    5,    4,    4,    4,    4,    3,    3,
  518.         5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
  519.         5,    5,    5,    5,    5,    5,    5,    5,    5,    1
  520.     } ;
  521.  
  522. static yyconst flex_int16_t yy_base[970] =
  523.     {   0,
  524.         0,   69,   75,  145, 1329, 1328, 1330, 1333,   70, 1333,
  525.      1304, 1303,   94, 1302,   91,   92,   90, 1301,  202,  256,
  526.        89, 1300,   95,    0,   79,   68,   64,   79,  124,   76,
  527.       131, 1265,  127,  141,   81,   88,   82, 1259,  136,  126,
  528.       183,  177,  149,  168,  134,  180,  206,  251, 1333,  140,
  529.      1333, 1307,  239, 1333,    0, 1333, 1333,  228, 1333, 1333,
  530.      1333, 1333, 1333, 1333, 1333, 1333, 1333,  231, 1333,  233,
  531.       137,  307,  273, 1333, 1333,    0,    0, 1333, 1296, 1333,
  532.      1333, 1333, 1295,    0, 1333, 1333, 1256, 1261,  115, 1258,
  533.      1267, 1266, 1252, 1255, 1267,  244, 1261, 1248, 1245, 1259,
  534.  
  535.      1245, 1242, 1242, 1248,  126,  180, 1242, 1253, 1238, 1244,
  536.      1248, 1249,    0, 1240, 1251,  254, 1250, 1245, 1225,  143,
  537.      1229, 1243, 1233,  188, 1226,  271, 1239, 1241,  285, 1220,
  538.      1228, 1225, 1214, 1223,  223,  252, 1228, 1223, 1226, 1214,
  539.      1217,  246,  246,  226, 1227, 1214, 1227,   83, 1220, 1219,
  540.      1333, 1333,  329,  334,  340, 1333, 1204, 1217, 1208, 1219,
  541.       342,    0,  333,    0,  346, 1333,  329,  390, 1333,  353,
  542.       397,  281, 1333, 1333, 1214,    0, 1209, 1204, 1208, 1218,
  543.      1215,  328, 1198, 1198, 1210, 1201,  278, 1212, 1209, 1209,
  544.      1207, 1204, 1195, 1202, 1188, 1186, 1199, 1184, 1201,    0,
  545.  
  546.      1198, 1185, 1193, 1190, 1194, 1195, 1188, 1185, 1173, 1172,
  547.      1186, 1189, 1176, 1185, 1172, 1179, 1169,  362, 1175, 1178,
  548.      1168, 1176, 1164, 1168, 1159, 1174, 1173, 1163, 1170,  325,
  549.      1153, 1172, 1155, 1153, 1164, 1153, 1148, 1146, 1148, 1159,
  550.      1144, 1146, 1143, 1155, 1154, 1157, 1138,  326, 1147, 1142,
  551.      1140, 1150, 1128,  402, 1147, 1149, 1137, 1129, 1128, 1132,
  552.      1144, 1127,    0,  414,  421,  438, 1333,  445,  456, 1333,
  553.      1333, 1122, 1133, 1132,    0, 1129,  405,    0,    0, 1122,
  554.      1120, 1120, 1121, 1116, 1125, 1113, 1131, 1119,  408,    0,
  555.         0, 1113, 1124, 1123, 1123,    0, 1107,  426,    0,    0,
  556.  
  557.      1109,  450, 1117, 1118, 1108, 1102, 1101, 1102, 1101, 1101,
  558.       461, 1096,    0,    0, 1092, 1091, 1090, 1092, 1093, 1098,
  559.      1092, 1088, 1102, 1097, 1097, 1095, 1094, 1087, 1081, 1083,
  560.      1082, 1085, 1085, 1077, 1080, 1075, 1084, 1089, 1076, 1073,
  561.      1086, 1076,    0,    0, 1083, 1079,    0, 1070, 1070, 1076,
  562.      1066, 1074,  464, 1071,    0,    0,    0,    0, 1060, 1073,
  563.      1072, 1071, 1070, 1067, 1055,  473,  480, 1067, 1068, 1068,
  564.         0,    0,    0,    0, 1054,    0, 1063, 1053,    0, 1052,
  565.      1053, 1047, 1058,    0,    0,    0, 1048,    0, 1044,    0,
  566.         0,    0,    0,    0,    0,    0,    0,    0, 1055,  486,
  567.  
  568.      1054,    0,    0, 1052, 1048, 1044,    0,    0,    0, 1036,
  569.       467,  489,  498, 1041, 1037, 1043, 1033, 1031, 1045, 1029,
  570.         0, 1029, 1043, 1031, 1027, 1034, 1028, 1040, 1035,    0,
  571.      1033, 1030, 1034, 1017, 1015, 1018, 1025, 1031, 1026, 1025,
  572.      1012,    0, 1014, 1015,    0,    0,    0,    0, 1012, 1016,
  573.         0, 1009, 1009, 1064, 1008, 1011,    0, 1019,  998, 1008,
  574.      1002,    0,  995,  995, 1009,    0, 1011,    0,  503, 1025,
  575.      1024, 1023,  988,  987,    0, 1005, 1004,  999,    0,    0,
  576.         0,    0,    0,    0,    0,    0,    0,    0,  987, 1001,
  577.       987,  984,    0,    0,  990,  989,    0,  985,  993,  992,
  578.  
  579.         0,  984,  976,    0,    0,    0,    0,  973,    0,    0,
  580.       972,  984,  506,  976,  983,  982,  979,  973,  970,  965,
  581.       524,  981,  966,  960,  960,  974,  958,  971,    0,    0,
  582.       963,  988,  987,  986,  951,  950,  359,  365,    0,  963,
  583.       966,  964,  952,  948,    0,  961,  958,  957,  946,  945,
  584.       935,  953,  938,  941,  519,  946,  949,    0,  967,  966,
  585.       965,  930,  929,    0,  944,  930,    0,  941,  933,  935,
  586.       549,  555,  985,  928,  932,  935,    0,    0,    0,    0,
  587.       956,  955,    0,  931,  934,  918,  926,  916,  924,  925,
  588.       925,  924,  909,  561,  922,    0,  923,  911,  910,    0,
  589.  
  590.         0,    0,  906,  936,  935,  934,  899,  898,  894,  902,
  591.         0,  932,  931,    0,  907,  910,    0,  564,    0,  887,
  592.       895,  582, 1333,  592,    0,  603,  594, 1333,  895,    0,
  593.       891,  890,  900,  900,  887,  902,  885,  900,  895,    0,
  594.         0,    0,  913,  912,  911,  876,  875,    0,  875,    0,
  595.         0,    0,  500,  590,  899,  886,  889,  871,  884,  871,
  596.       870,  880,  880,  898,  897,  896,  861,  860,    0,  865,
  597.       628,  638,  446,  882,  872,  860,  856,  857,  856,  867,
  598.         0,  870,  866,  868,  864,  850,  883,  526,    0,  859,
  599.       862,  854,  845,  853,  843,  864,  853,  849,  851,  849,
  600.  
  601.       849,  848,    0,  835,  834,  845,    0,  866,  600,    0,
  602.       842,  845, 1333,  508, 1333,  648,    0,  659,  860,  843,
  603.       825,    0,  842,  841,  824,  816,  824,  814,  822,    0,
  604.       819,  818,  839,  828,  826,  826,  809,  812,  827,  810,
  605.       843,  822,  823,  820,  817,  522,  804,  819,  818,  794,
  606.       772,  771,  792,  781,  779,  779,  526,  794,  762,  772,
  607.       755,  754,    0,  782,  754,  780,  752,  756,  755,  788,
  608.       767,  764,  784,  761,  764,  760,  760,  743,  740,  754,
  609.        10,  170,  176,  190,  209,  241,  247,    0,  326,  332,
  610.       368,  350,  352,  425,  478,  468,  476,    0,    0,  502,
  611.  
  612.         0,  503,    0,  511,  514,  499,  500,  525,  526,    0,
  613.       520,  538,  539,  553,  576,  559,    0,    0,  571,  589,
  614.       590,    0,    0,  592,  594,  582,  589,  602,  610,  670,
  615.       680,  620,  629,  638,  616,  617,  625,    0,    0,  626,
  616.       649,  624,  652,  647,  641,  628,  651,  649,  642,  631,
  617.       632,  640,    0,    0,  641,  701,  702,  703,  637,  659,
  618.       660,    0,    0,  664,  665,  660,    0,  661,  646,  670,
  619.         0,  648,  658,  681,    0,    0,  674,  675,  663,  720,
  620.       673,  675,  666,  667,  659,  660,  684,  685,    0,  684,
  621.       694,  668,  704,  668,  669,  673,  689,  738,  740,  675,
  622.  
  623.       677,    0,    0,  696,  697,  687,  695,    0,  711,    0,
  624.         0,  706,  750,  751, 1333,  754,  753,    0,    0,  698,
  625.       699,  693,  719,    0,  704,  764, 1333,  765,  718,  703,
  626.       704,    0,  723,  719,  723,  773,    0,    0,  718,  733,
  627.       778,  779, 1333,  716,  726,  783, 1333,    0,  723,  785,
  628.       788,  789,  790,  739,  740,  796,  797, 1333, 1333,  835,
  629.       840,  843,  846,  797,  798,  849,  853,  856,  858
  630.     } ;
  631.  
  632. static yyconst flex_int16_t yy_def[970] =
  633.     {   0,
  634.       959,    1,  960,  960,  961,  961,  959,  959,  959,  959,
  635.       959,  959,  959,  959,  959,  959,  959,  959,  959,  959,
  636.       959,  959,  959,  962,  959,  962,  962,  962,  962,  962,
  637.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  638.       962,  962,  962,  962,  962,  959,  959,  959,  959,  959,
  639.       959,  959,  959,  959,  963,  959,  959,  959,  959,  959,
  640.       959,  959,  959,  959,  959,  959,  959,  964,  959,  965,
  641.        19,  959,  959,  959,  959,  966,   20,  959,  959,  959,
  642.       959,  959,  959,  962,  959,  959,  962,  962,  962,  962,
  643.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  644.  
  645.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  646.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  647.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  648.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  649.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  650.       959,  959,  959,  959,  959,  959,  959,  959,  959,  959,
  651.       959,  967,  959,  963,  959,  959,  965,  959,  959,  959,
  652.       959,  966,  959,  959,  962,  962,  962,  962,  962,  962,
  653.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  654.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  655.  
  656.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  657.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  658.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  659.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  660.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  661.       962,  962,  962,  962,  962,  962,  962,  962,  959,  959,
  662.       959,  959,  967,  959,  959,  959,  959,  959,  959,  959,
  663.       959,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  664.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  665.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  666.  
  667.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  668.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  669.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  670.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  671.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  672.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  673.       962,  959,  959,  959,  959,  959,  959,  962,  962,  962,
  674.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  675.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  676.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  677.  
  678.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  679.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  680.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  681.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  682.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  683.       962,  962,  959,  959,  959,  959,  962,  962,  962,  962,
  684.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  685.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  686.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  687.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  688.  
  689.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  690.       962,  962,  962,  962,  962,  962,  962,  962,  962,  959,
  691.       959,  959,  959,  962,  962,  962,  962,  962,  962,  962,
  692.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  693.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  694.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  695.       962,  962,  962,  962,  962,  962,  962,  962,  962,  959,
  696.       959,  959,  959,  959,  962,  962,  962,  962,  962,  962,
  697.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  698.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  699.  
  700.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  701.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  702.       959,  959,  959,  959,  968,  959,  959,  959,  962,  962,
  703.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  704.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  705.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  706.       962,  962,  962,  962,  962,  962,  962,  962,  962,  959,
  707.       959,  959,  968,  959,  959,  959,  962,  962,  962,  962,
  708.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  709.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  710.  
  711.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  712.       962,  962,  959,  959,  959,  959,  969,  959,  959,  959,
  713.       959,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  714.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  715.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  716.       962,  962,  962,  962,  962,  962,  969,  959,  959,  959,
  717.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  718.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  719.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  720.       962,  962,  962,  962,  959,  959,  959,  962,  962,  962,
  721.  
  722.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  723.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  724.       962,  962,  962,  962,  962,  962,  962,  962,  962,  959,
  725.       959,  959,  962,  962,  962,  962,  962,  962,  962,  962,
  726.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  727.       962,  962,  962,  962,  962,  959,  959,  959,  959,  962,
  728.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  729.       962,  962,  962,  962,  962,  962,  962,  962,  959,  959,
  730.       959,  959,  962,  962,  962,  962,  962,  962,  962,  962,
  731.       962,  962,  962,  962,  962,  959,  959,  959,  959,  962,
  732.  
  733.       962,  962,  962,  962,  962,  962,  962,  962,  962,  962,
  734.       962,  959,  959,  959,  959,  959,  959,  962,  962,  962,
  735.       962,  962,  962,  962,  959,  959,  959,  959,  959,  962,
  736.       962,  962,  962,  959,  959,  959,  962,  962,  962,  959,
  737.       959,  959,  959,  962,  959,  959,  959,  962,  959,  959,
  738.       959,  959,  959,  959,  959,  959,  959,  959,    0,  959,
  739.       959,  959,  959,  959,  959,  959,  959,  959,  959
  740.     } ;
  741.  
  742. static yyconst flex_int16_t yy_nxt[1404] =
  743.     {   0,
  744.         8,    9,   10,    9,   11,    8,   12,   13,    8,    8,
  745.        14,   15,   16,   17,   18,   19,   20,   20,   20,   20,
  746.        20,   20,    8,   21,   22,   23,   24,   24,   24,   24,
  747.        24,   24,   24,   24,   24,   24,   24,   24,   24,   24,
  748.        24,   24,   25,   24,   26,   27,   28,   29,   30,   31,
  749.        32,   33,   34,   24,   24,   35,   36,   37,   38,   39,
  750.        40,   41,   42,   43,   44,   45,   24,   24,   24,   46,
  751.        47,   58,  817,   58,   48,   49,   50,   51,   50,   49,
  752.        49,   49,   49,   49,   49,   49,   49,   49,   49,   52,
  753.        49,   53,   53,   53,   53,   53,   53,   54,   49,   49,
  754.  
  755.        49,   61,   64,   85,   66,   68,   68,   68,   68,   68,
  756.        68,   68,   79,   80,   87,   65,   67,   49,   62,   82,
  757.        83,   86,   90,   93,   91,  119,  123,   94,   92,   88,
  758.        89,  101,  121,  102,   95,  255,  122,   96,  256,  120,
  759.       124,  161,  103,  161,   49,   49,   50,   51,   50,   49,
  760.        49,   49,   49,   49,   49,   49,   49,   49,   49,   52,
  761.        49,   53,   53,   53,   53,   53,   53,   54,   49,   49,
  762.        49,  110,   97,  177,  129,  104,   98,  178,  959,  111,
  763.       126,  196,   99,  105,  130,  149,  106,   49,  100,  107,
  764.       113,  112,  197,  114,  150,  108,  127,  115,  116,  128,
  765.  
  766.       216,  142,  117,  959,  151,  118,  143,  153,  217,   58,
  767.       144,  154,  146,  145,   49,   70,  147,   71,   71,   71,
  768.        71,   71,   71,   72,  198,  138,  148,  131,  139,   58,
  769.       818,   58,   73,   74,  132,  133,  819,  140,  199,  134,
  770.       221,  820,   75,   76,  141,  135,  136,  222,  137,  152,
  771.        73,   74,  155,  156,  163,  163,  163,  163,  163,  163,
  772.       163,  165,  166,  168,  169,   75,  821,  237,   76,   70,
  773.       250,   77,   77,   77,   77,   77,   77,   77,  251,  165,
  774.       166,  168,  169,  238,  170,  170,   73,   74,  171,  171,
  775.       171,  171,  171,  171,  171,  185,   78,  239,  248,  157,
  776.  
  777.       186,  187,  246,  247,   73,   74,  158,  249,  822,  208,
  778.       159,  240,  209,  210,  823,  160,  211,  224,  212,   78,
  779.        70,  271,   72,   72,   72,   72,   72,   72,   72,  229,
  780.       153,  225,   58,  226,  154,  155,  156,   73,   74,  284,
  781.       285,  155,  156,  161,  271,  161,  230,  231,  163,  163,
  782.       163,  163,  163,  163,  163,   73,   74,  264,  264,  266,
  783.       267,  265,  265,  265,  265,  265,  265,  265,  171,  171,
  784.       171,  171,  171,  171,  171,  348,  278,  266,  267,  315,
  785.       316,  317,  157,  329,  349,  586,  824,  330,  157,  158,
  786.       279,  588,  825,  159,  826,  158,  827,  587,  160,  159,
  787.  
  788.       828,  268,  268,  589,  160,  269,  269,  269,  269,  269,
  789.       269,  269,  171,  171,  171,  171,  171,  171,  171,  355,
  790.       356,  357,  372,  373,  374,  384,  385,  386,  270,  265,
  791.       265,  265,  265,  265,  265,  265,  265,  265,  265,  265,
  792.       265,  265,  265,  392,  393,  394,  270,  622,  623,  366,
  793.       366,  829,  166,  367,  367,  367,  367,  367,  367,  367,
  794.       269,  269,  269,  269,  269,  269,  269,  396,  397,  398,
  795.       166,  269,  269,  269,  269,  269,  269,  269,  407,  408,
  796.       409,  446,  447,  448,  480,  481,  482,  169,  367,  367,
  797.       367,  367,  367,  367,  367,  367,  367,  367,  367,  367,
  798.  
  799.       367,  367,  470,  471,  472,  169,  483,  484,  485,  714,
  800.       715,  267,  830,  473,  474,  486,  487,  488,  831,  532,
  801.       533,  534,  559,  560,  561,  521,  693,  714,  715,  267,
  802.       535,  536,  832,  562,  563,  604,  605,  606,  694,  571,
  803.       572,  572,  572,  572,  572,  572,  607,  608,  783,  609,
  804.       622,  623,  732,  833,  834,  835,  622,  623,  836,  837,
  805.       784,  733,  838,  734,  624,  624,  624,  624,  624,  624,
  806.       626,  626,  626,  626,  626,  626,  626,  643,  644,  645,
  807.       664,  665,  666,  622,  623,  839,  840,  841,  646,  647,
  808.       625,  667,  668,  622,  623,  627,  842,  671,  672,  672,
  809.  
  810.       672,  672,  672,  672,  622,  623,  843,  624,  624,  624,
  811.       624,  624,  624,  844,  845,  625,  695,  846,  626,  626,
  812.       626,  626,  626,  626,  626,  696,  752,  697,  698,  714,
  813.       715,  847,  674,  848,  849,  753,  850,  754,  851,  714,
  814.       715,  675,  852,  716,  716,  716,  716,  716,  716,  714,
  815.       715,  853,  676,  718,  718,  718,  718,  718,  718,  718,
  816.       714,  715,  854,  716,  716,  716,  716,  716,  716,  717,
  817.       855,  856,  859,  860,  718,  718,  718,  718,  718,  718,
  818.       718,  857,  861,  862,  863,  864,  865,  866,  858,  867,
  819.       868,  869,  870,  871,  717,  872,  873,  874,  875,  876,
  820.  
  821.       877,  878,  856,  857,  880,  882,  883,  884,  885,  886,
  822.       858,  887,  888,  889,  890,  891,  892,  893,  894,  895,
  823.       896,  880,  897,  899,  900,  901,  902,  903,  904,  905,
  824.       898,  906,  907,  908,  909,  910,  911,  912,  913,  914,
  825.       918,  916,  919,  920,  921,  922,  923,  915,  917,  924,
  826.       925,  926,  914,  879,  928,  916,  930,  931,  932,  927,
  827.       915,  881,  917,  933,  934,  926,  928,  935,  937,  938,
  828.       939,  940,  941,  927,  942,  936,  944,  945,  881,  946,
  829.       942,  948,  943,  949,  946,  950,  951,  947,  943,  951,
  830.       953,  953,  947,  952,  955,  956,  952,  957,  957,   68,
  831.  
  832.       167,  816,  815,  814,  813,  958,  958,  812,  811,  810,
  833.       809,  929,  808,  807,  806,  805,  804,  803,  802,  801,
  834.       800,  799,  798,  929,  797,  796,  795,  794,  793,  792,
  835.       791,  790,  789,  954,  954,   55,   55,   55,   55,   55,
  836.        56,   56,   56,   56,   56,   84,   84,   84,  164,  164,
  837.       164,  172,  172,  263,  788,  263,  263,  263,  673,  673,
  838.       757,  757,  787,  786,  785,  782,  781,  780,  779,  778,
  839.       777,  776,  775,  774,  773,  772,  771,  770,  769,  768,
  840.       767,  766,  765,  764,  763,  762,  761,  760,  759,  758,
  841.       756,  755,  751,  750,  749,  748,  747,  746,  745,  744,
  842.  
  843.       743,  742,  741,  740,  739,  738,  737,  736,  735,  731,
  844.       730,  729,  728,  727,  726,  725,  724,  723,  722,  721,
  845.       720,  719,  713,  712,  711,  710,  709,  708,  707,  706,
  846.       705,  704,  703,  702,  701,  700,  699,  692,  691,  690,
  847.       689,  688,  687,  686,  685,  684,  683,  682,  681,  680,
  848.       679,  678,  677,  670,  669,  663,  662,  661,  660,  659,
  849.       658,  657,  656,  655,  654,  653,  652,  651,  650,  649,
  850.       648,  642,  641,  640,  639,  638,  637,  636,  635,  634,
  851.       633,  632,  631,  630,  629,  628,  627,  621,  620,  619,
  852.       618,  617,  616,  615,  614,  613,  612,  611,  610,  603,
  853.  
  854.       602,  601,  600,  599,  598,  597,  596,  595,  594,  593,
  855.       592,  591,  590,  585,  584,  583,  582,  581,  580,  579,
  856.       578,  577,  576,  575,  574,  573,  570,  569,  568,  567,
  857.       566,  565,  564,  558,  557,  556,  555,  554,  553,  552,
  858.       551,  550,  549,  548,  547,  546,  545,  544,  543,  542,
  859.       541,  540,  539,  538,  537,  531,  530,  529,  528,  527,
  860.       526,  525,  524,  523,  522,  521,  520,  519,  518,  517,
  861.       516,  515,  514,  513,  512,  511,  510,  509,  508,  507,
  862.       506,  505,  504,  503,  502,  501,  500,  499,  498,  497,
  863.       496,  495,  494,  493,  492,  491,  490,  489,  479,  478,
  864.  
  865.       477,  476,  475,  469,  468,  467,  466,  465,  464,  463,
  866.       462,  461,  460,  459,  458,  457,  456,  455,  454,  453,
  867.       452,  451,  450,  449,  445,  444,  443,  442,  441,  440,
  868.       439,  438,  437,  436,  435,  434,  433,  432,  431,  430,
  869.       429,  428,  427,  426,  425,  424,  423,  422,  421,  420,
  870.       419,  418,  417,  416,  415,  414,  413,  412,  411,  410,
  871.       406,  405,  404,  403,  402,  401,  400,  399,  395,  391,
  872.       390,  389,  388,  387,  383,  382,  381,  380,  379,  378,
  873.       377,  376,  375,  371,  370,  369,  368,  365,  364,  363,
  874.       362,  361,  360,  359,  358,  354,  353,  352,  351,  350,
  875.  
  876.       347,  346,  345,  344,  343,  342,  341,  340,  339,  338,
  877.       337,  336,  335,  334,  333,  332,  331,  328,  327,  326,
  878.       325,  324,  323,  322,  321,  320,  319,  318,  314,  313,
  879.       312,  311,  310,  309,  308,  307,  306,  305,  304,  303,
  880.       302,  301,  300,  299,  298,  297,  296,  295,  294,  293,
  881.       292,  291,  290,  289,  288,  287,  286,  283,  282,  281,
  882.       280,  277,  276,  275,  274,  273,  272,  262,  261,  260,
  883.       259,  258,  257,  254,  253,  252,  245,  244,  243,  242,
  884.       241,  236,  235,  234,  233,  232,  228,  227,  223,  220,
  885.       219,  218,  215,  214,  213,  207,  206,  205,  204,  203,
  886.  
  887.       202,  201,  200,  195,  194,  193,  192,  191,  190,  189,
  888.       188,  184,  183,  182,  181,  180,  179,  176,  175,  174,
  889.       173,  162,  125,  109,   81,   69,   63,   60,   59,  959,
  890.        57,   57,    7,  959,  959,  959,  959,  959,  959,  959,
  891.       959,  959,  959,  959,  959,  959,  959,  959,  959,  959,
  892.       959,  959,  959,  959,  959,  959,  959,  959,  959,  959,
  893.       959,  959,  959,  959,  959,  959,  959,  959,  959,  959,
  894.       959,  959,  959,  959,  959,  959,  959,  959,  959,  959,
  895.       959,  959,  959,  959,  959,  959,  959,  959,  959,  959,
  896.       959,  959,  959,  959,  959,  959,  959,  959,  959,  959,
  897.  
  898.       959,  959,  959
  899.     } ;
  900.  
  901. static yyconst flex_int16_t yy_chk[1404] =
  902.     {   0,
  903.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  904.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  905.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  906.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  907.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  908.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  909.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  910.         2,    9,  781,    9,    2,    3,    3,    3,    3,    3,
  911.         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
  912.         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
  913.  
  914.         3,   13,   15,   25,   16,   17,   17,   17,   17,   17,
  915.        17,   17,   21,   21,   26,   15,   16,    3,   13,   23,
  916.        23,   25,   27,   28,   27,   35,   37,   28,   27,   26,
  917.        26,   30,   36,   30,   28,  148,   36,   28,  148,   35,
  918.        37,   50,   30,   50,    3,    4,    4,    4,    4,    4,
  919.         4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
  920.         4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
  921.         4,   33,   29,   89,   40,   31,   29,   89,   71,   33,
  922.        39,  105,   29,   31,   40,   45,   31,    4,   29,   31,
  923.        34,   33,  105,   34,   45,   31,   39,   34,   34,   39,
  924.  
  925.       120,   43,   34,   71,   46,   34,   43,   47,  120,   47,
  926.        43,   47,   44,   43,    4,   19,   44,   19,   19,   19,
  927.        19,   19,   19,   19,  106,   42,   44,   41,   42,   58,
  928.       782,   58,   19,   19,   41,   41,  783,   42,  106,   41,
  929.       124,  784,   19,   19,   42,   41,   41,  124,   41,   46,
  930.        19,   19,   48,   48,   53,   53,   53,   53,   53,   53,
  931.        53,   68,   68,   70,   70,   19,  785,  135,   19,   20,
  932.       144,   20,   20,   20,   20,   20,   20,   20,  144,   68,
  933.        68,   70,   70,  135,   73,   73,   20,   20,   73,   73,
  934.        73,   73,   73,   73,   73,   96,   20,  136,  143,   48,
  935.  
  936.        96,   96,  142,  142,   20,   20,   48,  143,  786,  116,
  937.        48,  136,  116,  116,  787,   48,  116,  126,  116,   20,
  938.        72,  172,   72,   72,   72,   72,   72,   72,   72,  129,
  939.       153,  126,  153,  126,  153,  154,  154,   72,   72,  187,
  940.       187,  155,  155,  161,  172,  161,  129,  129,  163,  163,
  941.       163,  163,  163,  163,  163,   72,   72,  165,  165,  167,
  942.       167,  165,  165,  165,  165,  165,  165,  165,  170,  170,
  943.       170,  170,  170,  170,  170,  248,  182,  167,  167,  218,
  944.       218,  218,  154,  230,  248,  537,  789,  230,  155,  154,
  945.       182,  538,  790,  154,  791,  155,  792,  537,  154,  155,
  946.  
  947.       793,  168,  168,  538,  155,  168,  168,  168,  168,  168,
  948.       168,  168,  171,  171,  171,  171,  171,  171,  171,  254,
  949.       254,  254,  277,  277,  277,  289,  289,  289,  171,  264,
  950.       264,  264,  264,  264,  264,  264,  265,  265,  265,  265,
  951.       265,  265,  265,  298,  298,  298,  171,  673,  673,  266,
  952.       266,  794,  265,  266,  266,  266,  266,  266,  266,  266,
  953.       268,  268,  268,  268,  268,  268,  268,  302,  302,  302,
  954.       265,  269,  269,  269,  269,  269,  269,  269,  311,  311,
  955.       311,  353,  353,  353,  411,  411,  411,  269,  366,  366,
  956.       366,  366,  366,  366,  366,  367,  367,  367,  367,  367,
  957.  
  958.       367,  367,  400,  400,  400,  269,  412,  412,  412,  714,
  959.       714,  367,  795,  400,  400,  413,  413,  413,  796,  469,
  960.       469,  469,  513,  513,  513,  521,  653,  757,  757,  367,
  961.       469,  469,  797,  513,  513,  555,  555,  555,  653,  521,
  962.       521,  521,  521,  521,  521,  521,  555,  555,  746,  555,
  963.       571,  571,  688,  800,  802,  804,  572,  572,  805,  806,
  964.       746,  688,  807,  688,  571,  571,  571,  571,  571,  571,
  965.       572,  572,  572,  572,  572,  572,  572,  594,  594,  594,
  966.       618,  618,  618,  622,  622,  808,  809,  811,  594,  594,
  967.       571,  618,  618,  624,  624,  627,  812,  622,  622,  622,
  968.  
  969.       622,  622,  622,  622,  626,  626,  813,  624,  624,  624,
  970.       624,  624,  624,  814,  815,  571,  654,  816,  626,  626,
  971.       626,  626,  626,  626,  626,  654,  709,  654,  654,  671,
  972.       671,  819,  627,  820,  821,  709,  824,  709,  825,  672,
  973.       672,  627,  826,  671,  671,  671,  671,  671,  671,  716,
  974.       716,  827,  627,  672,  672,  672,  672,  672,  672,  672,
  975.       718,  718,  828,  716,  716,  716,  716,  716,  716,  671,
  976.       829,  830,  832,  833,  718,  718,  718,  718,  718,  718,
  977.       718,  831,  834,  835,  836,  837,  840,  841,  831,  842,
  978.       843,  844,  845,  846,  671,  847,  848,  849,  850,  851,
  979.  
  980.       852,  855,  856,  857,  858,  859,  860,  861,  864,  865,
  981.       857,  866,  868,  869,  870,  872,  873,  874,  877,  878,
  982.       879,  880,  881,  882,  883,  884,  885,  886,  887,  888,
  983.       881,  890,  891,  892,  893,  894,  895,  896,  897,  898,
  984.       900,  899,  901,  904,  905,  906,  907,  898,  899,  909,
  985.       912,  913,  914,  856,  917,  916,  920,  921,  922,  913,
  986.       914,  858,  916,  923,  925,  926,  928,  929,  930,  931,
  987.       933,  934,  935,  926,  936,  929,  939,  940,  880,  941,
  988.       942,  944,  936,  945,  946,  949,  950,  941,  942,  951,
  989.       952,  953,  946,  950,  954,  955,  951,  956,  957,  964,
  990.  
  991.       965,  780,  779,  778,  777,  956,  957,  776,  775,  774,
  992.       773,  917,  772,  771,  770,  769,  768,  767,  766,  765,
  993.       764,  762,  761,  928,  760,  759,  758,  756,  755,  754,
  994.       753,  752,  751,  952,  953,  960,  960,  960,  960,  960,
  995.       961,  961,  961,  961,  961,  962,  962,  962,  963,  963,
  996.       963,  966,  966,  967,  750,  967,  967,  967,  968,  968,
  997.       969,  969,  749,  748,  747,  745,  744,  743,  742,  741,
  998.       740,  739,  738,  737,  736,  735,  734,  733,  732,  731,
  999.       729,  728,  727,  726,  725,  724,  723,  721,  720,  719,
  1000.       712,  711,  708,  706,  705,  704,  702,  701,  700,  699,
  1001.  
  1002.       698,  697,  696,  695,  694,  693,  692,  691,  690,  687,
  1003.       686,  685,  684,  683,  682,  680,  679,  678,  677,  676,
  1004.       675,  674,  670,  668,  667,  666,  665,  664,  663,  662,
  1005.       661,  660,  659,  658,  657,  656,  655,  649,  647,  646,
  1006.       645,  644,  643,  639,  638,  637,  636,  635,  634,  633,
  1007.       632,  631,  629,  621,  620,  616,  615,  613,  612,  610,
  1008.       609,  608,  607,  606,  605,  604,  603,  599,  598,  597,
  1009.       595,  593,  592,  591,  590,  589,  588,  587,  586,  585,
  1010.       584,  582,  581,  576,  575,  574,  573,  570,  569,  568,
  1011.       566,  565,  563,  562,  561,  560,  559,  557,  556,  554,
  1012.  
  1013.       553,  552,  551,  550,  549,  548,  547,  546,  544,  543,
  1014.       542,  541,  540,  536,  535,  534,  533,  532,  531,  528,
  1015.       527,  526,  525,  524,  523,  522,  520,  519,  518,  517,
  1016.       516,  515,  514,  512,  511,  508,  503,  502,  500,  499,
  1017.       498,  496,  495,  492,  491,  490,  489,  478,  477,  476,
  1018.       474,  473,  472,  471,  470,  467,  465,  464,  463,  461,
  1019.       460,  459,  458,  456,  455,  454,  453,  452,  450,  449,
  1020.       444,  443,  441,  440,  439,  438,  437,  436,  435,  434,
  1021.       433,  432,  431,  429,  428,  427,  426,  425,  424,  423,
  1022.       422,  420,  419,  418,  417,  416,  415,  414,  410,  406,
  1023.  
  1024.       405,  404,  401,  399,  389,  387,  383,  382,  381,  380,
  1025.       378,  377,  375,  370,  369,  368,  365,  364,  363,  362,
  1026.       361,  360,  359,  354,  352,  351,  350,  349,  348,  346,
  1027.       345,  342,  341,  340,  339,  338,  337,  336,  335,  334,
  1028.       333,  332,  331,  330,  329,  328,  327,  326,  325,  324,
  1029.       323,  322,  321,  320,  319,  318,  317,  316,  315,  312,
  1030.       310,  309,  308,  307,  306,  305,  304,  303,  301,  297,
  1031.       295,  294,  293,  292,  288,  287,  286,  285,  284,  283,
  1032.       282,  281,  280,  276,  274,  273,  272,  262,  261,  260,
  1033.       259,  258,  257,  256,  255,  253,  252,  251,  250,  249,
  1034.  
  1035.       247,  246,  245,  244,  243,  242,  241,  240,  239,  238,
  1036.       237,  236,  235,  234,  233,  232,  231,  229,  228,  227,
  1037.       226,  225,  224,  223,  222,  221,  220,  219,  217,  216,
  1038.       215,  214,  213,  212,  211,  210,  209,  208,  207,  206,
  1039.       205,  204,  203,  202,  201,  199,  198,  197,  196,  195,
  1040.       194,  193,  192,  191,  190,  189,  188,  186,  185,  184,
  1041.       183,  181,  180,  179,  178,  177,  175,  160,  159,  158,
  1042.       157,  150,  149,  147,  146,  145,  141,  140,  139,  138,
  1043.       137,  134,  133,  132,  131,  130,  128,  127,  125,  123,
  1044.       122,  121,  119,  118,  117,  115,  114,  112,  111,  110,
  1045.  
  1046.       109,  108,  107,  104,  103,  102,  101,  100,   99,   98,
  1047.        97,   95,   94,   93,   92,   91,   90,   88,   87,   83,
  1048.        79,   52,   38,   32,   22,   18,   14,   12,   11,    7,
  1049.         6,    5,  959,  959,  959,  959,  959,  959,  959,  959,
  1050.       959,  959,  959,  959,  959,  959,  959,  959,  959,  959,
  1051.       959,  959,  959,  959,  959,  959,  959,  959,  959,  959,
  1052.       959,  959,  959,  959,  959,  959,  959,  959,  959,  959,
  1053.       959,  959,  959,  959,  959,  959,  959,  959,  959,  959,
  1054.       959,  959,  959,  959,  959,  959,  959,  959,  959,  959,
  1055.       959,  959,  959,  959,  959,  959,  959,  959,  959,  959,
  1056.  
  1057.       959,  959,  959
  1058.     } ;
  1059.  
  1060. /* The intent behind this definition is that it'll catch
  1061.  * any uses of REJECT which flex missed.
  1062.  */
  1063. #define REJECT reject_used_but_not_detected
  1064. #define yymore() yymore_used_but_not_detected
  1065. #define YY_MORE_ADJ 0
  1066. #define YY_RESTORE_YY_MORE_OFFSET
  1067. #line 1 "glsl_lexer.ll"
  1068. #line 2 "glsl_lexer.ll"
  1069. /*
  1070.  * Copyright © 2008, 2009 Intel Corporation
  1071.  *
  1072.  * Permission is hereby granted, free of charge, to any person obtaining a
  1073.  * copy of this software and associated documentation files (the "Software"),
  1074.  * to deal in the Software without restriction, including without limitation
  1075.  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  1076.  * and/or sell copies of the Software, and to permit persons to whom the
  1077.  * Software is furnished to do so, subject to the following conditions:
  1078.  *
  1079.  * The above copyright notice and this permission notice (including the next
  1080.  * paragraph) shall be included in all copies or substantial portions of the
  1081.  * Software.
  1082.  *
  1083.  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1084.  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1085.  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
  1086.  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1087.  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  1088.  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  1089.  * DEALINGS IN THE SOFTWARE.
  1090.  */
  1091. #include <ctype.h>
  1092. #include <limits.h>
  1093. #include "strtod.h"
  1094. #include "ast.h"
  1095. #include "glsl_parser_extras.h"
  1096. #include "glsl_parser.h"
  1097.  
  1098. static int classify_identifier(struct _mesa_glsl_parse_state *, const char *);
  1099.  
  1100. #ifdef _MSC_VER
  1101. #define YY_NO_UNISTD_H
  1102. #endif
  1103.  
  1104. #define YY_USER_ACTION                                          \
  1105.    do {                                                         \
  1106.       yylloc->source = 0;                                       \
  1107.       yylloc->first_column = yycolumn + 1;                      \
  1108.       yylloc->first_line = yylineno + 1;                        \
  1109.       yycolumn += yyleng;                                       \
  1110.    } while(0);
  1111.  
  1112. #define YY_USER_INIT yylineno = 0; yycolumn = 0;
  1113.  
  1114. /* A macro for handling reserved words and keywords across language versions.
  1115.  *
  1116.  * Certain words start out as identifiers, become reserved words in
  1117.  * later language revisions, and finally become language keywords.
  1118.  * This may happen at different times in desktop GLSL and GLSL ES.
  1119.  *
  1120.  * For example, consider the following lexer rule:
  1121.  * samplerBuffer       KEYWORD(130, 0, 140, 0, SAMPLERBUFFER)
  1122.  *
  1123.  * This means that "samplerBuffer" will be treated as:
  1124.  * - a keyword (SAMPLERBUFFER token)         ...in GLSL >= 1.40
  1125.  * - a reserved word - error                 ...in GLSL >= 1.30
  1126.  * - an identifier                           ...in GLSL <  1.30 or GLSL ES
  1127.  */
  1128. #define KEYWORD(reserved_glsl, reserved_glsl_es,                        \
  1129.                 allowed_glsl, allowed_glsl_es, token)                   \
  1130.    KEYWORD_WITH_ALT(reserved_glsl, reserved_glsl_es,                    \
  1131.                     allowed_glsl, allowed_glsl_es, false, token)
  1132.  
  1133. /**
  1134.  * Like the KEYWORD macro, but the word is also treated as a keyword
  1135.  * if the given boolean expression is true.
  1136.  */
  1137. #define KEYWORD_WITH_ALT(reserved_glsl, reserved_glsl_es,               \
  1138.                          allowed_glsl, allowed_glsl_es,                 \
  1139.                          alt_expr, token)                               \
  1140.    do {                                                                 \
  1141.       if (yyextra->is_version(allowed_glsl, allowed_glsl_es)            \
  1142.           || (alt_expr)) {                                              \
  1143.          return token;                                                  \
  1144.       } else if (yyextra->is_version(reserved_glsl,                     \
  1145.                                      reserved_glsl_es)) {               \
  1146.          _mesa_glsl_error(yylloc, yyextra,                              \
  1147.                           "Illegal use of reserved word `%s'", yytext); \
  1148.          return ERROR_TOK;                                              \
  1149.       } else {                                                          \
  1150.          yylval->identifier = strdup(yytext);                           \
  1151.          return classify_identifier(yyextra, yytext);                   \
  1152.       }                                                                 \
  1153.    } while (0)
  1154.  
  1155. /**
  1156.  * A macro for handling keywords that have been present in GLSL since
  1157.  * its origin, but were changed into reserved words in GLSL 3.00 ES.
  1158.  */
  1159. #define DEPRECATED_ES_KEYWORD(token)                                    \
  1160.    do {                                                                 \
  1161.       if (yyextra->is_version(0, 300)) {                                \
  1162.          _mesa_glsl_error(yylloc, yyextra,                              \
  1163.                           "Illegal use of reserved word `%s'", yytext); \
  1164.          return ERROR_TOK;                                              \
  1165.       } else {                                                          \
  1166.          return token;                                                  \
  1167.       }                                                                 \
  1168.    } while (0)
  1169.  
  1170. static int
  1171. literal_integer(char *text, int len, struct _mesa_glsl_parse_state *state,
  1172.                 YYSTYPE *lval, YYLTYPE *lloc, int base)
  1173. {
  1174.    bool is_uint = (text[len - 1] == 'u' ||
  1175.                    text[len - 1] == 'U');
  1176.    const char *digits = text;
  1177.  
  1178.    /* Skip "0x" */
  1179.    if (base == 16)
  1180.       digits += 2;
  1181.  
  1182. #ifdef _MSC_VER
  1183.    unsigned __int64 value = _strtoui64(digits, NULL, base);
  1184. #else
  1185.    unsigned long long value = strtoull(digits, NULL, base);
  1186. #endif
  1187.  
  1188.    lval->n = (int)value;
  1189.  
  1190.    if (value > UINT_MAX) {
  1191.       /* Note that signed 0xffffffff is valid, not out of range! */
  1192.       if (state->is_version(130, 300)) {
  1193.          _mesa_glsl_error(lloc, state,
  1194.                           "Literal value `%s' out of range", text);
  1195.       } else {
  1196.          _mesa_glsl_warning(lloc, state,
  1197.                             "Literal value `%s' out of range", text);
  1198.       }
  1199.    } else if (base == 10 && !is_uint && (unsigned)value > (unsigned)INT_MAX + 1) {
  1200.       /* Tries to catch unintentionally providing a negative value.
  1201.        * Note that -2147483648 is parsed as -(2147483648), so we don't
  1202.        * want to warn for INT_MAX.
  1203.        */
  1204.       _mesa_glsl_warning(lloc, state,
  1205.                          "Signed literal value `%s' is interpreted as %d",
  1206.                          text, lval->n);
  1207.    }
  1208.    return is_uint ? UINTCONSTANT : INTCONSTANT;
  1209. }
  1210.  
  1211. #define LITERAL_INTEGER(base) \
  1212.    literal_integer(yytext, yyleng, yyextra, yylval, yylloc, base)
  1213.  
  1214.  
  1215. #line 1216 "glsl_lexer.cpp"
  1216.  
  1217. #define INITIAL 0
  1218. #define PP 1
  1219. #define PRAGMA 2
  1220.  
  1221. #ifndef YY_NO_UNISTD_H
  1222. /* Special case for "unistd.h", since it is non-ANSI. We include it way
  1223.  * down here because we want the user's section 1 to have been scanned first.
  1224.  * The user has a chance to override it with an option.
  1225.  */
  1226. #include <unistd.h>
  1227. #endif
  1228.  
  1229. #define YY_EXTRA_TYPE struct _mesa_glsl_parse_state *
  1230.  
  1231. /* Holds the entire state of the reentrant scanner. */
  1232. struct yyguts_t
  1233.     {
  1234.  
  1235.     /* User-defined. Not touched by flex. */
  1236.     YY_EXTRA_TYPE yyextra_r;
  1237.  
  1238.     /* The rest are the same as the globals declared in the non-reentrant scanner. */
  1239.     FILE *yyin_r, *yyout_r;
  1240.     size_t yy_buffer_stack_top; /**< index of top of stack. */
  1241.     size_t yy_buffer_stack_max; /**< capacity of stack. */
  1242.     YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
  1243.     char yy_hold_char;
  1244.     int yy_n_chars;
  1245.     int yyleng_r;
  1246.     char *yy_c_buf_p;
  1247.     int yy_init;
  1248.     int yy_start;
  1249.     int yy_did_buffer_switch_on_eof;
  1250.     int yy_start_stack_ptr;
  1251.     int yy_start_stack_depth;
  1252.     int *yy_start_stack;
  1253.     yy_state_type yy_last_accepting_state;
  1254.     char* yy_last_accepting_cpos;
  1255.  
  1256.     int yylineno_r;
  1257.     int yy_flex_debug_r;
  1258.  
  1259.     char *yytext_r;
  1260.     int yy_more_flag;
  1261.     int yy_more_len;
  1262.  
  1263.     YYSTYPE * yylval_r;
  1264.  
  1265.     YYLTYPE * yylloc_r;
  1266.  
  1267.     }; /* end struct yyguts_t */
  1268.  
  1269. static int yy_init_globals (yyscan_t yyscanner );
  1270.  
  1271.     /* This must go here because YYSTYPE and YYLTYPE are included
  1272.      * from bison output in section 1.*/
  1273.     #    define yylval yyg->yylval_r
  1274.    
  1275.     #    define yylloc yyg->yylloc_r
  1276.    
  1277. int _mesa_glsl_lexer_lex_init (yyscan_t* scanner);
  1278.  
  1279. int _mesa_glsl_lexer_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
  1280.  
  1281. /* Accessor methods to globals.
  1282.    These are made visible to non-reentrant scanners for convenience. */
  1283.  
  1284. int _mesa_glsl_lexer_lex_destroy (yyscan_t yyscanner );
  1285.  
  1286. int _mesa_glsl_lexer_get_debug (yyscan_t yyscanner );
  1287.  
  1288. void _mesa_glsl_lexer_set_debug (int debug_flag ,yyscan_t yyscanner );
  1289.  
  1290. YY_EXTRA_TYPE _mesa_glsl_lexer_get_extra (yyscan_t yyscanner );
  1291.  
  1292. void _mesa_glsl_lexer_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
  1293.  
  1294. FILE *_mesa_glsl_lexer_get_in (yyscan_t yyscanner );
  1295.  
  1296. void _mesa_glsl_lexer_set_in  (FILE * in_str ,yyscan_t yyscanner );
  1297.  
  1298. FILE *_mesa_glsl_lexer_get_out (yyscan_t yyscanner );
  1299.  
  1300. void _mesa_glsl_lexer_set_out  (FILE * out_str ,yyscan_t yyscanner );
  1301.  
  1302. int _mesa_glsl_lexer_get_leng (yyscan_t yyscanner );
  1303.  
  1304. char *_mesa_glsl_lexer_get_text (yyscan_t yyscanner );
  1305.  
  1306. int _mesa_glsl_lexer_get_lineno (yyscan_t yyscanner );
  1307.  
  1308. void _mesa_glsl_lexer_set_lineno (int line_number ,yyscan_t yyscanner );
  1309.  
  1310. int _mesa_glsl_lexer_get_column  (yyscan_t yyscanner );
  1311.  
  1312. void _mesa_glsl_lexer_set_column (int column_no ,yyscan_t yyscanner );
  1313.  
  1314. YYSTYPE * _mesa_glsl_lexer_get_lval (yyscan_t yyscanner );
  1315.  
  1316. void _mesa_glsl_lexer_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
  1317.  
  1318.        YYLTYPE *_mesa_glsl_lexer_get_lloc (yyscan_t yyscanner );
  1319.    
  1320.         void _mesa_glsl_lexer_set_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
  1321.    
  1322. /* Macros after this point can all be overridden by user definitions in
  1323.  * section 1.
  1324.  */
  1325.  
  1326. #ifndef YY_SKIP_YYWRAP
  1327. #ifdef __cplusplus
  1328. extern "C" int _mesa_glsl_lexer_wrap (yyscan_t yyscanner );
  1329. #else
  1330. extern int _mesa_glsl_lexer_wrap (yyscan_t yyscanner );
  1331. #endif
  1332. #endif
  1333.  
  1334. #ifndef yytext_ptr
  1335. static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
  1336. #endif
  1337.  
  1338. #ifdef YY_NEED_STRLEN
  1339. static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
  1340. #endif
  1341.  
  1342. #ifndef YY_NO_INPUT
  1343.  
  1344. #ifdef __cplusplus
  1345. static int yyinput (yyscan_t yyscanner );
  1346. #else
  1347. static int input (yyscan_t yyscanner );
  1348. #endif
  1349.  
  1350. #endif
  1351.  
  1352. /* Amount of stuff to slurp up with each read. */
  1353. #ifndef YY_READ_BUF_SIZE
  1354. #ifdef __ia64__
  1355. /* On IA-64, the buffer size is 16k, not 8k */
  1356. #define YY_READ_BUF_SIZE 16384
  1357. #else
  1358. #define YY_READ_BUF_SIZE 8192
  1359. #endif /* __ia64__ */
  1360. #endif
  1361.  
  1362. /* Copy whatever the last rule matched to the standard output. */
  1363. #ifndef ECHO
  1364. /* This used to be an fputs(), but since the string might contain NUL's,
  1365.  * we now use fwrite().
  1366.  */
  1367. #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
  1368. #endif
  1369.  
  1370. /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
  1371.  * is returned in "result".
  1372.  */
  1373. #ifndef YY_INPUT
  1374. #define YY_INPUT(buf,result,max_size) \
  1375.         if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
  1376.                 { \
  1377.                 int c = '*'; \
  1378.                 size_t n; \
  1379.                 for ( n = 0; n < max_size && \
  1380.                              (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
  1381.                         buf[n] = (char) c; \
  1382.                 if ( c == '\n' ) \
  1383.                         buf[n++] = (char) c; \
  1384.                 if ( c == EOF && ferror( yyin ) ) \
  1385.                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
  1386.                 result = n; \
  1387.                 } \
  1388.         else \
  1389.                 { \
  1390.                 errno=0; \
  1391.                 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
  1392.                         { \
  1393.                         if( errno != EINTR) \
  1394.                                 { \
  1395.                                 YY_FATAL_ERROR( "input in flex scanner failed" ); \
  1396.                                 break; \
  1397.                                 } \
  1398.                         errno=0; \
  1399.                         clearerr(yyin); \
  1400.                         } \
  1401.                 }\
  1402. \
  1403.  
  1404. #endif
  1405.  
  1406. /* No semi-colon after return; correct usage is to write "yyterminate();" -
  1407.  * we don't want an extra ';' after the "return" because that will cause
  1408.  * some compilers to complain about unreachable statements.
  1409.  */
  1410. #ifndef yyterminate
  1411. #define yyterminate() return YY_NULL
  1412. #endif
  1413.  
  1414. /* Number of entries by which start-condition stack grows. */
  1415. #ifndef YY_START_STACK_INCR
  1416. #define YY_START_STACK_INCR 25
  1417. #endif
  1418.  
  1419. /* Report a fatal error. */
  1420. #ifndef YY_FATAL_ERROR
  1421. #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
  1422. #endif
  1423.  
  1424. /* end tables serialization structures and prototypes */
  1425.  
  1426. /* Default declaration of generated scanner - a define so the user can
  1427.  * easily add parameters.
  1428.  */
  1429. #ifndef YY_DECL
  1430. #define YY_DECL_IS_OURS 1
  1431.  
  1432. extern int _mesa_glsl_lexer_lex \
  1433.                (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
  1434.  
  1435. #define YY_DECL int _mesa_glsl_lexer_lex \
  1436.                (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
  1437. #endif /* !YY_DECL */
  1438.  
  1439. /* Code executed at the beginning of each rule, after yytext and yyleng
  1440.  * have been set up.
  1441.  */
  1442. #ifndef YY_USER_ACTION
  1443. #define YY_USER_ACTION
  1444. #endif
  1445.  
  1446. /* Code executed at the end of each rule. */
  1447. #ifndef YY_BREAK
  1448. #define YY_BREAK break;
  1449. #endif
  1450.  
  1451. #define YY_RULE_SETUP \
  1452.         if ( yyleng > 0 ) \
  1453.                 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
  1454.                                 (yytext[yyleng - 1] == '\n'); \
  1455.         YY_USER_ACTION
  1456.  
  1457. /** The main scanner function which does all the work.
  1458.  */
  1459. YY_DECL
  1460. {
  1461.         register yy_state_type yy_current_state;
  1462.         register char *yy_cp, *yy_bp;
  1463.         register int yy_act;
  1464.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1465.  
  1466. #line 164 "glsl_lexer.ll"
  1467.  
  1468.  
  1469. #line 1470 "glsl_lexer.cpp"
  1470.  
  1471.     yylval = yylval_param;
  1472.  
  1473.     yylloc = yylloc_param;
  1474.  
  1475.         if ( !yyg->yy_init )
  1476.                 {
  1477.                 yyg->yy_init = 1;
  1478.  
  1479. #ifdef YY_USER_INIT
  1480.                 YY_USER_INIT;
  1481. #endif
  1482.  
  1483.                 if ( ! yyg->yy_start )
  1484.                         yyg->yy_start = 1;      /* first start state */
  1485.  
  1486.                 if ( ! yyin )
  1487.                         yyin = stdin;
  1488.  
  1489.                 if ( ! yyout )
  1490.                         yyout = stdout;
  1491.  
  1492.                 if ( ! YY_CURRENT_BUFFER ) {
  1493.                         _mesa_glsl_lexer_ensure_buffer_stack (yyscanner);
  1494.                         YY_CURRENT_BUFFER_LVALUE =
  1495.                                 _mesa_glsl_lexer__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
  1496.                 }
  1497.  
  1498.                 _mesa_glsl_lexer__load_buffer_state(yyscanner );
  1499.                 }
  1500.  
  1501.         while ( 1 )             /* loops until end-of-file is reached */
  1502.                 {
  1503.                 yy_cp = yyg->yy_c_buf_p;
  1504.  
  1505.                 /* Support of yytext. */
  1506.                 *yy_cp = yyg->yy_hold_char;
  1507.  
  1508.                 /* yy_bp points to the position in yy_ch_buf of the start of
  1509.                  * the current run.
  1510.                  */
  1511.                 yy_bp = yy_cp;
  1512.  
  1513.                 yy_current_state = yyg->yy_start;
  1514.                 yy_current_state += YY_AT_BOL();
  1515. yy_match:
  1516.                 do
  1517.                         {
  1518.                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
  1519.                         if ( yy_accept[yy_current_state] )
  1520.                                 {
  1521.                                 yyg->yy_last_accepting_state = yy_current_state;
  1522.                                 yyg->yy_last_accepting_cpos = yy_cp;
  1523.                                 }
  1524.                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1525.                                 {
  1526.                                 yy_current_state = (int) yy_def[yy_current_state];
  1527.                                 if ( yy_current_state >= 960 )
  1528.                                         yy_c = yy_meta[(unsigned int) yy_c];
  1529.                                 }
  1530.                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  1531.                         ++yy_cp;
  1532.                         }
  1533.                 while ( yy_current_state != 959 );
  1534.                 yy_cp = yyg->yy_last_accepting_cpos;
  1535.                 yy_current_state = yyg->yy_last_accepting_state;
  1536.  
  1537. yy_find_action:
  1538.                 yy_act = yy_accept[yy_current_state];
  1539.  
  1540.                 YY_DO_BEFORE_ACTION;
  1541.  
  1542. do_action:      /* This label is used only to access EOF actions. */
  1543.  
  1544.                 switch ( yy_act )
  1545.         { /* beginning of action switch */
  1546.                         case 0: /* must back up */
  1547.                         /* undo the effects of YY_DO_BEFORE_ACTION */
  1548.                         *yy_cp = yyg->yy_hold_char;
  1549.                         yy_cp = yyg->yy_last_accepting_cpos;
  1550.                         yy_current_state = yyg->yy_last_accepting_state;
  1551.                         goto yy_find_action;
  1552.  
  1553. case 1:
  1554. YY_RULE_SETUP
  1555. #line 166 "glsl_lexer.ll"
  1556. ;
  1557.         YY_BREAK
  1558. /* Preprocessor tokens. */
  1559. case 2:
  1560. *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
  1561. yyg->yy_c_buf_p = yy_cp -= 1;
  1562. YY_DO_BEFORE_ACTION; /* set up yytext again */
  1563. YY_RULE_SETUP
  1564. #line 169 "glsl_lexer.ll"
  1565. ;
  1566.         YY_BREAK
  1567. case 3:
  1568. YY_RULE_SETUP
  1569. #line 170 "glsl_lexer.ll"
  1570. { BEGIN PP; return VERSION_TOK; }
  1571.         YY_BREAK
  1572. case 4:
  1573. YY_RULE_SETUP
  1574. #line 171 "glsl_lexer.ll"
  1575. { BEGIN PP; return EXTENSION; }
  1576.         YY_BREAK
  1577. case 5:
  1578. *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
  1579. yyg->yy_c_buf_p = yy_cp -= 1;
  1580. YY_DO_BEFORE_ACTION; /* set up yytext again */
  1581. YY_RULE_SETUP
  1582. #line 172 "glsl_lexer.ll"
  1583. {
  1584.                                    /* Eat characters until the first digit is
  1585.                                     * encountered
  1586.                                     */
  1587.                                    char *ptr = yytext;
  1588.                                    while (!isdigit(*ptr))
  1589.                                       ptr++;
  1590.  
  1591.                                    /* Subtract one from the line number because
  1592.                                     * yylineno is zero-based instead of
  1593.                                     * one-based.
  1594.                                     */
  1595.                                    yylineno = strtol(ptr, &ptr, 0) - 1;
  1596.                                    yylloc->source = strtol(ptr, NULL, 0);
  1597.                                 }
  1598.         YY_BREAK
  1599. case 6:
  1600. *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
  1601. yyg->yy_c_buf_p = yy_cp -= 1;
  1602. YY_DO_BEFORE_ACTION; /* set up yytext again */
  1603. YY_RULE_SETUP
  1604. #line 187 "glsl_lexer.ll"
  1605. {
  1606.                                    /* Eat characters until the first digit is
  1607.                                     * encountered
  1608.                                     */
  1609.                                    char *ptr = yytext;
  1610.                                    while (!isdigit(*ptr))
  1611.                                       ptr++;
  1612.  
  1613.                                    /* Subtract one from the line number because
  1614.                                     * yylineno is zero-based instead of
  1615.                                     * one-based.
  1616.                                     */
  1617.                                    yylineno = strtol(ptr, &ptr, 0) - 1;
  1618.                                 }
  1619.         YY_BREAK
  1620. case 7:
  1621. YY_RULE_SETUP
  1622. #line 201 "glsl_lexer.ll"
  1623. {
  1624.                                   BEGIN PP;
  1625.                                   return PRAGMA_DEBUG_ON;
  1626.                                 }
  1627.         YY_BREAK
  1628. case 8:
  1629. YY_RULE_SETUP
  1630. #line 205 "glsl_lexer.ll"
  1631. {
  1632.                                   BEGIN PP;
  1633.                                   return PRAGMA_DEBUG_OFF;
  1634.                                 }
  1635.         YY_BREAK
  1636. case 9:
  1637. YY_RULE_SETUP
  1638. #line 209 "glsl_lexer.ll"
  1639. {
  1640.                                   BEGIN PP;
  1641.                                   return PRAGMA_OPTIMIZE_ON;
  1642.                                 }
  1643.         YY_BREAK
  1644. case 10:
  1645. YY_RULE_SETUP
  1646. #line 213 "glsl_lexer.ll"
  1647. {
  1648.                                   BEGIN PP;
  1649.                                   return PRAGMA_OPTIMIZE_OFF;
  1650.                                 }
  1651.         YY_BREAK
  1652. case 11:
  1653. YY_RULE_SETUP
  1654. #line 217 "glsl_lexer.ll"
  1655. {
  1656.                                   BEGIN PP;
  1657.                                   return PRAGMA_INVARIANT_ALL;
  1658.                                 }
  1659.         YY_BREAK
  1660. case 12:
  1661. YY_RULE_SETUP
  1662. #line 221 "glsl_lexer.ll"
  1663. { BEGIN PRAGMA; }
  1664.         YY_BREAK
  1665. case 13:
  1666. /* rule 13 can match eol */
  1667. YY_RULE_SETUP
  1668. #line 223 "glsl_lexer.ll"
  1669. { BEGIN 0; yylineno++; yycolumn = 0; }
  1670.         YY_BREAK
  1671. case 14:
  1672. YY_RULE_SETUP
  1673. #line 224 "glsl_lexer.ll"
  1674. { }
  1675.         YY_BREAK
  1676. case 15:
  1677. YY_RULE_SETUP
  1678. #line 226 "glsl_lexer.ll"
  1679. { }
  1680.         YY_BREAK
  1681. case 16:
  1682. YY_RULE_SETUP
  1683. #line 227 "glsl_lexer.ll"
  1684. { }
  1685.         YY_BREAK
  1686. case 17:
  1687. YY_RULE_SETUP
  1688. #line 228 "glsl_lexer.ll"
  1689. return COLON;
  1690.         YY_BREAK
  1691. case 18:
  1692. YY_RULE_SETUP
  1693. #line 229 "glsl_lexer.ll"
  1694. {
  1695.                                    yylval->identifier = strdup(yytext);
  1696.                                    return IDENTIFIER;
  1697.                                 }
  1698.         YY_BREAK
  1699. case 19:
  1700. YY_RULE_SETUP
  1701. #line 233 "glsl_lexer.ll"
  1702. {
  1703.                                     yylval->n = strtol(yytext, NULL, 10);
  1704.                                     return INTCONSTANT;
  1705.                                 }
  1706.         YY_BREAK
  1707. case 20:
  1708. /* rule 20 can match eol */
  1709. YY_RULE_SETUP
  1710. #line 237 "glsl_lexer.ll"
  1711. { BEGIN 0; yylineno++; yycolumn = 0; return EOL; }
  1712.         YY_BREAK
  1713. case 21:
  1714. /* rule 21 can match eol */
  1715. YY_RULE_SETUP
  1716. #line 239 "glsl_lexer.ll"
  1717. { yylineno++; yycolumn = 0; }
  1718.         YY_BREAK
  1719. case 22:
  1720. YY_RULE_SETUP
  1721. #line 241 "glsl_lexer.ll"
  1722. DEPRECATED_ES_KEYWORD(ATTRIBUTE);
  1723.         YY_BREAK
  1724. case 23:
  1725. YY_RULE_SETUP
  1726. #line 242 "glsl_lexer.ll"
  1727. return CONST_TOK;
  1728.         YY_BREAK
  1729. case 24:
  1730. YY_RULE_SETUP
  1731. #line 243 "glsl_lexer.ll"
  1732. return BOOL_TOK;
  1733.         YY_BREAK
  1734. case 25:
  1735. YY_RULE_SETUP
  1736. #line 244 "glsl_lexer.ll"
  1737. return FLOAT_TOK;
  1738.         YY_BREAK
  1739. case 26:
  1740. YY_RULE_SETUP
  1741. #line 245 "glsl_lexer.ll"
  1742. return INT_TOK;
  1743.         YY_BREAK
  1744. case 27:
  1745. YY_RULE_SETUP
  1746. #line 246 "glsl_lexer.ll"
  1747. KEYWORD(130, 300, 130, 300, UINT_TOK);
  1748.         YY_BREAK
  1749. case 28:
  1750. YY_RULE_SETUP
  1751. #line 248 "glsl_lexer.ll"
  1752. return BREAK;
  1753.         YY_BREAK
  1754. case 29:
  1755. YY_RULE_SETUP
  1756. #line 249 "glsl_lexer.ll"
  1757. return CONTINUE;
  1758.         YY_BREAK
  1759. case 30:
  1760. YY_RULE_SETUP
  1761. #line 250 "glsl_lexer.ll"
  1762. return DO;
  1763.         YY_BREAK
  1764. case 31:
  1765. YY_RULE_SETUP
  1766. #line 251 "glsl_lexer.ll"
  1767. return WHILE;
  1768.         YY_BREAK
  1769. case 32:
  1770. YY_RULE_SETUP
  1771. #line 252 "glsl_lexer.ll"
  1772. return ELSE;
  1773.         YY_BREAK
  1774. case 33:
  1775. YY_RULE_SETUP
  1776. #line 253 "glsl_lexer.ll"
  1777. return FOR;
  1778.         YY_BREAK
  1779. case 34:
  1780. YY_RULE_SETUP
  1781. #line 254 "glsl_lexer.ll"
  1782. return IF;
  1783.         YY_BREAK
  1784. case 35:
  1785. YY_RULE_SETUP
  1786. #line 255 "glsl_lexer.ll"
  1787. return DISCARD;
  1788.         YY_BREAK
  1789. case 36:
  1790. YY_RULE_SETUP
  1791. #line 256 "glsl_lexer.ll"
  1792. return RETURN;
  1793.         YY_BREAK
  1794. case 37:
  1795. YY_RULE_SETUP
  1796. #line 258 "glsl_lexer.ll"
  1797. return BVEC2;
  1798.         YY_BREAK
  1799. case 38:
  1800. YY_RULE_SETUP
  1801. #line 259 "glsl_lexer.ll"
  1802. return BVEC3;
  1803.         YY_BREAK
  1804. case 39:
  1805. YY_RULE_SETUP
  1806. #line 260 "glsl_lexer.ll"
  1807. return BVEC4;
  1808.         YY_BREAK
  1809. case 40:
  1810. YY_RULE_SETUP
  1811. #line 261 "glsl_lexer.ll"
  1812. return IVEC2;
  1813.         YY_BREAK
  1814. case 41:
  1815. YY_RULE_SETUP
  1816. #line 262 "glsl_lexer.ll"
  1817. return IVEC3;
  1818.         YY_BREAK
  1819. case 42:
  1820. YY_RULE_SETUP
  1821. #line 263 "glsl_lexer.ll"
  1822. return IVEC4;
  1823.         YY_BREAK
  1824. case 43:
  1825. YY_RULE_SETUP
  1826. #line 264 "glsl_lexer.ll"
  1827. KEYWORD(130, 300, 130, 300, UVEC2);
  1828.         YY_BREAK
  1829. case 44:
  1830. YY_RULE_SETUP
  1831. #line 265 "glsl_lexer.ll"
  1832. KEYWORD(130, 300, 130, 300, UVEC3);
  1833.         YY_BREAK
  1834. case 45:
  1835. YY_RULE_SETUP
  1836. #line 266 "glsl_lexer.ll"
  1837. KEYWORD(130, 300, 130, 300, UVEC4);
  1838.         YY_BREAK
  1839. case 46:
  1840. YY_RULE_SETUP
  1841. #line 267 "glsl_lexer.ll"
  1842. return VEC2;
  1843.         YY_BREAK
  1844. case 47:
  1845. YY_RULE_SETUP
  1846. #line 268 "glsl_lexer.ll"
  1847. return VEC3;
  1848.         YY_BREAK
  1849. case 48:
  1850. YY_RULE_SETUP
  1851. #line 269 "glsl_lexer.ll"
  1852. return VEC4;
  1853.         YY_BREAK
  1854. case 49:
  1855. YY_RULE_SETUP
  1856. #line 270 "glsl_lexer.ll"
  1857. return MAT2X2;
  1858.         YY_BREAK
  1859. case 50:
  1860. YY_RULE_SETUP
  1861. #line 271 "glsl_lexer.ll"
  1862. return MAT3X3;
  1863.         YY_BREAK
  1864. case 51:
  1865. YY_RULE_SETUP
  1866. #line 272 "glsl_lexer.ll"
  1867. return MAT4X4;
  1868.         YY_BREAK
  1869. case 52:
  1870. YY_RULE_SETUP
  1871. #line 273 "glsl_lexer.ll"
  1872. KEYWORD(120, 300, 120, 300, MAT2X2);
  1873.         YY_BREAK
  1874. case 53:
  1875. YY_RULE_SETUP
  1876. #line 274 "glsl_lexer.ll"
  1877. KEYWORD(120, 300, 120, 300, MAT2X3);
  1878.         YY_BREAK
  1879. case 54:
  1880. YY_RULE_SETUP
  1881. #line 275 "glsl_lexer.ll"
  1882. KEYWORD(120, 300, 120, 300, MAT2X4);
  1883.         YY_BREAK
  1884. case 55:
  1885. YY_RULE_SETUP
  1886. #line 276 "glsl_lexer.ll"
  1887. KEYWORD(120, 300, 120, 300, MAT3X2);
  1888.         YY_BREAK
  1889. case 56:
  1890. YY_RULE_SETUP
  1891. #line 277 "glsl_lexer.ll"
  1892. KEYWORD(120, 300, 120, 300, MAT3X3);
  1893.         YY_BREAK
  1894. case 57:
  1895. YY_RULE_SETUP
  1896. #line 278 "glsl_lexer.ll"
  1897. KEYWORD(120, 300, 120, 300, MAT3X4);
  1898.         YY_BREAK
  1899. case 58:
  1900. YY_RULE_SETUP
  1901. #line 279 "glsl_lexer.ll"
  1902. KEYWORD(120, 300, 120, 300, MAT4X2);
  1903.         YY_BREAK
  1904. case 59:
  1905. YY_RULE_SETUP
  1906. #line 280 "glsl_lexer.ll"
  1907. KEYWORD(120, 300, 120, 300, MAT4X3);
  1908.         YY_BREAK
  1909. case 60:
  1910. YY_RULE_SETUP
  1911. #line 281 "glsl_lexer.ll"
  1912. KEYWORD(120, 300, 120, 300, MAT4X4);
  1913.         YY_BREAK
  1914. case 61:
  1915. YY_RULE_SETUP
  1916. #line 283 "glsl_lexer.ll"
  1917. return IN_TOK;
  1918.         YY_BREAK
  1919. case 62:
  1920. YY_RULE_SETUP
  1921. #line 284 "glsl_lexer.ll"
  1922. return OUT_TOK;
  1923.         YY_BREAK
  1924. case 63:
  1925. YY_RULE_SETUP
  1926. #line 285 "glsl_lexer.ll"
  1927. return INOUT_TOK;
  1928.         YY_BREAK
  1929. case 64:
  1930. YY_RULE_SETUP
  1931. #line 286 "glsl_lexer.ll"
  1932. return UNIFORM;
  1933.         YY_BREAK
  1934. case 65:
  1935. YY_RULE_SETUP
  1936. #line 287 "glsl_lexer.ll"
  1937. DEPRECATED_ES_KEYWORD(VARYING);
  1938.         YY_BREAK
  1939. case 66:
  1940. YY_RULE_SETUP
  1941. #line 288 "glsl_lexer.ll"
  1942. KEYWORD(120, 300, 120, 300, CENTROID);
  1943.         YY_BREAK
  1944. case 67:
  1945. YY_RULE_SETUP
  1946. #line 289 "glsl_lexer.ll"
  1947. KEYWORD(120, 100, 120, 100, INVARIANT);
  1948.         YY_BREAK
  1949. case 68:
  1950. YY_RULE_SETUP
  1951. #line 290 "glsl_lexer.ll"
  1952. KEYWORD(130, 100, 130, 300, FLAT);
  1953.         YY_BREAK
  1954. case 69:
  1955. YY_RULE_SETUP
  1956. #line 291 "glsl_lexer.ll"
  1957. KEYWORD(130, 300, 130, 300, SMOOTH);
  1958.         YY_BREAK
  1959. case 70:
  1960. YY_RULE_SETUP
  1961. #line 292 "glsl_lexer.ll"
  1962. KEYWORD(130, 300, 130, 0, NOPERSPECTIVE);
  1963.         YY_BREAK
  1964. case 71:
  1965. YY_RULE_SETUP
  1966. #line 294 "glsl_lexer.ll"
  1967. DEPRECATED_ES_KEYWORD(SAMPLER1D);
  1968.         YY_BREAK
  1969. case 72:
  1970. YY_RULE_SETUP
  1971. #line 295 "glsl_lexer.ll"
  1972. return SAMPLER2D;
  1973.         YY_BREAK
  1974. case 73:
  1975. YY_RULE_SETUP
  1976. #line 296 "glsl_lexer.ll"
  1977. return SAMPLER3D;
  1978.         YY_BREAK
  1979. case 74:
  1980. YY_RULE_SETUP
  1981. #line 297 "glsl_lexer.ll"
  1982. return SAMPLERCUBE;
  1983.         YY_BREAK
  1984. case 75:
  1985. YY_RULE_SETUP
  1986. #line 298 "glsl_lexer.ll"
  1987. KEYWORD(130, 300, 130, 0, SAMPLER1DARRAY);
  1988.         YY_BREAK
  1989. case 76:
  1990. YY_RULE_SETUP
  1991. #line 299 "glsl_lexer.ll"
  1992. KEYWORD(130, 300, 130, 300, SAMPLER2DARRAY);
  1993.         YY_BREAK
  1994. case 77:
  1995. YY_RULE_SETUP
  1996. #line 300 "glsl_lexer.ll"
  1997. DEPRECATED_ES_KEYWORD(SAMPLER1DSHADOW);
  1998.         YY_BREAK
  1999. case 78:
  2000. YY_RULE_SETUP
  2001. #line 301 "glsl_lexer.ll"
  2002. return SAMPLER2DSHADOW;
  2003.         YY_BREAK
  2004. case 79:
  2005. YY_RULE_SETUP
  2006. #line 302 "glsl_lexer.ll"
  2007. KEYWORD(130, 300, 130, 300, SAMPLERCUBESHADOW);
  2008.         YY_BREAK
  2009. case 80:
  2010. YY_RULE_SETUP
  2011. #line 303 "glsl_lexer.ll"
  2012. KEYWORD(130, 300, 130, 0, SAMPLER1DARRAYSHADOW);
  2013.         YY_BREAK
  2014. case 81:
  2015. YY_RULE_SETUP
  2016. #line 304 "glsl_lexer.ll"
  2017. KEYWORD(130, 300, 130, 300, SAMPLER2DARRAYSHADOW);
  2018.         YY_BREAK
  2019. case 82:
  2020. YY_RULE_SETUP
  2021. #line 305 "glsl_lexer.ll"
  2022. KEYWORD(130, 300, 130, 0, ISAMPLER1D);
  2023.         YY_BREAK
  2024. case 83:
  2025. YY_RULE_SETUP
  2026. #line 306 "glsl_lexer.ll"
  2027. KEYWORD(130, 300, 130, 300, ISAMPLER2D);
  2028.         YY_BREAK
  2029. case 84:
  2030. YY_RULE_SETUP
  2031. #line 307 "glsl_lexer.ll"
  2032. KEYWORD(130, 300, 130, 300, ISAMPLER3D);
  2033.         YY_BREAK
  2034. case 85:
  2035. YY_RULE_SETUP
  2036. #line 308 "glsl_lexer.ll"
  2037. KEYWORD(130, 300, 130, 300, ISAMPLERCUBE);
  2038.         YY_BREAK
  2039. case 86:
  2040. YY_RULE_SETUP
  2041. #line 309 "glsl_lexer.ll"
  2042. KEYWORD(130, 300, 130, 0, ISAMPLER1DARRAY);
  2043.         YY_BREAK
  2044. case 87:
  2045. YY_RULE_SETUP
  2046. #line 310 "glsl_lexer.ll"
  2047. KEYWORD(130, 300, 130, 300, ISAMPLER2DARRAY);
  2048.         YY_BREAK
  2049. case 88:
  2050. YY_RULE_SETUP
  2051. #line 311 "glsl_lexer.ll"
  2052. KEYWORD(130, 300, 130, 0, USAMPLER1D);
  2053.         YY_BREAK
  2054. case 89:
  2055. YY_RULE_SETUP
  2056. #line 312 "glsl_lexer.ll"
  2057. KEYWORD(130, 300, 130, 300, USAMPLER2D);
  2058.         YY_BREAK
  2059. case 90:
  2060. YY_RULE_SETUP
  2061. #line 313 "glsl_lexer.ll"
  2062. KEYWORD(130, 300, 130, 300, USAMPLER3D);
  2063.         YY_BREAK
  2064. case 91:
  2065. YY_RULE_SETUP
  2066. #line 314 "glsl_lexer.ll"
  2067. KEYWORD(130, 300, 130, 300, USAMPLERCUBE);
  2068.         YY_BREAK
  2069. case 92:
  2070. YY_RULE_SETUP
  2071. #line 315 "glsl_lexer.ll"
  2072. KEYWORD(130, 300, 130, 0, USAMPLER1DARRAY);
  2073.         YY_BREAK
  2074. case 93:
  2075. YY_RULE_SETUP
  2076. #line 316 "glsl_lexer.ll"
  2077. KEYWORD(130, 300, 130, 300, USAMPLER2DARRAY);
  2078.         YY_BREAK
  2079. /* additional keywords in ARB_texture_multisample, included in GLSL 1.50 */
  2080. /* these are reserved but not defined in GLSL 3.00 */
  2081. case 94:
  2082. YY_RULE_SETUP
  2083. #line 320 "glsl_lexer.ll"
  2084. KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, SAMPLER2DMS);
  2085.         YY_BREAK
  2086. case 95:
  2087. YY_RULE_SETUP
  2088. #line 321 "glsl_lexer.ll"
  2089. KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, ISAMPLER2DMS);
  2090.         YY_BREAK
  2091. case 96:
  2092. YY_RULE_SETUP
  2093. #line 322 "glsl_lexer.ll"
  2094. KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, USAMPLER2DMS);
  2095.         YY_BREAK
  2096. case 97:
  2097. YY_RULE_SETUP
  2098. #line 323 "glsl_lexer.ll"
  2099. KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, SAMPLER2DMSARRAY);
  2100.         YY_BREAK
  2101. case 98:
  2102. YY_RULE_SETUP
  2103. #line 324 "glsl_lexer.ll"
  2104. KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, ISAMPLER2DMSARRAY);
  2105.         YY_BREAK
  2106. case 99:
  2107. YY_RULE_SETUP
  2108. #line 325 "glsl_lexer.ll"
  2109. KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, USAMPLER2DMSARRAY);
  2110.         YY_BREAK
  2111. /* keywords available with ARB_texture_cube_map_array_enable extension on desktop GLSL */
  2112. case 100:
  2113. YY_RULE_SETUP
  2114. #line 328 "glsl_lexer.ll"
  2115. KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, SAMPLERCUBEARRAY);
  2116.         YY_BREAK
  2117. case 101:
  2118. YY_RULE_SETUP
  2119. #line 329 "glsl_lexer.ll"
  2120. KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, ISAMPLERCUBEARRAY);
  2121.         YY_BREAK
  2122. case 102:
  2123. YY_RULE_SETUP
  2124. #line 330 "glsl_lexer.ll"
  2125. KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, USAMPLERCUBEARRAY);
  2126.         YY_BREAK
  2127. case 103:
  2128. YY_RULE_SETUP
  2129. #line 331 "glsl_lexer.ll"
  2130. KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, SAMPLERCUBEARRAYSHADOW);
  2131.         YY_BREAK
  2132. case 104:
  2133. YY_RULE_SETUP
  2134. #line 333 "glsl_lexer.ll"
  2135. {
  2136.                           if (yyextra->OES_EGL_image_external_enable)
  2137.                              return SAMPLEREXTERNALOES;
  2138.                           else
  2139.                              return IDENTIFIER;
  2140.                 }
  2141.         YY_BREAK
  2142. case 105:
  2143. YY_RULE_SETUP
  2144. #line 341 "glsl_lexer.ll"
  2145. return STRUCT;
  2146.         YY_BREAK
  2147. case 106:
  2148. YY_RULE_SETUP
  2149. #line 342 "glsl_lexer.ll"
  2150. return VOID_TOK;
  2151.         YY_BREAK
  2152. case 107:
  2153. YY_RULE_SETUP
  2154. #line 344 "glsl_lexer.ll"
  2155. {
  2156.                   if ((yyextra->is_version(140, 300))
  2157.                       || yyextra->AMD_conservative_depth_enable
  2158.                       || yyextra->ARB_conservative_depth_enable
  2159.                       || yyextra->ARB_explicit_attrib_location_enable
  2160.                       || yyextra->ARB_uniform_buffer_object_enable
  2161.                       || yyextra->ARB_fragment_coord_conventions_enable
  2162.                       || yyextra->ARB_shading_language_420pack_enable) {
  2163.                       return LAYOUT_TOK;
  2164.                    } else {
  2165.                       yylval->identifier = strdup(yytext);
  2166.                       return classify_identifier(yyextra, yytext);
  2167.                    }
  2168.                 }
  2169.         YY_BREAK
  2170. case 108:
  2171. YY_RULE_SETUP
  2172. #line 359 "glsl_lexer.ll"
  2173. return INC_OP;
  2174.         YY_BREAK
  2175. case 109:
  2176. YY_RULE_SETUP
  2177. #line 360 "glsl_lexer.ll"
  2178. return DEC_OP;
  2179.         YY_BREAK
  2180. case 110:
  2181. YY_RULE_SETUP
  2182. #line 361 "glsl_lexer.ll"
  2183. return LE_OP;
  2184.         YY_BREAK
  2185. case 111:
  2186. YY_RULE_SETUP
  2187. #line 362 "glsl_lexer.ll"
  2188. return GE_OP;
  2189.         YY_BREAK
  2190. case 112:
  2191. YY_RULE_SETUP
  2192. #line 363 "glsl_lexer.ll"
  2193. return EQ_OP;
  2194.         YY_BREAK
  2195. case 113:
  2196. YY_RULE_SETUP
  2197. #line 364 "glsl_lexer.ll"
  2198. return NE_OP;
  2199.         YY_BREAK
  2200. case 114:
  2201. YY_RULE_SETUP
  2202. #line 365 "glsl_lexer.ll"
  2203. return AND_OP;
  2204.         YY_BREAK
  2205. case 115:
  2206. YY_RULE_SETUP
  2207. #line 366 "glsl_lexer.ll"
  2208. return OR_OP;
  2209.         YY_BREAK
  2210. case 116:
  2211. YY_RULE_SETUP
  2212. #line 367 "glsl_lexer.ll"
  2213. return XOR_OP;
  2214.         YY_BREAK
  2215. case 117:
  2216. YY_RULE_SETUP
  2217. #line 368 "glsl_lexer.ll"
  2218. return LEFT_OP;
  2219.         YY_BREAK
  2220. case 118:
  2221. YY_RULE_SETUP
  2222. #line 369 "glsl_lexer.ll"
  2223. return RIGHT_OP;
  2224.         YY_BREAK
  2225. case 119:
  2226. YY_RULE_SETUP
  2227. #line 371 "glsl_lexer.ll"
  2228. return MUL_ASSIGN;
  2229.         YY_BREAK
  2230. case 120:
  2231. YY_RULE_SETUP
  2232. #line 372 "glsl_lexer.ll"
  2233. return DIV_ASSIGN;
  2234.         YY_BREAK
  2235. case 121:
  2236. YY_RULE_SETUP
  2237. #line 373 "glsl_lexer.ll"
  2238. return ADD_ASSIGN;
  2239.         YY_BREAK
  2240. case 122:
  2241. YY_RULE_SETUP
  2242. #line 374 "glsl_lexer.ll"
  2243. return MOD_ASSIGN;
  2244.         YY_BREAK
  2245. case 123:
  2246. YY_RULE_SETUP
  2247. #line 375 "glsl_lexer.ll"
  2248. return LEFT_ASSIGN;
  2249.         YY_BREAK
  2250. case 124:
  2251. YY_RULE_SETUP
  2252. #line 376 "glsl_lexer.ll"
  2253. return RIGHT_ASSIGN;
  2254.         YY_BREAK
  2255. case 125:
  2256. YY_RULE_SETUP
  2257. #line 377 "glsl_lexer.ll"
  2258. return AND_ASSIGN;
  2259.         YY_BREAK
  2260. case 126:
  2261. YY_RULE_SETUP
  2262. #line 378 "glsl_lexer.ll"
  2263. return XOR_ASSIGN;
  2264.         YY_BREAK
  2265. case 127:
  2266. YY_RULE_SETUP
  2267. #line 379 "glsl_lexer.ll"
  2268. return OR_ASSIGN;
  2269.         YY_BREAK
  2270. case 128:
  2271. YY_RULE_SETUP
  2272. #line 380 "glsl_lexer.ll"
  2273. return SUB_ASSIGN;
  2274.         YY_BREAK
  2275. case 129:
  2276. YY_RULE_SETUP
  2277. #line 382 "glsl_lexer.ll"
  2278. {
  2279.                             return LITERAL_INTEGER(10);
  2280.                         }
  2281.         YY_BREAK
  2282. case 130:
  2283. YY_RULE_SETUP
  2284. #line 385 "glsl_lexer.ll"
  2285. {
  2286.                             return LITERAL_INTEGER(16);
  2287.                         }
  2288.         YY_BREAK
  2289. case 131:
  2290. YY_RULE_SETUP
  2291. #line 388 "glsl_lexer.ll"
  2292. {
  2293.                             return LITERAL_INTEGER(8);
  2294.                         }
  2295.         YY_BREAK
  2296. case 132:
  2297. YY_RULE_SETUP
  2298. #line 392 "glsl_lexer.ll"
  2299. {
  2300.                             yylval->real = glsl_strtof(yytext, NULL);
  2301.                             return FLOATCONSTANT;
  2302.                         }
  2303.         YY_BREAK
  2304. case 133:
  2305. YY_RULE_SETUP
  2306. #line 396 "glsl_lexer.ll"
  2307. {
  2308.                             yylval->real = glsl_strtof(yytext, NULL);
  2309.                             return FLOATCONSTANT;
  2310.                         }
  2311.         YY_BREAK
  2312. case 134:
  2313. YY_RULE_SETUP
  2314. #line 400 "glsl_lexer.ll"
  2315. {
  2316.                             yylval->real = glsl_strtof(yytext, NULL);
  2317.                             return FLOATCONSTANT;
  2318.                         }
  2319.         YY_BREAK
  2320. case 135:
  2321. YY_RULE_SETUP
  2322. #line 404 "glsl_lexer.ll"
  2323. {
  2324.                             yylval->real = glsl_strtof(yytext, NULL);
  2325.                             return FLOATCONSTANT;
  2326.                         }
  2327.         YY_BREAK
  2328. case 136:
  2329. YY_RULE_SETUP
  2330. #line 408 "glsl_lexer.ll"
  2331. {
  2332.                             yylval->real = glsl_strtof(yytext, NULL);
  2333.                             return FLOATCONSTANT;
  2334.                         }
  2335.         YY_BREAK
  2336. case 137:
  2337. YY_RULE_SETUP
  2338. #line 413 "glsl_lexer.ll"
  2339. {
  2340.                             yylval->n = 1;
  2341.                             return BOOLCONSTANT;
  2342.                         }
  2343.         YY_BREAK
  2344. case 138:
  2345. YY_RULE_SETUP
  2346. #line 417 "glsl_lexer.ll"
  2347. {
  2348.                             yylval->n = 0;
  2349.                             return BOOLCONSTANT;
  2350.                         }
  2351.         YY_BREAK
  2352. /* Reserved words in GLSL 1.10. */
  2353. case 139:
  2354. YY_RULE_SETUP
  2355. #line 424 "glsl_lexer.ll"
  2356. KEYWORD(110, 100, 0, 0, ASM);
  2357.         YY_BREAK
  2358. case 140:
  2359. YY_RULE_SETUP
  2360. #line 425 "glsl_lexer.ll"
  2361. KEYWORD(110, 100, 0, 0, CLASS);
  2362.         YY_BREAK
  2363. case 141:
  2364. YY_RULE_SETUP
  2365. #line 426 "glsl_lexer.ll"
  2366. KEYWORD(110, 100, 0, 0, UNION);
  2367.         YY_BREAK
  2368. case 142:
  2369. YY_RULE_SETUP
  2370. #line 427 "glsl_lexer.ll"
  2371. KEYWORD(110, 100, 0, 0, ENUM);
  2372.         YY_BREAK
  2373. case 143:
  2374. YY_RULE_SETUP
  2375. #line 428 "glsl_lexer.ll"
  2376. KEYWORD(110, 100, 0, 0, TYPEDEF);
  2377.         YY_BREAK
  2378. case 144:
  2379. YY_RULE_SETUP
  2380. #line 429 "glsl_lexer.ll"
  2381. KEYWORD(110, 100, 0, 0, TEMPLATE);
  2382.         YY_BREAK
  2383. case 145:
  2384. YY_RULE_SETUP
  2385. #line 430 "glsl_lexer.ll"
  2386. KEYWORD(110, 100, 0, 0, THIS);
  2387.         YY_BREAK
  2388. case 146:
  2389. YY_RULE_SETUP
  2390. #line 431 "glsl_lexer.ll"
  2391. KEYWORD_WITH_ALT(110, 100, 140, 300, yyextra->ARB_uniform_buffer_object_enable, PACKED_TOK);
  2392.         YY_BREAK
  2393. case 147:
  2394. YY_RULE_SETUP
  2395. #line 432 "glsl_lexer.ll"
  2396. KEYWORD(110, 100, 0, 0, GOTO);
  2397.         YY_BREAK
  2398. case 148:
  2399. YY_RULE_SETUP
  2400. #line 433 "glsl_lexer.ll"
  2401. KEYWORD(110, 100, 130, 300, SWITCH);
  2402.         YY_BREAK
  2403. case 149:
  2404. YY_RULE_SETUP
  2405. #line 434 "glsl_lexer.ll"
  2406. KEYWORD(110, 100, 130, 300, DEFAULT);
  2407.         YY_BREAK
  2408. case 150:
  2409. YY_RULE_SETUP
  2410. #line 435 "glsl_lexer.ll"
  2411. KEYWORD(110, 100, 0, 0, INLINE_TOK);
  2412.         YY_BREAK
  2413. case 151:
  2414. YY_RULE_SETUP
  2415. #line 436 "glsl_lexer.ll"
  2416. KEYWORD(110, 100, 0, 0, NOINLINE);
  2417.         YY_BREAK
  2418. case 152:
  2419. YY_RULE_SETUP
  2420. #line 437 "glsl_lexer.ll"
  2421. KEYWORD(110, 100, 0, 0, VOLATILE);
  2422.         YY_BREAK
  2423. case 153:
  2424. YY_RULE_SETUP
  2425. #line 438 "glsl_lexer.ll"
  2426. KEYWORD(110, 100, 0, 0, PUBLIC_TOK);
  2427.         YY_BREAK
  2428. case 154:
  2429. YY_RULE_SETUP
  2430. #line 439 "glsl_lexer.ll"
  2431. KEYWORD(110, 100, 0, 0, STATIC);
  2432.         YY_BREAK
  2433. case 155:
  2434. YY_RULE_SETUP
  2435. #line 440 "glsl_lexer.ll"
  2436. KEYWORD(110, 100, 0, 0, EXTERN);
  2437.         YY_BREAK
  2438. case 156:
  2439. YY_RULE_SETUP
  2440. #line 441 "glsl_lexer.ll"
  2441. KEYWORD(110, 100, 0, 0, EXTERNAL);
  2442.         YY_BREAK
  2443. case 157:
  2444. YY_RULE_SETUP
  2445. #line 442 "glsl_lexer.ll"
  2446. KEYWORD(110, 100, 0, 0, INTERFACE);
  2447.         YY_BREAK
  2448. case 158:
  2449. YY_RULE_SETUP
  2450. #line 443 "glsl_lexer.ll"
  2451. KEYWORD(110, 100, 0, 0, LONG_TOK);
  2452.         YY_BREAK
  2453. case 159:
  2454. YY_RULE_SETUP
  2455. #line 444 "glsl_lexer.ll"
  2456. KEYWORD(110, 100, 0, 0, SHORT_TOK);
  2457.         YY_BREAK
  2458. case 160:
  2459. YY_RULE_SETUP
  2460. #line 445 "glsl_lexer.ll"
  2461. KEYWORD(110, 100, 400, 0, DOUBLE_TOK);
  2462.         YY_BREAK
  2463. case 161:
  2464. YY_RULE_SETUP
  2465. #line 446 "glsl_lexer.ll"
  2466. KEYWORD(110, 100, 0, 0, HALF);
  2467.         YY_BREAK
  2468. case 162:
  2469. YY_RULE_SETUP
  2470. #line 447 "glsl_lexer.ll"
  2471. KEYWORD(110, 100, 0, 0, FIXED_TOK);
  2472.         YY_BREAK
  2473. case 163:
  2474. YY_RULE_SETUP
  2475. #line 448 "glsl_lexer.ll"
  2476. KEYWORD(110, 100, 0, 0, UNSIGNED);
  2477.         YY_BREAK
  2478. case 164:
  2479. YY_RULE_SETUP
  2480. #line 449 "glsl_lexer.ll"
  2481. KEYWORD(110, 100, 0, 0, INPUT_TOK);
  2482.         YY_BREAK
  2483. case 165:
  2484. YY_RULE_SETUP
  2485. #line 450 "glsl_lexer.ll"
  2486. KEYWORD(110, 100, 0, 0, OUTPUT);
  2487.         YY_BREAK
  2488. case 166:
  2489. YY_RULE_SETUP
  2490. #line 451 "glsl_lexer.ll"
  2491. KEYWORD(110, 100, 0, 0, HVEC2);
  2492.         YY_BREAK
  2493. case 167:
  2494. YY_RULE_SETUP
  2495. #line 452 "glsl_lexer.ll"
  2496. KEYWORD(110, 100, 0, 0, HVEC3);
  2497.         YY_BREAK
  2498. case 168:
  2499. YY_RULE_SETUP
  2500. #line 453 "glsl_lexer.ll"
  2501. KEYWORD(110, 100, 0, 0, HVEC4);
  2502.         YY_BREAK
  2503. case 169:
  2504. YY_RULE_SETUP
  2505. #line 454 "glsl_lexer.ll"
  2506. KEYWORD(110, 100, 400, 0, DVEC2);
  2507.         YY_BREAK
  2508. case 170:
  2509. YY_RULE_SETUP
  2510. #line 455 "glsl_lexer.ll"
  2511. KEYWORD(110, 100, 400, 0, DVEC3);
  2512.         YY_BREAK
  2513. case 171:
  2514. YY_RULE_SETUP
  2515. #line 456 "glsl_lexer.ll"
  2516. KEYWORD(110, 100, 400, 0, DVEC4);
  2517.         YY_BREAK
  2518. case 172:
  2519. YY_RULE_SETUP
  2520. #line 457 "glsl_lexer.ll"
  2521. KEYWORD(110, 100, 0, 0, FVEC2);
  2522.         YY_BREAK
  2523. case 173:
  2524. YY_RULE_SETUP
  2525. #line 458 "glsl_lexer.ll"
  2526. KEYWORD(110, 100, 0, 0, FVEC3);
  2527.         YY_BREAK
  2528. case 174:
  2529. YY_RULE_SETUP
  2530. #line 459 "glsl_lexer.ll"
  2531. KEYWORD(110, 100, 0, 0, FVEC4);
  2532.         YY_BREAK
  2533. case 175:
  2534. YY_RULE_SETUP
  2535. #line 460 "glsl_lexer.ll"
  2536. DEPRECATED_ES_KEYWORD(SAMPLER2DRECT);
  2537.         YY_BREAK
  2538. case 176:
  2539. YY_RULE_SETUP
  2540. #line 461 "glsl_lexer.ll"
  2541. KEYWORD(110, 100, 0, 0, SAMPLER3DRECT);
  2542.         YY_BREAK
  2543. case 177:
  2544. YY_RULE_SETUP
  2545. #line 462 "glsl_lexer.ll"
  2546. DEPRECATED_ES_KEYWORD(SAMPLER2DRECTSHADOW);
  2547.         YY_BREAK
  2548. case 178:
  2549. YY_RULE_SETUP
  2550. #line 463 "glsl_lexer.ll"
  2551. KEYWORD(110, 100, 0, 0, SIZEOF);
  2552.         YY_BREAK
  2553. case 179:
  2554. YY_RULE_SETUP
  2555. #line 464 "glsl_lexer.ll"
  2556. KEYWORD(110, 100, 0, 0, CAST);
  2557.         YY_BREAK
  2558. case 180:
  2559. YY_RULE_SETUP
  2560. #line 465 "glsl_lexer.ll"
  2561. KEYWORD(110, 100, 0, 0, NAMESPACE);
  2562.         YY_BREAK
  2563. case 181:
  2564. YY_RULE_SETUP
  2565. #line 466 "glsl_lexer.ll"
  2566. KEYWORD(110, 100, 0, 0, USING);
  2567.         YY_BREAK
  2568. /* Additional reserved words in GLSL 1.20. */
  2569. case 182:
  2570. YY_RULE_SETUP
  2571. #line 469 "glsl_lexer.ll"
  2572. KEYWORD(120, 100, 130, 100, LOWP);
  2573.         YY_BREAK
  2574. case 183:
  2575. YY_RULE_SETUP
  2576. #line 470 "glsl_lexer.ll"
  2577. KEYWORD(120, 100, 130, 100, MEDIUMP);
  2578.         YY_BREAK
  2579. case 184:
  2580. YY_RULE_SETUP
  2581. #line 471 "glsl_lexer.ll"
  2582. KEYWORD(120, 100, 130, 100, HIGHP);
  2583.         YY_BREAK
  2584. case 185:
  2585. YY_RULE_SETUP
  2586. #line 472 "glsl_lexer.ll"
  2587. KEYWORD(120, 100, 130, 100, PRECISION);
  2588.         YY_BREAK
  2589. /* Additional reserved words in GLSL 1.30. */
  2590. case 186:
  2591. YY_RULE_SETUP
  2592. #line 475 "glsl_lexer.ll"
  2593. KEYWORD(130, 300, 130, 300, CASE);
  2594.         YY_BREAK
  2595. case 187:
  2596. YY_RULE_SETUP
  2597. #line 476 "glsl_lexer.ll"
  2598. KEYWORD(130, 300, 0, 0, COMMON);
  2599.         YY_BREAK
  2600. case 188:
  2601. YY_RULE_SETUP
  2602. #line 477 "glsl_lexer.ll"
  2603. KEYWORD(130, 300, 0, 0, PARTITION);
  2604.         YY_BREAK
  2605. case 189:
  2606. YY_RULE_SETUP
  2607. #line 478 "glsl_lexer.ll"
  2608. KEYWORD(130, 300, 0, 0, ACTIVE);
  2609.         YY_BREAK
  2610. case 190:
  2611. YY_RULE_SETUP
  2612. #line 479 "glsl_lexer.ll"
  2613. KEYWORD(130, 100, 0, 0, SUPERP);
  2614.         YY_BREAK
  2615. case 191:
  2616. YY_RULE_SETUP
  2617. #line 480 "glsl_lexer.ll"
  2618. KEYWORD(130, 300, 140, 0, SAMPLERBUFFER);
  2619.         YY_BREAK
  2620. case 192:
  2621. YY_RULE_SETUP
  2622. #line 481 "glsl_lexer.ll"
  2623. KEYWORD(130, 300, 0, 0, FILTER);
  2624.         YY_BREAK
  2625. case 193:
  2626. YY_RULE_SETUP
  2627. #line 482 "glsl_lexer.ll"
  2628. KEYWORD(130, 300, 0, 0, IMAGE1D);
  2629.         YY_BREAK
  2630. case 194:
  2631. YY_RULE_SETUP
  2632. #line 483 "glsl_lexer.ll"
  2633. KEYWORD(130, 300, 0, 0, IMAGE2D);
  2634.         YY_BREAK
  2635. case 195:
  2636. YY_RULE_SETUP
  2637. #line 484 "glsl_lexer.ll"
  2638. KEYWORD(130, 300, 0, 0, IMAGE3D);
  2639.         YY_BREAK
  2640. case 196:
  2641. YY_RULE_SETUP
  2642. #line 485 "glsl_lexer.ll"
  2643. KEYWORD(130, 300, 0, 0, IMAGECUBE);
  2644.         YY_BREAK
  2645. case 197:
  2646. YY_RULE_SETUP
  2647. #line 486 "glsl_lexer.ll"
  2648. KEYWORD(130, 300, 0, 0, IIMAGE1D);
  2649.         YY_BREAK
  2650. case 198:
  2651. YY_RULE_SETUP
  2652. #line 487 "glsl_lexer.ll"
  2653. KEYWORD(130, 300, 0, 0, IIMAGE2D);
  2654.         YY_BREAK
  2655. case 199:
  2656. YY_RULE_SETUP
  2657. #line 488 "glsl_lexer.ll"
  2658. KEYWORD(130, 300, 0, 0, IIMAGE3D);
  2659.         YY_BREAK
  2660. case 200:
  2661. YY_RULE_SETUP
  2662. #line 489 "glsl_lexer.ll"
  2663. KEYWORD(130, 300, 0, 0, IIMAGECUBE);
  2664.         YY_BREAK
  2665. case 201:
  2666. YY_RULE_SETUP
  2667. #line 490 "glsl_lexer.ll"
  2668. KEYWORD(130, 300, 0, 0, UIMAGE1D);
  2669.         YY_BREAK
  2670. case 202:
  2671. YY_RULE_SETUP
  2672. #line 491 "glsl_lexer.ll"
  2673. KEYWORD(130, 300, 0, 0, UIMAGE2D);
  2674.         YY_BREAK
  2675. case 203:
  2676. YY_RULE_SETUP
  2677. #line 492 "glsl_lexer.ll"
  2678. KEYWORD(130, 300, 0, 0, UIMAGE3D);
  2679.         YY_BREAK
  2680. case 204:
  2681. YY_RULE_SETUP
  2682. #line 493 "glsl_lexer.ll"
  2683. KEYWORD(130, 300, 0, 0, UIMAGECUBE);
  2684.         YY_BREAK
  2685. case 205:
  2686. YY_RULE_SETUP
  2687. #line 494 "glsl_lexer.ll"
  2688. KEYWORD(130, 300, 0, 0, IMAGE1DARRAY);
  2689.         YY_BREAK
  2690. case 206:
  2691. YY_RULE_SETUP
  2692. #line 495 "glsl_lexer.ll"
  2693. KEYWORD(130, 300, 0, 0, IMAGE2DARRAY);
  2694.         YY_BREAK
  2695. case 207:
  2696. YY_RULE_SETUP
  2697. #line 496 "glsl_lexer.ll"
  2698. KEYWORD(130, 300, 0, 0, IIMAGE1DARRAY);
  2699.         YY_BREAK
  2700. case 208:
  2701. YY_RULE_SETUP
  2702. #line 497 "glsl_lexer.ll"
  2703. KEYWORD(130, 300, 0, 0, IIMAGE2DARRAY);
  2704.         YY_BREAK
  2705. case 209:
  2706. YY_RULE_SETUP
  2707. #line 498 "glsl_lexer.ll"
  2708. KEYWORD(130, 300, 0, 0, UIMAGE1DARRAY);
  2709.         YY_BREAK
  2710. case 210:
  2711. YY_RULE_SETUP
  2712. #line 499 "glsl_lexer.ll"
  2713. KEYWORD(130, 300, 0, 0, UIMAGE2DARRAY);
  2714.         YY_BREAK
  2715. case 211:
  2716. YY_RULE_SETUP
  2717. #line 500 "glsl_lexer.ll"
  2718. KEYWORD(130, 300, 0, 0, IMAGE1DSHADOW);
  2719.         YY_BREAK
  2720. case 212:
  2721. YY_RULE_SETUP
  2722. #line 501 "glsl_lexer.ll"
  2723. KEYWORD(130, 300, 0, 0, IMAGE2DSHADOW);
  2724.         YY_BREAK
  2725. case 213:
  2726. YY_RULE_SETUP
  2727. #line 502 "glsl_lexer.ll"
  2728. KEYWORD(130, 300, 0, 0, IMAGE1DARRAYSHADOW);
  2729.         YY_BREAK
  2730. case 214:
  2731. YY_RULE_SETUP
  2732. #line 503 "glsl_lexer.ll"
  2733. KEYWORD(130, 300, 0, 0, IMAGE2DARRAYSHADOW);
  2734.         YY_BREAK
  2735. case 215:
  2736. YY_RULE_SETUP
  2737. #line 504 "glsl_lexer.ll"
  2738. KEYWORD(130, 300, 0, 0, IMAGEBUFFER);
  2739.         YY_BREAK
  2740. case 216:
  2741. YY_RULE_SETUP
  2742. #line 505 "glsl_lexer.ll"
  2743. KEYWORD(130, 300, 0, 0, IIMAGEBUFFER);
  2744.         YY_BREAK
  2745. case 217:
  2746. YY_RULE_SETUP
  2747. #line 506 "glsl_lexer.ll"
  2748. KEYWORD(130, 300, 0, 0, UIMAGEBUFFER);
  2749.         YY_BREAK
  2750. case 218:
  2751. YY_RULE_SETUP
  2752. #line 507 "glsl_lexer.ll"
  2753. KEYWORD_WITH_ALT(130, 0, 140, 0, yyextra->ARB_uniform_buffer_object_enable && !yyextra->es_shader, ROW_MAJOR);
  2754.         YY_BREAK
  2755. /* Additional reserved words in GLSL 1.40 */
  2756. case 219:
  2757. YY_RULE_SETUP
  2758. #line 510 "glsl_lexer.ll"
  2759. KEYWORD(140, 300, 140, 0, ISAMPLER2DRECT);
  2760.         YY_BREAK
  2761. case 220:
  2762. YY_RULE_SETUP
  2763. #line 511 "glsl_lexer.ll"
  2764. KEYWORD(140, 300, 140, 0, USAMPLER2DRECT);
  2765.         YY_BREAK
  2766. case 221:
  2767. YY_RULE_SETUP
  2768. #line 512 "glsl_lexer.ll"
  2769. KEYWORD(140, 300, 140, 0, ISAMPLERBUFFER);
  2770.         YY_BREAK
  2771. case 222:
  2772. YY_RULE_SETUP
  2773. #line 513 "glsl_lexer.ll"
  2774. KEYWORD(140, 300, 140, 0, USAMPLERBUFFER);
  2775.         YY_BREAK
  2776. /* Additional reserved words in GLSL ES 3.00 */
  2777. case 223:
  2778. YY_RULE_SETUP
  2779. #line 516 "glsl_lexer.ll"
  2780. KEYWORD(0, 300, 0, 0, COHERENT);
  2781.         YY_BREAK
  2782. case 224:
  2783. YY_RULE_SETUP
  2784. #line 517 "glsl_lexer.ll"
  2785. KEYWORD(0, 300, 0, 0, RESTRICT);
  2786.         YY_BREAK
  2787. case 225:
  2788. YY_RULE_SETUP
  2789. #line 518 "glsl_lexer.ll"
  2790. KEYWORD(0, 300, 0, 0, READONLY);
  2791.         YY_BREAK
  2792. case 226:
  2793. YY_RULE_SETUP
  2794. #line 519 "glsl_lexer.ll"
  2795. KEYWORD(0, 300, 0, 0, WRITEONLY);
  2796.         YY_BREAK
  2797. case 227:
  2798. YY_RULE_SETUP
  2799. #line 520 "glsl_lexer.ll"
  2800. KEYWORD(0, 300, 0, 0, RESOURCE);
  2801.         YY_BREAK
  2802. case 228:
  2803. YY_RULE_SETUP
  2804. #line 521 "glsl_lexer.ll"
  2805. KEYWORD(0, 300, 0, 0, ATOMIC_UINT);
  2806.         YY_BREAK
  2807. case 229:
  2808. YY_RULE_SETUP
  2809. #line 522 "glsl_lexer.ll"
  2810. KEYWORD(0, 300, 0, 0, PATCH);
  2811.         YY_BREAK
  2812. case 230:
  2813. YY_RULE_SETUP
  2814. #line 523 "glsl_lexer.ll"
  2815. KEYWORD(0, 300, 0, 0, SAMPLE);
  2816.         YY_BREAK
  2817. case 231:
  2818. YY_RULE_SETUP
  2819. #line 524 "glsl_lexer.ll"
  2820. KEYWORD(0, 300, 0, 0, SUBROUTINE);
  2821.         YY_BREAK
  2822. case 232:
  2823. YY_RULE_SETUP
  2824. #line 527 "glsl_lexer.ll"
  2825. {
  2826.                             struct _mesa_glsl_parse_state *state = yyextra;
  2827.                             void *ctx = state; 
  2828.                             yylval->identifier = ralloc_strdup(ctx, yytext);
  2829.                             return classify_identifier(state, yytext);
  2830.                         }
  2831.         YY_BREAK
  2832. case 233:
  2833. YY_RULE_SETUP
  2834. #line 534 "glsl_lexer.ll"
  2835. { return yytext[0]; }
  2836.         YY_BREAK
  2837. case 234:
  2838. YY_RULE_SETUP
  2839. #line 536 "glsl_lexer.ll"
  2840. ECHO;
  2841.         YY_BREAK
  2842. #line 2843 "glsl_lexer.cpp"
  2843. case YY_STATE_EOF(INITIAL):
  2844. case YY_STATE_EOF(PP):
  2845. case YY_STATE_EOF(PRAGMA):
  2846.         yyterminate();
  2847.  
  2848.         case YY_END_OF_BUFFER:
  2849.                 {
  2850.                 /* Amount of text matched not including the EOB char. */
  2851.                 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
  2852.  
  2853.                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
  2854.                 *yy_cp = yyg->yy_hold_char;
  2855.                 YY_RESTORE_YY_MORE_OFFSET
  2856.  
  2857.                 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
  2858.                         {
  2859.                         /* We're scanning a new file or input source.  It's
  2860.                          * possible that this happened because the user
  2861.                          * just pointed yyin at a new source and called
  2862.                          * _mesa_glsl_lexer_lex().  If so, then we have to assure
  2863.                          * consistency between YY_CURRENT_BUFFER and our
  2864.                          * globals.  Here is the right place to do so, because
  2865.                          * this is the first action (other than possibly a
  2866.                          * back-up) that will match for the new input source.
  2867.                          */
  2868.                         yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  2869.                         YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
  2870.                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
  2871.                         }
  2872.  
  2873.                 /* Note that here we test for yy_c_buf_p "<=" to the position
  2874.                  * of the first EOB in the buffer, since yy_c_buf_p will
  2875.                  * already have been incremented past the NUL character
  2876.                  * (since all states make transitions on EOB to the
  2877.                  * end-of-buffer state).  Contrast this with the test
  2878.                  * in input().
  2879.                  */
  2880.                 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
  2881.                         { /* This was really a NUL. */
  2882.                         yy_state_type yy_next_state;
  2883.  
  2884.                         yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
  2885.  
  2886.                         yy_current_state = yy_get_previous_state( yyscanner );
  2887.  
  2888.                         /* Okay, we're now positioned to make the NUL
  2889.                          * transition.  We couldn't have
  2890.                          * yy_get_previous_state() go ahead and do it
  2891.                          * for us because it doesn't know how to deal
  2892.                          * with the possibility of jamming (and we don't
  2893.                          * want to build jamming into it because then it
  2894.                          * will run more slowly).
  2895.                          */
  2896.  
  2897.                         yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
  2898.  
  2899.                         yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  2900.  
  2901.                         if ( yy_next_state )
  2902.                                 {
  2903.                                 /* Consume the NUL. */
  2904.                                 yy_cp = ++yyg->yy_c_buf_p;
  2905.                                 yy_current_state = yy_next_state;
  2906.                                 goto yy_match;
  2907.                                 }
  2908.  
  2909.                         else
  2910.                                 {
  2911.                                 yy_cp = yyg->yy_last_accepting_cpos;
  2912.                                 yy_current_state = yyg->yy_last_accepting_state;
  2913.                                 goto yy_find_action;
  2914.                                 }
  2915.                         }
  2916.  
  2917.                 else switch ( yy_get_next_buffer( yyscanner ) )
  2918.                         {
  2919.                         case EOB_ACT_END_OF_FILE:
  2920.                                 {
  2921.                                 yyg->yy_did_buffer_switch_on_eof = 0;
  2922.  
  2923.                                 if ( _mesa_glsl_lexer_wrap(yyscanner ) )
  2924.                                         {
  2925.                                         /* Note: because we've taken care in
  2926.                                          * yy_get_next_buffer() to have set up
  2927.                                          * yytext, we can now set up
  2928.                                          * yy_c_buf_p so that if some total
  2929.                                          * hoser (like flex itself) wants to
  2930.                                          * call the scanner after we return the
  2931.                                          * YY_NULL, it'll still work - another
  2932.                                          * YY_NULL will get returned.
  2933.                                          */
  2934.                                         yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
  2935.  
  2936.                                         yy_act = YY_STATE_EOF(YY_START);
  2937.                                         goto do_action;
  2938.                                         }
  2939.  
  2940.                                 else
  2941.                                         {
  2942.                                         if ( ! yyg->yy_did_buffer_switch_on_eof )
  2943.                                                 YY_NEW_FILE;
  2944.                                         }
  2945.                                 break;
  2946.                                 }
  2947.  
  2948.                         case EOB_ACT_CONTINUE_SCAN:
  2949.                                 yyg->yy_c_buf_p =
  2950.                                         yyg->yytext_ptr + yy_amount_of_matched_text;
  2951.  
  2952.                                 yy_current_state = yy_get_previous_state( yyscanner );
  2953.  
  2954.                                 yy_cp = yyg->yy_c_buf_p;
  2955.                                 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  2956.                                 goto yy_match;
  2957.  
  2958.                         case EOB_ACT_LAST_MATCH:
  2959.                                 yyg->yy_c_buf_p =
  2960.                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
  2961.  
  2962.                                 yy_current_state = yy_get_previous_state( yyscanner );
  2963.  
  2964.                                 yy_cp = yyg->yy_c_buf_p;
  2965.                                 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  2966.                                 goto yy_find_action;
  2967.                         }
  2968.                 break;
  2969.                 }
  2970.  
  2971.         default:
  2972.                 YY_FATAL_ERROR(
  2973.                         "fatal flex scanner internal error--no action found" );
  2974.         } /* end of action switch */
  2975.                 } /* end of scanning one token */
  2976. } /* end of _mesa_glsl_lexer_lex */
  2977.  
  2978. /* yy_get_next_buffer - try to read in a new buffer
  2979.  *
  2980.  * Returns a code representing an action:
  2981.  *      EOB_ACT_LAST_MATCH -
  2982.  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  2983.  *      EOB_ACT_END_OF_FILE - end of file
  2984.  */
  2985. static int yy_get_next_buffer (yyscan_t yyscanner)
  2986. {
  2987.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2988.         register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
  2989.         register char *source = yyg->yytext_ptr;
  2990.         register int number_to_move, i;
  2991.         int ret_val;
  2992.  
  2993.         if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
  2994.                 YY_FATAL_ERROR(
  2995.                 "fatal flex scanner internal error--end of buffer missed" );
  2996.  
  2997.         if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
  2998.                 { /* Don't try to fill the buffer, so this is an EOF. */
  2999.                 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
  3000.                         {
  3001.                         /* We matched a single character, the EOB, so
  3002.                          * treat this as a final EOF.
  3003.                          */
  3004.                         return EOB_ACT_END_OF_FILE;
  3005.                         }
  3006.  
  3007.                 else
  3008.                         {
  3009.                         /* We matched some text prior to the EOB, first
  3010.                          * process it.
  3011.                          */
  3012.                         return EOB_ACT_LAST_MATCH;
  3013.                         }
  3014.                 }
  3015.  
  3016.         /* Try to read more data. */
  3017.  
  3018.         /* First move last chars to start of buffer. */
  3019.         number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
  3020.  
  3021.         for ( i = 0; i < number_to_move; ++i )
  3022.                 *(dest++) = *(source++);
  3023.  
  3024.         if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
  3025.                 /* don't do the read, it's not guaranteed to return an EOF,
  3026.                  * just force an EOF
  3027.                  */
  3028.                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
  3029.  
  3030.         else
  3031.                 {
  3032.                         int num_to_read =
  3033.                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
  3034.  
  3035.                 while ( num_to_read <= 0 )
  3036.                         { /* Not enough room in the buffer - grow it. */
  3037.  
  3038.                         /* just a shorter name for the current buffer */
  3039.                         YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
  3040.  
  3041.                         int yy_c_buf_p_offset =
  3042.                                 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
  3043.  
  3044.                         if ( b->yy_is_our_buffer )
  3045.                                 {
  3046.                                 int new_size = b->yy_buf_size * 2;
  3047.  
  3048.                                 if ( new_size <= 0 )
  3049.                                         b->yy_buf_size += b->yy_buf_size / 8;
  3050.                                 else
  3051.                                         b->yy_buf_size *= 2;
  3052.  
  3053.                                 b->yy_ch_buf = (char *)
  3054.                                         /* Include room in for 2 EOB chars. */
  3055.                                         _mesa_glsl_lexer_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
  3056.                                 }
  3057.                         else
  3058.                                 /* Can't grow it, we don't own it. */
  3059.                                 b->yy_ch_buf = 0;
  3060.  
  3061.                         if ( ! b->yy_ch_buf )
  3062.                                 YY_FATAL_ERROR(
  3063.                                 "fatal error - scanner input buffer overflow" );
  3064.  
  3065.                         yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
  3066.  
  3067.                         num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
  3068.                                                 number_to_move - 1;
  3069.  
  3070.                         }
  3071.  
  3072.                 if ( num_to_read > YY_READ_BUF_SIZE )
  3073.                         num_to_read = YY_READ_BUF_SIZE;
  3074.  
  3075.                 /* Read in more data. */
  3076.                 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
  3077.                         yyg->yy_n_chars, (size_t) num_to_read );
  3078.  
  3079.                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
  3080.                 }
  3081.  
  3082.         if ( yyg->yy_n_chars == 0 )
  3083.                 {
  3084.                 if ( number_to_move == YY_MORE_ADJ )
  3085.                         {
  3086.                         ret_val = EOB_ACT_END_OF_FILE;
  3087.                         _mesa_glsl_lexer_restart(yyin  ,yyscanner);
  3088.                         }
  3089.  
  3090.                 else
  3091.                         {
  3092.                         ret_val = EOB_ACT_LAST_MATCH;
  3093.                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
  3094.                                 YY_BUFFER_EOF_PENDING;
  3095.                         }
  3096.                 }
  3097.  
  3098.         else
  3099.                 ret_val = EOB_ACT_CONTINUE_SCAN;
  3100.  
  3101.         if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
  3102.                 /* Extend the array by 50%, plus the number we really need. */
  3103.                 yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
  3104.                 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) _mesa_glsl_lexer_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
  3105.                 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
  3106.                         YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
  3107.         }
  3108.  
  3109.         yyg->yy_n_chars += number_to_move;
  3110.         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  3111.         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  3112.  
  3113.         yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
  3114.  
  3115.         return ret_val;
  3116. }
  3117.  
  3118. /* yy_get_previous_state - get the state just before the EOB char was reached */
  3119.  
  3120.     static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
  3121. {
  3122.         register yy_state_type yy_current_state;
  3123.         register char *yy_cp;
  3124.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3125.  
  3126.         yy_current_state = yyg->yy_start;
  3127.         yy_current_state += YY_AT_BOL();
  3128.  
  3129.         for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
  3130.                 {
  3131.                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
  3132.                 if ( yy_accept[yy_current_state] )
  3133.                         {
  3134.                         yyg->yy_last_accepting_state = yy_current_state;
  3135.                         yyg->yy_last_accepting_cpos = yy_cp;
  3136.                         }
  3137.                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  3138.                         {
  3139.                         yy_current_state = (int) yy_def[yy_current_state];
  3140.                         if ( yy_current_state >= 960 )
  3141.                                 yy_c = yy_meta[(unsigned int) yy_c];
  3142.                         }
  3143.                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  3144.                 }
  3145.  
  3146.         return yy_current_state;
  3147. }
  3148.  
  3149. /* yy_try_NUL_trans - try to make a transition on the NUL character
  3150.  *
  3151.  * synopsis
  3152.  *      next_state = yy_try_NUL_trans( current_state );
  3153.  */
  3154.     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state , yyscan_t yyscanner)
  3155. {
  3156.         register int yy_is_jam;
  3157.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
  3158.         register char *yy_cp = yyg->yy_c_buf_p;
  3159.  
  3160.         register YY_CHAR yy_c = 1;
  3161.         if ( yy_accept[yy_current_state] )
  3162.                 {
  3163.                 yyg->yy_last_accepting_state = yy_current_state;
  3164.                 yyg->yy_last_accepting_cpos = yy_cp;
  3165.                 }
  3166.         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  3167.                 {
  3168.                 yy_current_state = (int) yy_def[yy_current_state];
  3169.                 if ( yy_current_state >= 960 )
  3170.                         yy_c = yy_meta[(unsigned int) yy_c];
  3171.                 }
  3172.         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  3173.         yy_is_jam = (yy_current_state == 959);
  3174.  
  3175.         return yy_is_jam ? 0 : yy_current_state;
  3176. }
  3177.  
  3178. #ifndef YY_NO_INPUT
  3179. #ifdef __cplusplus
  3180.     static int yyinput (yyscan_t yyscanner)
  3181. #else
  3182.     static int input  (yyscan_t yyscanner)
  3183. #endif
  3184.  
  3185. {
  3186.         int c;
  3187.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3188.  
  3189.         *yyg->yy_c_buf_p = yyg->yy_hold_char;
  3190.  
  3191.         if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  3192.                 {
  3193.                 /* yy_c_buf_p now points to the character we want to return.
  3194.                  * If this occurs *before* the EOB characters, then it's a
  3195.                  * valid NUL; if not, then we've hit the end of the buffer.
  3196.                  */
  3197.                 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
  3198.                         /* This was really a NUL. */
  3199.                         *yyg->yy_c_buf_p = '\0';
  3200.  
  3201.                 else
  3202.                         { /* need more input */
  3203.                         int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
  3204.                         ++yyg->yy_c_buf_p;
  3205.  
  3206.                         switch ( yy_get_next_buffer( yyscanner ) )
  3207.                                 {
  3208.                                 case EOB_ACT_LAST_MATCH:
  3209.                                         /* This happens because yy_g_n_b()
  3210.                                          * sees that we've accumulated a
  3211.                                          * token and flags that we need to
  3212.                                          * try matching the token before
  3213.                                          * proceeding.  But for input(),
  3214.                                          * there's no matching to consider.
  3215.                                          * So convert the EOB_ACT_LAST_MATCH
  3216.                                          * to EOB_ACT_END_OF_FILE.
  3217.                                          */
  3218.  
  3219.                                         /* Reset buffer status. */
  3220.                                         _mesa_glsl_lexer_restart(yyin ,yyscanner);
  3221.  
  3222.                                         /*FALLTHROUGH*/
  3223.  
  3224.                                 case EOB_ACT_END_OF_FILE:
  3225.                                         {
  3226.                                         if ( _mesa_glsl_lexer_wrap(yyscanner ) )
  3227.                                                 return EOF;
  3228.  
  3229.                                         if ( ! yyg->yy_did_buffer_switch_on_eof )
  3230.                                                 YY_NEW_FILE;
  3231. #ifdef __cplusplus
  3232.                                         return yyinput(yyscanner);
  3233. #else
  3234.                                         return input(yyscanner);
  3235. #endif
  3236.                                         }
  3237.  
  3238.                                 case EOB_ACT_CONTINUE_SCAN:
  3239.                                         yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
  3240.                                         break;
  3241.                                 }
  3242.                         }
  3243.                 }
  3244.  
  3245.         c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
  3246.         *yyg->yy_c_buf_p = '\0';        /* preserve yytext */
  3247.         yyg->yy_hold_char = *++yyg->yy_c_buf_p;
  3248.  
  3249.         YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
  3250.  
  3251.         return c;
  3252. }
  3253. #endif  /* ifndef YY_NO_INPUT */
  3254.  
  3255. /** Immediately switch to a different input stream.
  3256.  * @param input_file A readable stream.
  3257.  * @param yyscanner The scanner object.
  3258.  * @note This function does not reset the start condition to @c INITIAL .
  3259.  */
  3260.     void _mesa_glsl_lexer_restart  (FILE * input_file , yyscan_t yyscanner)
  3261. {
  3262.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3263.  
  3264.         if ( ! YY_CURRENT_BUFFER ){
  3265.         _mesa_glsl_lexer_ensure_buffer_stack (yyscanner);
  3266.                 YY_CURRENT_BUFFER_LVALUE =
  3267.             _mesa_glsl_lexer__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
  3268.         }
  3269.  
  3270.         _mesa_glsl_lexer__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
  3271.         _mesa_glsl_lexer__load_buffer_state(yyscanner );
  3272. }
  3273.  
  3274. /** Switch to a different input buffer.
  3275.  * @param new_buffer The new input buffer.
  3276.  * @param yyscanner The scanner object.
  3277.  */
  3278.     void _mesa_glsl_lexer__switch_to_buffer  (YY_BUFFER_STATE  new_buffer , yyscan_t yyscanner)
  3279. {
  3280.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3281.  
  3282.         /* TODO. We should be able to replace this entire function body
  3283.          * with
  3284.          *              _mesa_glsl_lexer_pop_buffer_state();
  3285.          *              _mesa_glsl_lexer_push_buffer_state(new_buffer);
  3286.      */
  3287.         _mesa_glsl_lexer_ensure_buffer_stack (yyscanner);
  3288.         if ( YY_CURRENT_BUFFER == new_buffer )
  3289.                 return;
  3290.  
  3291.         if ( YY_CURRENT_BUFFER )
  3292.                 {
  3293.                 /* Flush out information for old buffer. */
  3294.                 *yyg->yy_c_buf_p = yyg->yy_hold_char;
  3295.                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
  3296.                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
  3297.                 }
  3298.  
  3299.         YY_CURRENT_BUFFER_LVALUE = new_buffer;
  3300.         _mesa_glsl_lexer__load_buffer_state(yyscanner );
  3301.  
  3302.         /* We don't actually know whether we did this switch during
  3303.          * EOF (_mesa_glsl_lexer_wrap()) processing, but the only time this flag
  3304.          * is looked at is after _mesa_glsl_lexer_wrap() is called, so it's safe
  3305.          * to go ahead and always set it.
  3306.          */
  3307.         yyg->yy_did_buffer_switch_on_eof = 1;
  3308. }
  3309.  
  3310. static void _mesa_glsl_lexer__load_buffer_state  (yyscan_t yyscanner)
  3311. {
  3312.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3313.         yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  3314.         yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
  3315.         yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
  3316.         yyg->yy_hold_char = *yyg->yy_c_buf_p;
  3317. }
  3318.  
  3319. /** Allocate and initialize an input buffer state.
  3320.  * @param file A readable stream.
  3321.  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
  3322.  * @param yyscanner The scanner object.
  3323.  * @return the allocated buffer state.
  3324.  */
  3325.     YY_BUFFER_STATE _mesa_glsl_lexer__create_buffer  (FILE * file, int  size , yyscan_t yyscanner)
  3326. {
  3327.         YY_BUFFER_STATE b;
  3328.    
  3329.         b = (YY_BUFFER_STATE) _mesa_glsl_lexer_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
  3330.         if ( ! b )
  3331.                 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_lexer__create_buffer()" );
  3332.  
  3333.         b->yy_buf_size = size;
  3334.  
  3335.         /* yy_ch_buf has to be 2 characters longer than the size given because
  3336.          * we need to put in 2 end-of-buffer characters.
  3337.          */
  3338.         b->yy_ch_buf = (char *) _mesa_glsl_lexer_alloc(b->yy_buf_size + 2 ,yyscanner );
  3339.         if ( ! b->yy_ch_buf )
  3340.                 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_lexer__create_buffer()" );
  3341.  
  3342.         b->yy_is_our_buffer = 1;
  3343.  
  3344.         _mesa_glsl_lexer__init_buffer(b,file ,yyscanner);
  3345.  
  3346.         return b;
  3347. }
  3348.  
  3349. /** Destroy the buffer.
  3350.  * @param b a buffer created with _mesa_glsl_lexer__create_buffer()
  3351.  * @param yyscanner The scanner object.
  3352.  */
  3353.     void _mesa_glsl_lexer__delete_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
  3354. {
  3355.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3356.  
  3357.         if ( ! b )
  3358.                 return;
  3359.  
  3360.         if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
  3361.                 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
  3362.  
  3363.         if ( b->yy_is_our_buffer )
  3364.                 _mesa_glsl_lexer_free((void *) b->yy_ch_buf ,yyscanner );
  3365.  
  3366.         _mesa_glsl_lexer_free((void *) b ,yyscanner );
  3367. }
  3368.  
  3369. /* Initializes or reinitializes a buffer.
  3370.  * This function is sometimes called more than once on the same buffer,
  3371.  * such as during a _mesa_glsl_lexer_restart() or at EOF.
  3372.  */
  3373.     static void _mesa_glsl_lexer__init_buffer  (YY_BUFFER_STATE  b, FILE * file , yyscan_t yyscanner)
  3374.  
  3375. {
  3376.         int oerrno = errno;
  3377.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3378.  
  3379.         _mesa_glsl_lexer__flush_buffer(b ,yyscanner);
  3380.  
  3381.         b->yy_input_file = file;
  3382.         b->yy_fill_buffer = 1;
  3383.  
  3384.     /* If b is the current buffer, then _mesa_glsl_lexer__init_buffer was _probably_
  3385.      * called from _mesa_glsl_lexer_restart() or through yy_get_next_buffer.
  3386.      * In that case, we don't want to reset the lineno or column.
  3387.      */
  3388.     if (b != YY_CURRENT_BUFFER){
  3389.         b->yy_bs_lineno = 1;
  3390.         b->yy_bs_column = 0;
  3391.     }
  3392.  
  3393.         b->yy_is_interactive = 0;
  3394.    
  3395.         errno = oerrno;
  3396. }
  3397.  
  3398. /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
  3399.  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
  3400.  * @param yyscanner The scanner object.
  3401.  */
  3402.     void _mesa_glsl_lexer__flush_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
  3403. {
  3404.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3405.         if ( ! b )
  3406.                 return;
  3407.  
  3408.         b->yy_n_chars = 0;
  3409.  
  3410.         /* We always need two end-of-buffer characters.  The first causes
  3411.          * a transition to the end-of-buffer state.  The second causes
  3412.          * a jam in that state.
  3413.          */
  3414.         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
  3415.         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  3416.  
  3417.         b->yy_buf_pos = &b->yy_ch_buf[0];
  3418.  
  3419.         b->yy_at_bol = 1;
  3420.         b->yy_buffer_status = YY_BUFFER_NEW;
  3421.  
  3422.         if ( b == YY_CURRENT_BUFFER )
  3423.                 _mesa_glsl_lexer__load_buffer_state(yyscanner );
  3424. }
  3425.  
  3426. /** Pushes the new state onto the stack. The new state becomes
  3427.  *  the current state. This function will allocate the stack
  3428.  *  if necessary.
  3429.  *  @param new_buffer The new state.
  3430.  *  @param yyscanner The scanner object.
  3431.  */
  3432. void _mesa_glsl_lexer_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
  3433. {
  3434.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3435.         if (new_buffer == NULL)
  3436.                 return;
  3437.  
  3438.         _mesa_glsl_lexer_ensure_buffer_stack(yyscanner);
  3439.  
  3440.         /* This block is copied from _mesa_glsl_lexer__switch_to_buffer. */
  3441.         if ( YY_CURRENT_BUFFER )
  3442.                 {
  3443.                 /* Flush out information for old buffer. */
  3444.                 *yyg->yy_c_buf_p = yyg->yy_hold_char;
  3445.                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
  3446.                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
  3447.                 }
  3448.  
  3449.         /* Only push if top exists. Otherwise, replace top. */
  3450.         if (YY_CURRENT_BUFFER)
  3451.                 yyg->yy_buffer_stack_top++;
  3452.         YY_CURRENT_BUFFER_LVALUE = new_buffer;
  3453.  
  3454.         /* copied from _mesa_glsl_lexer__switch_to_buffer. */
  3455.         _mesa_glsl_lexer__load_buffer_state(yyscanner );
  3456.         yyg->yy_did_buffer_switch_on_eof = 1;
  3457. }
  3458.  
  3459. /** Removes and deletes the top of the stack, if present.
  3460.  *  The next element becomes the new top.
  3461.  *  @param yyscanner The scanner object.
  3462.  */
  3463. void _mesa_glsl_lexer_pop_buffer_state (yyscan_t yyscanner)
  3464. {
  3465.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3466.         if (!YY_CURRENT_BUFFER)
  3467.                 return;
  3468.  
  3469.         _mesa_glsl_lexer__delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
  3470.         YY_CURRENT_BUFFER_LVALUE = NULL;
  3471.         if (yyg->yy_buffer_stack_top > 0)
  3472.                 --yyg->yy_buffer_stack_top;
  3473.  
  3474.         if (YY_CURRENT_BUFFER) {
  3475.                 _mesa_glsl_lexer__load_buffer_state(yyscanner );
  3476.                 yyg->yy_did_buffer_switch_on_eof = 1;
  3477.         }
  3478. }
  3479.  
  3480. /* Allocates the stack if it does not exist.
  3481.  *  Guarantees space for at least one push.
  3482.  */
  3483. static void _mesa_glsl_lexer_ensure_buffer_stack (yyscan_t yyscanner)
  3484. {
  3485.         int num_to_alloc;
  3486.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3487.  
  3488.         if (!yyg->yy_buffer_stack) {
  3489.  
  3490.                 /* First allocation is just for 2 elements, since we don't know if this
  3491.                  * scanner will even need a stack. We use 2 instead of 1 to avoid an
  3492.                  * immediate realloc on the next call.
  3493.          */
  3494.                 num_to_alloc = 1;
  3495.                 yyg->yy_buffer_stack = (struct yy_buffer_state**)_mesa_glsl_lexer_alloc
  3496.                                                                 (num_to_alloc * sizeof(struct yy_buffer_state*)
  3497.                                                                 , yyscanner);
  3498.                 if ( ! yyg->yy_buffer_stack )
  3499.                         YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_lexer_ensure_buffer_stack()" );
  3500.                                                                  
  3501.                 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
  3502.                                
  3503.                 yyg->yy_buffer_stack_max = num_to_alloc;
  3504.                 yyg->yy_buffer_stack_top = 0;
  3505.                 return;
  3506.         }
  3507.  
  3508.         if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
  3509.  
  3510.                 /* Increase the buffer to prepare for a possible push. */
  3511.                 int grow_size = 8 /* arbitrary grow size */;
  3512.  
  3513.                 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
  3514.                 yyg->yy_buffer_stack = (struct yy_buffer_state**)_mesa_glsl_lexer_realloc
  3515.                                                                 (yyg->yy_buffer_stack,
  3516.                                                                 num_to_alloc * sizeof(struct yy_buffer_state*)
  3517.                                                                 , yyscanner);
  3518.                 if ( ! yyg->yy_buffer_stack )
  3519.                         YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_lexer_ensure_buffer_stack()" );
  3520.  
  3521.                 /* zero only the new slots.*/
  3522.                 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
  3523.                 yyg->yy_buffer_stack_max = num_to_alloc;
  3524.         }
  3525. }
  3526.  
  3527. /** Setup the input buffer state to scan directly from a user-specified character buffer.
  3528.  * @param base the character buffer
  3529.  * @param size the size in bytes of the character buffer
  3530.  * @param yyscanner The scanner object.
  3531.  * @return the newly allocated buffer state object.
  3532.  */
  3533. YY_BUFFER_STATE _mesa_glsl_lexer__scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
  3534. {
  3535.         YY_BUFFER_STATE b;
  3536.    
  3537.         if ( size < 2 ||
  3538.              base[size-2] != YY_END_OF_BUFFER_CHAR ||
  3539.              base[size-1] != YY_END_OF_BUFFER_CHAR )
  3540.                 /* They forgot to leave room for the EOB's. */
  3541.                 return 0;
  3542.  
  3543.         b = (YY_BUFFER_STATE) _mesa_glsl_lexer_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
  3544.         if ( ! b )
  3545.                 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_lexer__scan_buffer()" );
  3546.  
  3547.         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
  3548.         b->yy_buf_pos = b->yy_ch_buf = base;
  3549.         b->yy_is_our_buffer = 0;
  3550.         b->yy_input_file = 0;
  3551.         b->yy_n_chars = b->yy_buf_size;
  3552.         b->yy_is_interactive = 0;
  3553.         b->yy_at_bol = 1;
  3554.         b->yy_fill_buffer = 0;
  3555.         b->yy_buffer_status = YY_BUFFER_NEW;
  3556.  
  3557.         _mesa_glsl_lexer__switch_to_buffer(b ,yyscanner );
  3558.  
  3559.         return b;
  3560. }
  3561.  
  3562. /** Setup the input buffer state to scan a string. The next call to _mesa_glsl_lexer_lex() will
  3563.  * scan from a @e copy of @a str.
  3564.  * @param yystr a NUL-terminated string to scan
  3565.  * @param yyscanner The scanner object.
  3566.  * @return the newly allocated buffer state object.
  3567.  * @note If you want to scan bytes that may contain NUL values, then use
  3568.  *       _mesa_glsl_lexer__scan_bytes() instead.
  3569.  */
  3570. YY_BUFFER_STATE _mesa_glsl_lexer__scan_string (yyconst char * yystr , yyscan_t yyscanner)
  3571. {
  3572.    
  3573.         return _mesa_glsl_lexer__scan_bytes(yystr,strlen(yystr) ,yyscanner);
  3574. }
  3575.  
  3576. /** Setup the input buffer state to scan the given bytes. The next call to _mesa_glsl_lexer_lex() will
  3577.  * scan from a @e copy of @a bytes.
  3578.  * @param yybytes the byte buffer to scan
  3579.  * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
  3580.  * @param yyscanner The scanner object.
  3581.  * @return the newly allocated buffer state object.
  3582.  */
  3583. YY_BUFFER_STATE _mesa_glsl_lexer__scan_bytes  (yyconst char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
  3584. {
  3585.         YY_BUFFER_STATE b;
  3586.         char *buf;
  3587.         yy_size_t n;
  3588.         int i;
  3589.    
  3590.         /* Get memory for full buffer, including space for trailing EOB's. */
  3591.         n = _yybytes_len + 2;
  3592.         buf = (char *) _mesa_glsl_lexer_alloc(n ,yyscanner );
  3593.         if ( ! buf )
  3594.                 YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_lexer__scan_bytes()" );
  3595.  
  3596.         for ( i = 0; i < _yybytes_len; ++i )
  3597.                 buf[i] = yybytes[i];
  3598.  
  3599.         buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
  3600.  
  3601.         b = _mesa_glsl_lexer__scan_buffer(buf,n ,yyscanner);
  3602.         if ( ! b )
  3603.                 YY_FATAL_ERROR( "bad buffer in _mesa_glsl_lexer__scan_bytes()" );
  3604.  
  3605.         /* It's okay to grow etc. this buffer, and we should throw it
  3606.          * away when we're done.
  3607.          */
  3608.         b->yy_is_our_buffer = 1;
  3609.  
  3610.         return b;
  3611. }
  3612.  
  3613. #ifndef YY_EXIT_FAILURE
  3614. #define YY_EXIT_FAILURE 2
  3615. #endif
  3616.  
  3617. static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
  3618. {
  3619.         (void) fprintf( stderr, "%s\n", msg );
  3620.         exit( YY_EXIT_FAILURE );
  3621. }
  3622.  
  3623. /* Redefine yyless() so it works in section 3 code. */
  3624.  
  3625. #undef yyless
  3626. #define yyless(n) \
  3627.         do \
  3628.                 { \
  3629.                 /* Undo effects of setting up yytext. */ \
  3630.         int yyless_macro_arg = (n); \
  3631.         YY_LESS_LINENO(yyless_macro_arg);\
  3632.                 yytext[yyleng] = yyg->yy_hold_char; \
  3633.                 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
  3634.                 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
  3635.                 *yyg->yy_c_buf_p = '\0'; \
  3636.                 yyleng = yyless_macro_arg; \
  3637.                 } \
  3638.         while ( 0 )
  3639.  
  3640. /* Accessor  methods (get/set functions) to struct members. */
  3641.  
  3642. /** Get the user-defined data for this scanner.
  3643.  * @param yyscanner The scanner object.
  3644.  */
  3645. YY_EXTRA_TYPE _mesa_glsl_lexer_get_extra  (yyscan_t yyscanner)
  3646. {
  3647.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3648.     return yyextra;
  3649. }
  3650.  
  3651. /** Get the current line number.
  3652.  * @param yyscanner The scanner object.
  3653.  */
  3654. int _mesa_glsl_lexer_get_lineno  (yyscan_t yyscanner)
  3655. {
  3656.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3657.    
  3658.         if (! YY_CURRENT_BUFFER)
  3659.             return 0;
  3660.    
  3661.     return yylineno;
  3662. }
  3663.  
  3664. /** Get the current column number.
  3665.  * @param yyscanner The scanner object.
  3666.  */
  3667. int _mesa_glsl_lexer_get_column  (yyscan_t yyscanner)
  3668. {
  3669.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3670.    
  3671.         if (! YY_CURRENT_BUFFER)
  3672.             return 0;
  3673.    
  3674.     return yycolumn;
  3675. }
  3676.  
  3677. /** Get the input stream.
  3678.  * @param yyscanner The scanner object.
  3679.  */
  3680. FILE *_mesa_glsl_lexer_get_in  (yyscan_t yyscanner)
  3681. {
  3682.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3683.     return yyin;
  3684. }
  3685.  
  3686. /** Get the output stream.
  3687.  * @param yyscanner The scanner object.
  3688.  */
  3689. FILE *_mesa_glsl_lexer_get_out  (yyscan_t yyscanner)
  3690. {
  3691.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3692.     return yyout;
  3693. }
  3694.  
  3695. /** Get the length of the current token.
  3696.  * @param yyscanner The scanner object.
  3697.  */
  3698. int _mesa_glsl_lexer_get_leng  (yyscan_t yyscanner)
  3699. {
  3700.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3701.     return yyleng;
  3702. }
  3703.  
  3704. /** Get the current token.
  3705.  * @param yyscanner The scanner object.
  3706.  */
  3707.  
  3708. char *_mesa_glsl_lexer_get_text  (yyscan_t yyscanner)
  3709. {
  3710.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3711.     return yytext;
  3712. }
  3713.  
  3714. /** Set the user-defined data. This data is never touched by the scanner.
  3715.  * @param user_defined The data to be associated with this scanner.
  3716.  * @param yyscanner The scanner object.
  3717.  */
  3718. void _mesa_glsl_lexer_set_extra (YY_EXTRA_TYPE  user_defined , yyscan_t yyscanner)
  3719. {
  3720.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3721.     yyextra = user_defined ;
  3722. }
  3723.  
  3724. /** Set the current line number.
  3725.  * @param line_number
  3726.  * @param yyscanner The scanner object.
  3727.  */
  3728. void _mesa_glsl_lexer_set_lineno (int  line_number , yyscan_t yyscanner)
  3729. {
  3730.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3731.  
  3732.         /* lineno is only valid if an input buffer exists. */
  3733.         if (! YY_CURRENT_BUFFER )
  3734.            yy_fatal_error( "_mesa_glsl_lexer_set_lineno called with no buffer" , yyscanner);
  3735.    
  3736.     yylineno = line_number;
  3737. }
  3738.  
  3739. /** Set the current column.
  3740.  * @param line_number
  3741.  * @param yyscanner The scanner object.
  3742.  */
  3743. void _mesa_glsl_lexer_set_column (int  column_no , yyscan_t yyscanner)
  3744. {
  3745.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3746.  
  3747.         /* column is only valid if an input buffer exists. */
  3748.         if (! YY_CURRENT_BUFFER )
  3749.            yy_fatal_error( "_mesa_glsl_lexer_set_column called with no buffer" , yyscanner);
  3750.    
  3751.     yycolumn = column_no;
  3752. }
  3753.  
  3754. /** Set the input stream. This does not discard the current
  3755.  * input buffer.
  3756.  * @param in_str A readable stream.
  3757.  * @param yyscanner The scanner object.
  3758.  * @see _mesa_glsl_lexer__switch_to_buffer
  3759.  */
  3760. void _mesa_glsl_lexer_set_in (FILE *  in_str , yyscan_t yyscanner)
  3761. {
  3762.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3763.     yyin = in_str ;
  3764. }
  3765.  
  3766. void _mesa_glsl_lexer_set_out (FILE *  out_str , yyscan_t yyscanner)
  3767. {
  3768.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3769.     yyout = out_str ;
  3770. }
  3771.  
  3772. int _mesa_glsl_lexer_get_debug  (yyscan_t yyscanner)
  3773. {
  3774.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3775.     return yy_flex_debug;
  3776. }
  3777.  
  3778. void _mesa_glsl_lexer_set_debug (int  bdebug , yyscan_t yyscanner)
  3779. {
  3780.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3781.     yy_flex_debug = bdebug ;
  3782. }
  3783.  
  3784. /* Accessor methods for yylval and yylloc */
  3785.  
  3786. YYSTYPE * _mesa_glsl_lexer_get_lval  (yyscan_t yyscanner)
  3787. {
  3788.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3789.     return yylval;
  3790. }
  3791.  
  3792. void _mesa_glsl_lexer_set_lval (YYSTYPE *  yylval_param , yyscan_t yyscanner)
  3793. {
  3794.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3795.     yylval = yylval_param;
  3796. }
  3797.  
  3798. YYLTYPE *_mesa_glsl_lexer_get_lloc  (yyscan_t yyscanner)
  3799. {
  3800.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3801.     return yylloc;
  3802. }
  3803.    
  3804. void _mesa_glsl_lexer_set_lloc (YYLTYPE *  yylloc_param , yyscan_t yyscanner)
  3805. {
  3806.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3807.     yylloc = yylloc_param;
  3808. }
  3809.    
  3810. /* User-visible API */
  3811.  
  3812. /* _mesa_glsl_lexer_lex_init is special because it creates the scanner itself, so it is
  3813.  * the ONLY reentrant function that doesn't take the scanner as the last argument.
  3814.  * That's why we explicitly handle the declaration, instead of using our macros.
  3815.  */
  3816.  
  3817. int _mesa_glsl_lexer_lex_init(yyscan_t* ptr_yy_globals)
  3818.  
  3819. {
  3820.     if (ptr_yy_globals == NULL){
  3821.         errno = EINVAL;
  3822.         return 1;
  3823.     }
  3824.  
  3825.     *ptr_yy_globals = (yyscan_t) _mesa_glsl_lexer_alloc ( sizeof( struct yyguts_t ), NULL );
  3826.  
  3827.     if (*ptr_yy_globals == NULL){
  3828.         errno = ENOMEM;
  3829.         return 1;
  3830.     }
  3831.  
  3832.     /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
  3833.     memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
  3834.  
  3835.     return yy_init_globals ( *ptr_yy_globals );
  3836. }
  3837.  
  3838. /* _mesa_glsl_lexer_lex_init_extra has the same functionality as _mesa_glsl_lexer_lex_init, but follows the
  3839.  * convention of taking the scanner as the last argument. Note however, that
  3840.  * this is a *pointer* to a scanner, as it will be allocated by this call (and
  3841.  * is the reason, too, why this function also must handle its own declaration).
  3842.  * The user defined value in the first argument will be available to _mesa_glsl_lexer_alloc in
  3843.  * the yyextra field.
  3844.  */
  3845.  
  3846. int _mesa_glsl_lexer_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
  3847.  
  3848. {
  3849.     struct yyguts_t dummy_yyguts;
  3850.  
  3851.     _mesa_glsl_lexer_set_extra (yy_user_defined, &dummy_yyguts);
  3852.  
  3853.     if (ptr_yy_globals == NULL){
  3854.         errno = EINVAL;
  3855.         return 1;
  3856.     }
  3857.        
  3858.     *ptr_yy_globals = (yyscan_t) _mesa_glsl_lexer_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
  3859.        
  3860.     if (*ptr_yy_globals == NULL){
  3861.         errno = ENOMEM;
  3862.         return 1;
  3863.     }
  3864.    
  3865.     /* By setting to 0xAA, we expose bugs in
  3866.     yy_init_globals. Leave at 0x00 for releases. */
  3867.     memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
  3868.    
  3869.     _mesa_glsl_lexer_set_extra (yy_user_defined, *ptr_yy_globals);
  3870.    
  3871.     return yy_init_globals ( *ptr_yy_globals );
  3872. }
  3873.  
  3874. static int yy_init_globals (yyscan_t yyscanner)
  3875. {
  3876.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3877.     /* Initialization is the same as for the non-reentrant scanner.
  3878.      * This function is called from _mesa_glsl_lexer_lex_destroy(), so don't allocate here.
  3879.      */
  3880.  
  3881.     yyg->yy_buffer_stack = 0;
  3882.     yyg->yy_buffer_stack_top = 0;
  3883.     yyg->yy_buffer_stack_max = 0;
  3884.     yyg->yy_c_buf_p = (char *) 0;
  3885.     yyg->yy_init = 0;
  3886.     yyg->yy_start = 0;
  3887.  
  3888.     yyg->yy_start_stack_ptr = 0;
  3889.     yyg->yy_start_stack_depth = 0;
  3890.     yyg->yy_start_stack =  NULL;
  3891.  
  3892. /* Defined in main.c */
  3893. #ifdef YY_STDINIT
  3894.     yyin = stdin;
  3895.     yyout = stdout;
  3896. #else
  3897.     yyin = (FILE *) 0;
  3898.     yyout = (FILE *) 0;
  3899. #endif
  3900.  
  3901.     /* For future reference: Set errno on error, since we are called by
  3902.      * _mesa_glsl_lexer_lex_init()
  3903.      */
  3904.     return 0;
  3905. }
  3906.  
  3907. /* _mesa_glsl_lexer_lex_destroy is for both reentrant and non-reentrant scanners. */
  3908. int _mesa_glsl_lexer_lex_destroy  (yyscan_t yyscanner)
  3909. {
  3910.     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  3911.  
  3912.     /* Pop the buffer stack, destroying each element. */
  3913.         while(YY_CURRENT_BUFFER){
  3914.                 _mesa_glsl_lexer__delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
  3915.                 YY_CURRENT_BUFFER_LVALUE = NULL;
  3916.                 _mesa_glsl_lexer_pop_buffer_state(yyscanner);
  3917.         }
  3918.  
  3919.         /* Destroy the stack itself. */
  3920.         _mesa_glsl_lexer_free(yyg->yy_buffer_stack ,yyscanner);
  3921.         yyg->yy_buffer_stack = NULL;
  3922.  
  3923.     /* Destroy the start condition stack. */
  3924.         _mesa_glsl_lexer_free(yyg->yy_start_stack ,yyscanner );
  3925.         yyg->yy_start_stack = NULL;
  3926.  
  3927.     /* Reset the globals. This is important in a non-reentrant scanner so the next time
  3928.      * _mesa_glsl_lexer_lex() is called, initialization will occur. */
  3929.     yy_init_globals( yyscanner);
  3930.  
  3931.     /* Destroy the main struct (reentrant only). */
  3932.     _mesa_glsl_lexer_free ( yyscanner , yyscanner );
  3933.     yyscanner = NULL;
  3934.     return 0;
  3935. }
  3936.  
  3937. /*
  3938.  * Internal utility routines.
  3939.  */
  3940.  
  3941. #ifndef yytext_ptr
  3942. static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
  3943. {
  3944.         register int i;
  3945.         for ( i = 0; i < n; ++i )
  3946.                 s1[i] = s2[i];
  3947. }
  3948. #endif
  3949.  
  3950. #ifdef YY_NEED_STRLEN
  3951. static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
  3952. {
  3953.         register int n;
  3954.         for ( n = 0; s[n]; ++n )
  3955.                 ;
  3956.  
  3957.         return n;
  3958. }
  3959. #endif
  3960.  
  3961. void *_mesa_glsl_lexer_alloc (yy_size_t  size , yyscan_t yyscanner)
  3962. {
  3963.         return (void *) malloc( size );
  3964. }
  3965.  
  3966. void *_mesa_glsl_lexer_realloc  (void * ptr, yy_size_t  size , yyscan_t yyscanner)
  3967. {
  3968.         /* The cast to (char *) in the following accommodates both
  3969.          * implementations that use char* generic pointers, and those
  3970.          * that use void* generic pointers.  It works with the latter
  3971.          * because both ANSI C and C++ allow castless assignment from
  3972.          * any pointer type to void*, and deal with argument conversions
  3973.          * as though doing an assignment.
  3974.          */
  3975.         return (void *) realloc( (char *) ptr, size );
  3976. }
  3977.  
  3978. void _mesa_glsl_lexer_free (void * ptr , yyscan_t yyscanner)
  3979. {
  3980.         free( (char *) ptr );   /* see _mesa_glsl_lexer_realloc() for (char *) cast */
  3981. }
  3982.  
  3983. #define YYTABLES_NAME "yytables"
  3984.  
  3985. #line 536 "glsl_lexer.ll"
  3986.  
  3987.  
  3988.  
  3989. int
  3990. classify_identifier(struct _mesa_glsl_parse_state *state, const char *name)
  3991. {
  3992.    if (state->symbols->get_variable(name) || state->symbols->get_function(name))
  3993.       return IDENTIFIER;
  3994.    else if (state->symbols->get_type(name))
  3995.       return TYPE_IDENTIFIER;
  3996.    else
  3997.       return NEW_IDENTIFIER;
  3998. }
  3999.  
  4000. void
  4001. _mesa_glsl_lexer_ctor(struct _mesa_glsl_parse_state *state, const char *string)
  4002. {
  4003.    _mesa_glsl_lexer_lex_init_extra(state,& state->scanner);
  4004.    _mesa_glsl_lexer__scan_string(string,state->scanner);
  4005. }
  4006.  
  4007. void
  4008. _mesa_glsl_lexer_dtor(struct _mesa_glsl_parse_state *state)
  4009. {
  4010.    _mesa_glsl_lexer_lex_destroy(state->scanner);
  4011. }
  4012.  
  4013.