pktloc_grammar.c 60 KB

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