lex.c_shipped 66 KB

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