lexer.c 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781
  1. #line 2 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/lexer.c"
  2. #line 4 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/lexer.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 39
  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. #define YY_BUF_SIZE 16384
  115. #endif
  116. /* The state buf must be large enough to hold one state per character in the main buffer.
  117. */
  118. #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
  119. #ifndef YY_TYPEDEF_YY_BUFFER_STATE
  120. #define YY_TYPEDEF_YY_BUFFER_STATE
  121. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  122. #endif
  123. #ifndef YY_TYPEDEF_YY_SIZE_T
  124. #define YY_TYPEDEF_YY_SIZE_T
  125. typedef size_t yy_size_t;
  126. #endif
  127. extern yy_size_t yyleng;
  128. extern FILE *yyin, *yyout;
  129. #define EOB_ACT_CONTINUE_SCAN 0
  130. #define EOB_ACT_END_OF_FILE 1
  131. #define EOB_ACT_LAST_MATCH 2
  132. #define YY_LESS_LINENO(n)
  133. #define YY_LINENO_REWIND_TO(ptr)
  134. /* Return all but the first "n" matched characters back to the input stream. */
  135. #define yyless(n) \
  136. do \
  137. { \
  138. /* Undo effects of setting up yytext. */ \
  139. int yyless_macro_arg = (n); \
  140. YY_LESS_LINENO(yyless_macro_arg);\
  141. *yy_cp = (yy_hold_char); \
  142. YY_RESTORE_YY_MORE_OFFSET \
  143. (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
  144. YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  145. } \
  146. while ( 0 )
  147. #define unput(c) yyunput( c, (yytext_ptr) )
  148. #ifndef YY_STRUCT_YY_BUFFER_STATE
  149. #define YY_STRUCT_YY_BUFFER_STATE
  150. struct yy_buffer_state
  151. {
  152. FILE *yy_input_file;
  153. char *yy_ch_buf; /* input buffer */
  154. char *yy_buf_pos; /* current position in input buffer */
  155. /* Size of input buffer in bytes, not including room for EOB
  156. * characters.
  157. */
  158. yy_size_t yy_buf_size;
  159. /* Number of characters read into yy_ch_buf, not including EOB
  160. * characters.
  161. */
  162. yy_size_t yy_n_chars;
  163. /* Whether we "own" the buffer - i.e., we know we created it,
  164. * and can realloc() it to grow it, and should free() it to
  165. * delete it.
  166. */
  167. int yy_is_our_buffer;
  168. /* Whether this is an "interactive" input source; if so, and
  169. * if we're using stdio for input, then we want to use getc()
  170. * instead of fread(), to make sure we stop fetching input after
  171. * each newline.
  172. */
  173. int yy_is_interactive;
  174. /* Whether we're considered to be at the beginning of a line.
  175. * If so, '^' rules will be active on the next match, otherwise
  176. * not.
  177. */
  178. int yy_at_bol;
  179. int yy_bs_lineno; /**< The line count. */
  180. int yy_bs_column; /**< The column count. */
  181. /* Whether to try to fill the input buffer when we reach the
  182. * end of it.
  183. */
  184. int yy_fill_buffer;
  185. int yy_buffer_status;
  186. #define YY_BUFFER_NEW 0
  187. #define YY_BUFFER_NORMAL 1
  188. /* When an EOF's been seen but there's still some text to process
  189. * then we mark the buffer as YY_EOF_PENDING, to indicate that we
  190. * shouldn't try reading from the input source any more. We might
  191. * still have a bunch of tokens to match, though, because of
  192. * possible backing-up.
  193. *
  194. * When we actually see the EOF, we change the status to "new"
  195. * (via yyrestart()), so that the user can continue scanning by
  196. * just pointing yyin at a new input file.
  197. */
  198. #define YY_BUFFER_EOF_PENDING 2
  199. };
  200. #endif /* !YY_STRUCT_YY_BUFFER_STATE */
  201. /* Stack of input buffers. */
  202. static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
  203. static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
  204. static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
  205. /* We provide macros for accessing buffer states in case in the
  206. * future we want to put the buffer states in a more general
  207. * "scanner state".
  208. *
  209. * Returns the top of the stack, or NULL.
  210. */
  211. #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
  212. ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
  213. : NULL)
  214. /* Same as previous macro, but useful when we know that the buffer stack is not
  215. * NULL or when we need an lvalue. For internal use only.
  216. */
  217. #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
  218. /* yy_hold_char holds the character lost when yytext is formed. */
  219. static char yy_hold_char;
  220. static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
  221. yy_size_t yyleng;
  222. /* Points to current character in buffer. */
  223. static char *yy_c_buf_p = (char *) 0;
  224. static int yy_init = 0; /* whether we need to initialize */
  225. static int yy_start = 0; /* start state number */
  226. /* Flag which is used to allow yywrap()'s to do buffer switches
  227. * instead of setting up a fresh yyin. A bit of a hack ...
  228. */
  229. static int yy_did_buffer_switch_on_eof;
  230. void yyrestart (FILE *input_file );
  231. void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
  232. YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
  233. void yy_delete_buffer (YY_BUFFER_STATE b );
  234. void yy_flush_buffer (YY_BUFFER_STATE b );
  235. void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
  236. void yypop_buffer_state (void );
  237. static void yyensure_buffer_stack (void );
  238. static void yy_load_buffer_state (void );
  239. static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
  240. #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
  241. YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
  242. YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
  243. YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len );
  244. void *yyalloc (yy_size_t );
  245. void *yyrealloc (void *,yy_size_t );
  246. void yyfree (void * );
  247. #define yy_new_buffer yy_create_buffer
  248. #define yy_set_interactive(is_interactive) \
  249. { \
  250. if ( ! YY_CURRENT_BUFFER ){ \
  251. yyensure_buffer_stack (); \
  252. YY_CURRENT_BUFFER_LVALUE = \
  253. yy_create_buffer(yyin,YY_BUF_SIZE ); \
  254. } \
  255. YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
  256. }
  257. #define yy_set_bol(at_bol) \
  258. { \
  259. if ( ! YY_CURRENT_BUFFER ){\
  260. yyensure_buffer_stack (); \
  261. YY_CURRENT_BUFFER_LVALUE = \
  262. yy_create_buffer(yyin,YY_BUF_SIZE ); \
  263. } \
  264. YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
  265. }
  266. #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
  267. /* Begin user sect3 */
  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 15
  289. #define YY_END_OF_BUFFER 16
  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[26] =
  298. { 0,
  299. 0, 0, 16, 15, 3, 2, 15, 15, 12, 13,
  300. 1, 11, 9, 10, 15, 15, 3, 4, 7, 1,
  301. 6, 5, 14, 8, 0
  302. } ;
  303. static yyconst flex_int32_t yy_ec[256] =
  304. { 0,
  305. 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
  306. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  307. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  308. 1, 2, 4, 1, 1, 1, 1, 5, 1, 6,
  309. 7, 1, 1, 1, 1, 1, 1, 8, 8, 8,
  310. 8, 8, 8, 8, 8, 8, 8, 1, 1, 9,
  311. 10, 11, 1, 1, 12, 12, 12, 12, 12, 12,
  312. 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
  313. 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
  314. 1, 1, 1, 1, 1, 1, 12, 12, 12, 12,
  315. 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
  316. 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
  317. 12, 12, 1, 13, 1, 1, 1, 1, 1, 1,
  318. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  319. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  320. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  321. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  322. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  323. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  324. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  325. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  326. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  327. 1, 1, 1, 1, 1, 1, 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
  331. } ;
  332. static yyconst flex_int32_t yy_meta[14] =
  333. { 0,
  334. 1, 1, 1, 1, 1, 1, 1, 2, 1, 1,
  335. 1, 2, 1
  336. } ;
  337. static yyconst flex_int16_t yy_base[27] =
  338. { 0,
  339. 0, 0, 24, 25, 21, 25, 12, 16, 25, 25,
  340. 12, 9, 25, 8, 0, 4, 14, 25, 25, 7,
  341. 25, 25, 0, 25, 25, 12
  342. } ;
  343. static yyconst flex_int16_t yy_def[27] =
  344. { 0,
  345. 25, 1, 25, 25, 25, 25, 25, 25, 25, 25,
  346. 25, 25, 25, 25, 26, 25, 25, 25, 25, 25,
  347. 25, 25, 26, 25, 0, 25
  348. } ;
  349. static yyconst flex_int16_t yy_nxt[39] =
  350. { 0,
  351. 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
  352. 14, 15, 16, 23, 20, 17, 24, 22, 21, 20,
  353. 19, 18, 17, 25, 3, 25, 25, 25, 25, 25,
  354. 25, 25, 25, 25, 25, 25, 25, 25
  355. } ;
  356. static yyconst flex_int16_t yy_chk[39] =
  357. { 0,
  358. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  359. 1, 1, 1, 26, 20, 17, 16, 14, 12, 11,
  360. 8, 7, 5, 3, 25, 25, 25, 25, 25, 25,
  361. 25, 25, 25, 25, 25, 25, 25, 25
  362. } ;
  363. static yy_state_type yy_last_accepting_state;
  364. static char *yy_last_accepting_cpos;
  365. extern int yy_flex_debug;
  366. int yy_flex_debug = 0;
  367. /* The intent behind this definition is that it'll catch
  368. * any uses of REJECT which flex missed.
  369. */
  370. #define REJECT reject_used_but_not_detected
  371. #define yymore() yymore_used_but_not_detected
  372. #define YY_MORE_ADJ 0
  373. #define YY_RESTORE_YY_MORE_OFFSET
  374. char *yytext;
  375. #line 1 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/lexer.l"
  376. /*
  377. * ZMap Copyright 2013 Regents of the University of Michigan
  378. *
  379. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  380. * use this file except in compliance with the License. You may obtain a copy
  381. * of the License at http://www.apache.org/licenses/LICENSE-2.0
  382. */
  383. #line 10 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/lexer.l"
  384. #pragma GCC diagnostic ignored "-Wredundant-decls"
  385. #pragma GCC diagnostic ignored "-Wmissing-noreturn"
  386. #include <string.h>
  387. #include "parser.h"
  388. #define YY_NO_INPUT 1
  389. #line 480 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/lexer.c"
  390. #define INITIAL 0
  391. #ifndef YY_NO_UNISTD_H
  392. /* Special case for "unistd.h", since it is non-ANSI. We include it way
  393. * down here because we want the user's section 1 to have been scanned first.
  394. * The user has a chance to override it with an option.
  395. */
  396. #include <unistd.h>
  397. #endif
  398. #ifndef YY_EXTRA_TYPE
  399. #define YY_EXTRA_TYPE void *
  400. #endif
  401. static int yy_init_globals (void );
  402. /* Accessor methods to globals.
  403. These are made visible to non-reentrant scanners for convenience. */
  404. int yylex_destroy (void );
  405. int yyget_debug (void );
  406. void yyset_debug (int debug_flag );
  407. YY_EXTRA_TYPE yyget_extra (void );
  408. void yyset_extra (YY_EXTRA_TYPE user_defined );
  409. FILE *yyget_in (void );
  410. void yyset_in (FILE * in_str );
  411. FILE *yyget_out (void );
  412. void yyset_out (FILE * out_str );
  413. yy_size_t yyget_leng (void );
  414. char *yyget_text (void );
  415. int yyget_lineno (void );
  416. void yyset_lineno (int line_number );
  417. /* Macros after this point can all be overridden by user definitions in
  418. * section 1.
  419. */
  420. #ifndef YY_SKIP_YYWRAP
  421. #ifdef __cplusplus
  422. extern "C" int yywrap (void );
  423. #else
  424. extern int yywrap (void );
  425. #endif
  426. #endif
  427. #ifndef yytext_ptr
  428. static void yy_flex_strncpy (char *,yyconst char *,int );
  429. #endif
  430. #ifdef YY_NEED_STRLEN
  431. static int yy_flex_strlen (yyconst char * );
  432. #endif
  433. #ifndef YY_NO_INPUT
  434. #ifdef __cplusplus
  435. static int yyinput (void );
  436. #else
  437. static int input (void );
  438. #endif
  439. #endif
  440. /* Amount of stuff to slurp up with each read. */
  441. #ifndef YY_READ_BUF_SIZE
  442. #define YY_READ_BUF_SIZE 8192
  443. #endif
  444. /* Copy whatever the last rule matched to the standard output. */
  445. #ifndef ECHO
  446. /* This used to be an fputs(), but since the string might contain NUL's,
  447. * we now use fwrite().
  448. */
  449. #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
  450. #endif
  451. /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
  452. * is returned in "result".
  453. */
  454. #ifndef YY_INPUT
  455. #define YY_INPUT(buf,result,max_size) \
  456. if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
  457. { \
  458. int c = '*'; \
  459. size_t n; \
  460. for ( n = 0; n < max_size && \
  461. (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
  462. buf[n] = (char) c; \
  463. if ( c == '\n' ) \
  464. buf[n++] = (char) c; \
  465. if ( c == EOF && ferror( yyin ) ) \
  466. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  467. result = n; \
  468. } \
  469. else \
  470. { \
  471. errno=0; \
  472. while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
  473. { \
  474. if( errno != EINTR) \
  475. { \
  476. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  477. break; \
  478. } \
  479. errno=0; \
  480. clearerr(yyin); \
  481. } \
  482. }\
  483. \
  484. #endif
  485. /* No semi-colon after return; correct usage is to write "yyterminate();" -
  486. * we don't want an extra ';' after the "return" because that will cause
  487. * some compilers to complain about unreachable statements.
  488. */
  489. #ifndef yyterminate
  490. #define yyterminate() return YY_NULL
  491. #endif
  492. /* Number of entries by which start-condition stack grows. */
  493. #ifndef YY_START_STACK_INCR
  494. #define YY_START_STACK_INCR 25
  495. #endif
  496. /* Report a fatal error. */
  497. #ifndef YY_FATAL_ERROR
  498. #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
  499. #endif
  500. /* end tables serialization structures and prototypes */
  501. /* Default declaration of generated scanner - a define so the user can
  502. * easily add parameters.
  503. */
  504. #ifndef YY_DECL
  505. #define YY_DECL_IS_OURS 1
  506. extern int yylex (void);
  507. #define YY_DECL int yylex (void)
  508. #endif /* !YY_DECL */
  509. /* Code executed at the beginning of each rule, after yytext and yyleng
  510. * have been set up.
  511. */
  512. #ifndef YY_USER_ACTION
  513. #define YY_USER_ACTION
  514. #endif
  515. /* Code executed at the end of each rule. */
  516. #ifndef YY_BREAK
  517. #define YY_BREAK break;
  518. #endif
  519. #define YY_RULE_SETUP \
  520. YY_USER_ACTION
  521. /** The main scanner function which does all the work.
  522. */
  523. YY_DECL
  524. {
  525. register yy_state_type yy_current_state;
  526. register char *yy_cp, *yy_bp;
  527. register int yy_act;
  528. if ( !(yy_init) )
  529. {
  530. (yy_init) = 1;
  531. #ifdef YY_USER_INIT
  532. YY_USER_INIT;
  533. #endif
  534. if ( ! (yy_start) )
  535. (yy_start) = 1; /* first start state */
  536. if ( ! yyin )
  537. yyin = stdin;
  538. if ( ! yyout )
  539. yyout = stdout;
  540. if ( ! YY_CURRENT_BUFFER ) {
  541. yyensure_buffer_stack ();
  542. YY_CURRENT_BUFFER_LVALUE =
  543. yy_create_buffer(yyin,YY_BUF_SIZE );
  544. }
  545. yy_load_buffer_state( );
  546. }
  547. {
  548. #line 20 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/lexer.l"
  549. #line 689 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/lexer.c"
  550. while ( 1 ) /* loops until end-of-file is reached */
  551. {
  552. yy_cp = (yy_c_buf_p);
  553. /* Support of yytext. */
  554. *yy_cp = (yy_hold_char);
  555. /* yy_bp points to the position in yy_ch_buf of the start of
  556. * the current run.
  557. */
  558. yy_bp = yy_cp;
  559. yy_current_state = (yy_start);
  560. yy_match:
  561. do
  562. {
  563. register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
  564. if ( yy_accept[yy_current_state] )
  565. {
  566. (yy_last_accepting_state) = yy_current_state;
  567. (yy_last_accepting_cpos) = yy_cp;
  568. }
  569. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  570. {
  571. yy_current_state = (int) yy_def[yy_current_state];
  572. if ( yy_current_state >= 26 )
  573. yy_c = yy_meta[(unsigned int) yy_c];
  574. }
  575. yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  576. ++yy_cp;
  577. }
  578. while ( yy_base[yy_current_state] != 25 );
  579. yy_find_action:
  580. yy_act = yy_accept[yy_current_state];
  581. if ( yy_act == 0 )
  582. { /* have to back up */
  583. yy_cp = (yy_last_accepting_cpos);
  584. yy_current_state = (yy_last_accepting_state);
  585. yy_act = yy_accept[yy_current_state];
  586. }
  587. YY_DO_BEFORE_ACTION;
  588. do_action: /* This label is used only to access EOF actions. */
  589. switch ( yy_act )
  590. { /* beginning of action switch */
  591. case 0: /* must back up */
  592. /* undo the effects of YY_DO_BEFORE_ACTION */
  593. *yy_cp = (yy_hold_char);
  594. yy_cp = (yy_last_accepting_cpos);
  595. yy_current_state = (yy_last_accepting_state);
  596. goto yy_find_action;
  597. case 1:
  598. YY_RULE_SETUP
  599. #line 21 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/lexer.l"
  600. yylval.int_literal = (uint64_t) atoll(yytext); return T_NUMBER;
  601. YY_BREAK
  602. case 2:
  603. /* rule 2 can match eol */
  604. YY_RULE_SETUP
  605. #line 22 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/lexer.l"
  606. /* Ignore end of line */
  607. YY_BREAK
  608. case 3:
  609. YY_RULE_SETUP
  610. #line 23 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/lexer.l"
  611. /* Ignore whitespace */
  612. YY_BREAK
  613. case 4:
  614. YY_RULE_SETUP
  615. #line 24 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/lexer.l"
  616. return T_NOT_EQ;
  617. YY_BREAK
  618. case 5:
  619. YY_RULE_SETUP
  620. #line 25 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/lexer.l"
  621. return T_GT_EQ;
  622. YY_BREAK
  623. case 6:
  624. YY_RULE_SETUP
  625. #line 26 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/lexer.l"
  626. return T_LT_EQ;
  627. YY_BREAK
  628. case 7:
  629. YY_RULE_SETUP
  630. #line 27 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/lexer.l"
  631. return T_AND;
  632. YY_BREAK
  633. case 8:
  634. YY_RULE_SETUP
  635. #line 28 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/lexer.l"
  636. return T_OR;
  637. YY_BREAK
  638. case 9:
  639. YY_RULE_SETUP
  640. #line 29 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/lexer.l"
  641. return '=';
  642. YY_BREAK
  643. case 10:
  644. YY_RULE_SETUP
  645. #line 30 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/lexer.l"
  646. return '>';
  647. YY_BREAK
  648. case 11:
  649. YY_RULE_SETUP
  650. #line 31 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/lexer.l"
  651. return '<';
  652. YY_BREAK
  653. case 12:
  654. YY_RULE_SETUP
  655. #line 32 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/lexer.l"
  656. return '(';
  657. YY_BREAK
  658. case 13:
  659. YY_RULE_SETUP
  660. #line 33 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/lexer.l"
  661. return ')';
  662. YY_BREAK
  663. case 14:
  664. YY_RULE_SETUP
  665. #line 34 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/lexer.l"
  666. yylval.string_literal = strdup(yytext); return T_FIELD;
  667. YY_BREAK
  668. case 15:
  669. YY_RULE_SETUP
  670. #line 36 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/lexer.l"
  671. ECHO;
  672. YY_BREAK
  673. #line 822 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/lexer.c"
  674. case YY_STATE_EOF(INITIAL):
  675. yyterminate();
  676. case YY_END_OF_BUFFER:
  677. {
  678. /* Amount of text matched not including the EOB char. */
  679. int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
  680. /* Undo the effects of YY_DO_BEFORE_ACTION. */
  681. *yy_cp = (yy_hold_char);
  682. YY_RESTORE_YY_MORE_OFFSET
  683. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
  684. {
  685. /* We're scanning a new file or input source. It's
  686. * possible that this happened because the user
  687. * just pointed yyin at a new source and called
  688. * yylex(). If so, then we have to assure
  689. * consistency between YY_CURRENT_BUFFER and our
  690. * globals. Here is the right place to do so, because
  691. * this is the first action (other than possibly a
  692. * back-up) that will match for the new input source.
  693. */
  694. (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  695. YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
  696. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
  697. }
  698. /* Note that here we test for yy_c_buf_p "<=" to the position
  699. * of the first EOB in the buffer, since yy_c_buf_p will
  700. * already have been incremented past the NUL character
  701. * (since all states make transitions on EOB to the
  702. * end-of-buffer state). Contrast this with the test
  703. * in input().
  704. */
  705. if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
  706. { /* This was really a NUL. */
  707. yy_state_type yy_next_state;
  708. (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
  709. yy_current_state = yy_get_previous_state( );
  710. /* Okay, we're now positioned to make the NUL
  711. * transition. We couldn't have
  712. * yy_get_previous_state() go ahead and do it
  713. * for us because it doesn't know how to deal
  714. * with the possibility of jamming (and we don't
  715. * want to build jamming into it because then it
  716. * will run more slowly).
  717. */
  718. yy_next_state = yy_try_NUL_trans( yy_current_state );
  719. yy_bp = (yytext_ptr) + YY_MORE_ADJ;
  720. if ( yy_next_state )
  721. {
  722. /* Consume the NUL. */
  723. yy_cp = ++(yy_c_buf_p);
  724. yy_current_state = yy_next_state;
  725. goto yy_match;
  726. }
  727. else
  728. {
  729. yy_cp = (yy_c_buf_p);
  730. goto yy_find_action;
  731. }
  732. }
  733. else switch ( yy_get_next_buffer( ) )
  734. {
  735. case EOB_ACT_END_OF_FILE:
  736. {
  737. (yy_did_buffer_switch_on_eof) = 0;
  738. if ( yywrap( ) )
  739. {
  740. /* Note: because we've taken care in
  741. * yy_get_next_buffer() to have set up
  742. * yytext, we can now set up
  743. * yy_c_buf_p so that if some total
  744. * hoser (like flex itself) wants to
  745. * call the scanner after we return the
  746. * YY_NULL, it'll still work - another
  747. * YY_NULL will get returned.
  748. */
  749. (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
  750. yy_act = YY_STATE_EOF(YY_START);
  751. goto do_action;
  752. }
  753. else
  754. {
  755. if ( ! (yy_did_buffer_switch_on_eof) )
  756. YY_NEW_FILE;
  757. }
  758. break;
  759. }
  760. case EOB_ACT_CONTINUE_SCAN:
  761. (yy_c_buf_p) =
  762. (yytext_ptr) + yy_amount_of_matched_text;
  763. yy_current_state = yy_get_previous_state( );
  764. yy_cp = (yy_c_buf_p);
  765. yy_bp = (yytext_ptr) + YY_MORE_ADJ;
  766. goto yy_match;
  767. case EOB_ACT_LAST_MATCH:
  768. (yy_c_buf_p) =
  769. &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
  770. yy_current_state = yy_get_previous_state( );
  771. yy_cp = (yy_c_buf_p);
  772. yy_bp = (yytext_ptr) + YY_MORE_ADJ;
  773. goto yy_find_action;
  774. }
  775. break;
  776. }
  777. default:
  778. YY_FATAL_ERROR(
  779. "fatal flex scanner internal error--no action found" );
  780. } /* end of action switch */
  781. } /* end of scanning one token */
  782. } /* end of user's declarations */
  783. } /* end of yylex */
  784. /* yy_get_next_buffer - try to read in a new buffer
  785. *
  786. * Returns a code representing an action:
  787. * EOB_ACT_LAST_MATCH -
  788. * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  789. * EOB_ACT_END_OF_FILE - end of file
  790. */
  791. static int yy_get_next_buffer (void)
  792. {
  793. register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
  794. register char *source = (yytext_ptr);
  795. register int number_to_move, i;
  796. int ret_val;
  797. if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
  798. YY_FATAL_ERROR(
  799. "fatal flex scanner internal error--end of buffer missed" );
  800. if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
  801. { /* Don't try to fill the buffer, so this is an EOF. */
  802. if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
  803. {
  804. /* We matched a single character, the EOB, so
  805. * treat this as a final EOF.
  806. */
  807. return EOB_ACT_END_OF_FILE;
  808. }
  809. else
  810. {
  811. /* We matched some text prior to the EOB, first
  812. * process it.
  813. */
  814. return EOB_ACT_LAST_MATCH;
  815. }
  816. }
  817. /* Try to read more data. */
  818. /* First move last chars to start of buffer. */
  819. number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
  820. for ( i = 0; i < number_to_move; ++i )
  821. *(dest++) = *(source++);
  822. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
  823. /* don't do the read, it's not guaranteed to return an EOF,
  824. * just force an EOF
  825. */
  826. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
  827. else
  828. {
  829. yy_size_t num_to_read =
  830. YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
  831. while ( num_to_read <= 0 )
  832. { /* Not enough room in the buffer - grow it. */
  833. /* just a shorter name for the current buffer */
  834. YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
  835. int yy_c_buf_p_offset =
  836. (int) ((yy_c_buf_p) - b->yy_ch_buf);
  837. if ( b->yy_is_our_buffer )
  838. {
  839. yy_size_t new_size = b->yy_buf_size * 2;
  840. if ( new_size <= 0 )
  841. b->yy_buf_size += b->yy_buf_size / 8;
  842. else
  843. b->yy_buf_size *= 2;
  844. b->yy_ch_buf = (char *)
  845. /* Include room in for 2 EOB chars. */
  846. yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
  847. }
  848. else
  849. /* Can't grow it, we don't own it. */
  850. b->yy_ch_buf = 0;
  851. if ( ! b->yy_ch_buf )
  852. YY_FATAL_ERROR(
  853. "fatal error - scanner input buffer overflow" );
  854. (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
  855. num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
  856. number_to_move - 1;
  857. }
  858. if ( num_to_read > YY_READ_BUF_SIZE )
  859. num_to_read = YY_READ_BUF_SIZE;
  860. /* Read in more data. */
  861. YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
  862. (yy_n_chars), num_to_read );
  863. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
  864. }
  865. if ( (yy_n_chars) == 0 )
  866. {
  867. if ( number_to_move == YY_MORE_ADJ )
  868. {
  869. ret_val = EOB_ACT_END_OF_FILE;
  870. yyrestart(yyin );
  871. }
  872. else
  873. {
  874. ret_val = EOB_ACT_LAST_MATCH;
  875. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
  876. YY_BUFFER_EOF_PENDING;
  877. }
  878. }
  879. else
  880. ret_val = EOB_ACT_CONTINUE_SCAN;
  881. if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
  882. /* Extend the array by 50%, plus the number we really need. */
  883. yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
  884. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
  885. if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
  886. YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
  887. }
  888. (yy_n_chars) += number_to_move;
  889. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
  890. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
  891. (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
  892. return ret_val;
  893. }
  894. /* yy_get_previous_state - get the state just before the EOB char was reached */
  895. static yy_state_type yy_get_previous_state (void)
  896. {
  897. register yy_state_type yy_current_state;
  898. register char *yy_cp;
  899. yy_current_state = (yy_start);
  900. for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
  901. {
  902. register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
  903. if ( yy_accept[yy_current_state] )
  904. {
  905. (yy_last_accepting_state) = yy_current_state;
  906. (yy_last_accepting_cpos) = yy_cp;
  907. }
  908. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  909. {
  910. yy_current_state = (int) yy_def[yy_current_state];
  911. if ( yy_current_state >= 26 )
  912. yy_c = yy_meta[(unsigned int) yy_c];
  913. }
  914. yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  915. }
  916. return yy_current_state;
  917. }
  918. /* yy_try_NUL_trans - try to make a transition on the NUL character
  919. *
  920. * synopsis
  921. * next_state = yy_try_NUL_trans( current_state );
  922. */
  923. static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
  924. {
  925. register int yy_is_jam;
  926. register char *yy_cp = (yy_c_buf_p);
  927. register YY_CHAR yy_c = 1;
  928. if ( yy_accept[yy_current_state] )
  929. {
  930. (yy_last_accepting_state) = yy_current_state;
  931. (yy_last_accepting_cpos) = yy_cp;
  932. }
  933. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  934. {
  935. yy_current_state = (int) yy_def[yy_current_state];
  936. if ( yy_current_state >= 26 )
  937. yy_c = yy_meta[(unsigned int) yy_c];
  938. }
  939. yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
  940. yy_is_jam = (yy_current_state == 25);
  941. return yy_is_jam ? 0 : yy_current_state;
  942. }
  943. #ifndef YY_NO_INPUT
  944. #ifdef __cplusplus
  945. static int yyinput (void)
  946. #else
  947. static int input (void)
  948. #endif
  949. {
  950. int c;
  951. *(yy_c_buf_p) = (yy_hold_char);
  952. if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
  953. {
  954. /* yy_c_buf_p now points to the character we want to return.
  955. * If this occurs *before* the EOB characters, then it's a
  956. * valid NUL; if not, then we've hit the end of the buffer.
  957. */
  958. if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
  959. /* This was really a NUL. */
  960. *(yy_c_buf_p) = '\0';
  961. else
  962. { /* need more input */
  963. yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
  964. ++(yy_c_buf_p);
  965. switch ( yy_get_next_buffer( ) )
  966. {
  967. case EOB_ACT_LAST_MATCH:
  968. /* This happens because yy_g_n_b()
  969. * sees that we've accumulated a
  970. * token and flags that we need to
  971. * try matching the token before
  972. * proceeding. But for input(),
  973. * there's no matching to consider.
  974. * So convert the EOB_ACT_LAST_MATCH
  975. * to EOB_ACT_END_OF_FILE.
  976. */
  977. /* Reset buffer status. */
  978. yyrestart(yyin );
  979. /*FALLTHROUGH*/
  980. case EOB_ACT_END_OF_FILE:
  981. {
  982. if ( yywrap( ) )
  983. return EOF;
  984. if ( ! (yy_did_buffer_switch_on_eof) )
  985. YY_NEW_FILE;
  986. #ifdef __cplusplus
  987. return yyinput();
  988. #else
  989. return input();
  990. #endif
  991. }
  992. case EOB_ACT_CONTINUE_SCAN:
  993. (yy_c_buf_p) = (yytext_ptr) + offset;
  994. break;
  995. }
  996. }
  997. }
  998. c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
  999. *(yy_c_buf_p) = '\0'; /* preserve yytext */
  1000. (yy_hold_char) = *++(yy_c_buf_p);
  1001. return c;
  1002. }
  1003. #endif /* ifndef YY_NO_INPUT */
  1004. /** Immediately switch to a different input stream.
  1005. * @param input_file A readable stream.
  1006. *
  1007. * @note This function does not reset the start condition to @c INITIAL .
  1008. */
  1009. void yyrestart (FILE * input_file )
  1010. {
  1011. if ( ! YY_CURRENT_BUFFER ){
  1012. yyensure_buffer_stack ();
  1013. YY_CURRENT_BUFFER_LVALUE =
  1014. yy_create_buffer(yyin,YY_BUF_SIZE );
  1015. }
  1016. yy_init_buffer(YY_CURRENT_BUFFER,input_file );
  1017. yy_load_buffer_state( );
  1018. }
  1019. /** Switch to a different input buffer.
  1020. * @param new_buffer The new input buffer.
  1021. *
  1022. */
  1023. void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
  1024. {
  1025. /* TODO. We should be able to replace this entire function body
  1026. * with
  1027. * yypop_buffer_state();
  1028. * yypush_buffer_state(new_buffer);
  1029. */
  1030. yyensure_buffer_stack ();
  1031. if ( YY_CURRENT_BUFFER == new_buffer )
  1032. return;
  1033. if ( YY_CURRENT_BUFFER )
  1034. {
  1035. /* Flush out information for old buffer. */
  1036. *(yy_c_buf_p) = (yy_hold_char);
  1037. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
  1038. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
  1039. }
  1040. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  1041. yy_load_buffer_state( );
  1042. /* We don't actually know whether we did this switch during
  1043. * EOF (yywrap()) processing, but the only time this flag
  1044. * is looked at is after yywrap() is called, so it's safe
  1045. * to go ahead and always set it.
  1046. */
  1047. (yy_did_buffer_switch_on_eof) = 1;
  1048. }
  1049. static void yy_load_buffer_state (void)
  1050. {
  1051. (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  1052. (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
  1053. yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
  1054. (yy_hold_char) = *(yy_c_buf_p);
  1055. }
  1056. /** Allocate and initialize an input buffer state.
  1057. * @param file A readable stream.
  1058. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
  1059. *
  1060. * @return the allocated buffer state.
  1061. */
  1062. YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
  1063. {
  1064. YY_BUFFER_STATE b;
  1065. b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
  1066. if ( ! b )
  1067. YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1068. b->yy_buf_size = size;
  1069. /* yy_ch_buf has to be 2 characters longer than the size given because
  1070. * we need to put in 2 end-of-buffer characters.
  1071. */
  1072. b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
  1073. if ( ! b->yy_ch_buf )
  1074. YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1075. b->yy_is_our_buffer = 1;
  1076. yy_init_buffer(b,file );
  1077. return b;
  1078. }
  1079. /** Destroy the buffer.
  1080. * @param b a buffer created with yy_create_buffer()
  1081. *
  1082. */
  1083. void yy_delete_buffer (YY_BUFFER_STATE b )
  1084. {
  1085. if ( ! b )
  1086. return;
  1087. if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
  1088. YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
  1089. if ( b->yy_is_our_buffer )
  1090. yyfree((void *) b->yy_ch_buf );
  1091. yyfree((void *) b );
  1092. }
  1093. /* Initializes or reinitializes a buffer.
  1094. * This function is sometimes called more than once on the same buffer,
  1095. * such as during a yyrestart() or at EOF.
  1096. */
  1097. static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
  1098. {
  1099. int oerrno = errno;
  1100. yy_flush_buffer(b );
  1101. b->yy_input_file = file;
  1102. b->yy_fill_buffer = 1;
  1103. /* If b is the current buffer, then yy_init_buffer was _probably_
  1104. * called from yyrestart() or through yy_get_next_buffer.
  1105. * In that case, we don't want to reset the lineno or column.
  1106. */
  1107. if (b != YY_CURRENT_BUFFER){
  1108. b->yy_bs_lineno = 1;
  1109. b->yy_bs_column = 0;
  1110. }
  1111. b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
  1112. errno = oerrno;
  1113. }
  1114. /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
  1115. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
  1116. *
  1117. */
  1118. void yy_flush_buffer (YY_BUFFER_STATE b )
  1119. {
  1120. if ( ! b )
  1121. return;
  1122. b->yy_n_chars = 0;
  1123. /* We always need two end-of-buffer characters. The first causes
  1124. * a transition to the end-of-buffer state. The second causes
  1125. * a jam in that state.
  1126. */
  1127. b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
  1128. b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  1129. b->yy_buf_pos = &b->yy_ch_buf[0];
  1130. b->yy_at_bol = 1;
  1131. b->yy_buffer_status = YY_BUFFER_NEW;
  1132. if ( b == YY_CURRENT_BUFFER )
  1133. yy_load_buffer_state( );
  1134. }
  1135. /** Pushes the new state onto the stack. The new state becomes
  1136. * the current state. This function will allocate the stack
  1137. * if necessary.
  1138. * @param new_buffer The new state.
  1139. *
  1140. */
  1141. void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
  1142. {
  1143. if (new_buffer == NULL)
  1144. return;
  1145. yyensure_buffer_stack();
  1146. /* This block is copied from yy_switch_to_buffer. */
  1147. if ( YY_CURRENT_BUFFER )
  1148. {
  1149. /* Flush out information for old buffer. */
  1150. *(yy_c_buf_p) = (yy_hold_char);
  1151. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
  1152. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
  1153. }
  1154. /* Only push if top exists. Otherwise, replace top. */
  1155. if (YY_CURRENT_BUFFER)
  1156. (yy_buffer_stack_top)++;
  1157. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  1158. /* copied from yy_switch_to_buffer. */
  1159. yy_load_buffer_state( );
  1160. (yy_did_buffer_switch_on_eof) = 1;
  1161. }
  1162. /** Removes and deletes the top of the stack, if present.
  1163. * The next element becomes the new top.
  1164. *
  1165. */
  1166. void yypop_buffer_state (void)
  1167. {
  1168. if (!YY_CURRENT_BUFFER)
  1169. return;
  1170. yy_delete_buffer(YY_CURRENT_BUFFER );
  1171. YY_CURRENT_BUFFER_LVALUE = NULL;
  1172. if ((yy_buffer_stack_top) > 0)
  1173. --(yy_buffer_stack_top);
  1174. if (YY_CURRENT_BUFFER) {
  1175. yy_load_buffer_state( );
  1176. (yy_did_buffer_switch_on_eof) = 1;
  1177. }
  1178. }
  1179. /* Allocates the stack if it does not exist.
  1180. * Guarantees space for at least one push.
  1181. */
  1182. static void yyensure_buffer_stack (void)
  1183. {
  1184. yy_size_t num_to_alloc;
  1185. if (!(yy_buffer_stack)) {
  1186. /* First allocation is just for 2 elements, since we don't know if this
  1187. * scanner will even need a stack. We use 2 instead of 1 to avoid an
  1188. * immediate realloc on the next call.
  1189. */
  1190. num_to_alloc = 1;
  1191. (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
  1192. (num_to_alloc * sizeof(struct yy_buffer_state*)
  1193. );
  1194. if ( ! (yy_buffer_stack) )
  1195. YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
  1196. memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
  1197. (yy_buffer_stack_max) = num_to_alloc;
  1198. (yy_buffer_stack_top) = 0;
  1199. return;
  1200. }
  1201. if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
  1202. /* Increase the buffer to prepare for a possible push. */
  1203. int grow_size = 8 /* arbitrary grow size */;
  1204. num_to_alloc = (yy_buffer_stack_max) + grow_size;
  1205. (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
  1206. ((yy_buffer_stack),
  1207. num_to_alloc * sizeof(struct yy_buffer_state*)
  1208. );
  1209. if ( ! (yy_buffer_stack) )
  1210. YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
  1211. /* zero only the new slots.*/
  1212. memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
  1213. (yy_buffer_stack_max) = num_to_alloc;
  1214. }
  1215. }
  1216. /** Setup the input buffer state to scan directly from a user-specified character buffer.
  1217. * @param base the character buffer
  1218. * @param size the size in bytes of the character buffer
  1219. *
  1220. * @return the newly allocated buffer state object.
  1221. */
  1222. YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
  1223. {
  1224. YY_BUFFER_STATE b;
  1225. if ( size < 2 ||
  1226. base[size-2] != YY_END_OF_BUFFER_CHAR ||
  1227. base[size-1] != YY_END_OF_BUFFER_CHAR )
  1228. /* They forgot to leave room for the EOB's. */
  1229. return 0;
  1230. b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
  1231. if ( ! b )
  1232. YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
  1233. b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
  1234. b->yy_buf_pos = b->yy_ch_buf = base;
  1235. b->yy_is_our_buffer = 0;
  1236. b->yy_input_file = 0;
  1237. b->yy_n_chars = b->yy_buf_size;
  1238. b->yy_is_interactive = 0;
  1239. b->yy_at_bol = 1;
  1240. b->yy_fill_buffer = 0;
  1241. b->yy_buffer_status = YY_BUFFER_NEW;
  1242. yy_switch_to_buffer(b );
  1243. return b;
  1244. }
  1245. /** Setup the input buffer state to scan a string. The next call to yylex() will
  1246. * scan from a @e copy of @a str.
  1247. * @param yystr a NUL-terminated string to scan
  1248. *
  1249. * @return the newly allocated buffer state object.
  1250. * @note If you want to scan bytes that may contain NUL values, then use
  1251. * yy_scan_bytes() instead.
  1252. */
  1253. YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
  1254. {
  1255. return yy_scan_bytes(yystr,strlen(yystr) );
  1256. }
  1257. /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
  1258. * scan from a @e copy of @a bytes.
  1259. * @param yybytes the byte buffer to scan
  1260. * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
  1261. *
  1262. * @return the newly allocated buffer state object.
  1263. */
  1264. YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
  1265. {
  1266. YY_BUFFER_STATE b;
  1267. char *buf;
  1268. yy_size_t n;
  1269. yy_size_t i;
  1270. /* Get memory for full buffer, including space for trailing EOB's. */
  1271. n = _yybytes_len + 2;
  1272. buf = (char *) yyalloc(n );
  1273. if ( ! buf )
  1274. YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
  1275. for ( i = 0; i < _yybytes_len; ++i )
  1276. buf[i] = yybytes[i];
  1277. buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
  1278. b = yy_scan_buffer(buf,n );
  1279. if ( ! b )
  1280. YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
  1281. /* It's okay to grow etc. this buffer, and we should throw it
  1282. * away when we're done.
  1283. */
  1284. b->yy_is_our_buffer = 1;
  1285. return b;
  1286. }
  1287. #ifndef YY_EXIT_FAILURE
  1288. #define YY_EXIT_FAILURE 2
  1289. #endif
  1290. static void yy_fatal_error (yyconst char* msg )
  1291. {
  1292. (void) fprintf( stderr, "%s\n", msg );
  1293. exit( YY_EXIT_FAILURE );
  1294. }
  1295. /* Redefine yyless() so it works in section 3 code. */
  1296. #undef yyless
  1297. #define yyless(n) \
  1298. do \
  1299. { \
  1300. /* Undo effects of setting up yytext. */ \
  1301. int yyless_macro_arg = (n); \
  1302. YY_LESS_LINENO(yyless_macro_arg);\
  1303. yytext[yyleng] = (yy_hold_char); \
  1304. (yy_c_buf_p) = yytext + yyless_macro_arg; \
  1305. (yy_hold_char) = *(yy_c_buf_p); \
  1306. *(yy_c_buf_p) = '\0'; \
  1307. yyleng = yyless_macro_arg; \
  1308. } \
  1309. while ( 0 )
  1310. /* Accessor methods (get/set functions) to struct members. */
  1311. /** Get the current line number.
  1312. *
  1313. */
  1314. int yyget_lineno (void)
  1315. {
  1316. return yylineno;
  1317. }
  1318. /** Get the input stream.
  1319. *
  1320. */
  1321. FILE *yyget_in (void)
  1322. {
  1323. return yyin;
  1324. }
  1325. /** Get the output stream.
  1326. *
  1327. */
  1328. FILE *yyget_out (void)
  1329. {
  1330. return yyout;
  1331. }
  1332. /** Get the length of the current token.
  1333. *
  1334. */
  1335. yy_size_t yyget_leng (void)
  1336. {
  1337. return yyleng;
  1338. }
  1339. /** Get the current token.
  1340. *
  1341. */
  1342. char *yyget_text (void)
  1343. {
  1344. return yytext;
  1345. }
  1346. /** Set the current line number.
  1347. * @param line_number
  1348. *
  1349. */
  1350. void yyset_lineno (int line_number )
  1351. {
  1352. yylineno = line_number;
  1353. }
  1354. /** Set the input stream. This does not discard the current
  1355. * input buffer.
  1356. * @param in_str A readable stream.
  1357. *
  1358. * @see yy_switch_to_buffer
  1359. */
  1360. void yyset_in (FILE * in_str )
  1361. {
  1362. yyin = in_str ;
  1363. }
  1364. void yyset_out (FILE * out_str )
  1365. {
  1366. yyout = out_str ;
  1367. }
  1368. int yyget_debug (void)
  1369. {
  1370. return yy_flex_debug;
  1371. }
  1372. void yyset_debug (int bdebug )
  1373. {
  1374. yy_flex_debug = bdebug ;
  1375. }
  1376. static int yy_init_globals (void)
  1377. {
  1378. /* Initialization is the same as for the non-reentrant scanner.
  1379. * This function is called from yylex_destroy(), so don't allocate here.
  1380. */
  1381. (yy_buffer_stack) = 0;
  1382. (yy_buffer_stack_top) = 0;
  1383. (yy_buffer_stack_max) = 0;
  1384. (yy_c_buf_p) = (char *) 0;
  1385. (yy_init) = 0;
  1386. (yy_start) = 0;
  1387. /* Defined in main.c */
  1388. #ifdef YY_STDINIT
  1389. yyin = stdin;
  1390. yyout = stdout;
  1391. #else
  1392. yyin = (FILE *) 0;
  1393. yyout = (FILE *) 0;
  1394. #endif
  1395. /* For future reference: Set errno on error, since we are called by
  1396. * yylex_init()
  1397. */
  1398. return 0;
  1399. }
  1400. /* yylex_destroy is for both reentrant and non-reentrant scanners. */
  1401. int yylex_destroy (void)
  1402. {
  1403. /* Pop the buffer stack, destroying each element. */
  1404. while(YY_CURRENT_BUFFER){
  1405. yy_delete_buffer(YY_CURRENT_BUFFER );
  1406. YY_CURRENT_BUFFER_LVALUE = NULL;
  1407. yypop_buffer_state();
  1408. }
  1409. /* Destroy the stack itself. */
  1410. yyfree((yy_buffer_stack) );
  1411. (yy_buffer_stack) = NULL;
  1412. /* Reset the globals. This is important in a non-reentrant scanner so the next time
  1413. * yylex() is called, initialization will occur. */
  1414. yy_init_globals( );
  1415. return 0;
  1416. }
  1417. /*
  1418. * Internal utility routines.
  1419. */
  1420. #ifndef yytext_ptr
  1421. static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
  1422. {
  1423. register int i;
  1424. for ( i = 0; i < n; ++i )
  1425. s1[i] = s2[i];
  1426. }
  1427. #endif
  1428. #ifdef YY_NEED_STRLEN
  1429. static int yy_flex_strlen (yyconst char * s )
  1430. {
  1431. register int n;
  1432. for ( n = 0; s[n]; ++n )
  1433. ;
  1434. return n;
  1435. }
  1436. #endif
  1437. void *yyalloc (yy_size_t size )
  1438. {
  1439. return (void *) malloc( size );
  1440. }
  1441. void *yyrealloc (void * ptr, yy_size_t size )
  1442. {
  1443. /* The cast to (char *) in the following accommodates both
  1444. * implementations that use char* generic pointers, and those
  1445. * that use void* generic pointers. It works with the latter
  1446. * because both ANSI C and C++ allow castless assignment from
  1447. * any pointer type to void*, and deal with argument conversions
  1448. * as though doing an assignment.
  1449. */
  1450. return (void *) realloc( (char *) ptr, size );
  1451. }
  1452. void yyfree (void * ptr )
  1453. {
  1454. free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
  1455. }
  1456. #define YYTABLES_NAME "yytables"
  1457. #line 36 "/home/mike/folder/studium_ms/semester_5/master_thesis/repo_prepare/zmap/src/lexer.l"