dtc-lexer.lex.c_shipped 52 KB

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