lex.lex.c_shipped 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292
  1. #line 3 "scripts/genksyms/lex.lex.c_shipped"
  2. #define YY_INT_ALIGNED short int
  3. /* A lexical scanner generated by flex */
  4. #define FLEX_SCANNER
  5. #define YY_FLEX_MAJOR_VERSION 2
  6. #define YY_FLEX_MINOR_VERSION 5
  7. #define YY_FLEX_SUBMINOR_VERSION 35
  8. #if YY_FLEX_SUBMINOR_VERSION > 0
  9. #define FLEX_BETA
  10. #endif
  11. /* First, we deal with platform-specific or compiler-specific issues. */
  12. /* begin standard C headers. */
  13. #include <stdio.h>
  14. #include <string.h>
  15. #include <errno.h>
  16. #include <stdlib.h>
  17. /* end standard C headers. */
  18. /* flex integer type definitions */
  19. #ifndef FLEXINT_H
  20. #define FLEXINT_H
  21. /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
  22. #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  23. /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
  24. * if you want the limit (max/min) macros for int types.
  25. */
  26. #ifndef __STDC_LIMIT_MACROS
  27. #define __STDC_LIMIT_MACROS 1
  28. #endif
  29. #include <inttypes.h>
  30. typedef int8_t flex_int8_t;
  31. typedef uint8_t flex_uint8_t;
  32. typedef int16_t flex_int16_t;
  33. typedef uint16_t flex_uint16_t;
  34. typedef int32_t flex_int32_t;
  35. typedef uint32_t flex_uint32_t;
  36. #else
  37. typedef signed char flex_int8_t;
  38. typedef short int flex_int16_t;
  39. typedef int flex_int32_t;
  40. typedef unsigned char flex_uint8_t;
  41. typedef unsigned short int flex_uint16_t;
  42. typedef unsigned int flex_uint32_t;
  43. #endif /* ! C99 */
  44. /* Limits of integral types. */
  45. #ifndef INT8_MIN
  46. #define INT8_MIN (-128)
  47. #endif
  48. #ifndef INT16_MIN
  49. #define INT16_MIN (-32767-1)
  50. #endif
  51. #ifndef INT32_MIN
  52. #define INT32_MIN (-2147483647-1)
  53. #endif
  54. #ifndef INT8_MAX
  55. #define INT8_MAX (127)
  56. #endif
  57. #ifndef INT16_MAX
  58. #define INT16_MAX (32767)
  59. #endif
  60. #ifndef INT32_MAX
  61. #define INT32_MAX (2147483647)
  62. #endif
  63. #ifndef UINT8_MAX
  64. #define UINT8_MAX (255U)
  65. #endif
  66. #ifndef UINT16_MAX
  67. #define UINT16_MAX (65535U)
  68. #endif
  69. #ifndef UINT32_MAX
  70. #define UINT32_MAX (4294967295U)
  71. #endif
  72. #endif /* ! FLEXINT_H */
  73. #ifdef __cplusplus
  74. /* The "const" storage-class-modifier is valid. */
  75. #define YY_USE_CONST
  76. #else /* ! __cplusplus */
  77. /* C99 requires __STDC__ to be defined as 1. */
  78. #if defined (__STDC__)
  79. #define YY_USE_CONST
  80. #endif /* defined (__STDC__) */
  81. #endif /* ! __cplusplus */
  82. #ifdef YY_USE_CONST
  83. #define yyconst const
  84. #else
  85. #define yyconst
  86. #endif
  87. /* Returned upon end-of-file. */
  88. #define YY_NULL 0
  89. /* Promotes a possibly negative, possibly signed char to an unsigned
  90. * integer for use as an array index. If the signed char is negative,
  91. * we want to instead treat it as an 8-bit unsigned char, hence the
  92. * double cast.
  93. */
  94. #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
  95. /* Enter a start condition. This macro really ought to take a parameter,
  96. * but we do it the disgusting crufty way forced on us by the ()-less
  97. * definition of BEGIN.
  98. */
  99. #define BEGIN (yy_start) = 1 + 2 *
  100. /* Translate the current start state into a value that can be later handed
  101. * to BEGIN to return to the state. The YYSTATE alias is for lex
  102. * compatibility.
  103. */
  104. #define YY_START (((yy_start) - 1) / 2)
  105. #define YYSTATE YY_START
  106. /* Action number for EOF rule of a given start state. */
  107. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  108. /* Special action meaning "start processing a new file". */
  109. #define YY_NEW_FILE yyrestart(yyin )
  110. #define YY_END_OF_BUFFER_CHAR 0
  111. /* Size of default input buffer. */
  112. #ifndef YY_BUF_SIZE
  113. #define YY_BUF_SIZE 16384
  114. #endif
  115. /* The state buf must be large enough to hold one state per character in the main buffer.
  116. */
  117. #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
  118. #ifndef YY_TYPEDEF_YY_BUFFER_STATE
  119. #define YY_TYPEDEF_YY_BUFFER_STATE
  120. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  121. #endif
  122. extern int yyleng;
  123. extern FILE *yyin, *yyout;
  124. #define EOB_ACT_CONTINUE_SCAN 0
  125. #define EOB_ACT_END_OF_FILE 1
  126. #define EOB_ACT_LAST_MATCH 2
  127. #define YY_LESS_LINENO(n)
  128. /* Return all but the first "n" matched characters back to the input stream. */
  129. #define yyless(n) \
  130. do \
  131. { \
  132. /* Undo effects of setting up yytext. */ \
  133. int yyless_macro_arg = (n); \
  134. YY_LESS_LINENO(yyless_macro_arg);\
  135. *yy_cp = (yy_hold_char); \
  136. YY_RESTORE_YY_MORE_OFFSET \
  137. (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
  138. YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  139. } \
  140. while ( 0 )
  141. #define unput(c) yyunput( c, (yytext_ptr) )
  142. #ifndef YY_TYPEDEF_YY_SIZE_T
  143. #define YY_TYPEDEF_YY_SIZE_T
  144. typedef size_t yy_size_t;
  145. #endif
  146. #ifndef YY_STRUCT_YY_BUFFER_STATE
  147. #define YY_STRUCT_YY_BUFFER_STATE
  148. struct yy_buffer_state
  149. {
  150. FILE *yy_input_file;
  151. char *yy_ch_buf; /* input buffer */
  152. char *yy_buf_pos; /* current position in input buffer */
  153. /* Size of input buffer in bytes, not including room for EOB
  154. * characters.
  155. */
  156. yy_size_t yy_buf_size;
  157. /* Number of characters read into yy_ch_buf, not including EOB
  158. * characters.
  159. */
  160. int yy_n_chars;
  161. /* Whether we "own" the buffer - i.e., we know we created it,
  162. * and can realloc() it to grow it, and should free() it to
  163. * delete it.
  164. */
  165. int yy_is_our_buffer;
  166. /* Whether this is an "interactive" input source; if so, and
  167. * if we're using stdio for input, then we want to use getc()
  168. * instead of fread(), to make sure we stop fetching input after
  169. * each newline.
  170. */
  171. int yy_is_interactive;
  172. /* Whether we're considered to be at the beginning of a line.
  173. * If so, '^' rules will be active on the next match, otherwise
  174. * not.
  175. */
  176. int yy_at_bol;
  177. int yy_bs_lineno; /**< The line count. */
  178. int yy_bs_column; /**< The column count. */
  179. /* Whether to try to fill the input buffer when we reach the
  180. * end of it.
  181. */
  182. int yy_fill_buffer;
  183. int yy_buffer_status;
  184. #define YY_BUFFER_NEW 0
  185. #define YY_BUFFER_NORMAL 1
  186. /* When an EOF's been seen but there's still some text to process
  187. * then we mark the buffer as YY_EOF_PENDING, to indicate that we
  188. * shouldn't try reading from the input source any more. We might
  189. * still have a bunch of tokens to match, though, because of
  190. * possible backing-up.
  191. *
  192. * When we actually see the EOF, we change the status to "new"
  193. * (via yyrestart()), so that the user can continue scanning by
  194. * just pointing yyin at a new input file.
  195. */
  196. #define YY_BUFFER_EOF_PENDING 2
  197. };
  198. #endif /* !YY_STRUCT_YY_BUFFER_STATE */
  199. /* Stack of input buffers. */
  200. static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
  201. static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
  202. static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
  203. /* We provide macros for accessing buffer states in case in the
  204. * future we want to put the buffer states in a more general
  205. * "scanner state".
  206. *
  207. * Returns the top of the stack, or NULL.
  208. */
  209. #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
  210. ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
  211. : NULL)
  212. /* Same as previous macro, but useful when we know that the buffer stack is not
  213. * NULL or when we need an lvalue. For internal use only.
  214. */
  215. #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
  216. /* yy_hold_char holds the character lost when yytext is formed. */
  217. static char yy_hold_char;
  218. static int yy_n_chars; /* number of characters read into yy_ch_buf */
  219. int yyleng;
  220. /* Points to current character in buffer. */
  221. static char *yy_c_buf_p = (char *) 0;
  222. static int yy_init = 0; /* whether we need to initialize */
  223. static int yy_start = 0; /* start state number */
  224. /* Flag which is used to allow yywrap()'s to do buffer switches
  225. * instead of setting up a fresh yyin. A bit of a hack ...
  226. */
  227. static int yy_did_buffer_switch_on_eof;
  228. void yyrestart (FILE *input_file );
  229. void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
  230. YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
  231. void yy_delete_buffer (YY_BUFFER_STATE b );
  232. void yy_flush_buffer (YY_BUFFER_STATE b );
  233. void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
  234. void yypop_buffer_state (void );
  235. static void yyensure_buffer_stack (void );
  236. static void yy_load_buffer_state (void );
  237. static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
  238. #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
  239. YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
  240. YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
  241. YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
  242. void *yyalloc (yy_size_t );
  243. void *yyrealloc (void *,yy_size_t );
  244. void yyfree (void * );
  245. #define yy_new_buffer yy_create_buffer
  246. #define yy_set_interactive(is_interactive) \
  247. { \
  248. if ( ! YY_CURRENT_BUFFER ){ \
  249. yyensure_buffer_stack (); \
  250. YY_CURRENT_BUFFER_LVALUE = \
  251. yy_create_buffer(yyin,YY_BUF_SIZE ); \
  252. } \
  253. YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
  254. }
  255. #define yy_set_bol(at_bol) \
  256. { \
  257. if ( ! YY_CURRENT_BUFFER ){\
  258. yyensure_buffer_stack (); \
  259. YY_CURRENT_BUFFER_LVALUE = \
  260. yy_create_buffer(yyin,YY_BUF_SIZE ); \
  261. } \
  262. YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
  263. }
  264. #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
  265. /* Begin user sect3 */
  266. #define yywrap(n) 1
  267. #define YY_SKIP_YYWRAP
  268. typedef unsigned char YY_CHAR;
  269. FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
  270. typedef int yy_state_type;
  271. extern int yylineno;
  272. int yylineno = 1;
  273. extern char *yytext;
  274. #define yytext_ptr yytext
  275. static yy_state_type yy_get_previous_state (void );
  276. static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
  277. static int yy_get_next_buffer (void );
  278. static void yy_fatal_error (yyconst char msg[] );
  279. /* Done after the current pattern has been matched and before the
  280. * corresponding action - sets up yytext.
  281. */
  282. #define YY_DO_BEFORE_ACTION \
  283. (yytext_ptr) = yy_bp; \
  284. yyleng = (size_t) (yy_cp - yy_bp); \
  285. (yy_hold_char) = *yy_cp; \
  286. *yy_cp = '\0'; \
  287. (yy_c_buf_p) = yy_cp;
  288. #define YY_NUM_RULES 13
  289. #define YY_END_OF_BUFFER 14
  290. /* This struct is not used in this scanner,
  291. but its presence is necessary. */
  292. struct yy_trans_info
  293. {
  294. flex_int32_t yy_verify;
  295. flex_int32_t yy_nxt;
  296. };
  297. static yyconst flex_int16_t yy_accept[73] =
  298. { 0,
  299. 0, 0, 14, 12, 4, 3, 12, 7, 12, 12,
  300. 12, 12, 12, 9, 9, 12, 12, 7, 12, 12,
  301. 4, 0, 5, 0, 7, 8, 0, 6, 0, 0,
  302. 10, 10, 9, 0, 0, 9, 9, 0, 9, 0,
  303. 0, 0, 0, 2, 0, 0, 11, 0, 10, 0,
  304. 10, 9, 9, 0, 0, 0, 10, 10, 0, 0,
  305. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  306. 1, 0
  307. } ;
  308. static yyconst flex_int32_t yy_ec[256] =
  309. { 0,
  310. 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
  311. 4, 4, 4, 1, 1, 1, 1, 1, 1, 1,
  312. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  313. 1, 2, 1, 5, 6, 7, 8, 9, 10, 1,
  314. 1, 8, 11, 1, 12, 13, 8, 14, 15, 15,
  315. 15, 15, 15, 15, 15, 16, 16, 1, 1, 17,
  316. 18, 19, 1, 1, 20, 20, 20, 20, 21, 22,
  317. 7, 7, 7, 7, 7, 23, 7, 7, 7, 7,
  318. 7, 7, 7, 7, 24, 7, 7, 25, 7, 7,
  319. 1, 26, 1, 8, 7, 1, 20, 20, 20, 20,
  320. 21, 22, 7, 7, 7, 7, 7, 27, 7, 7,
  321. 7, 7, 7, 7, 7, 7, 24, 7, 7, 25,
  322. 7, 7, 1, 28, 1, 8, 1, 1, 1, 1,
  323. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  324. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  325. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  326. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  327. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  328. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  329. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  330. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  331. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  332. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  333. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  334. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  335. 1, 1, 1, 1, 1
  336. } ;
  337. static yyconst flex_int32_t yy_meta[29] =
  338. { 0,
  339. 1, 1, 2, 1, 1, 1, 3, 1, 1, 1,
  340. 4, 4, 5, 6, 6, 6, 1, 1, 1, 7,
  341. 8, 7, 3, 3, 3, 1, 3, 1
  342. } ;
  343. static yyconst flex_int16_t yy_base[85] =
  344. { 0,
  345. 0, 145, 150, 266, 27, 266, 25, 0, 131, 23,
  346. 23, 16, 23, 39, 31, 25, 39, 60, 22, 65,
  347. 57, 43, 266, 0, 0, 266, 61, 266, 0, 128,
  348. 74, 0, 113, 59, 62, 113, 52, 0, 0, 72,
  349. 66, 110, 100, 266, 73, 74, 266, 70, 266, 90,
  350. 103, 266, 84, 129, 108, 113, 143, 266, 107, 66,
  351. 118, 137, 168, 120, 80, 91, 145, 143, 83, 41,
  352. 266, 266, 190, 196, 204, 212, 220, 228, 232, 237,
  353. 238, 243, 249, 257
  354. } ;
  355. static yyconst flex_int16_t yy_def[85] =
  356. { 0,
  357. 72, 1, 72, 72, 72, 72, 73, 74, 72, 72,
  358. 75, 72, 72, 72, 14, 72, 72, 74, 72, 76,
  359. 72, 73, 72, 77, 74, 72, 75, 72, 78, 72,
  360. 72, 31, 14, 79, 80, 72, 72, 81, 15, 73,
  361. 75, 76, 76, 72, 73, 75, 72, 82, 72, 72,
  362. 72, 72, 81, 76, 54, 72, 72, 72, 76, 54,
  363. 76, 76, 76, 54, 83, 76, 63, 83, 84, 84,
  364. 72, 0, 72, 72, 72, 72, 72, 72, 72, 72,
  365. 72, 72, 72, 72
  366. } ;
  367. static yyconst flex_int16_t yy_nxt[295] =
  368. { 0,
  369. 4, 5, 6, 5, 7, 4, 8, 9, 10, 11,
  370. 9, 12, 13, 14, 15, 15, 16, 9, 17, 8,
  371. 8, 8, 18, 8, 8, 4, 8, 19, 21, 23,
  372. 21, 26, 28, 26, 26, 30, 31, 31, 31, 26,
  373. 26, 26, 26, 71, 39, 39, 39, 23, 29, 26,
  374. 24, 32, 33, 33, 34, 72, 26, 26, 21, 35,
  375. 21, 36, 37, 38, 40, 36, 43, 44, 24, 41,
  376. 28, 32, 50, 50, 52, 28, 23, 23, 52, 35,
  377. 56, 56, 44, 28, 42, 71, 29, 31, 31, 31,
  378. 42, 29, 59, 44, 48, 49, 49, 24, 24, 29,
  379. 49, 43, 44, 51, 51, 51, 36, 37, 59, 44,
  380. 36, 65, 44, 54, 55, 55, 51, 51, 51, 59,
  381. 44, 64, 64, 64, 58, 58, 57, 57, 57, 58,
  382. 59, 44, 42, 64, 64, 64, 52, 72, 59, 44,
  383. 47, 66, 60, 60, 42, 44, 59, 69, 26, 72,
  384. 20, 61, 62, 63, 72, 61, 57, 57, 57, 66,
  385. 72, 72, 72, 66, 49, 49, 72, 61, 62, 49,
  386. 44, 61, 72, 72, 72, 72, 72, 72, 72, 72,
  387. 72, 67, 67, 67, 72, 72, 72, 67, 67, 67,
  388. 22, 22, 22, 22, 22, 22, 22, 22, 25, 72,
  389. 72, 25, 25, 25, 27, 27, 27, 27, 27, 27,
  390. 27, 27, 42, 42, 42, 42, 42, 42, 42, 42,
  391. 45, 72, 45, 45, 45, 45, 45, 45, 46, 72,
  392. 46, 46, 46, 46, 46, 46, 34, 34, 72, 34,
  393. 51, 72, 51, 53, 53, 53, 57, 72, 57, 68,
  394. 68, 68, 68, 68, 68, 68, 68, 70, 70, 70,
  395. 70, 70, 70, 70, 70, 3, 72, 72, 72, 72,
  396. 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
  397. 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
  398. 72, 72, 72, 72
  399. } ;
  400. static yyconst flex_int16_t yy_chk[295] =
  401. { 0,
  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, 5, 7,
  405. 5, 10, 11, 12, 12, 13, 13, 13, 13, 19,
  406. 10, 16, 16, 70, 15, 15, 15, 22, 11, 19,
  407. 7, 14, 14, 14, 14, 15, 17, 17, 21, 14,
  408. 21, 14, 14, 14, 18, 14, 20, 20, 22, 18,
  409. 27, 34, 35, 35, 37, 41, 40, 45, 37, 34,
  410. 48, 48, 65, 46, 65, 69, 27, 31, 31, 31,
  411. 60, 41, 66, 66, 31, 31, 31, 40, 45, 46,
  412. 31, 43, 43, 50, 50, 50, 53, 53, 59, 59,
  413. 53, 59, 42, 43, 43, 43, 51, 51, 51, 61,
  414. 61, 55, 55, 55, 51, 51, 56, 56, 56, 51,
  415. 54, 54, 55, 64, 64, 64, 36, 33, 62, 62,
  416. 30, 61, 54, 54, 64, 68, 67, 68, 9, 3,
  417. 2, 54, 54, 54, 0, 54, 57, 57, 57, 62,
  418. 0, 0, 0, 62, 57, 57, 0, 67, 67, 57,
  419. 63, 67, 0, 0, 0, 0, 0, 0, 0, 0,
  420. 0, 63, 63, 63, 0, 0, 0, 63, 63, 63,
  421. 73, 73, 73, 73, 73, 73, 73, 73, 74, 0,
  422. 0, 74, 74, 74, 75, 75, 75, 75, 75, 75,
  423. 75, 75, 76, 76, 76, 76, 76, 76, 76, 76,
  424. 77, 0, 77, 77, 77, 77, 77, 77, 78, 0,
  425. 78, 78, 78, 78, 78, 78, 79, 79, 0, 79,
  426. 80, 0, 80, 81, 81, 81, 82, 0, 82, 83,
  427. 83, 83, 83, 83, 83, 83, 83, 84, 84, 84,
  428. 84, 84, 84, 84, 84, 72, 72, 72, 72, 72,
  429. 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
  430. 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
  431. 72, 72, 72, 72
  432. } ;
  433. static yy_state_type yy_last_accepting_state;
  434. static char *yy_last_accepting_cpos;
  435. extern int yy_flex_debug;
  436. int yy_flex_debug = 0;
  437. /* The intent behind this definition is that it'll catch
  438. * any uses of REJECT which flex missed.
  439. */
  440. #define REJECT reject_used_but_not_detected
  441. #define yymore() yymore_used_but_not_detected
  442. #define YY_MORE_ADJ 0
  443. #define YY_RESTORE_YY_MORE_OFFSET
  444. char *yytext;
  445. /* Lexical analysis for genksyms.
  446. Copyright 1996, 1997 Linux International.
  447. New implementation contributed by Richard Henderson <rth@tamu.edu>
  448. Based on original work by Bjorn Ekwall <bj0rn@blox.se>
  449. Taken from Linux modutils 2.4.22.
  450. This program is free software; you can redistribute it and/or modify it
  451. under the terms of the GNU General Public License as published by the
  452. Free Software Foundation; either version 2 of the License, or (at your
  453. option) any later version.
  454. This program is distributed in the hope that it will be useful, but
  455. WITHOUT ANY WARRANTY; without even the implied warranty of
  456. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  457. General Public License for more details.
  458. You should have received a copy of the GNU General Public License
  459. along with this program; if not, write to the Free Software Foundation,
  460. Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
  461. #include <limits.h>
  462. #include <stdlib.h>
  463. #include <string.h>
  464. #include <ctype.h>
  465. #include "genksyms.h"
  466. #include "parse.tab.h"
  467. /* We've got a two-level lexer here. We let flex do basic tokenization
  468. and then we categorize those basic tokens in the second stage. */
  469. #define YY_DECL static int yylex1(void)
  470. /* We don't do multiple input files. */
  471. #define YY_NO_INPUT 1
  472. #define INITIAL 0
  473. #ifndef YY_NO_UNISTD_H
  474. /* Special case for "unistd.h", since it is non-ANSI. We include it way
  475. * down here because we want the user's section 1 to have been scanned first.
  476. * The user has a chance to override it with an option.
  477. */
  478. #include <unistd.h>
  479. #endif
  480. #ifndef YY_EXTRA_TYPE
  481. #define YY_EXTRA_TYPE void *
  482. #endif
  483. static int yy_init_globals (void );
  484. /* Accessor methods to globals.
  485. These are made visible to non-reentrant scanners for convenience. */
  486. int yylex_destroy (void );
  487. int yyget_debug (void );
  488. void yyset_debug (int debug_flag );
  489. YY_EXTRA_TYPE yyget_extra (void );
  490. void yyset_extra (YY_EXTRA_TYPE user_defined );
  491. FILE *yyget_in (void );
  492. void yyset_in (FILE * in_str );
  493. FILE *yyget_out (void );
  494. void yyset_out (FILE * out_str );
  495. int yyget_leng (void );
  496. char *yyget_text (void );
  497. int yyget_lineno (void );
  498. void yyset_lineno (int line_number );
  499. /* Macros after this point can all be overridden by user definitions in
  500. * section 1.
  501. */
  502. #ifndef YY_SKIP_YYWRAP
  503. #ifdef __cplusplus
  504. extern "C" int yywrap (void );
  505. #else
  506. extern int yywrap (void );
  507. #endif
  508. #endif
  509. static void yyunput (int c,char *buf_ptr );
  510. #ifndef yytext_ptr
  511. static void yy_flex_strncpy (char *,yyconst char *,int );
  512. #endif
  513. #ifdef YY_NEED_STRLEN
  514. static int yy_flex_strlen (yyconst char * );
  515. #endif
  516. #ifndef YY_NO_INPUT
  517. #ifdef __cplusplus
  518. static int yyinput (void );
  519. #else
  520. static int input (void );
  521. #endif
  522. #endif
  523. /* Amount of stuff to slurp up with each read. */
  524. #ifndef YY_READ_BUF_SIZE
  525. #define YY_READ_BUF_SIZE 8192
  526. #endif
  527. /* Copy whatever the last rule matched to the standard output. */
  528. #ifndef ECHO
  529. /* This used to be an fputs(), but since the string might contain NUL's,
  530. * we now use fwrite().
  531. */
  532. #define ECHO fwrite( yytext, yyleng, 1, yyout )
  533. #endif
  534. /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
  535. * is returned in "result".
  536. */
  537. #ifndef YY_INPUT
  538. #define YY_INPUT(buf,result,max_size) \
  539. if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
  540. { \
  541. int c = '*'; \
  542. int n; \
  543. for ( n = 0; n < max_size && \
  544. (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
  545. buf[n] = (char) c; \
  546. if ( c == '\n' ) \
  547. buf[n++] = (char) c; \
  548. if ( c == EOF && ferror( yyin ) ) \
  549. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  550. result = n; \
  551. } \
  552. else \
  553. { \
  554. errno=0; \
  555. while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
  556. { \
  557. if( errno != EINTR) \
  558. { \
  559. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  560. break; \
  561. } \
  562. errno=0; \
  563. clearerr(yyin); \
  564. } \
  565. }\
  566. \
  567. #endif
  568. /* No semi-colon after return; correct usage is to write "yyterminate();" -
  569. * we don't want an extra ';' after the "return" because that will cause
  570. * some compilers to complain about unreachable statements.
  571. */
  572. #ifndef yyterminate
  573. #define yyterminate() return YY_NULL
  574. #endif
  575. /* Number of entries by which start-condition stack grows. */
  576. #ifndef YY_START_STACK_INCR
  577. #define YY_START_STACK_INCR 25
  578. #endif
  579. /* Report a fatal error. */
  580. #ifndef YY_FATAL_ERROR
  581. #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
  582. #endif
  583. /* end tables serialization structures and prototypes */
  584. /* Default declaration of generated scanner - a define so the user can
  585. * easily add parameters.
  586. */
  587. #ifndef YY_DECL
  588. #define YY_DECL_IS_OURS 1
  589. extern int yylex (void);
  590. #define YY_DECL int yylex (void)
  591. #endif /* !YY_DECL */
  592. /* Code executed at the beginning of each rule, after yytext and yyleng
  593. * have been set up.
  594. */
  595. #ifndef YY_USER_ACTION
  596. #define YY_USER_ACTION
  597. #endif
  598. /* Code executed at the end of each rule. */
  599. #ifndef YY_BREAK
  600. #define YY_BREAK break;
  601. #endif
  602. #define YY_RULE_SETUP \
  603. if ( yyleng > 0 ) \
  604. YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
  605. (yytext[yyleng - 1] == '\n'); \
  606. YY_USER_ACTION
  607. /** The main scanner function which does all the work.
  608. */
  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. /* Keep track of our location in the original source files. */
  615. if ( !(yy_init) )
  616. {
  617. (yy_init) = 1;
  618. #ifdef YY_USER_INIT
  619. YY_USER_INIT;
  620. #endif
  621. if ( ! (yy_start) )
  622. (yy_start) = 1; /* first start state */
  623. if ( ! yyin )
  624. yyin = stdin;
  625. if ( ! yyout )
  626. yyout = stdout;
  627. if ( ! YY_CURRENT_BUFFER ) {
  628. yyensure_buffer_stack ();
  629. YY_CURRENT_BUFFER_LVALUE =
  630. yy_create_buffer(yyin,YY_BUF_SIZE );
  631. }
  632. yy_load_buffer_state( );
  633. }
  634. while ( 1 ) /* loops until end-of-file is reached */
  635. {
  636. yy_cp = (yy_c_buf_p);
  637. /* Support of yytext. */
  638. *yy_cp = (yy_hold_char);
  639. /* yy_bp points to the position in yy_ch_buf of the start of
  640. * the current run.
  641. */
  642. yy_bp = yy_cp;
  643. yy_current_state = (yy_start);
  644. yy_current_state += YY_AT_BOL();
  645. yy_match:
  646. do
  647. {
  648. register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
  649. if ( yy_accept[yy_current_state] )
  650. {
  651. (yy_last_accepting_state) = yy_current_state;
  652. (yy_last_accepting_cpos) = yy_cp;
  653. }
  654. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  655. {
  656. yy_current_state = (int) yy_def[yy_current_state];
  657. if ( yy_current_state >= 73 )
  658. yy_c = yy_meta[(unsigned int) yy_c];
  659. }
  660. yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  661. ++yy_cp;
  662. }
  663. while ( yy_base[yy_current_state] != 266 );
  664. yy_find_action:
  665. yy_act = yy_accept[yy_current_state];
  666. if ( yy_act == 0 )
  667. { /* have to back up */
  668. yy_cp = (yy_last_accepting_cpos);
  669. yy_current_state = (yy_last_accepting_state);
  670. yy_act = yy_accept[yy_current_state];
  671. }
  672. YY_DO_BEFORE_ACTION;
  673. do_action: /* This label is used only to access EOF actions. */
  674. switch ( yy_act )
  675. { /* beginning of action switch */
  676. case 0: /* must back up */
  677. /* undo the effects of YY_DO_BEFORE_ACTION */
  678. *yy_cp = (yy_hold_char);
  679. yy_cp = (yy_last_accepting_cpos);
  680. yy_current_state = (yy_last_accepting_state);
  681. goto yy_find_action;
  682. case 1:
  683. /* rule 1 can match eol */
  684. YY_RULE_SETUP
  685. return FILENAME;
  686. YY_BREAK
  687. case 2:
  688. /* rule 2 can match eol */
  689. YY_RULE_SETUP
  690. cur_line++;
  691. YY_BREAK
  692. case 3:
  693. /* rule 3 can match eol */
  694. YY_RULE_SETUP
  695. cur_line++;
  696. YY_BREAK
  697. /* Ignore all other whitespace. */
  698. case 4:
  699. YY_RULE_SETUP
  700. ;
  701. YY_BREAK
  702. case 5:
  703. /* rule 5 can match eol */
  704. YY_RULE_SETUP
  705. return STRING;
  706. YY_BREAK
  707. case 6:
  708. /* rule 6 can match eol */
  709. YY_RULE_SETUP
  710. return CHAR;
  711. YY_BREAK
  712. case 7:
  713. YY_RULE_SETUP
  714. return IDENT;
  715. YY_BREAK
  716. /* The Pedant requires that the other C multi-character tokens be
  717. recognized as tokens. We don't actually use them since we don't
  718. parse expressions, but we do want whitespace to be arranged
  719. around them properly. */
  720. case 8:
  721. YY_RULE_SETUP
  722. return OTHER;
  723. YY_BREAK
  724. case 9:
  725. YY_RULE_SETUP
  726. return INT;
  727. YY_BREAK
  728. case 10:
  729. YY_RULE_SETUP
  730. return REAL;
  731. YY_BREAK
  732. case 11:
  733. YY_RULE_SETUP
  734. return DOTS;
  735. YY_BREAK
  736. /* All other tokens are single characters. */
  737. case 12:
  738. YY_RULE_SETUP
  739. return yytext[0];
  740. YY_BREAK
  741. case 13:
  742. YY_RULE_SETUP
  743. ECHO;
  744. YY_BREAK
  745. case YY_STATE_EOF(INITIAL):
  746. yyterminate();
  747. case YY_END_OF_BUFFER:
  748. {
  749. /* Amount of text matched not including the EOB char. */
  750. int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
  751. /* Undo the effects of YY_DO_BEFORE_ACTION. */
  752. *yy_cp = (yy_hold_char);
  753. YY_RESTORE_YY_MORE_OFFSET
  754. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
  755. {
  756. /* We're scanning a new file or input source. It's
  757. * possible that this happened because the user
  758. * just pointed yyin at a new source and called
  759. * yylex(). If so, then we have to assure
  760. * consistency between YY_CURRENT_BUFFER and our
  761. * globals. Here is the right place to do so, because
  762. * this is the first action (other than possibly a
  763. * back-up) that will match for the new input source.
  764. */
  765. (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  766. YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
  767. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
  768. }
  769. /* Note that here we test for yy_c_buf_p "<=" to the position
  770. * of the first EOB in the buffer, since yy_c_buf_p will
  771. * already have been incremented past the NUL character
  772. * (since all states make transitions on EOB to the
  773. * end-of-buffer state). Contrast this with the test
  774. * in input().
  775. */
  776. if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
  777. { /* This was really a NUL. */
  778. yy_state_type yy_next_state;
  779. (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
  780. yy_current_state = yy_get_previous_state( );
  781. /* Okay, we're now positioned to make the NUL
  782. * transition. We couldn't have
  783. * yy_get_previous_state() go ahead and do it
  784. * for us because it doesn't know how to deal
  785. * with the possibility of jamming (and we don't
  786. * want to build jamming into it because then it
  787. * will run more slowly).
  788. */
  789. yy_next_state = yy_try_NUL_trans( yy_current_state );
  790. yy_bp = (yytext_ptr) + YY_MORE_ADJ;
  791. if ( yy_next_state )
  792. {
  793. /* Consume the NUL. */
  794. yy_cp = ++(yy_c_buf_p);
  795. yy_current_state = yy_next_state;
  796. goto yy_match;
  797. }
  798. else
  799. {
  800. yy_cp = (yy_c_buf_p);
  801. goto yy_find_action;
  802. }
  803. }
  804. else switch ( yy_get_next_buffer( ) )
  805. {
  806. case EOB_ACT_END_OF_FILE:
  807. {
  808. (yy_did_buffer_switch_on_eof) = 0;
  809. if ( yywrap( ) )
  810. {
  811. /* Note: because we've taken care in
  812. * yy_get_next_buffer() to have set up
  813. * yytext, we can now set up
  814. * yy_c_buf_p so that if some total
  815. * hoser (like flex itself) wants to
  816. * call the scanner after we return the
  817. * YY_NULL, it'll still work - another
  818. * YY_NULL will get returned.
  819. */
  820. (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
  821. yy_act = YY_STATE_EOF(YY_START);
  822. goto do_action;
  823. }
  824. else
  825. {
  826. if ( ! (yy_did_buffer_switch_on_eof) )
  827. YY_NEW_FILE;
  828. }
  829. break;
  830. }
  831. case EOB_ACT_CONTINUE_SCAN:
  832. (yy_c_buf_p) =
  833. (yytext_ptr) + yy_amount_of_matched_text;
  834. yy_current_state = yy_get_previous_state( );
  835. yy_cp = (yy_c_buf_p);
  836. yy_bp = (yytext_ptr) + YY_MORE_ADJ;
  837. goto yy_match;
  838. case EOB_ACT_LAST_MATCH:
  839. (yy_c_buf_p) =
  840. &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
  841. yy_current_state = yy_get_previous_state( );
  842. yy_cp = (yy_c_buf_p);
  843. yy_bp = (yytext_ptr) + YY_MORE_ADJ;
  844. goto yy_find_action;
  845. }
  846. break;
  847. }
  848. default:
  849. YY_FATAL_ERROR(
  850. "fatal flex scanner internal error--no action found" );
  851. } /* end of action switch */
  852. } /* end of scanning one token */
  853. } /* end of yylex */
  854. /* yy_get_next_buffer - try to read in a new buffer
  855. *
  856. * Returns a code representing an action:
  857. * EOB_ACT_LAST_MATCH -
  858. * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  859. * EOB_ACT_END_OF_FILE - end of file
  860. */
  861. static int yy_get_next_buffer (void)
  862. {
  863. register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
  864. register char *source = (yytext_ptr);
  865. register int number_to_move, i;
  866. int ret_val;
  867. if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
  868. YY_FATAL_ERROR(
  869. "fatal flex scanner internal error--end of buffer missed" );
  870. if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
  871. { /* Don't try to fill the buffer, so this is an EOF. */
  872. if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
  873. {
  874. /* We matched a single character, the EOB, so
  875. * treat this as a final EOF.
  876. */
  877. return EOB_ACT_END_OF_FILE;
  878. }
  879. else
  880. {
  881. /* We matched some text prior to the EOB, first
  882. * process it.
  883. */
  884. return EOB_ACT_LAST_MATCH;
  885. }
  886. }
  887. /* Try to read more data. */
  888. /* First move last chars to start of buffer. */
  889. number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
  890. for ( i = 0; i < number_to_move; ++i )
  891. *(dest++) = *(source++);
  892. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
  893. /* don't do the read, it's not guaranteed to return an EOF,
  894. * just force an EOF
  895. */
  896. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
  897. else
  898. {
  899. int num_to_read =
  900. YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
  901. while ( num_to_read <= 0 )
  902. { /* Not enough room in the buffer - grow it. */
  903. /* just a shorter name for the current buffer */
  904. YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
  905. int yy_c_buf_p_offset =
  906. (int) ((yy_c_buf_p) - b->yy_ch_buf);
  907. if ( b->yy_is_our_buffer )
  908. {
  909. int new_size = b->yy_buf_size * 2;
  910. if ( new_size <= 0 )
  911. b->yy_buf_size += b->yy_buf_size / 8;
  912. else
  913. b->yy_buf_size *= 2;
  914. b->yy_ch_buf = (char *)
  915. /* Include room in for 2 EOB chars. */
  916. yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
  917. }
  918. else
  919. /* Can't grow it, we don't own it. */
  920. b->yy_ch_buf = 0;
  921. if ( ! b->yy_ch_buf )
  922. YY_FATAL_ERROR(
  923. "fatal error - scanner input buffer overflow" );
  924. (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
  925. num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
  926. number_to_move - 1;
  927. }
  928. if ( num_to_read > YY_READ_BUF_SIZE )
  929. num_to_read = YY_READ_BUF_SIZE;
  930. /* Read in more data. */
  931. YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
  932. (yy_n_chars), (size_t) num_to_read );
  933. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
  934. }
  935. if ( (yy_n_chars) == 0 )
  936. {
  937. if ( number_to_move == YY_MORE_ADJ )
  938. {
  939. ret_val = EOB_ACT_END_OF_FILE;
  940. yyrestart(yyin );
  941. }
  942. else
  943. {
  944. ret_val = EOB_ACT_LAST_MATCH;
  945. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
  946. YY_BUFFER_EOF_PENDING;
  947. }
  948. }
  949. else
  950. ret_val = EOB_ACT_CONTINUE_SCAN;
  951. if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
  952. /* Extend the array by 50%, plus the number we really need. */
  953. yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
  954. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
  955. if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
  956. YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
  957. }
  958. (yy_n_chars) += number_to_move;
  959. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
  960. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
  961. (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
  962. return ret_val;
  963. }
  964. /* yy_get_previous_state - get the state just before the EOB char was reached */
  965. static yy_state_type yy_get_previous_state (void)
  966. {
  967. register yy_state_type yy_current_state;
  968. register char *yy_cp;
  969. yy_current_state = (yy_start);
  970. yy_current_state += YY_AT_BOL();
  971. for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
  972. {
  973. register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
  974. if ( yy_accept[yy_current_state] )
  975. {
  976. (yy_last_accepting_state) = yy_current_state;
  977. (yy_last_accepting_cpos) = yy_cp;
  978. }
  979. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  980. {
  981. yy_current_state = (int) yy_def[yy_current_state];
  982. if ( yy_current_state >= 73 )
  983. yy_c = yy_meta[(unsigned int) yy_c];
  984. }
  985. yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  986. }
  987. return yy_current_state;
  988. }
  989. /* yy_try_NUL_trans - try to make a transition on the NUL character
  990. *
  991. * synopsis
  992. * next_state = yy_try_NUL_trans( current_state );
  993. */
  994. static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
  995. {
  996. register int yy_is_jam;
  997. register char *yy_cp = (yy_c_buf_p);
  998. register YY_CHAR yy_c = 1;
  999. if ( yy_accept[yy_current_state] )
  1000. {
  1001. (yy_last_accepting_state) = yy_current_state;
  1002. (yy_last_accepting_cpos) = yy_cp;
  1003. }
  1004. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1005. {
  1006. yy_current_state = (int) yy_def[yy_current_state];
  1007. if ( yy_current_state >= 73 )
  1008. yy_c = yy_meta[(unsigned int) yy_c];
  1009. }
  1010. yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  1011. yy_is_jam = (yy_current_state == 72);
  1012. return yy_is_jam ? 0 : yy_current_state;
  1013. }
  1014. static void yyunput (int c, register char * yy_bp )
  1015. {
  1016. register char *yy_cp;
  1017. yy_cp = (yy_c_buf_p);
  1018. /* undo effects of setting up yytext */
  1019. *yy_cp = (yy_hold_char);
  1020. if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
  1021. { /* need to shift things up to make room */
  1022. /* +2 for EOB chars. */
  1023. register int number_to_move = (yy_n_chars) + 2;
  1024. register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
  1025. YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
  1026. register char *source =
  1027. &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
  1028. while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
  1029. *--dest = *--source;
  1030. yy_cp += (int) (dest - source);
  1031. yy_bp += (int) (dest - source);
  1032. YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
  1033. (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
  1034. if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
  1035. YY_FATAL_ERROR( "flex scanner push-back overflow" );
  1036. }
  1037. *--yy_cp = (char) c;
  1038. (yytext_ptr) = yy_bp;
  1039. (yy_hold_char) = *yy_cp;
  1040. (yy_c_buf_p) = yy_cp;
  1041. }
  1042. #ifndef YY_NO_INPUT
  1043. #ifdef __cplusplus
  1044. static int yyinput (void)
  1045. #else
  1046. static int input (void)
  1047. #endif
  1048. {
  1049. int c;
  1050. *(yy_c_buf_p) = (yy_hold_char);
  1051. if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
  1052. {
  1053. /* yy_c_buf_p now points to the character we want to return.
  1054. * If this occurs *before* the EOB characters, then it's a
  1055. * valid NUL; if not, then we've hit the end of the buffer.
  1056. */
  1057. if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
  1058. /* This was really a NUL. */
  1059. *(yy_c_buf_p) = '\0';
  1060. else
  1061. { /* need more input */
  1062. int offset = (yy_c_buf_p) - (yytext_ptr);
  1063. ++(yy_c_buf_p);
  1064. switch ( yy_get_next_buffer( ) )
  1065. {
  1066. case EOB_ACT_LAST_MATCH:
  1067. /* This happens because yy_g_n_b()
  1068. * sees that we've accumulated a
  1069. * token and flags that we need to
  1070. * try matching the token before
  1071. * proceeding. But for input(),
  1072. * there's no matching to consider.
  1073. * So convert the EOB_ACT_LAST_MATCH
  1074. * to EOB_ACT_END_OF_FILE.
  1075. */
  1076. /* Reset buffer status. */
  1077. yyrestart(yyin );
  1078. /*FALLTHROUGH*/
  1079. case EOB_ACT_END_OF_FILE:
  1080. {
  1081. if ( yywrap( ) )
  1082. return EOF;
  1083. if ( ! (yy_did_buffer_switch_on_eof) )
  1084. YY_NEW_FILE;
  1085. #ifdef __cplusplus
  1086. return yyinput();
  1087. #else
  1088. return input();
  1089. #endif
  1090. }
  1091. case EOB_ACT_CONTINUE_SCAN:
  1092. (yy_c_buf_p) = (yytext_ptr) + offset;
  1093. break;
  1094. }
  1095. }
  1096. }
  1097. c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
  1098. *(yy_c_buf_p) = '\0'; /* preserve yytext */
  1099. (yy_hold_char) = *++(yy_c_buf_p);
  1100. YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
  1101. return c;
  1102. }
  1103. #endif /* ifndef YY_NO_INPUT */
  1104. /** Immediately switch to a different input stream.
  1105. * @param input_file A readable stream.
  1106. *
  1107. * @note This function does not reset the start condition to @c INITIAL .
  1108. */
  1109. void yyrestart (FILE * input_file )
  1110. {
  1111. if ( ! YY_CURRENT_BUFFER ){
  1112. yyensure_buffer_stack ();
  1113. YY_CURRENT_BUFFER_LVALUE =
  1114. yy_create_buffer(yyin,YY_BUF_SIZE );
  1115. }
  1116. yy_init_buffer(YY_CURRENT_BUFFER,input_file );
  1117. yy_load_buffer_state( );
  1118. }
  1119. /** Switch to a different input buffer.
  1120. * @param new_buffer The new input buffer.
  1121. *
  1122. */
  1123. void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
  1124. {
  1125. /* TODO. We should be able to replace this entire function body
  1126. * with
  1127. * yypop_buffer_state();
  1128. * yypush_buffer_state(new_buffer);
  1129. */
  1130. yyensure_buffer_stack ();
  1131. if ( YY_CURRENT_BUFFER == new_buffer )
  1132. return;
  1133. if ( YY_CURRENT_BUFFER )
  1134. {
  1135. /* Flush out information for old buffer. */
  1136. *(yy_c_buf_p) = (yy_hold_char);
  1137. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
  1138. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
  1139. }
  1140. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  1141. yy_load_buffer_state( );
  1142. /* We don't actually know whether we did this switch during
  1143. * EOF (yywrap()) processing, but the only time this flag
  1144. * is looked at is after yywrap() is called, so it's safe
  1145. * to go ahead and always set it.
  1146. */
  1147. (yy_did_buffer_switch_on_eof) = 1;
  1148. }
  1149. static void yy_load_buffer_state (void)
  1150. {
  1151. (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  1152. (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
  1153. yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
  1154. (yy_hold_char) = *(yy_c_buf_p);
  1155. }
  1156. /** Allocate and initialize an input buffer state.
  1157. * @param file A readable stream.
  1158. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
  1159. *
  1160. * @return the allocated buffer state.
  1161. */
  1162. YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
  1163. {
  1164. YY_BUFFER_STATE b;
  1165. b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
  1166. if ( ! b )
  1167. YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1168. b->yy_buf_size = size;
  1169. /* yy_ch_buf has to be 2 characters longer than the size given because
  1170. * we need to put in 2 end-of-buffer characters.
  1171. */
  1172. b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
  1173. if ( ! b->yy_ch_buf )
  1174. YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1175. b->yy_is_our_buffer = 1;
  1176. yy_init_buffer(b,file );
  1177. return b;
  1178. }
  1179. /** Destroy the buffer.
  1180. * @param b a buffer created with yy_create_buffer()
  1181. *
  1182. */
  1183. void yy_delete_buffer (YY_BUFFER_STATE b )
  1184. {
  1185. if ( ! b )
  1186. return;
  1187. if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
  1188. YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
  1189. if ( b->yy_is_our_buffer )
  1190. yyfree((void *) b->yy_ch_buf );
  1191. yyfree((void *) b );
  1192. }
  1193. #ifndef __cplusplus
  1194. extern int isatty (int );
  1195. #endif /* __cplusplus */
  1196. /* Initializes or reinitializes a buffer.
  1197. * This function is sometimes called more than once on the same buffer,
  1198. * such as during a yyrestart() or at EOF.
  1199. */
  1200. static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
  1201. {
  1202. int oerrno = errno;
  1203. yy_flush_buffer(b );
  1204. b->yy_input_file = file;
  1205. b->yy_fill_buffer = 1;
  1206. /* If b is the current buffer, then yy_init_buffer was _probably_
  1207. * called from yyrestart() or through yy_get_next_buffer.
  1208. * In that case, we don't want to reset the lineno or column.
  1209. */
  1210. if (b != YY_CURRENT_BUFFER){
  1211. b->yy_bs_lineno = 1;
  1212. b->yy_bs_column = 0;
  1213. }
  1214. b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
  1215. errno = oerrno;
  1216. }
  1217. /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
  1218. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
  1219. *
  1220. */
  1221. void yy_flush_buffer (YY_BUFFER_STATE b )
  1222. {
  1223. if ( ! b )
  1224. return;
  1225. b->yy_n_chars = 0;
  1226. /* We always need two end-of-buffer characters. The first causes
  1227. * a transition to the end-of-buffer state. The second causes
  1228. * a jam in that state.
  1229. */
  1230. b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
  1231. b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  1232. b->yy_buf_pos = &b->yy_ch_buf[0];
  1233. b->yy_at_bol = 1;
  1234. b->yy_buffer_status = YY_BUFFER_NEW;
  1235. if ( b == YY_CURRENT_BUFFER )
  1236. yy_load_buffer_state( );
  1237. }
  1238. /** Pushes the new state onto the stack. The new state becomes
  1239. * the current state. This function will allocate the stack
  1240. * if necessary.
  1241. * @param new_buffer The new state.
  1242. *
  1243. */
  1244. void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
  1245. {
  1246. if (new_buffer == NULL)
  1247. return;
  1248. yyensure_buffer_stack();
  1249. /* This block is copied from yy_switch_to_buffer. */
  1250. if ( YY_CURRENT_BUFFER )
  1251. {
  1252. /* Flush out information for old buffer. */
  1253. *(yy_c_buf_p) = (yy_hold_char);
  1254. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
  1255. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
  1256. }
  1257. /* Only push if top exists. Otherwise, replace top. */
  1258. if (YY_CURRENT_BUFFER)
  1259. (yy_buffer_stack_top)++;
  1260. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  1261. /* copied from yy_switch_to_buffer. */
  1262. yy_load_buffer_state( );
  1263. (yy_did_buffer_switch_on_eof) = 1;
  1264. }
  1265. /** Removes and deletes the top of the stack, if present.
  1266. * The next element becomes the new top.
  1267. *
  1268. */
  1269. void yypop_buffer_state (void)
  1270. {
  1271. if (!YY_CURRENT_BUFFER)
  1272. return;
  1273. yy_delete_buffer(YY_CURRENT_BUFFER );
  1274. YY_CURRENT_BUFFER_LVALUE = NULL;
  1275. if ((yy_buffer_stack_top) > 0)
  1276. --(yy_buffer_stack_top);
  1277. if (YY_CURRENT_BUFFER) {
  1278. yy_load_buffer_state( );
  1279. (yy_did_buffer_switch_on_eof) = 1;
  1280. }
  1281. }
  1282. /* Allocates the stack if it does not exist.
  1283. * Guarantees space for at least one push.
  1284. */
  1285. static void yyensure_buffer_stack (void)
  1286. {
  1287. int num_to_alloc;
  1288. if (!(yy_buffer_stack)) {
  1289. /* First allocation is just for 2 elements, since we don't know if this
  1290. * scanner will even need a stack. We use 2 instead of 1 to avoid an
  1291. * immediate realloc on the next call.
  1292. */
  1293. num_to_alloc = 1;
  1294. (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
  1295. (num_to_alloc * sizeof(struct yy_buffer_state*)
  1296. );
  1297. if ( ! (yy_buffer_stack) )
  1298. YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
  1299. memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
  1300. (yy_buffer_stack_max) = num_to_alloc;
  1301. (yy_buffer_stack_top) = 0;
  1302. return;
  1303. }
  1304. if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
  1305. /* Increase the buffer to prepare for a possible push. */
  1306. int grow_size = 8 /* arbitrary grow size */;
  1307. num_to_alloc = (yy_buffer_stack_max) + grow_size;
  1308. (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
  1309. ((yy_buffer_stack),
  1310. num_to_alloc * sizeof(struct yy_buffer_state*)
  1311. );
  1312. if ( ! (yy_buffer_stack) )
  1313. YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
  1314. /* zero only the new slots.*/
  1315. memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
  1316. (yy_buffer_stack_max) = num_to_alloc;
  1317. }
  1318. }
  1319. /** Setup the input buffer state to scan directly from a user-specified character buffer.
  1320. * @param base the character buffer
  1321. * @param size the size in bytes of the character buffer
  1322. *
  1323. * @return the newly allocated buffer state object.
  1324. */
  1325. YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
  1326. {
  1327. YY_BUFFER_STATE b;
  1328. if ( size < 2 ||
  1329. base[size-2] != YY_END_OF_BUFFER_CHAR ||
  1330. base[size-1] != YY_END_OF_BUFFER_CHAR )
  1331. /* They forgot to leave room for the EOB's. */
  1332. return 0;
  1333. b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
  1334. if ( ! b )
  1335. YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
  1336. b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
  1337. b->yy_buf_pos = b->yy_ch_buf = base;
  1338. b->yy_is_our_buffer = 0;
  1339. b->yy_input_file = 0;
  1340. b->yy_n_chars = b->yy_buf_size;
  1341. b->yy_is_interactive = 0;
  1342. b->yy_at_bol = 1;
  1343. b->yy_fill_buffer = 0;
  1344. b->yy_buffer_status = YY_BUFFER_NEW;
  1345. yy_switch_to_buffer(b );
  1346. return b;
  1347. }
  1348. /** Setup the input buffer state to scan a string. The next call to yylex() will
  1349. * scan from a @e copy of @a str.
  1350. * @param yystr a NUL-terminated string to scan
  1351. *
  1352. * @return the newly allocated buffer state object.
  1353. * @note If you want to scan bytes that may contain NUL values, then use
  1354. * yy_scan_bytes() instead.
  1355. */
  1356. YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
  1357. {
  1358. return yy_scan_bytes(yystr,strlen(yystr) );
  1359. }
  1360. /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
  1361. * scan from a @e copy of @a bytes.
  1362. * @param bytes the byte buffer to scan
  1363. * @param len the number of bytes in the buffer pointed to by @a bytes.
  1364. *
  1365. * @return the newly allocated buffer state object.
  1366. */
  1367. YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
  1368. {
  1369. YY_BUFFER_STATE b;
  1370. char *buf;
  1371. yy_size_t n;
  1372. int i;
  1373. /* Get memory for full buffer, including space for trailing EOB's. */
  1374. n = _yybytes_len + 2;
  1375. buf = (char *) yyalloc(n );
  1376. if ( ! buf )
  1377. YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
  1378. for ( i = 0; i < _yybytes_len; ++i )
  1379. buf[i] = yybytes[i];
  1380. buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
  1381. b = yy_scan_buffer(buf,n );
  1382. if ( ! b )
  1383. YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
  1384. /* It's okay to grow etc. this buffer, and we should throw it
  1385. * away when we're done.
  1386. */
  1387. b->yy_is_our_buffer = 1;
  1388. return b;
  1389. }
  1390. #ifndef YY_EXIT_FAILURE
  1391. #define YY_EXIT_FAILURE 2
  1392. #endif
  1393. static void yy_fatal_error (yyconst char* msg )
  1394. {
  1395. (void) fprintf( stderr, "%s\n", msg );
  1396. exit( YY_EXIT_FAILURE );
  1397. }
  1398. /* Redefine yyless() so it works in section 3 code. */
  1399. #undef yyless
  1400. #define yyless(n) \
  1401. do \
  1402. { \
  1403. /* Undo effects of setting up yytext. */ \
  1404. int yyless_macro_arg = (n); \
  1405. YY_LESS_LINENO(yyless_macro_arg);\
  1406. yytext[yyleng] = (yy_hold_char); \
  1407. (yy_c_buf_p) = yytext + yyless_macro_arg; \
  1408. (yy_hold_char) = *(yy_c_buf_p); \
  1409. *(yy_c_buf_p) = '\0'; \
  1410. yyleng = yyless_macro_arg; \
  1411. } \
  1412. while ( 0 )
  1413. /* Accessor methods (get/set functions) to struct members. */
  1414. /** Get the current line number.
  1415. *
  1416. */
  1417. int yyget_lineno (void)
  1418. {
  1419. return yylineno;
  1420. }
  1421. /** Get the input stream.
  1422. *
  1423. */
  1424. FILE *yyget_in (void)
  1425. {
  1426. return yyin;
  1427. }
  1428. /** Get the output stream.
  1429. *
  1430. */
  1431. FILE *yyget_out (void)
  1432. {
  1433. return yyout;
  1434. }
  1435. /** Get the length of the current token.
  1436. *
  1437. */
  1438. int yyget_leng (void)
  1439. {
  1440. return yyleng;
  1441. }
  1442. /** Get the current token.
  1443. *
  1444. */
  1445. char *yyget_text (void)
  1446. {
  1447. return yytext;
  1448. }
  1449. /** Set the current line number.
  1450. * @param line_number
  1451. *
  1452. */
  1453. void yyset_lineno (int line_number )
  1454. {
  1455. yylineno = line_number;
  1456. }
  1457. /** Set the input stream. This does not discard the current
  1458. * input buffer.
  1459. * @param in_str A readable stream.
  1460. *
  1461. * @see yy_switch_to_buffer
  1462. */
  1463. void yyset_in (FILE * in_str )
  1464. {
  1465. yyin = in_str ;
  1466. }
  1467. void yyset_out (FILE * out_str )
  1468. {
  1469. yyout = out_str ;
  1470. }
  1471. int yyget_debug (void)
  1472. {
  1473. return yy_flex_debug;
  1474. }
  1475. void yyset_debug (int bdebug )
  1476. {
  1477. yy_flex_debug = bdebug ;
  1478. }
  1479. static int yy_init_globals (void)
  1480. {
  1481. /* Initialization is the same as for the non-reentrant scanner.
  1482. * This function is called from yylex_destroy(), so don't allocate here.
  1483. */
  1484. (yy_buffer_stack) = 0;
  1485. (yy_buffer_stack_top) = 0;
  1486. (yy_buffer_stack_max) = 0;
  1487. (yy_c_buf_p) = (char *) 0;
  1488. (yy_init) = 0;
  1489. (yy_start) = 0;
  1490. /* Defined in main.c */
  1491. #ifdef YY_STDINIT
  1492. yyin = stdin;
  1493. yyout = stdout;
  1494. #else
  1495. yyin = (FILE *) 0;
  1496. yyout = (FILE *) 0;
  1497. #endif
  1498. /* For future reference: Set errno on error, since we are called by
  1499. * yylex_init()
  1500. */
  1501. return 0;
  1502. }
  1503. /* yylex_destroy is for both reentrant and non-reentrant scanners. */
  1504. int yylex_destroy (void)
  1505. {
  1506. /* Pop the buffer stack, destroying each element. */
  1507. while(YY_CURRENT_BUFFER){
  1508. yy_delete_buffer(YY_CURRENT_BUFFER );
  1509. YY_CURRENT_BUFFER_LVALUE = NULL;
  1510. yypop_buffer_state();
  1511. }
  1512. /* Destroy the stack itself. */
  1513. yyfree((yy_buffer_stack) );
  1514. (yy_buffer_stack) = NULL;
  1515. /* Reset the globals. This is important in a non-reentrant scanner so the next time
  1516. * yylex() is called, initialization will occur. */
  1517. yy_init_globals( );
  1518. return 0;
  1519. }
  1520. /*
  1521. * Internal utility routines.
  1522. */
  1523. #ifndef yytext_ptr
  1524. static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
  1525. {
  1526. register int i;
  1527. for ( i = 0; i < n; ++i )
  1528. s1[i] = s2[i];
  1529. }
  1530. #endif
  1531. #ifdef YY_NEED_STRLEN
  1532. static int yy_flex_strlen (yyconst char * s )
  1533. {
  1534. register int n;
  1535. for ( n = 0; s[n]; ++n )
  1536. ;
  1537. return n;
  1538. }
  1539. #endif
  1540. void *yyalloc (yy_size_t size )
  1541. {
  1542. return (void *) malloc( size );
  1543. }
  1544. void *yyrealloc (void * ptr, yy_size_t size )
  1545. {
  1546. /* The cast to (char *) in the following accommodates both
  1547. * implementations that use char* generic pointers, and those
  1548. * that use void* generic pointers. It works with the latter
  1549. * because both ANSI C and C++ allow castless assignment from
  1550. * any pointer type to void*, and deal with argument conversions
  1551. * as though doing an assignment.
  1552. */
  1553. return (void *) realloc( (char *) ptr, size );
  1554. }
  1555. void yyfree (void * ptr )
  1556. {
  1557. free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
  1558. }
  1559. #define YYTABLES_NAME "yytables"
  1560. /* Bring in the keyword recognizer. */
  1561. #include "keywords.hash.c"
  1562. /* Macros to append to our phrase collection list. */
  1563. /*
  1564. * We mark any token, that that equals to a known enumerator, as
  1565. * SYM_ENUM_CONST. The parser will change this for struct and union tags later,
  1566. * the only problem is struct and union members:
  1567. * enum e { a, b }; struct s { int a, b; }
  1568. * but in this case, the only effect will be, that the ABI checksums become
  1569. * more volatile, which is acceptable. Also, such collisions are quite rare,
  1570. * so far it was only observed in include/linux/telephony.h.
  1571. */
  1572. #define _APP(T,L) do { \
  1573. cur_node = next_node; \
  1574. next_node = xmalloc(sizeof(*next_node)); \
  1575. next_node->next = cur_node; \
  1576. cur_node->string = memcpy(xmalloc(L+1), T, L+1); \
  1577. cur_node->tag = \
  1578. find_symbol(cur_node->string, SYM_ENUM_CONST, 1)?\
  1579. SYM_ENUM_CONST : SYM_NORMAL ; \
  1580. cur_node->in_source_file = in_source_file; \
  1581. } while (0)
  1582. #define APP _APP(yytext, yyleng)
  1583. /* The second stage lexer. Here we incorporate knowledge of the state
  1584. of the parser to tailor the tokens that are returned. */
  1585. int
  1586. yylex(void)
  1587. {
  1588. static enum {
  1589. ST_NOTSTARTED, ST_NORMAL, ST_ATTRIBUTE, ST_ASM, ST_TYPEOF, ST_TYPEOF_1,
  1590. ST_BRACKET, ST_BRACE, ST_EXPRESSION,
  1591. ST_TABLE_1, ST_TABLE_2, ST_TABLE_3, ST_TABLE_4,
  1592. ST_TABLE_5, ST_TABLE_6
  1593. } lexstate = ST_NOTSTARTED;
  1594. static int suppress_type_lookup, dont_want_brace_phrase;
  1595. static struct string_list *next_node;
  1596. int token, count = 0;
  1597. struct string_list *cur_node;
  1598. if (lexstate == ST_NOTSTARTED)
  1599. {
  1600. next_node = xmalloc(sizeof(*next_node));
  1601. next_node->next = NULL;
  1602. lexstate = ST_NORMAL;
  1603. }
  1604. repeat:
  1605. token = yylex1();
  1606. if (token == 0)
  1607. return 0;
  1608. else if (token == FILENAME)
  1609. {
  1610. char *file, *e;
  1611. /* Save the filename and line number for later error messages. */
  1612. if (cur_filename)
  1613. free(cur_filename);
  1614. file = strchr(yytext, '\"')+1;
  1615. e = strchr(file, '\"');
  1616. *e = '\0';
  1617. cur_filename = memcpy(xmalloc(e-file+1), file, e-file+1);
  1618. cur_line = atoi(yytext+2);
  1619. if (!source_file) {
  1620. source_file = xstrdup(cur_filename);
  1621. in_source_file = 1;
  1622. } else {
  1623. in_source_file = (strcmp(cur_filename, source_file) == 0);
  1624. }
  1625. goto repeat;
  1626. }
  1627. switch (lexstate)
  1628. {
  1629. case ST_NORMAL:
  1630. switch (token)
  1631. {
  1632. case IDENT:
  1633. APP;
  1634. {
  1635. const struct resword *r = is_reserved_word(yytext, yyleng);
  1636. if (r)
  1637. {
  1638. switch (token = r->token)
  1639. {
  1640. case ATTRIBUTE_KEYW:
  1641. lexstate = ST_ATTRIBUTE;
  1642. count = 0;
  1643. goto repeat;
  1644. case ASM_KEYW:
  1645. lexstate = ST_ASM;
  1646. count = 0;
  1647. goto repeat;
  1648. case TYPEOF_KEYW:
  1649. lexstate = ST_TYPEOF;
  1650. count = 0;
  1651. goto repeat;
  1652. case STRUCT_KEYW:
  1653. case UNION_KEYW:
  1654. case ENUM_KEYW:
  1655. dont_want_brace_phrase = 3;
  1656. suppress_type_lookup = 2;
  1657. goto fini;
  1658. case EXPORT_SYMBOL_KEYW:
  1659. goto fini;
  1660. }
  1661. }
  1662. if (!suppress_type_lookup)
  1663. {
  1664. if (find_symbol(yytext, SYM_TYPEDEF, 1))
  1665. token = TYPE;
  1666. }
  1667. }
  1668. break;
  1669. case '[':
  1670. APP;
  1671. lexstate = ST_BRACKET;
  1672. count = 1;
  1673. goto repeat;
  1674. case '{':
  1675. APP;
  1676. if (dont_want_brace_phrase)
  1677. break;
  1678. lexstate = ST_BRACE;
  1679. count = 1;
  1680. goto repeat;
  1681. case '=': case ':':
  1682. APP;
  1683. lexstate = ST_EXPRESSION;
  1684. break;
  1685. case DOTS:
  1686. default:
  1687. APP;
  1688. break;
  1689. }
  1690. break;
  1691. case ST_ATTRIBUTE:
  1692. APP;
  1693. switch (token)
  1694. {
  1695. case '(':
  1696. ++count;
  1697. goto repeat;
  1698. case ')':
  1699. if (--count == 0)
  1700. {
  1701. lexstate = ST_NORMAL;
  1702. token = ATTRIBUTE_PHRASE;
  1703. break;
  1704. }
  1705. goto repeat;
  1706. default:
  1707. goto repeat;
  1708. }
  1709. break;
  1710. case ST_ASM:
  1711. APP;
  1712. switch (token)
  1713. {
  1714. case '(':
  1715. ++count;
  1716. goto repeat;
  1717. case ')':
  1718. if (--count == 0)
  1719. {
  1720. lexstate = ST_NORMAL;
  1721. token = ASM_PHRASE;
  1722. break;
  1723. }
  1724. goto repeat;
  1725. default:
  1726. goto repeat;
  1727. }
  1728. break;
  1729. case ST_TYPEOF_1:
  1730. if (token == IDENT)
  1731. {
  1732. if (is_reserved_word(yytext, yyleng)
  1733. || find_symbol(yytext, SYM_TYPEDEF, 1))
  1734. {
  1735. yyless(0);
  1736. unput('(');
  1737. lexstate = ST_NORMAL;
  1738. token = TYPEOF_KEYW;
  1739. break;
  1740. }
  1741. _APP("(", 1);
  1742. }
  1743. lexstate = ST_TYPEOF;
  1744. /* FALLTHRU */
  1745. case ST_TYPEOF:
  1746. switch (token)
  1747. {
  1748. case '(':
  1749. if ( ++count == 1 )
  1750. lexstate = ST_TYPEOF_1;
  1751. else
  1752. APP;
  1753. goto repeat;
  1754. case ')':
  1755. APP;
  1756. if (--count == 0)
  1757. {
  1758. lexstate = ST_NORMAL;
  1759. token = TYPEOF_PHRASE;
  1760. break;
  1761. }
  1762. goto repeat;
  1763. default:
  1764. APP;
  1765. goto repeat;
  1766. }
  1767. break;
  1768. case ST_BRACKET:
  1769. APP;
  1770. switch (token)
  1771. {
  1772. case '[':
  1773. ++count;
  1774. goto repeat;
  1775. case ']':
  1776. if (--count == 0)
  1777. {
  1778. lexstate = ST_NORMAL;
  1779. token = BRACKET_PHRASE;
  1780. break;
  1781. }
  1782. goto repeat;
  1783. default:
  1784. goto repeat;
  1785. }
  1786. break;
  1787. case ST_BRACE:
  1788. APP;
  1789. switch (token)
  1790. {
  1791. case '{':
  1792. ++count;
  1793. goto repeat;
  1794. case '}':
  1795. if (--count == 0)
  1796. {
  1797. lexstate = ST_NORMAL;
  1798. token = BRACE_PHRASE;
  1799. break;
  1800. }
  1801. goto repeat;
  1802. default:
  1803. goto repeat;
  1804. }
  1805. break;
  1806. case ST_EXPRESSION:
  1807. switch (token)
  1808. {
  1809. case '(': case '[': case '{':
  1810. ++count;
  1811. APP;
  1812. goto repeat;
  1813. case '}':
  1814. /* is this the last line of an enum declaration? */
  1815. if (count == 0)
  1816. {
  1817. /* Put back the token we just read so's we can find it again
  1818. after registering the expression. */
  1819. unput(token);
  1820. lexstate = ST_NORMAL;
  1821. token = EXPRESSION_PHRASE;
  1822. break;
  1823. }
  1824. /* FALLTHRU */
  1825. case ')': case ']':
  1826. --count;
  1827. APP;
  1828. goto repeat;
  1829. case ',': case ';':
  1830. if (count == 0)
  1831. {
  1832. /* Put back the token we just read so's we can find it again
  1833. after registering the expression. */
  1834. unput(token);
  1835. lexstate = ST_NORMAL;
  1836. token = EXPRESSION_PHRASE;
  1837. break;
  1838. }
  1839. APP;
  1840. goto repeat;
  1841. default:
  1842. APP;
  1843. goto repeat;
  1844. }
  1845. break;
  1846. case ST_TABLE_1:
  1847. goto repeat;
  1848. case ST_TABLE_2:
  1849. if (token == IDENT && yyleng == 1 && yytext[0] == 'X')
  1850. {
  1851. token = EXPORT_SYMBOL_KEYW;
  1852. lexstate = ST_TABLE_5;
  1853. APP;
  1854. break;
  1855. }
  1856. lexstate = ST_TABLE_6;
  1857. /* FALLTHRU */
  1858. case ST_TABLE_6:
  1859. switch (token)
  1860. {
  1861. case '{': case '[': case '(':
  1862. ++count;
  1863. break;
  1864. case '}': case ']': case ')':
  1865. --count;
  1866. break;
  1867. case ',':
  1868. if (count == 0)
  1869. lexstate = ST_TABLE_2;
  1870. break;
  1871. };
  1872. goto repeat;
  1873. case ST_TABLE_3:
  1874. goto repeat;
  1875. case ST_TABLE_4:
  1876. if (token == ';')
  1877. lexstate = ST_NORMAL;
  1878. goto repeat;
  1879. case ST_TABLE_5:
  1880. switch (token)
  1881. {
  1882. case ',':
  1883. token = ';';
  1884. lexstate = ST_TABLE_2;
  1885. APP;
  1886. break;
  1887. default:
  1888. APP;
  1889. break;
  1890. }
  1891. break;
  1892. default:
  1893. exit(1);
  1894. }
  1895. fini:
  1896. if (suppress_type_lookup > 0)
  1897. --suppress_type_lookup;
  1898. if (dont_want_brace_phrase > 0)
  1899. --dont_want_brace_phrase;
  1900. yylval = &next_node->next;
  1901. return token;
  1902. }