PageRenderTime 60ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 1ms

/other/netcdf_write_matrix/src/ncgen/ncgenyy.c

http://github.com/jbeezley/wrf-fire
C | 1982 lines | 1444 code | 306 blank | 232 comment | 139 complexity | 1283c08d6b4b6a16c32ede2485c1eb84 MD5 | raw file
Possible License(s): AGPL-1.0

Large files files are truncated, but you can click here to view the full file

  1. /* A lexical scanner generated by flex */
  2. /* Scanner skeleton version:
  3. * $Header: /upc/share/CVS/netcdf-3/ncgen/ncgenyy.c,v 1.6 2005/02/17 21:26:25 ed Exp $
  4. */
  5. #define FLEX_SCANNER
  6. #define YY_FLEX_MAJOR_VERSION 2
  7. #define YY_FLEX_MINOR_VERSION 5
  8. #include <stdio.h>
  9. /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
  10. #ifdef c_plusplus
  11. #ifndef __cplusplus
  12. #define __cplusplus
  13. #endif
  14. #endif
  15. #ifdef __cplusplus
  16. #include <stdlib.h>
  17. #include <unistd.h>
  18. /* Use prototypes in function declarations. */
  19. #define YY_USE_PROTOS
  20. /* The "const" storage-class-modifier is valid. */
  21. #define YY_USE_CONST
  22. #else /* ! __cplusplus */
  23. #if __STDC__
  24. #define YY_USE_PROTOS
  25. #define YY_USE_CONST
  26. #endif /* __STDC__ */
  27. #endif /* ! __cplusplus */
  28. #ifdef __TURBOC__
  29. #pragma warn -rch
  30. #pragma warn -use
  31. #include <io.h>
  32. #include <stdlib.h>
  33. #define YY_USE_CONST
  34. #define YY_USE_PROTOS
  35. #endif
  36. #ifdef YY_USE_CONST
  37. #define yyconst const
  38. #else
  39. #define yyconst
  40. #endif
  41. #ifdef YY_USE_PROTOS
  42. #define YY_PROTO(proto) proto
  43. #else
  44. #define YY_PROTO(proto) ()
  45. #endif
  46. /* Returned upon end-of-file. */
  47. #define YY_NULL 0
  48. /* Promotes a possibly negative, possibly signed char to an unsigned
  49. * integer for use as an array index. If the signed char is negative,
  50. * we want to instead treat it as an 8-bit unsigned char, hence the
  51. * double cast.
  52. */
  53. #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
  54. /* Enter a start condition. This macro really ought to take a parameter,
  55. * but we do it the disgusting crufty way forced on us by the ()-less
  56. * definition of BEGIN.
  57. */
  58. #define BEGIN yy_start = 1 + 2 *
  59. /* Translate the current start state into a value that can be later handed
  60. * to BEGIN to return to the state. The YYSTATE alias is for lex
  61. * compatibility.
  62. */
  63. #define YY_START ((yy_start - 1) / 2)
  64. #define YYSTATE YY_START
  65. /* Action number for EOF rule of a given start state. */
  66. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  67. /* Special action meaning "start processing a new file". */
  68. #define YY_NEW_FILE yyrestart( yyin )
  69. #define YY_END_OF_BUFFER_CHAR 0
  70. /* Size of default input buffer. */
  71. #define YY_BUF_SIZE 16384
  72. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  73. extern int yyleng;
  74. extern FILE *yyin, *yyout;
  75. #define EOB_ACT_CONTINUE_SCAN 0
  76. #define EOB_ACT_END_OF_FILE 1
  77. #define EOB_ACT_LAST_MATCH 2
  78. /* The funky do-while in the following #define is used to turn the definition
  79. * int a single C statement (which needs a semi-colon terminator). This
  80. * avoids problems with code like:
  81. *
  82. * if ( condition_holds )
  83. * yyless( 5 );
  84. * else
  85. * do_something_else();
  86. *
  87. * Prior to using the do-while the compiler would get upset at the
  88. * "else" because it interpreted the "if" statement as being all
  89. * done when it reached the ';' after the yyless() call.
  90. */
  91. /* Return all but the first 'n' matched characters back to the input stream. */
  92. #define yyless(n) \
  93. do \
  94. { \
  95. /* Undo effects of setting up yytext. */ \
  96. *yy_cp = yy_hold_char; \
  97. YY_RESTORE_YY_MORE_OFFSET \
  98. yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
  99. YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  100. } \
  101. while ( 0 )
  102. #define unput(c) yyunput( c, yytext_ptr )
  103. /* The following is because we cannot portably get our hands on size_t
  104. * (without autoconf's help, which isn't available because we want
  105. * flex-generated scanners to compile on their own).
  106. */
  107. typedef unsigned int yy_size_t;
  108. struct yy_buffer_state
  109. {
  110. FILE *yy_input_file;
  111. char *yy_ch_buf; /* input buffer */
  112. char *yy_buf_pos; /* current position in input buffer */
  113. /* Size of input buffer in bytes, not including room for EOB
  114. * characters.
  115. */
  116. yy_size_t yy_buf_size;
  117. /* Number of characters read into yy_ch_buf, not including EOB
  118. * characters.
  119. */
  120. int yy_n_chars;
  121. /* Whether we "own" the buffer - i.e., we know we created it,
  122. * and can realloc() it to grow it, and should free() it to
  123. * delete it.
  124. */
  125. int yy_is_our_buffer;
  126. /* Whether this is an "interactive" input source; if so, and
  127. * if we're using stdio for input, then we want to use getc()
  128. * instead of fread(), to make sure we stop fetching input after
  129. * each newline.
  130. */
  131. int yy_is_interactive;
  132. /* Whether we're considered to be at the beginning of a line.
  133. * If so, '^' rules will be active on the next match, otherwise
  134. * not.
  135. */
  136. int yy_at_bol;
  137. /* Whether to try to fill the input buffer when we reach the
  138. * end of it.
  139. */
  140. int yy_fill_buffer;
  141. int yy_buffer_status;
  142. #define YY_BUFFER_NEW 0
  143. #define YY_BUFFER_NORMAL 1
  144. /* When an EOF's been seen but there's still some text to process
  145. * then we mark the buffer as YY_EOF_PENDING, to indicate that we
  146. * shouldn't try reading from the input source any more. We might
  147. * still have a bunch of tokens to match, though, because of
  148. * possible backing-up.
  149. *
  150. * When we actually see the EOF, we change the status to "new"
  151. * (via yyrestart()), so that the user can continue scanning by
  152. * just pointing yyin at a new input file.
  153. */
  154. #define YY_BUFFER_EOF_PENDING 2
  155. };
  156. static YY_BUFFER_STATE yy_current_buffer = 0;
  157. /* We provide macros for accessing buffer states in case in the
  158. * future we want to put the buffer states in a more general
  159. * "scanner state".
  160. */
  161. #define YY_CURRENT_BUFFER yy_current_buffer
  162. /* yy_hold_char holds the character lost when yytext is formed. */
  163. static char yy_hold_char;
  164. static int yy_n_chars; /* number of characters read into yy_ch_buf */
  165. int yyleng;
  166. /* Points to current character in buffer. */
  167. static char *yy_c_buf_p = (char *) 0;
  168. static int yy_init = 1; /* whether we need to initialize */
  169. static int yy_start = 0; /* start state number */
  170. /* Flag which is used to allow yywrap()'s to do buffer switches
  171. * instead of setting up a fresh yyin. A bit of a hack ...
  172. */
  173. static int yy_did_buffer_switch_on_eof;
  174. void yyrestart YY_PROTO(( FILE * ));
  175. void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE ));
  176. void yy_load_buffer_state YY_PROTO(( void ));
  177. YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *, int ));
  178. void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE ));
  179. void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE, FILE * ));
  180. void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE ));
  181. #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
  182. YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *, yy_size_t ));
  183. YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char * ));
  184. YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *, int ));
  185. static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
  186. static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
  187. static void yy_flex_free YY_PROTO(( void * ));
  188. #define yy_new_buffer yy_create_buffer
  189. #define yy_set_interactive(is_interactive) \
  190. { \
  191. if ( ! yy_current_buffer ) \
  192. yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
  193. yy_current_buffer->yy_is_interactive = is_interactive; \
  194. }
  195. #define yy_set_bol(at_bol) \
  196. { \
  197. if ( ! yy_current_buffer ) \
  198. yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
  199. yy_current_buffer->yy_at_bol = at_bol; \
  200. }
  201. #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
  202. typedef unsigned char YY_CHAR;
  203. FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
  204. typedef int yy_state_type;
  205. extern char *yytext;
  206. #define yytext_ptr yytext
  207. static yy_state_type yy_get_previous_state YY_PROTO(( void ));
  208. static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
  209. static int yy_get_next_buffer YY_PROTO(( void ));
  210. static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
  211. /* Done after the current pattern has been matched and before the
  212. * corresponding action - sets up yytext.
  213. */
  214. #define YY_DO_BEFORE_ACTION \
  215. yytext_ptr = yy_bp; \
  216. yyleng = (int) (yy_cp - yy_bp); \
  217. yy_hold_char = *yy_cp; \
  218. *yy_cp = '\0'; \
  219. yy_c_buf_p = yy_cp;
  220. #define YY_NUM_RULES 30
  221. #define YY_END_OF_BUFFER 31
  222. static yyconst short int yy_accept[249] =
  223. { 0,
  224. 0, 0, 31, 29, 28, 17, 29, 29, 29, 29,
  225. 19, 29, 22, 22, 16, 16, 16, 16, 16, 16,
  226. 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
  227. 16, 16, 16, 16, 16, 16, 16, 16, 28, 0,
  228. 2, 0, 0, 0, 19, 22, 22, 0, 0, 19,
  229. 19, 0, 20, 1, 23, 23, 18, 23, 22, 21,
  230. 0, 22, 18, 16, 16, 16, 16, 16, 16, 16,
  231. 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
  232. 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
  233. 16, 16, 16, 16, 16, 16, 24, 0, 0, 0,
  234. 0, 0, 19, 0, 0, 19, 1, 23, 19, 23,
  235. 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
  236. 7, 16, 16, 16, 14, 16, 16, 16, 16, 16,
  237. 16, 16, 16, 16, 16, 7, 16, 16, 16, 16,
  238. 16, 16, 27, 25, 0, 0, 19, 0, 19, 20,
  239. 19, 5, 4, 16, 16, 16, 16, 16, 16, 16,
  240. 15, 16, 7, 16, 3, 16, 16, 16, 16, 16,
  241. 16, 16, 16, 16, 16, 16, 16, 16, 25, 0,
  242. 26, 0, 15, 0, 12, 16, 16, 16, 16, 16,
  243. 16, 16, 6, 16, 16, 16, 16, 16, 16, 16,
  244. 16, 16, 0, 16, 8, 16, 16, 16, 16, 16,
  245. 16, 16, 16, 16, 16, 16, 0, 16, 16, 16,
  246. 16, 0, 16, 16, 16, 16, 16, 0, 16, 16,
  247. 13, 13, 16, 16, 16, 16, 16, 14, 16, 9,
  248. 16, 16, 16, 16, 11, 16, 10, 0
  249. } ;
  250. static yyconst int yy_ec[256] =
  251. { 0,
  252. 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
  253. 1, 4, 1, 1, 1, 1, 1, 1, 1, 1,
  254. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  255. 1, 2, 1, 5, 6, 1, 1, 1, 7, 1,
  256. 1, 1, 8, 1, 9, 10, 11, 12, 13, 13,
  257. 13, 13, 13, 13, 13, 14, 14, 15, 1, 1,
  258. 1, 1, 1, 6, 16, 17, 18, 19, 20, 21,
  259. 22, 23, 24, 25, 25, 26, 27, 28, 29, 25,
  260. 25, 30, 31, 32, 33, 34, 25, 35, 36, 25,
  261. 6, 37, 6, 1, 25, 1, 38, 39, 40, 41,
  262. 42, 43, 44, 45, 46, 25, 25, 47, 48, 49,
  263. 50, 25, 25, 51, 52, 53, 54, 55, 25, 35,
  264. 56, 25, 57, 1, 1, 1, 1, 1, 1, 1,
  265. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  266. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  267. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  268. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  269. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  270. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  271. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  272. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  273. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  274. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  275. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  276. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  277. 1, 1, 1, 1, 1
  278. } ;
  279. static yyconst int yy_meta[58] =
  280. { 0,
  281. 1, 1, 2, 1, 1, 3, 4, 3, 3, 3,
  282. 1, 5, 5, 5, 1, 5, 5, 5, 5, 5,
  283. 5, 3, 3, 3, 3, 6, 3, 3, 3, 3,
  284. 3, 3, 3, 3, 3, 3, 1, 5, 5, 5,
  285. 5, 5, 5, 3, 3, 3, 6, 3, 3, 3,
  286. 3, 3, 3, 3, 3, 3, 7
  287. } ;
  288. static yyconst short int yy_base[259] =
  289. { 0,
  290. 0, 0, 442, 443, 56, 443, 54, 404, 51, 56,
  291. 87, 429, 125, 168, 0, 403, 415, 59, 65, 55,
  292. 54, 408, 47, 416, 412, 406, 417, 376, 386, 46,
  293. 383, 380, 378, 385, 384, 380, 375, 385, 85, 57,
  294. 443, 419, 414, 92, 0, 98, 0, 106, 371, 0,
  295. 443, 140, 443, 0, 124, 69, 100, 161, 443, 443,
  296. 0, 0, 443, 0, 387, 402, 385, 389, 382, 360,
  297. 109, 209, 384, 362, 379, 367, 381, 376, 379, 390,
  298. 376, 378, 373, 349, 363, 347, 351, 344, 347, 343,
  299. 346, 341, 355, 342, 344, 339, 443, 382, 177, 381,
  300. 110, 119, 245, 344, 179, 281, 0, 443, 193, 180,
  301. 366, 355, 368, 363, 365, 342, 0, 0, 364, 341,
  302. 358, 112, 355, 358, 0, 349, 344, 349, 331, 306,
  303. 293, 289, 284, 286, 285, 279, 276, 122, 272, 267,
  304. 271, 270, 443, 443, 191, 308, 443, 133, 169, 170,
  305. 443, 0, 0, 299, 285, 286, 264, 278, 256, 286,
  306. 0, 257, 0, 286, 0, 272, 276, 285, 284, 249,
  307. 250, 243, 247, 271, 248, 234, 237, 246, 443, 276,
  308. 443, 275, 443, 232, 443, 249, 259, 236, 253, 256,
  309. 229, 253, 0, 249, 255, 218, 227, 226, 246, 222,
  310. 217, 223, 215, 236, 0, 231, 205, 223, 198, 247,
  311. 216, 221, 200, 194, 191, 196, 189, 212, 190, 195,
  312. 181, 231, 211, 209, 176, 183, 182, 162, 185, 166,
  313. 0, 203, 181, 166, 137, 142, 109, 443, 94, 0,
  314. 109, 65, 82, 75, 443, 71, 443, 443, 328, 335,
  315. 340, 346, 353, 356, 67, 359, 361, 366
  316. } ;
  317. static yyconst short int yy_def[259] =
  318. { 0,
  319. 248, 1, 248, 248, 248, 248, 249, 250, 248, 248,
  320. 248, 248, 248, 248, 251, 251, 251, 251, 251, 251,
  321. 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
  322. 251, 251, 251, 251, 251, 251, 251, 251, 248, 249,
  323. 248, 249, 248, 252, 11, 14, 14, 248, 248, 11,
  324. 248, 248, 248, 253, 13, 254, 254, 254, 248, 248,
  325. 255, 14, 248, 251, 251, 251, 251, 251, 251, 251,
  326. 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
  327. 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
  328. 251, 251, 251, 251, 251, 251, 248, 248, 248, 256,
  329. 46, 248, 248, 248, 248, 248, 253, 248, 58, 255,
  330. 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
  331. 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
  332. 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
  333. 251, 251, 248, 248, 248, 257, 248, 248, 254, 254,
  334. 248, 251, 251, 251, 251, 251, 251, 251, 251, 251,
  335. 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
  336. 251, 251, 251, 251, 251, 251, 251, 251, 248, 248,
  337. 248, 248, 248, 248, 248, 251, 251, 251, 251, 251,
  338. 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
  339. 251, 251, 248, 251, 251, 251, 251, 251, 251, 251,
  340. 251, 251, 251, 251, 251, 251, 248, 251, 251, 251,
  341. 251, 258, 251, 251, 251, 251, 251, 248, 251, 251,
  342. 258, 258, 251, 251, 251, 251, 251, 248, 251, 251,
  343. 251, 251, 251, 251, 248, 251, 248, 0, 248, 248,
  344. 248, 248, 248, 248, 248, 248, 248, 248
  345. } ;
  346. static yyconst short int yy_nxt[501] =
  347. { 0,
  348. 4, 5, 6, 5, 7, 4, 8, 9, 10, 11,
  349. 12, 13, 14, 14, 4, 15, 16, 17, 18, 19,
  350. 20, 15, 15, 21, 15, 22, 15, 23, 15, 24,
  351. 25, 15, 26, 27, 15, 15, 4, 15, 28, 29,
  352. 30, 19, 31, 15, 15, 32, 33, 15, 34, 15,
  353. 35, 36, 15, 37, 38, 15, 4, 39, 41, 39,
  354. 45, 41, 46, 47, 47, 45, 78, 46, 47, 47,
  355. 48, 110, 71, 71, 67, 48, 72, 72, 72, 49,
  356. 73, 75, 68, 86, 79, 247, 39, 69, 39, 247,
  357. 42, 87, 48, 42, 108, 88, 245, 48, 50, 50,
  358. 50, 74, 76, 99, 99, 51, 52, 53, 70, 101,
  359. 101, 101, 51, 102, 102, 108, 246, 103, 103, 103,
  360. 72, 72, 72, 245, 244, 108, 100, 51, 52, 53,
  361. 103, 103, 103, 51, 45, 248, 55, 55, 55, 174,
  362. 56, 57, 56, 56, 58, 56, 108, 105, 105, 108,
  363. 59, 106, 106, 106, 161, 60, 248, 162, 248, 61,
  364. 243, 175, 56, 57, 56, 56, 58, 56, 102, 102,
  365. 108, 59, 109, 109, 109, 183, 60, 45, 184, 62,
  366. 62, 62, 240, 144, 63, 242, 108, 48, 145, 145,
  367. 106, 106, 106, 59, 108, 108, 241, 179, 60, 240,
  368. 248, 248, 180, 180, 232, 108, 63, 108, 125, 48,
  369. 60, 149, 239, 150, 59, 108, 108, 238, 151, 60,
  370. 72, 72, 72, 237, 236, 235, 108, 117, 234, 118,
  371. 233, 60, 232, 149, 117, 150, 125, 161, 230, 151,
  372. 229, 228, 227, 226, 163, 225, 224, 223, 222, 117,
  373. 221, 118, 163, 220, 219, 117, 103, 103, 103, 218,
  374. 217, 216, 215, 147, 210, 53, 210, 214, 205, 213,
  375. 147, 212, 211, 210, 209, 208, 207, 206, 205, 204,
  376. 203, 181, 179, 202, 201, 147, 193, 53, 200, 199,
  377. 198, 147, 106, 106, 106, 165, 197, 196, 185, 51,
  378. 195, 53, 194, 193, 192, 191, 51, 190, 189, 165,
  379. 188, 187, 186, 185, 181, 178, 177, 176, 165, 163,
  380. 173, 51, 172, 53, 171, 170, 169, 51, 40, 40,
  381. 40, 40, 40, 40, 40, 43, 43, 43, 43, 43,
  382. 43, 43, 64, 153, 64, 64, 98, 152, 98, 98,
  383. 98, 98, 98, 107, 168, 107, 107, 107, 107, 107,
  384. 56, 56, 146, 146, 182, 182, 231, 231, 231, 231,
  385. 231, 231, 167, 166, 165, 164, 163, 160, 159, 158,
  386. 157, 156, 155, 154, 153, 152, 148, 143, 143, 142,
  387. 141, 140, 139, 138, 137, 136, 135, 134, 133, 132,
  388. 131, 130, 129, 128, 127, 126, 125, 124, 123, 122,
  389. 121, 120, 119, 116, 115, 114, 113, 112, 111, 104,
  390. 97, 248, 96, 95, 94, 93, 92, 91, 90, 89,
  391. 85, 84, 83, 82, 81, 80, 77, 66, 65, 54,
  392. 44, 248, 3, 248, 248, 248, 248, 248, 248, 248,
  393. 248, 248, 248, 248, 248, 248, 248, 248, 248, 248,
  394. 248, 248, 248, 248, 248, 248, 248, 248, 248, 248,
  395. 248, 248, 248, 248, 248, 248, 248, 248, 248, 248,
  396. 248, 248, 248, 248, 248, 248, 248, 248, 248, 248,
  397. 248, 248, 248, 248, 248, 248, 248, 248, 248, 248
  398. } ;
  399. static yyconst short int yy_chk[501] =
  400. { 0,
  401. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  402. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  403. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  404. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  405. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  406. 1, 1, 1, 1, 1, 1, 1, 5, 7, 5,
  407. 9, 40, 9, 9, 9, 10, 23, 10, 10, 10,
  408. 9, 255, 19, 19, 18, 10, 19, 19, 19, 10,
  409. 20, 21, 18, 30, 23, 246, 39, 18, 39, 244,
  410. 7, 30, 9, 40, 56, 30, 243, 10, 11, 11,
  411. 11, 20, 21, 44, 44, 11, 11, 11, 18, 46,
  412. 46, 46, 11, 48, 48, 56, 242, 48, 48, 48,
  413. 71, 71, 71, 241, 239, 57, 44, 11, 11, 11,
  414. 102, 102, 102, 11, 13, 101, 13, 13, 13, 138,
  415. 13, 13, 13, 13, 13, 13, 57, 52, 52, 55,
  416. 13, 52, 52, 52, 122, 13, 101, 122, 55, 13,
  417. 237, 138, 13, 13, 13, 13, 13, 13, 58, 58,
  418. 55, 13, 58, 58, 58, 148, 13, 14, 148, 14,
  419. 14, 14, 236, 99, 14, 235, 58, 14, 99, 99,
  420. 105, 105, 105, 14, 149, 150, 234, 145, 14, 233,
  421. 109, 109, 145, 145, 232, 110, 14, 58, 230, 14,
  422. 110, 109, 229, 109, 14, 149, 150, 228, 109, 14,
  423. 72, 72, 72, 227, 226, 225, 110, 72, 224, 72,
  424. 223, 110, 222, 109, 72, 109, 221, 220, 219, 109,
  425. 218, 217, 216, 215, 214, 213, 212, 211, 210, 72,
  426. 209, 72, 208, 207, 206, 72, 103, 103, 103, 204,
  427. 203, 202, 201, 103, 200, 103, 199, 198, 197, 196,
  428. 103, 195, 194, 192, 191, 190, 189, 188, 187, 186,
  429. 184, 182, 180, 178, 177, 103, 176, 103, 175, 174,
  430. 173, 103, 106, 106, 106, 172, 171, 170, 169, 106,
  431. 168, 106, 167, 166, 164, 162, 106, 160, 159, 158,
  432. 157, 156, 155, 154, 146, 142, 141, 140, 139, 137,
  433. 136, 106, 135, 106, 134, 133, 132, 106, 249, 249,
  434. 249, 249, 249, 249, 249, 250, 250, 250, 250, 250,
  435. 250, 250, 251, 131, 251, 251, 252, 130, 252, 252,
  436. 252, 252, 252, 253, 129, 253, 253, 253, 253, 253,
  437. 254, 254, 256, 256, 257, 257, 258, 258, 258, 258,
  438. 258, 258, 128, 127, 126, 124, 123, 121, 120, 119,
  439. 116, 115, 114, 113, 112, 111, 104, 100, 98, 96,
  440. 95, 94, 93, 92, 91, 90, 89, 88, 87, 86,
  441. 85, 84, 83, 82, 81, 80, 79, 78, 77, 76,
  442. 75, 74, 73, 70, 69, 68, 67, 66, 65, 49,
  443. 43, 42, 38, 37, 36, 35, 34, 33, 32, 31,
  444. 29, 28, 27, 26, 25, 24, 22, 17, 16, 12,
  445. 8, 3, 248, 248, 248, 248, 248, 248, 248, 248,
  446. 248, 248, 248, 248, 248, 248, 248, 248, 248, 248,
  447. 248, 248, 248, 248, 248, 248, 248, 248, 248, 248,
  448. 248, 248, 248, 248, 248, 248, 248, 248, 248, 248,
  449. 248, 248, 248, 248, 248, 248, 248, 248, 248, 248,
  450. 248, 248, 248, 248, 248, 248, 248, 248, 248, 248
  451. } ;
  452. static yy_state_type yy_last_accepting_state;
  453. static char *yy_last_accepting_cpos;
  454. /* The intent behind this definition is that it'll catch
  455. * any uses of REJECT which flex missed.
  456. */
  457. #define REJECT reject_used_but_not_detected
  458. #define yymore() yymore_used_but_not_detected
  459. #define YY_MORE_ADJ 0
  460. #define YY_RESTORE_YY_MORE_OFFSET
  461. char *yytext;
  462. #line 1 "ncgen.l"
  463. #define INITIAL 0
  464. #line 2 "ncgen.l"
  465. /*********************************************************************
  466. * Copyright 1993, UCAR/Unidata
  467. * See netcdf/COPYRIGHT file for copying and redistribution conditions.
  468. * $Id: ncgenyy.c,v 1.6 2005/02/17 21:26:25 ed Exp $
  469. *********************************************************************/
  470. /* lex specification for tokens for ncgen */
  471. /* Fill value used by ncdump from version 2.4 and later. Should match
  472. definition of FILL_STRING in ../ncdump/vardata.h */
  473. #define FILL_STRING "_"
  474. #define XDR_INT_MIN (-2147483647-1)
  475. #define XDR_INT_MAX 2147483647
  476. char errstr[100]; /* for short error messages */
  477. #include <string.h>
  478. #include <ctype.h>
  479. #include "genlib.h"
  480. #include "ncgentab.h"
  481. #define YY_BREAK /* defining as nothing eliminates unreachable
  482. statement warnings from flex output,
  483. but make sure every action ends with
  484. "return" or "break"! */
  485. #line 583 "lex.yy.c"
  486. /* Macros after this point can all be overridden by user definitions in
  487. * section 1.
  488. */
  489. #ifndef YY_SKIP_YYWRAP
  490. #ifdef __cplusplus
  491. extern "C" int yywrap YY_PROTO(( void ));
  492. #else
  493. extern int yywrap YY_PROTO(( void ));
  494. #endif
  495. #endif
  496. #ifndef YY_NO_UNPUT
  497. static void yyunput YY_PROTO(( int c, char *buf_ptr ));
  498. #endif
  499. #ifndef yytext_ptr
  500. static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
  501. #endif
  502. #ifdef YY_NEED_STRLEN
  503. static int yy_flex_strlen YY_PROTO(( yyconst char * ));
  504. #endif
  505. #ifndef YY_NO_INPUT
  506. #ifdef __cplusplus
  507. static int yyinput YY_PROTO(( void ));
  508. #else
  509. static int input YY_PROTO(( void ));
  510. #endif
  511. #endif
  512. #if YY_STACK_USED
  513. static int yy_start_stack_ptr = 0;
  514. static int yy_start_stack_depth = 0;
  515. static int *yy_start_stack = 0;
  516. #ifndef YY_NO_PUSH_STATE
  517. static void yy_push_state YY_PROTO(( int new_state ));
  518. #endif
  519. #ifndef YY_NO_POP_STATE
  520. static void yy_pop_state YY_PROTO(( void ));
  521. #endif
  522. #ifndef YY_NO_TOP_STATE
  523. static int yy_top_state YY_PROTO(( void ));
  524. #endif
  525. #else
  526. #define YY_NO_PUSH_STATE 1
  527. #define YY_NO_POP_STATE 1
  528. #define YY_NO_TOP_STATE 1
  529. #endif
  530. #ifdef YY_MALLOC_DECL
  531. YY_MALLOC_DECL
  532. #else
  533. #if __STDC__
  534. #ifndef __cplusplus
  535. #include <stdlib.h>
  536. #endif
  537. #else
  538. /* Just try to get by without declaring the routines. This will fail
  539. * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
  540. * or sizeof(void*) != sizeof(int).
  541. */
  542. #endif
  543. #endif
  544. /* Amount of stuff to slurp up with each read. */
  545. #ifndef YY_READ_BUF_SIZE
  546. #define YY_READ_BUF_SIZE 8192
  547. #endif
  548. /* Copy whatever the last rule matched to the standard output. */
  549. #ifndef ECHO
  550. /* This used to be an fputs(), but since the string might contain NUL's,
  551. * we now use fwrite().
  552. */
  553. #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
  554. #endif
  555. /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
  556. * is returned in "result".
  557. */
  558. #ifndef YY_INPUT
  559. #define YY_INPUT(buf,result,max_size) \
  560. if ( yy_current_buffer->yy_is_interactive ) \
  561. { \
  562. int c = '*', n; \
  563. for ( n = 0; n < max_size && \
  564. (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
  565. buf[n] = (char) c; \
  566. if ( c == '\n' ) \
  567. buf[n++] = (char) c; \
  568. if ( c == EOF && ferror( yyin ) ) \
  569. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  570. result = n; \
  571. } \
  572. else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
  573. && ferror( yyin ) ) \
  574. YY_FATAL_ERROR( "input in flex scanner failed" );
  575. #endif
  576. /* No semi-colon after return; correct usage is to write "yyterminate();" -
  577. * we don't want an extra ';' after the "return" because that will cause
  578. * some compilers to complain about unreachable statements.
  579. */
  580. #ifndef yyterminate
  581. #define yyterminate() return YY_NULL
  582. #endif
  583. /* Number of entries by which start-condition stack grows. */
  584. #ifndef YY_START_STACK_INCR
  585. #define YY_START_STACK_INCR 25
  586. #endif
  587. /* Report a fatal error. */
  588. #ifndef YY_FATAL_ERROR
  589. #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
  590. #endif
  591. /* Default declaration of generated scanner - a define so the user can
  592. * easily add parameters.
  593. */
  594. #ifndef YY_DECL
  595. #define YY_DECL int yylex YY_PROTO(( void ))
  596. #endif
  597. /* Code executed at the beginning of each rule, after yytext and yyleng
  598. * have been set up.
  599. */
  600. #ifndef YY_USER_ACTION
  601. #define YY_USER_ACTION
  602. #endif
  603. /* Code executed at the end of each rule. */
  604. #ifndef YY_BREAK
  605. #define YY_BREAK break;
  606. #endif
  607. #define YY_RULE_SETUP \
  608. YY_USER_ACTION
  609. YY_DECL
  610. {
  611. register yy_state_type yy_current_state;
  612. register char *yy_cp, *yy_bp;
  613. register int yy_act;
  614. #line 35 "ncgen.l"
  615. #line 736 "lex.yy.c"
  616. if ( yy_init )
  617. {
  618. yy_init = 0;
  619. #ifdef YY_USER_INIT
  620. YY_USER_INIT;
  621. #endif
  622. if ( ! yy_start )
  623. yy_start = 1; /* first start state */
  624. if ( ! yyin )
  625. yyin = stdin;
  626. if ( ! yyout )
  627. yyout = stdout;
  628. if ( ! yy_current_buffer )
  629. yy_current_buffer =
  630. yy_create_buffer( yyin, YY_BUF_SIZE );
  631. yy_load_buffer_state();
  632. }
  633. while ( 1 ) /* loops until end-of-file is reached */
  634. {
  635. yy_cp = yy_c_buf_p;
  636. /* Support of yytext. */
  637. *yy_cp = yy_hold_char;
  638. /* yy_bp points to the position in yy_ch_buf of the start of
  639. * the current run.
  640. */
  641. yy_bp = yy_cp;
  642. yy_current_state = yy_start;
  643. yy_match:
  644. do
  645. {
  646. register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
  647. if ( yy_accept[yy_current_state] )
  648. {
  649. yy_last_accepting_state = yy_current_state;
  650. yy_last_accepting_cpos = yy_cp;
  651. }
  652. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  653. {
  654. yy_current_state = (int) yy_def[yy_current_state];
  655. if ( yy_current_state >= 249 )
  656. yy_c = yy_meta[(unsigned int) yy_c];
  657. }
  658. yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  659. ++yy_cp;
  660. }
  661. while ( yy_base[yy_current_state] != 443 );
  662. yy_find_action:
  663. yy_act = yy_accept[yy_current_state];
  664. if ( yy_act == 0 )
  665. { /* have to back up */
  666. yy_cp = yy_last_accepting_cpos;
  667. yy_current_state = yy_last_accepting_state;
  668. yy_act = yy_accept[yy_current_state];
  669. }
  670. YY_DO_BEFORE_ACTION;
  671. do_action: /* This label is used only to access EOF actions. */
  672. switch ( yy_act )
  673. { /* beginning of action switch */
  674. case 0: /* must back up */
  675. /* undo the effects of YY_DO_BEFORE_ACTION */
  676. *yy_cp = yy_hold_char;
  677. yy_cp = yy_last_accepting_cpos;
  678. yy_current_state = yy_last_accepting_state;
  679. goto yy_find_action;
  680. case 1:
  681. YY_RULE_SETUP
  682. #line 36 "ncgen.l"
  683. { /* comment */
  684. break;
  685. }
  686. YY_BREAK
  687. case 2:
  688. YY_RULE_SETUP
  689. #line 40 "ncgen.l"
  690. {
  691. if(yyleng > MAXTRST) {
  692. yyerror("string too long, truncated\n");
  693. yytext[MAXTRST-1] = '\0';
  694. }
  695. expand_escapes(termstring,(char *)yytext,yyleng);
  696. return (TERMSTRING);
  697. }
  698. YY_BREAK
  699. case 3:
  700. YY_RULE_SETUP
  701. #line 49 "ncgen.l"
  702. {return (FLOAT_K);}
  703. YY_BREAK
  704. case 4:
  705. YY_RULE_SETUP
  706. #line 50 "ncgen.l"
  707. {return (CHAR_K);}
  708. YY_BREAK
  709. case 5:
  710. YY_RULE_SETUP
  711. #line 51 "ncgen.l"
  712. {return (BYTE_K);}
  713. YY_BREAK
  714. case 6:
  715. YY_RULE_SETUP
  716. #line 52 "ncgen.l"
  717. {return (SHORT_K);}
  718. YY_BREAK
  719. case 7:
  720. YY_RULE_SETUP
  721. #line 53 "ncgen.l"
  722. {return (INT_K);}
  723. YY_BREAK
  724. case 8:
  725. YY_RULE_SETUP
  726. #line 54 "ncgen.l"
  727. {return (DOUBLE_K);}
  728. YY_BREAK
  729. case 9:
  730. YY_RULE_SETUP
  731. #line 55 "ncgen.l"
  732. {int_val = -1;
  733. return (NC_UNLIMITED_K);}
  734. YY_BREAK
  735. case 10:
  736. YY_RULE_SETUP
  737. #line 58 "ncgen.l"
  738. {return (DIMENSIONS);}
  739. YY_BREAK
  740. case 11:
  741. YY_RULE_SETUP
  742. #line 59 "ncgen.l"
  743. {return (VARIABLES);}
  744. YY_BREAK
  745. case 12:
  746. YY_RULE_SETUP
  747. #line 60 "ncgen.l"
  748. {return (DATA);}
  749. YY_BREAK
  750. case 13:
  751. YY_RULE_SETUP
  752. #line 61 "ncgen.l"
  753. {
  754. char *s = (char*)yytext+strlen("netcdf");
  755. char *t = (char*)yytext+yyleng-1;
  756. while (isspace(*s))
  757. s++;
  758. while (isspace(*t))
  759. t--;
  760. t++;
  761. if (t-s+1 < 1) {
  762. yyerror("netCDF name required");
  763. return (DATA); /* generate syntax error */
  764. }
  765. netcdfname = (char *) emalloc(t-s+1);
  766. (void) strncpy(netcdfname, s, t-s);
  767. netcdfname[t-s] = '\0';
  768. return (NETCDF);
  769. }
  770. YY_BREAK
  771. case 14:
  772. YY_RULE_SETUP
  773. #line 78 "ncgen.l"
  774. { /* missing value (pre-2.4 backward compatibility) */
  775. if (yytext[0] == '-') {
  776. double_val = -NC_FILL_DOUBLE;
  777. } else {
  778. double_val = NC_FILL_DOUBLE;
  779. }
  780. return (DOUBLE_CONST);
  781. }
  782. YY_BREAK
  783. case 15:
  784. YY_RULE_SETUP
  785. #line 86 "ncgen.l"
  786. { /* missing value (pre-2.4 backward compatibility) */
  787. if (yytext[0] == '-') {
  788. float_val = -NC_FILL_FLOAT;
  789. } else {
  790. float_val = NC_FILL_FLOAT;
  791. }
  792. return (FLOAT_CONST);
  793. }
  794. YY_BREAK
  795. case 16:
  796. YY_RULE_SETUP
  797. #line 94 "ncgen.l"
  798. {
  799. if (STREQ((char *)yytext, FILL_STRING))
  800. return (FILLVALUE);
  801. if ((yylval = lookup((char *)yytext)) == NULL) {
  802. yylval = install((char *)yytext);
  803. }
  804. return (IDENT);
  805. }
  806. YY_BREAK
  807. case 17:
  808. YY_RULE_SETUP
  809. #line 103 "ncgen.l"
  810. {
  811. lineno++ ;
  812. break;
  813. }
  814. YY_BREAK
  815. case 18:
  816. YY_RULE_SETUP
  817. #line 108 "ncgen.l"
  818. {
  819. int ii;
  820. if (sscanf((char*)yytext, "%d", &ii) != 1) {
  821. sprintf(errstr,"bad byte constant: %s",(char*)yytext);
  822. yyerror(errstr);
  823. }
  824. byte_val = ii;
  825. if (ii != (int)byte_val) {
  826. sprintf(errstr,"byte constant out of range (-128,127): %s",(char*)yytext);
  827. yyerror(errstr);
  828. }
  829. return (BYTE_CONST);
  830. }
  831. YY_BREAK
  832. case 19:
  833. YY_RULE_SETUP
  834. #line 122 "ncgen.l"
  835. {
  836. if (sscanf((char*)yytext, "%le", &double_val) != 1) {
  837. sprintf(errstr,"bad long or double constant: %s",(char*)yytext);
  838. yyerror(errstr);
  839. }
  840. return (DOUBLE_CONST);
  841. }
  842. YY_BREAK
  843. case 20:
  844. YY_RULE_SETUP
  845. #line 129 "ncgen.l"
  846. {
  847. if (sscanf((char*)yytext, "%e", &float_val) != 1) {
  848. sprintf(errstr,"bad float constant: %s",(char*)yytext);
  849. yyerror(errstr);
  850. }
  851. return (FLOAT_CONST);
  852. }
  853. YY_BREAK
  854. case 21:
  855. YY_RULE_SETUP
  856. #line 136 "ncgen.l"
  857. {
  858. if (sscanf((char*)yytext, "%hd", &short_val) != 1) {
  859. sprintf(errstr,"bad short constant: %s",(char*)yytext);
  860. yyerror(errstr);
  861. }
  862. return (SHORT_CONST);
  863. }
  864. YY_BREAK
  865. case 22:
  866. YY_RULE_SETUP
  867. #line 143 "ncgen.l"
  868. {
  869. char *ptr;
  870. errno = 0;
  871. double_val = strtod((char*)yytext, &ptr);
  872. if (errno != 0 && double_val == 0.0) {
  873. sprintf(errstr,"bad numerical constant: %s",(char*)yytext);
  874. yyerror(errstr);
  875. }
  876. if (double_val < XDR_INT_MIN ||double_val > XDR_INT_MAX) {
  877. return DOUBLE_CONST;
  878. } else {
  879. int_val = (int) double_val;
  880. return INT_CONST;
  881. }
  882. }
  883. YY_BREAK
  884. case 23:
  885. YY_RULE_SETUP
  886. #line 158 "ncgen.l"
  887. {
  888. char *ptr;
  889. long long_val;
  890. errno = 0;
  891. long_val = strtol((char*)yytext, &ptr, 0);
  892. if (errno != 0) {
  893. sprintf(errstr,"bad long constant: %s",(char*)yytext);
  894. yyerror(errstr);
  895. }
  896. if (long_val < XDR_INT_MIN || long_val > XDR_INT_MAX) {
  897. double_val = (double) long_val;
  898. return DOUBLE_CONST;
  899. } else {
  900. int_val = (int) long_val;
  901. return INT_CONST;
  902. }
  903. }
  904. YY_BREAK
  905. case 24:
  906. YY_RULE_SETUP
  907. #line 175 "ncgen.l"
  908. {
  909. (void) sscanf((char*)&yytext[1],"%c",&byte_val);
  910. return (BYTE_CONST);
  911. }
  912. YY_BREAK
  913. case 25:
  914. YY_RULE_SETUP
  915. #line 179 "ncgen.l"
  916. {
  917. byte_val = (char) strtol((char*)&yytext[2], (char **) 0, 8);
  918. return (BYTE_CONST);
  919. }
  920. YY_BREAK
  921. case 26:
  922. YY_RULE_SETUP
  923. #line 183 "ncgen.l"
  924. {
  925. byte_val = (char) strtol((char*)&yytext[3], (char **) 0, 16);
  926. return (BYTE_CONST);
  927. }
  928. YY_BREAK
  929. case 27:
  930. YY_RULE_SETUP
  931. #line 187 "ncgen.l"
  932. {
  933. switch ((char)yytext[2]) {
  934. case 'a': byte_val = '\007'; break; /* not everyone under-
  935. * stands '\a' yet */
  936. case 'b': byte_val = '\b'; break;
  937. case 'f': byte_val = '\f'; break;
  938. case 'n': byte_val = '\n'; break;
  939. case 'r': byte_val = '\r'; break;
  940. case 't': byte_val = '\t'; break;
  941. case 'v': byte_val = '\v'; break;
  942. case '\\': byte_val = '\\'; break;
  943. case '?': byte_val = '\177'; break;
  944. case '\'': byte_val = '\''; break;
  945. default: byte_val = (char)yytext[2];
  946. }
  947. return (BYTE_CONST);
  948. }
  949. YY_BREAK
  950. case 28:
  951. YY_RULE_SETUP
  952. #line 205 "ncgen.l"
  953. { /* whitespace */
  954. break;
  955. }
  956. YY_BREAK
  957. case 29:
  958. YY_RULE_SETUP
  959. #line 208 "ncgen.l"
  960. return (yytext[0]) ;
  961. YY_BREAK
  962. case 30:
  963. YY_RULE_SETUP
  964. #line 209 "ncgen.l"
  965. ECHO;
  966. YY_BREAK
  967. #line 1106 "lex.yy.c"
  968. case YY_STATE_EOF(INITIAL):
  969. yyterminate();
  970. case YY_END_OF_BUFFER:
  971. {
  972. /* Amount of text matched not including the EOB char. */
  973. int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
  974. /* Undo the effects of YY_DO_BEFORE_ACTION. */
  975. *yy_cp = yy_hold_char;
  976. YY_RESTORE_YY_MORE_OFFSET
  977. if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
  978. {
  979. /* We're scanning a new file or input source. It's
  980. * possible that this happened because the user
  981. * just pointed yyin at a new source and called
  982. * yylex(). If so, then we have to assure
  983. * consistency between yy_current_buffer and our
  984. * globals. Here is the right place to do so, because
  985. * this is the first action (other than possibly a
  986. * back-up) that will match for the new input source.
  987. */
  988. yy_n_chars = yy_current_buffer->yy_n_chars;
  989. yy_current_buffer->yy_input_file = yyin;
  990. yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
  991. }
  992. /* Note that here we test for yy_c_buf_p "<=" to the position
  993. * of the first EOB in the buffer, since yy_c_buf_p will
  994. * already have been incremented past the NUL character
  995. * (since all states make transitions on EOB to the
  996. * end-of-buffer state). Contrast this with the test
  997. * in input().
  998. */
  999. if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  1000. { /* This was really a NUL. */
  1001. yy_state_type yy_next_state;
  1002. yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
  1003. yy_current_state = yy_get_previous_state();
  1004. /* Okay, we're now positioned to make the NUL
  1005. * transition. We couldn't have
  1006. * yy_get_previous_state() go ahead and do it
  1007. * for us because it doesn't know how to deal
  1008. * with the possibility of jamming (and we don't
  1009. * want to build jamming into it because then it
  1010. * will run more slowly).
  1011. */
  1012. yy_next_state = yy_try_NUL_trans( yy_current_state );
  1013. yy_bp = yytext_ptr + YY_MORE_ADJ;
  1014. if ( yy_next_state )
  1015. {
  1016. /* Consume the NUL. */
  1017. yy_cp = ++yy_c_buf_p;
  1018. yy_current_state = yy_next_state;
  1019. goto yy_match;
  1020. }
  1021. else
  1022. {
  1023. yy_cp = yy_c_buf_p;
  1024. goto yy_find_action;
  1025. }
  1026. }
  1027. else switch ( yy_get_next_buffer() )
  1028. {
  1029. case EOB_ACT_END_OF_FILE:
  1030. {
  1031. yy_did_buffer_switch_on_eof = 0;
  1032. if ( yywrap() )
  1033. {
  1034. /* Note: because we've taken care in
  1035. * yy_get_next_buffer() to have set up
  1036. * yytext, we can now set up
  1037. * yy_c_buf_p so that if some total
  1038. * hoser (like flex itself) wants to
  1039. * call the scanner after we return the
  1040. * YY_NULL, it'll still work - another
  1041. * YY_NULL will get returned.
  1042. */
  1043. yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
  1044. yy_act = YY_STATE_EOF(YY_START);
  1045. goto do_action;
  1046. }
  1047. else
  1048. {
  1049. if ( ! yy_did_buffer_switch_on_eof )
  1050. YY_NEW_FILE;
  1051. }
  1052. break;
  1053. }
  1054. case EOB_ACT_CONTINUE_SCAN:
  1055. yy_c_buf_p =
  1056. yytext_ptr + yy_amount_of_matched_text;
  1057. yy_current_state = yy_get_previous_state();
  1058. yy_cp = yy_c_buf_p;
  1059. yy_bp = yytext_ptr + YY_MORE_ADJ;
  1060. goto yy_match;
  1061. case EOB_ACT_LAST_MATCH:
  1062. yy_c_buf_p =
  1063. &yy_current_buffer->yy_ch_buf[yy_n_chars];
  1064. yy_current_state = yy_get_previous_state();
  1065. yy_cp = yy_c_buf_p;
  1066. yy_bp = yytext_ptr + YY_MORE_ADJ;
  1067. goto yy_find_action;
  1068. }
  1069. break;
  1070. }
  1071. default:
  1072. YY_FATAL_ERROR(
  1073. "fatal flex scanner internal error--no action found" );
  1074. } /* end of action switch */
  1075. } /* end of scanning one token */
  1076. } /* end of yylex */
  1077. /* yy_get_next_buffer - try to read in a new buffer
  1078. *
  1079. * Returns a code representing an action:
  1080. * EOB_ACT_LAST_MATCH -
  1081. * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  1082. * EOB_ACT_END_OF_FILE - end of file
  1083. */
  1084. static int yy_get_next_buffer()
  1085. {
  1086. register char *dest = yy_current_buffer->yy_ch_buf;
  1087. register char *source = yytext_ptr;
  1088. register int number_to_move, i;
  1089. int ret_val;
  1090. if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
  1091. YY_FATAL_ERROR(
  1092. "fatal flex scanner internal error--end of buffer missed" );
  1093. if ( yy_current_buffer->yy_fill_buffer == 0 )
  1094. { /* Don't try to fill the buffer, so this is an EOF. */
  1095. if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
  1096. {
  1097. /* We matched a single character, the EOB, so
  1098. * treat this as a final EOF.
  1099. */
  1100. return EOB_ACT_END_OF_FILE;
  1101. }
  1102. else
  1103. {
  1104. /* We matched some text prior to the EOB, first
  1105. * process it.
  1106. */
  1107. return EOB_ACT_LAST_MATCH;
  1108. }
  1109. }
  1110. /* Try to read more data. */
  1111. /* First move last chars to start of buffer. */
  1112. number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
  1113. for ( i = 0; i < number_to_move; ++i )
  1114. *(dest++) = *(source++);
  1115. if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
  1116. /* don't do the read, it's not guaranteed to return an EOF,
  1117. * just force an EOF
  1118. */
  1119. yy_n_chars = 0;
  1120. else
  1121. {
  1122. int num_to_read =
  1123. yy_current_buffer->yy_buf_size - number_to_move - 1;
  1124. while ( num_to_read <= 0 )
  1125. { /* Not enough room in the buffer - grow it. */
  1126. #ifdef YY_USES_REJECT
  1127. YY_FATAL_ERROR(
  1128. "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
  1129. #else
  1130. /* just a shorter name for the current buffer */
  1131. YY_BUFFER_STATE b = yy_current_buffer;
  1132. int yy_c_buf_p_offset =
  1133. (int) (yy_c_buf_p - b->yy_ch_buf);
  1134. if ( b->yy_is_our_buffer )
  1135. {
  1136. int new_size = b->yy_buf_size * 2;
  1137. if ( new_size <= 0 )
  1138. b->yy_buf_size += b->yy_buf_size / 8;
  1139. else
  1140. b->yy_buf_size *= 2;
  1141. b->yy_ch_buf = (char *)
  1142. /* Include room in for 2 EOB chars. */
  1143. yy_flex_realloc( (void *) b->yy_ch_buf,
  1144. b->yy_buf_size + 2 );
  1145. }
  1146. else
  1147. /* Can't grow it, we don't own it. */
  1148. b->yy_ch_buf = 0;
  1149. if ( ! b->yy_ch_buf )
  1150. YY_FATAL_ERROR(
  1151. "fatal error - scanner input buffer overflow" );
  1152. yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
  1153. num_to_read = yy_current_buffer->yy_buf_size -
  1154. number_to_move - 1;
  1155. #endif
  1156. }
  1157. if ( num_to_read > YY_READ_BUF_SIZE )
  1158. num_to_read = YY_READ_BUF_SIZE;
  1159. /* Read in more data. */
  1160. YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
  1161. yy_n_chars, num_to_read );
  1162. }
  1163. if ( yy_n_chars == 0 )
  1164. {
  1165. if ( number_to_move == YY_MORE_ADJ )
  1166. {
  1167. ret_val = EOB_ACT_END_OF_FILE;
  1168. yyrestart( yyin );
  1169. }
  1170. else
  1171. {
  1172. ret_val = EOB_ACT_LAST_MATCH;
  1173. yy_current_buffer->yy_buffer_status =
  1174. YY_BUFFER_EOF_PENDING;
  1175. }
  1176. }
  1177. else
  1178. ret_val = EOB_ACT_CONTINUE_SCAN;
  1179. yy_n_chars += number_to_move;
  1180. yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  1181. yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  1182. yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
  1183. return ret_val;
  1184. }
  1185. /* yy_get_previous_state - get the state just before the EOB char was reached */
  1186. static yy_state_type yy_get_previous_state()
  1187. {
  1188. register yy_state_type yy_current_state;
  1189. register char *yy_cp;
  1190. yy_current_state = yy_start;
  1191. for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
  1192. {
  1193. register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
  1194. if ( yy_accept[yy_current_state] )
  1195. {
  1196. yy_last_accepting_state = yy_current_state;
  1197. yy_last_accepting_cpos = yy_cp;
  1198. }
  1199. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1200. {
  1201. yy_current_state = (int) yy_def[yy_current_state];
  1202. if ( yy_current_state >= 249 )
  1203. yy_c = yy_meta[(unsigned int) yy_c];
  1204. }
  1205. yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  1206. }
  1207. return yy_current_state;
  1208. }
  1209. /* yy_try_NUL_trans - try to make a transition on the NUL character
  1210. *
  1211. * synopsis
  1212. * next_state = yy_try_NUL_trans( current_state );
  1213. */
  1214. #ifdef YY_USE_PROTOS
  1215. static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
  1216. #else
  1217. static yy_state_type yy_try_NUL_trans( yy_current_state )
  1218. yy_state_type yy_current_state;
  1219. #endif
  1220. {
  1221. register int yy_is_jam;
  1222. register char *yy_cp = yy_c_buf_p;
  1223. register YY_CHAR yy_c = 1;
  1224. if ( yy_accept[yy_current_state] )
  1225. {
  1226. yy_last_accepting_state = yy_current_state;
  1227. yy_last_accepting_cpos = yy_cp;
  1228. }
  1229. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1230. {
  1231. yy_current_state = (int) yy_def[yy_current_state];
  1232. if ( yy_current_state >= 249 )
  1233. yy_c = yy_meta[(unsigned int) yy_c];
  1234. }
  1235. yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  1236. yy_is_jam = (yy_current_state == 248);
  1237. return yy_is_jam ? 0 : yy_current_state;
  1238. }
  1239. #ifndef YY_NO_UNPUT
  1240. #ifdef YY_USE_PROTOS
  1241. static void yyunput( int c, register char *yy_bp )
  1242. #else
  1243. static void yyunput( c, yy_bp )
  1244. int c;
  1245. register char *yy_bp;
  1246. #endif
  1247. {
  1248. register char *yy_cp = yy_c_buf_p;
  1249. /* undo effects of setting up yytext */
  1250. *yy_cp = yy_hold_char;
  1251. if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  1252. { /* need to shift things up to make room */
  1253. /* +2 for EOB chars. */
  1254. register int number_to_move = yy_n_chars + 2;
  1255. register char *dest = &yy_current_buffer->yy_ch_buf[
  1256. yy_current_buffer->yy_buf_size + 2];
  1257. register char *source =
  1258. &yy_current_buffer->yy_ch_buf[number_to_move];
  1259. while ( source > yy_current_buffer->yy_ch_buf )
  1260. *--dest = *--source;
  1261. yy_cp += (int) (dest - source);
  1262. yy_bp += (int) (dest - source);
  1263. yy_n_chars = yy_current_buffer->yy_buf_size;
  1264. if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  1265. YY_FATAL_ERROR( "flex scanner push-back overflow" );
  1266. }
  1267. *--yy_cp = (char) c;
  1268. yytext_ptr = yy_bp;
  1269. yy_hold_char = *yy_cp;
  1270. yy_c_buf_p = yy_cp;
  1271. }
  1272. #endif /* ifndef YY_NO_UNPUT */
  1273. #ifdef __cplusplus
  1274. static int yyinput()
  1275. #else
  1276. static int input()
  1277. #endif
  1278. {
  1279. int c;
  1280. *yy_c_buf_p = yy_hold_char;
  1281. if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  1282. {
  1283. /* yy_c_buf_p now points to the character we want to return.
  1284. * If this occurs *before* the EOB characters, then it's a
  1285. * valid NUL; if not, then we've hit the end of the buffer.
  1286. */
  1287. if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  1288. /* This was really a NUL. */
  1289. *yy_c_buf_p = '\0';
  1290. else
  1291. { /* need more input */
  1292. int offset = yy_c_buf_p - yytext_ptr;
  1293. ++yy_c_buf_p;
  1294. switch ( yy_get_next_buffer() )
  1295. {
  1296. case EOB_ACT_END_OF_FILE:
  1297. {
  1298. if ( yywrap() )
  1299. {
  1300. yy_c_buf_p = yytext_ptr + offset;
  1301. return EOF;
  1302. }
  1303. if ( ! yy_did_buffer_switch_on_eof )
  1304. YY_NEW_FILE;
  1305. #ifdef __cplusplus
  1306. return yyinput();
  1307. #else
  1308. return input();
  1309. #endif
  1310. }
  1311. case EOB_ACT_CONTINUE_SCAN:
  1312. yy_c_buf_p = yytext_ptr + offset;
  1313. break;
  1314. case EOB_ACT_LAST_MATCH:
  1315. #ifdef __cplusplus
  1316. YY_FATAL_ERROR(
  1317. "unexpected last match in yyinput()" );
  1318. #else
  1319. YY_FATAL_ERROR(
  1320. "unexpected last match in input()" );
  1321. #endif
  1322. }
  1323. }
  1324. }
  1325. c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
  1326. *yy_c_buf_p = '\0'; /* preserve yytext */
  1327. yy_hold_char = *++yy_c_buf_p;
  1328. return c;
  1329. }
  1330. #ifdef YY_USE_PROTOS
  1331. void yyrestart( FILE *input_file )
  1332. #else
  1333. void yyrestart( input_file )
  1334. FILE *input_file;
  1335. #endif
  1336. {
  1337. if ( ! yy_current_buffer )
  1338. yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
  1339. yy_init_buffer( yy_current_buffer, input_file );
  1340. yy_load_buffer_state();
  1341. }
  1342. #ifdef YY_USE_PROTOS
  1343. void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
  1344. #else
  1345. void yy_switch_to_buffer( new_buffer )
  1346. YY_BUFFER_STATE new_buffer;
  1347. #endif
  1348. {
  1349. if ( yy_current_buffer == new_buffer )
  1350. return;
  1351. if ( yy_current_buffer )
  1352. {
  1353. /* Flush out information for old buffer. */
  1354. *yy_c_buf_p = yy_hold_char;
  1355. yy_current_buffer->yy_buf_pos = yy_c_buf_p;
  1356. yy_current_buffer->yy_n_chars = yy_n_chars;
  1357. }
  1358. yy_current_buffer = new_buffer;
  1359. yy_load_buffer_state();
  1360. /* We don't actually know whether we did this switch during
  1361. * EOF (yywrap()) processing, but the only time this flag
  1362. * is looked at is after yywrap() is called, so it's safe
  1363. * to go ahead and always set it.
  1364. */
  1365. yy_did_buffer_switch_on_eof = 1;
  1366. }
  1367. #ifdef YY_USE_PROTOS
  1368. void yy_load_buffer_state( void )
  1369. #else
  1370. void yy_load_buffer_state()
  1371. #endif
  1372. {
  1373. yy_n_chars = yy_current_buffer->yy_n_chars;
  1374. yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
  1375. yyin = yy_current_buffer->yy_input_file;
  1376. yy_hold_char = *yy_c_buf_p;
  1377. }
  1378. #ifdef YY_USE_PROTOS
  1379. YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
  1380. #else
  1381. YY_BUFFER_STATE yy_create_buffer( file, size )
  1382. FILE *file;
  1383. int size;
  1384. #endif
  1385. {
  1386. YY_BUFFER_STATE b;
  1387. b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
  1388. if ( ! b )
  1389. YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1390. b->yy_buf_size = size;
  1391. /* yy_ch_buf has to be 2 characters longer than the size given because
  1392. * we need to put in 2 end-of-buffer characters.
  1393. */
  1394. b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
  1395. if ( ! b->yy_ch_buf )
  1396. YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1397. b->yy_is_our_buffer = 1;
  1398. yy_init_buffer( b, file );
  1399. return b;
  1400. }
  1401. #ifdef YY_USE_PROTOS
  1402. void yy_delete_buffer( YY_BUFFER_STATE b )
  1403. #else
  1404. void yy_delete_buffer( b )
  1405. YY_BUFFER_STATE b;
  1406. #endif
  1407. {
  1408. if ( ! b )
  1409. return;
  1410. if ( b == yy_current_buffer )
  1411. yy_current_buffer = (YY_BUFFER_STATE) 0;
  1412. if ( b->yy_is_our_buffer )
  1413. yy_flex_free( (void *) b->yy_ch_buf );
  1414. yy_flex_free( (void *) b );
  1415. }
  1416. #ifndef YY_ALWAYS_INTERACTIVE
  1417. #ifndef YY_NEVER_INTERACTIVE
  1418. extern int isatty YY_PROTO(( int ));
  1419. #endif
  1420. #endif
  1421. #ifdef YY_USE_PROTOS
  1422. void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
  1423. #else
  1424. void yy_init_buffer( b, file )
  1425. YY_BUFFER_STATE b;
  1426. FILE *file;
  1427. #endif
  1428. {
  1429. yy_flush_buffer( b );
  1430. b->yy_input_file = file;
  1431. b->yy_fill_buffer = 1;
  1432. #if YY_ALWAYS_INTERACTIVE
  1433. b->yy_is_interactive = 1;
  1434. #else
  1435. #if YY_NEVER_INTERACTIVE
  1436. b->yy_is_interactive = 0;
  1437. #else
  1438. b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
  1439. #endif
  1440. #endif
  1441. }
  1442. #ifdef YY_USE_PROTOS
  1443. void yy_flush_buffer( YY_BUFFER_STATE b )
  1444. #else
  1445. void yy_flush_buffer( b )
  1446. YY_BUFFER_STATE b;
  1447. #endif
  1448. {
  1449. b->yy_n_chars = 0;
  1450. /* We always need two end-of-buffer characters. The first causes
  1451. * a transition to the end-of-buffer state. The second causes
  1452. * a jam in that state.
  1453. */
  1454. b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
  1455. b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  1456. b->yy_buf_pos = &b->yy_ch_buf[0];
  1457. b->yy_at_bol = 1;
  1458. b->yy_buffer_status = YY_BUFFER_NEW;
  1459. if ( b == yy_current_buffer )
  1460. yy_load_buffer_state();
  1461. }
  1462. #ifndef YY_NO_SCAN_BUFFER
  1463. #ifdef YY_USE_PROTOS
  1464. YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
  1465. #else
  1466. YY_BUFFER_STATE yy_scan_buffer( base, size )
  1467. char *base;
  1468. yy_size_t size;
  1469. #endif
  1470. {
  1471. YY_BUFFER_STATE b;
  1472. if ( size < 2 ||
  1473. base[size-2] != YY_END_OF_BUFFER_CHAR ||
  1474. base[size-1] != YY_END_OF_BUFFER_CHAR )
  1475. /* They forgot to leave room for the EOB's. */
  1476. return 0;
  1477. b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
  1478. if ( ! b )
  1479. YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
  1480. b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
  1481. b->yy_buf_pos = b->yy_ch_buf = base;
  1482. b->yy_is_our_buffer = 0;
  1483. b->yy_input_file = 0;
  1484. b->yy_n_chars = b->yy_buf_size;
  1485. b->yy_is_interactive = 0;
  1486. b->yy_at_bol = 1;
  1487. b->yy_fill_buffer = 0;
  1488. b->yy_buffer_status = YY_BUFFER_NEW;
  1489. yy_switch_to_buffer( b );
  1490. return b;
  1491. }
  1492. #endif
  1493. #ifndef YY_NO_SCAN_STRING
  1494. #ifdef YY_USE_PROTOS
  1495. YY_BUFFER_STATE yy_scan_string( yyconst char *__flex_scan_str )
  1496. #else
  1497. YY_BUFFER_STATE yy_scan_string( __flex_scan_str )
  1498. yyconst char *__flex_scan_str;
  1499. #endif
  1500. {
  1501. int len;
  1502. for ( len = 0; __flex_scan_str[len]; ++len )

Large files files are truncated, but you can click here to view the full file