lex.c_shipped 52 KB

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