lex.c_shipped 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084
  1. #line 2 "scripts/genksyms/lex.c"
  2. /* A lexical scanner generated by flex */
  3. /* Scanner skeleton version:
  4. * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern 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. abort();
  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. #ifndef YYSTYPE
  1688. #define YYSTYPE int
  1689. #endif
  1690. #define ASM_KEYW 257
  1691. #define ATTRIBUTE_KEYW 258
  1692. #define AUTO_KEYW 259
  1693. #define BOOL_KEYW 260
  1694. #define CHAR_KEYW 261
  1695. #define CONST_KEYW 262
  1696. #define DOUBLE_KEYW 263
  1697. #define ENUM_KEYW 264
  1698. #define EXTERN_KEYW 265
  1699. #define FLOAT_KEYW 266
  1700. #define INLINE_KEYW 267
  1701. #define INT_KEYW 268
  1702. #define LONG_KEYW 269
  1703. #define REGISTER_KEYW 270
  1704. #define RESTRICT_KEYW 271
  1705. #define SHORT_KEYW 272
  1706. #define SIGNED_KEYW 273
  1707. #define STATIC_KEYW 274
  1708. #define STRUCT_KEYW 275
  1709. #define TYPEDEF_KEYW 276
  1710. #define UNION_KEYW 277
  1711. #define UNSIGNED_KEYW 278
  1712. #define VOID_KEYW 279
  1713. #define VOLATILE_KEYW 280
  1714. #define TYPEOF_KEYW 281
  1715. #define EXPORT_SYMBOL_KEYW 282
  1716. #define ASM_PHRASE 283
  1717. #define ATTRIBUTE_PHRASE 284
  1718. #define BRACE_PHRASE 285
  1719. #define BRACKET_PHRASE 286
  1720. #define EXPRESSION_PHRASE 287
  1721. #define CHAR 288
  1722. #define DOTS 289
  1723. #define IDENT 290
  1724. #define INT 291
  1725. #define REAL 292
  1726. #define STRING 293
  1727. #define TYPE 294
  1728. #define OTHER 295
  1729. #define FILENAME 296
  1730. extern YYSTYPE yylval;