c-tokenize.c 56 KB

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