settings_lexer.c 81 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108
  1. #line 2 "settings/settings_lexer.c"
  2. #line 4 "settings/settings_lexer.c"
  3. #define YY_INT_ALIGNED short int
  4. /* A lexical scanner generated by flex */
  5. /* %not-for-header */
  6. /* %if-c-only */
  7. /* %if-not-reentrant */
  8. /* %endif */
  9. /* %endif */
  10. /* %ok-for-header */
  11. #define FLEX_SCANNER
  12. #define YY_FLEX_MAJOR_VERSION 2
  13. #define YY_FLEX_MINOR_VERSION 6
  14. #define YY_FLEX_SUBMINOR_VERSION 4
  15. #if YY_FLEX_SUBMINOR_VERSION > 0
  16. #define FLEX_BETA
  17. #endif
  18. /* %if-c++-only */
  19. /* %endif */
  20. /* %if-c-only */
  21. #ifdef yy_create_buffer
  22. #define settings_parser__create_buffer_ALREADY_DEFINED
  23. #else
  24. #define yy_create_buffer settings_parser__create_buffer
  25. #endif
  26. #ifdef yy_delete_buffer
  27. #define settings_parser__delete_buffer_ALREADY_DEFINED
  28. #else
  29. #define yy_delete_buffer settings_parser__delete_buffer
  30. #endif
  31. #ifdef yy_scan_buffer
  32. #define settings_parser__scan_buffer_ALREADY_DEFINED
  33. #else
  34. #define yy_scan_buffer settings_parser__scan_buffer
  35. #endif
  36. #ifdef yy_scan_string
  37. #define settings_parser__scan_string_ALREADY_DEFINED
  38. #else
  39. #define yy_scan_string settings_parser__scan_string
  40. #endif
  41. #ifdef yy_scan_bytes
  42. #define settings_parser__scan_bytes_ALREADY_DEFINED
  43. #else
  44. #define yy_scan_bytes settings_parser__scan_bytes
  45. #endif
  46. #ifdef yy_init_buffer
  47. #define settings_parser__init_buffer_ALREADY_DEFINED
  48. #else
  49. #define yy_init_buffer settings_parser__init_buffer
  50. #endif
  51. #ifdef yy_flush_buffer
  52. #define settings_parser__flush_buffer_ALREADY_DEFINED
  53. #else
  54. #define yy_flush_buffer settings_parser__flush_buffer
  55. #endif
  56. #ifdef yy_load_buffer_state
  57. #define settings_parser__load_buffer_state_ALREADY_DEFINED
  58. #else
  59. #define yy_load_buffer_state settings_parser__load_buffer_state
  60. #endif
  61. #ifdef yy_switch_to_buffer
  62. #define settings_parser__switch_to_buffer_ALREADY_DEFINED
  63. #else
  64. #define yy_switch_to_buffer settings_parser__switch_to_buffer
  65. #endif
  66. #ifdef yypush_buffer_state
  67. #define settings_parser_push_buffer_state_ALREADY_DEFINED
  68. #else
  69. #define yypush_buffer_state settings_parser_push_buffer_state
  70. #endif
  71. #ifdef yypop_buffer_state
  72. #define settings_parser_pop_buffer_state_ALREADY_DEFINED
  73. #else
  74. #define yypop_buffer_state settings_parser_pop_buffer_state
  75. #endif
  76. #ifdef yyensure_buffer_stack
  77. #define settings_parser_ensure_buffer_stack_ALREADY_DEFINED
  78. #else
  79. #define yyensure_buffer_stack settings_parser_ensure_buffer_stack
  80. #endif
  81. #ifdef yylex
  82. #define settings_parser_lex_ALREADY_DEFINED
  83. #else
  84. #define yylex settings_parser_lex
  85. #endif
  86. #ifdef yyrestart
  87. #define settings_parser_restart_ALREADY_DEFINED
  88. #else
  89. #define yyrestart settings_parser_restart
  90. #endif
  91. #ifdef yylex_init
  92. #define settings_parser_lex_init_ALREADY_DEFINED
  93. #else
  94. #define yylex_init settings_parser_lex_init
  95. #endif
  96. #ifdef yylex_init_extra
  97. #define settings_parser_lex_init_extra_ALREADY_DEFINED
  98. #else
  99. #define yylex_init_extra settings_parser_lex_init_extra
  100. #endif
  101. #ifdef yylex_destroy
  102. #define settings_parser_lex_destroy_ALREADY_DEFINED
  103. #else
  104. #define yylex_destroy settings_parser_lex_destroy
  105. #endif
  106. #ifdef yyget_debug
  107. #define settings_parser_get_debug_ALREADY_DEFINED
  108. #else
  109. #define yyget_debug settings_parser_get_debug
  110. #endif
  111. #ifdef yyset_debug
  112. #define settings_parser_set_debug_ALREADY_DEFINED
  113. #else
  114. #define yyset_debug settings_parser_set_debug
  115. #endif
  116. #ifdef yyget_extra
  117. #define settings_parser_get_extra_ALREADY_DEFINED
  118. #else
  119. #define yyget_extra settings_parser_get_extra
  120. #endif
  121. #ifdef yyset_extra
  122. #define settings_parser_set_extra_ALREADY_DEFINED
  123. #else
  124. #define yyset_extra settings_parser_set_extra
  125. #endif
  126. #ifdef yyget_in
  127. #define settings_parser_get_in_ALREADY_DEFINED
  128. #else
  129. #define yyget_in settings_parser_get_in
  130. #endif
  131. #ifdef yyset_in
  132. #define settings_parser_set_in_ALREADY_DEFINED
  133. #else
  134. #define yyset_in settings_parser_set_in
  135. #endif
  136. #ifdef yyget_out
  137. #define settings_parser_get_out_ALREADY_DEFINED
  138. #else
  139. #define yyget_out settings_parser_get_out
  140. #endif
  141. #ifdef yyset_out
  142. #define settings_parser_set_out_ALREADY_DEFINED
  143. #else
  144. #define yyset_out settings_parser_set_out
  145. #endif
  146. #ifdef yyget_leng
  147. #define settings_parser_get_leng_ALREADY_DEFINED
  148. #else
  149. #define yyget_leng settings_parser_get_leng
  150. #endif
  151. #ifdef yyget_text
  152. #define settings_parser_get_text_ALREADY_DEFINED
  153. #else
  154. #define yyget_text settings_parser_get_text
  155. #endif
  156. #ifdef yyget_lineno
  157. #define settings_parser_get_lineno_ALREADY_DEFINED
  158. #else
  159. #define yyget_lineno settings_parser_get_lineno
  160. #endif
  161. #ifdef yyset_lineno
  162. #define settings_parser_set_lineno_ALREADY_DEFINED
  163. #else
  164. #define yyset_lineno settings_parser_set_lineno
  165. #endif
  166. #ifdef yyget_column
  167. #define settings_parser_get_column_ALREADY_DEFINED
  168. #else
  169. #define yyget_column settings_parser_get_column
  170. #endif
  171. #ifdef yyset_column
  172. #define settings_parser_set_column_ALREADY_DEFINED
  173. #else
  174. #define yyset_column settings_parser_set_column
  175. #endif
  176. #ifdef yywrap
  177. #define settings_parser_wrap_ALREADY_DEFINED
  178. #else
  179. #define yywrap settings_parser_wrap
  180. #endif
  181. /* %endif */
  182. #ifdef yyget_lval
  183. #define settings_parser_get_lval_ALREADY_DEFINED
  184. #else
  185. #define yyget_lval settings_parser_get_lval
  186. #endif
  187. #ifdef yyset_lval
  188. #define settings_parser_set_lval_ALREADY_DEFINED
  189. #else
  190. #define yyset_lval settings_parser_set_lval
  191. #endif
  192. #ifdef yyalloc
  193. #define settings_parser_alloc_ALREADY_DEFINED
  194. #else
  195. #define yyalloc settings_parser_alloc
  196. #endif
  197. #ifdef yyrealloc
  198. #define settings_parser_realloc_ALREADY_DEFINED
  199. #else
  200. #define yyrealloc settings_parser_realloc
  201. #endif
  202. #ifdef yyfree
  203. #define settings_parser_free_ALREADY_DEFINED
  204. #else
  205. #define yyfree settings_parser_free
  206. #endif
  207. /* %if-c-only */
  208. /* %endif */
  209. /* First, we deal with platform-specific or compiler-specific issues. */
  210. /* begin standard C headers. */
  211. /* %if-c-only */
  212. #include <stdio.h>
  213. #include <string.h>
  214. #include <errno.h>
  215. #include <stdlib.h>
  216. /* %endif */
  217. /* %if-tables-serialization */
  218. /* %endif */
  219. /* end standard C headers. */
  220. /* %if-c-or-c++ */
  221. /* flex integer type definitions */
  222. #ifndef FLEXINT_H
  223. #define FLEXINT_H
  224. /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
  225. #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  226. /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
  227. * if you want the limit (max/min) macros for int types.
  228. */
  229. #ifndef __STDC_LIMIT_MACROS
  230. #define __STDC_LIMIT_MACROS 1
  231. #endif
  232. #include <inttypes.h>
  233. typedef int8_t flex_int8_t;
  234. typedef uint8_t flex_uint8_t;
  235. typedef int16_t flex_int16_t;
  236. typedef uint16_t flex_uint16_t;
  237. typedef int32_t flex_int32_t;
  238. typedef uint32_t flex_uint32_t;
  239. #else
  240. typedef signed char flex_int8_t;
  241. typedef short int flex_int16_t;
  242. typedef int flex_int32_t;
  243. typedef unsigned char flex_uint8_t;
  244. typedef unsigned short int flex_uint16_t;
  245. typedef unsigned int flex_uint32_t;
  246. /* Limits of integral types. */
  247. #ifndef INT8_MIN
  248. #define INT8_MIN (-128)
  249. #endif
  250. #ifndef INT16_MIN
  251. #define INT16_MIN (-32767-1)
  252. #endif
  253. #ifndef INT32_MIN
  254. #define INT32_MIN (-2147483647-1)
  255. #endif
  256. #ifndef INT8_MAX
  257. #define INT8_MAX (127)
  258. #endif
  259. #ifndef INT16_MAX
  260. #define INT16_MAX (32767)
  261. #endif
  262. #ifndef INT32_MAX
  263. #define INT32_MAX (2147483647)
  264. #endif
  265. #ifndef UINT8_MAX
  266. #define UINT8_MAX (255U)
  267. #endif
  268. #ifndef UINT16_MAX
  269. #define UINT16_MAX (65535U)
  270. #endif
  271. #ifndef UINT32_MAX
  272. #define UINT32_MAX (4294967295U)
  273. #endif
  274. #ifndef SIZE_MAX
  275. #define SIZE_MAX (~(size_t)0)
  276. #endif
  277. #endif /* ! C99 */
  278. #endif /* ! FLEXINT_H */
  279. /* %endif */
  280. /* begin standard C++ headers. */
  281. /* %if-c++-only */
  282. /* %endif */
  283. /* TODO: this is always defined, so inline it */
  284. #define yyconst const
  285. #if defined(__GNUC__) && __GNUC__ >= 3
  286. #define yynoreturn __attribute__((__noreturn__))
  287. #else
  288. #define yynoreturn
  289. #endif
  290. /* %not-for-header */
  291. /* Returned upon end-of-file. */
  292. #define YY_NULL 0
  293. /* %ok-for-header */
  294. /* %not-for-header */
  295. /* Promotes a possibly negative, possibly signed char to an
  296. * integer in range [0..255] for use as an array index.
  297. */
  298. #define YY_SC_TO_UI(c) ((YY_CHAR) (c))
  299. /* %ok-for-header */
  300. /* %if-reentrant */
  301. /* An opaque pointer. */
  302. #ifndef YY_TYPEDEF_YY_SCANNER_T
  303. #define YY_TYPEDEF_YY_SCANNER_T
  304. typedef void* yyscan_t;
  305. #endif
  306. /* For convenience, these vars (plus the bison vars far below)
  307. are macros in the reentrant scanner. */
  308. #define yyin yyg->yyin_r
  309. #define yyout yyg->yyout_r
  310. #define yyextra yyg->yyextra_r
  311. #define yyleng yyg->yyleng_r
  312. #define yytext yyg->yytext_r
  313. #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
  314. #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
  315. #define yy_flex_debug yyg->yy_flex_debug_r
  316. /* %endif */
  317. /* %if-not-reentrant */
  318. /* %endif */
  319. /* Enter a start condition. This macro really ought to take a parameter,
  320. * but we do it the disgusting crufty way forced on us by the ()-less
  321. * definition of BEGIN.
  322. */
  323. #define BEGIN yyg->yy_start = 1 + 2 *
  324. /* Translate the current start state into a value that can be later handed
  325. * to BEGIN to return to the state. The YYSTATE alias is for lex
  326. * compatibility.
  327. */
  328. #define YY_START ((yyg->yy_start - 1) / 2)
  329. #define YYSTATE YY_START
  330. /* Action number for EOF rule of a given start state. */
  331. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  332. /* Special action meaning "start processing a new file". */
  333. #define YY_NEW_FILE yyrestart( yyin , yyscanner )
  334. #define YY_END_OF_BUFFER_CHAR 0
  335. /* Size of default input buffer. */
  336. #ifndef YY_BUF_SIZE
  337. #ifdef __ia64__
  338. /* On IA-64, the buffer size is 16k, not 8k.
  339. * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
  340. * Ditto for the __ia64__ case accordingly.
  341. */
  342. #define YY_BUF_SIZE 32768
  343. #else
  344. #define YY_BUF_SIZE 16384
  345. #endif /* __ia64__ */
  346. #endif
  347. /* The state buf must be large enough to hold one state per character in the main buffer.
  348. */
  349. #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
  350. #ifndef YY_TYPEDEF_YY_BUFFER_STATE
  351. #define YY_TYPEDEF_YY_BUFFER_STATE
  352. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  353. #endif
  354. #ifndef YY_TYPEDEF_YY_SIZE_T
  355. #define YY_TYPEDEF_YY_SIZE_T
  356. typedef size_t yy_size_t;
  357. #endif
  358. /* %if-not-reentrant */
  359. /* %endif */
  360. /* %if-c-only */
  361. /* %if-not-reentrant */
  362. /* %endif */
  363. /* %endif */
  364. #define EOB_ACT_CONTINUE_SCAN 0
  365. #define EOB_ACT_END_OF_FILE 1
  366. #define EOB_ACT_LAST_MATCH 2
  367. /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
  368. * access to the local variable yy_act. Since yyless() is a macro, it would break
  369. * existing scanners that call yyless() from OUTSIDE yylex.
  370. * One obvious solution it to make yy_act a global. I tried that, and saw
  371. * a 5% performance hit in a non-yylineno scanner, because yy_act is
  372. * normally declared as a register variable-- so it is not worth it.
  373. */
  374. #define YY_LESS_LINENO(n) \
  375. do { \
  376. int yyl;\
  377. for ( yyl = n; yyl < yyleng; ++yyl )\
  378. if ( yytext[yyl] == '\n' )\
  379. --yylineno;\
  380. }while(0)
  381. #define YY_LINENO_REWIND_TO(dst) \
  382. do {\
  383. const char *p;\
  384. for ( p = yy_cp-1; p >= (dst); --p)\
  385. if ( *p == '\n' )\
  386. --yylineno;\
  387. }while(0)
  388. /* Return all but the first "n" matched characters back to the input stream. */
  389. #define yyless(n) \
  390. do \
  391. { \
  392. /* Undo effects of setting up yytext. */ \
  393. int yyless_macro_arg = (n); \
  394. YY_LESS_LINENO(yyless_macro_arg);\
  395. *yy_cp = yyg->yy_hold_char; \
  396. YY_RESTORE_YY_MORE_OFFSET \
  397. yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
  398. YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  399. } \
  400. while ( 0 )
  401. #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
  402. #ifndef YY_STRUCT_YY_BUFFER_STATE
  403. #define YY_STRUCT_YY_BUFFER_STATE
  404. struct yy_buffer_state
  405. {
  406. /* %if-c-only */
  407. FILE *yy_input_file;
  408. /* %endif */
  409. /* %if-c++-only */
  410. /* %endif */
  411. char *yy_ch_buf; /* input buffer */
  412. char *yy_buf_pos; /* current position in input buffer */
  413. /* Size of input buffer in bytes, not including room for EOB
  414. * characters.
  415. */
  416. int yy_buf_size;
  417. /* Number of characters read into yy_ch_buf, not including EOB
  418. * characters.
  419. */
  420. int yy_n_chars;
  421. /* Whether we "own" the buffer - i.e., we know we created it,
  422. * and can realloc() it to grow it, and should free() it to
  423. * delete it.
  424. */
  425. int yy_is_our_buffer;
  426. /* Whether this is an "interactive" input source; if so, and
  427. * if we're using stdio for input, then we want to use getc()
  428. * instead of fread(), to make sure we stop fetching input after
  429. * each newline.
  430. */
  431. int yy_is_interactive;
  432. /* Whether we're considered to be at the beginning of a line.
  433. * If so, '^' rules will be active on the next match, otherwise
  434. * not.
  435. */
  436. int yy_at_bol;
  437. int yy_bs_lineno; /**< The line count. */
  438. int yy_bs_column; /**< The column count. */
  439. /* Whether to try to fill the input buffer when we reach the
  440. * end of it.
  441. */
  442. int yy_fill_buffer;
  443. int yy_buffer_status;
  444. #define YY_BUFFER_NEW 0
  445. #define YY_BUFFER_NORMAL 1
  446. /* When an EOF's been seen but there's still some text to process
  447. * then we mark the buffer as YY_EOF_PENDING, to indicate that we
  448. * shouldn't try reading from the input source any more. We might
  449. * still have a bunch of tokens to match, though, because of
  450. * possible backing-up.
  451. *
  452. * When we actually see the EOF, we change the status to "new"
  453. * (via yyrestart()), so that the user can continue scanning by
  454. * just pointing yyin at a new input file.
  455. */
  456. #define YY_BUFFER_EOF_PENDING 2
  457. };
  458. #endif /* !YY_STRUCT_YY_BUFFER_STATE */
  459. /* %if-c-only Standard (non-C++) definition */
  460. /* %not-for-header */
  461. /* %if-not-reentrant */
  462. /* %endif */
  463. /* %ok-for-header */
  464. /* %endif */
  465. /* We provide macros for accessing buffer states in case in the
  466. * future we want to put the buffer states in a more general
  467. * "scanner state".
  468. *
  469. * Returns the top of the stack, or NULL.
  470. */
  471. #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
  472. ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
  473. : NULL)
  474. /* Same as previous macro, but useful when we know that the buffer stack is not
  475. * NULL or when we need an lvalue. For internal use only.
  476. */
  477. #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
  478. /* %if-c-only Standard (non-C++) definition */
  479. /* %if-not-reentrant */
  480. /* %not-for-header */
  481. /* %ok-for-header */
  482. /* %endif */
  483. void yyrestart ( FILE *input_file , yyscan_t yyscanner );
  484. void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
  485. YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
  486. void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
  487. void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
  488. void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
  489. void yypop_buffer_state ( yyscan_t yyscanner );
  490. static void yyensure_buffer_stack ( yyscan_t yyscanner );
  491. static void yy_load_buffer_state ( yyscan_t yyscanner );
  492. static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
  493. #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
  494. YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
  495. YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
  496. YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
  497. /* %endif */
  498. void *yyalloc ( yy_size_t , yyscan_t yyscanner );
  499. void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
  500. void yyfree ( void * , yyscan_t yyscanner );
  501. #define yy_new_buffer yy_create_buffer
  502. #define yy_set_interactive(is_interactive) \
  503. { \
  504. if ( ! YY_CURRENT_BUFFER ){ \
  505. yyensure_buffer_stack (yyscanner); \
  506. YY_CURRENT_BUFFER_LVALUE = \
  507. yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
  508. } \
  509. YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
  510. }
  511. #define yy_set_bol(at_bol) \
  512. { \
  513. if ( ! YY_CURRENT_BUFFER ){\
  514. yyensure_buffer_stack (yyscanner); \
  515. YY_CURRENT_BUFFER_LVALUE = \
  516. yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
  517. } \
  518. YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
  519. }
  520. #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
  521. /* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
  522. /* Begin user sect3 */
  523. #define settings_parser_wrap(yyscanner) (/*CONSTCOND*/1)
  524. #define YY_SKIP_YYWRAP
  525. #define FLEX_DEBUG
  526. typedef flex_uint8_t YY_CHAR;
  527. typedef int yy_state_type;
  528. #define yytext_ptr yytext_r
  529. /* %% [1.5] DFA */
  530. /* %if-c-only Standard (non-C++) definition */
  531. static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
  532. static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner);
  533. static int yy_get_next_buffer ( yyscan_t yyscanner );
  534. static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
  535. /* %endif */
  536. /* Done after the current pattern has been matched and before the
  537. * corresponding action - sets up yytext.
  538. */
  539. #define YY_DO_BEFORE_ACTION \
  540. yyg->yytext_ptr = yy_bp; \
  541. /* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
  542. yyleng = (int) (yy_cp - yy_bp); \
  543. yyg->yy_hold_char = *yy_cp; \
  544. *yy_cp = '\0'; \
  545. /* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
  546. yyg->yy_c_buf_p = yy_cp;
  547. /* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
  548. #define YY_NUM_RULES 39
  549. #define YY_END_OF_BUFFER 40
  550. /* This struct is not used in this scanner,
  551. but its presence is necessary. */
  552. struct yy_trans_info
  553. {
  554. flex_int32_t yy_verify;
  555. flex_int32_t yy_nxt;
  556. };
  557. static const flex_int16_t yy_accept[85] =
  558. { 0,
  559. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  560. 40, 12, 2, 3, 2, 11, 1, 7, 6, 8,
  561. 9, 12, 4, 5, 17, 14, 15, 14, 18, 13,
  562. 16, 23, 20, 21, 19, 22, 29, 25, 24, 26,
  563. 27, 38, 30, 31, 32, 12, 2, 2, 1, 1,
  564. 3, 0, 12, 17, 0, 14, 14, 13, 13, 15,
  565. 0, 23, 20, 29, 28, 38, 37, 36, 37, 33,
  566. 34, 35, 1, 12, 17, 13, 12, 12, 12, 12,
  567. 0, 10, 10, 0
  568. } ;
  569. static const YY_CHAR yy_ec[256] =
  570. { 0,
  571. 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
  572. 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
  573. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  574. 1, 5, 1, 6, 7, 1, 1, 1, 1, 1,
  575. 1, 1, 1, 8, 1, 9, 1, 1, 1, 1,
  576. 1, 1, 1, 1, 1, 1, 1, 10, 1, 1,
  577. 11, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  578. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  579. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  580. 1, 12, 1, 1, 1, 1, 1, 1, 13, 14,
  581. 15, 1, 1, 1, 16, 1, 1, 17, 1, 18,
  582. 1, 1, 1, 19, 1, 20, 21, 1, 1, 1,
  583. 1, 1, 22, 1, 23, 1, 1, 1, 1, 1,
  584. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  585. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  586. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  587. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  588. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  589. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  590. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  591. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  592. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  593. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  594. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  595. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  596. 1, 1, 1, 1, 1
  597. } ;
  598. static const YY_CHAR yy_meta[24] =
  599. { 0,
  600. 1, 2, 3, 4, 5, 6, 5, 7, 8, 7,
  601. 9, 10, 1, 1, 1, 1, 1, 1, 1, 1,
  602. 1, 7, 5
  603. } ;
  604. static const flex_int16_t yy_base[103] =
  605. { 0,
  606. 0, 0, 23, 0, 45, 67, 89, 111, 49, 50,
  607. 124, 0, 133, 335, 55, 335, 60, 335, 335, 335,
  608. 335, 104, 335, 335, 112, 139, 335, 73, 335, 62,
  609. 335, 0, 74, 335, 335, 335, 0, 335, 335, 335,
  610. 0, 0, 335, 335, 144, 0, 0, 78, 0, 81,
  611. 335, 117, 106, 102, 0, 0, 84, 0, 94, 335,
  612. 107, 0, 97, 0, 335, 0, 335, 335, 106, 335,
  613. 335, 335, 0, 89, 78, 0, 60, 53, 43, 98,
  614. 102, 335, 103, 335, 164, 174, 184, 194, 204, 214,
  615. 224, 234, 244, 249, 255, 264, 274, 284, 294, 304,
  616. 314, 324
  617. } ;
  618. static const flex_int16_t yy_def[103] =
  619. { 0,
  620. 84, 1, 84, 3, 85, 85, 86, 86, 87, 87,
  621. 84, 88, 84, 84, 84, 84, 89, 84, 84, 84,
  622. 84, 88, 84, 84, 90, 84, 84, 84, 84, 91,
  623. 84, 92, 84, 84, 84, 84, 93, 84, 84, 84,
  624. 94, 95, 84, 84, 96, 88, 13, 84, 97, 89,
  625. 84, 98, 88, 90, 99, 26, 84, 100, 91, 84,
  626. 101, 92, 84, 93, 84, 95, 84, 84, 84, 84,
  627. 84, 84, 97, 88, 99, 100, 88, 88, 88, 88,
  628. 102, 84, 102, 0, 84, 84, 84, 84, 84, 84,
  629. 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
  630. 84, 84
  631. } ;
  632. static const flex_int16_t yy_nxt[359] =
  633. { 0,
  634. 12, 13, 14, 15, 13, 16, 17, 18, 19, 20,
  635. 21, 12, 12, 12, 12, 22, 12, 12, 12, 12,
  636. 12, 23, 24, 25, 26, 27, 28, 26, 29, 30,
  637. 31, 29, 29, 29, 25, 25, 25, 25, 25, 25,
  638. 25, 25, 25, 25, 29, 29, 33, 34, 35, 33,
  639. 36, 34, 43, 43, 44, 44, 48, 80, 48, 48,
  640. 45, 45, 51, 52, 60, 61, 79, 34, 33, 34,
  641. 35, 33, 36, 34, 57, 63, 57, 57, 63, 48,
  642. 78, 48, 48, 51, 52, 57, 55, 57, 57, 34,
  643. 38, 38, 39, 38, 40, 38, 60, 61, 63, 81,
  644. 41, 63, 81, 83, 83, 77, 83, 83, 68, 60,
  645. 55, 38, 38, 38, 39, 38, 40, 38, 74, 51,
  646. 55, 53, 41, 84, 84, 84, 84, 84, 84, 84,
  647. 84, 84, 84, 38, 47, 84, 48, 47, 84, 49,
  648. 56, 84, 57, 56, 84, 58, 68, 69, 84, 84,
  649. 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
  650. 84, 70, 71, 72, 32, 32, 32, 32, 32, 32,
  651. 32, 32, 32, 32, 37, 37, 37, 37, 37, 37,
  652. 37, 37, 37, 37, 42, 42, 42, 42, 42, 42,
  653. 42, 42, 42, 42, 46, 84, 84, 84, 84, 84,
  654. 84, 84, 84, 46, 50, 50, 50, 50, 50, 50,
  655. 50, 50, 50, 50, 54, 84, 84, 84, 84, 84,
  656. 84, 54, 84, 54, 59, 59, 59, 59, 59, 59,
  657. 59, 59, 59, 59, 62, 84, 84, 84, 84, 84,
  658. 62, 62, 62, 62, 64, 84, 84, 84, 84, 84,
  659. 64, 64, 64, 65, 65, 66, 66, 66, 84, 66,
  660. 84, 66, 66, 66, 67, 67, 67, 67, 67, 67,
  661. 67, 67, 67, 67, 73, 73, 84, 84, 73, 73,
  662. 73, 73, 73, 73, 52, 52, 52, 52, 52, 52,
  663. 52, 52, 52, 52, 75, 84, 84, 84, 84, 84,
  664. 84, 84, 84, 75, 76, 76, 84, 84, 76, 76,
  665. 76, 76, 76, 76, 61, 61, 61, 61, 61, 61,
  666. 61, 61, 61, 61, 82, 82, 82, 82, 82, 82,
  667. 82, 82, 84, 82, 11, 84, 84, 84, 84, 84,
  668. 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
  669. 84, 84, 84, 84, 84, 84, 84, 84
  670. } ;
  671. static const flex_int16_t yy_chk[359] =
  672. { 0,
  673. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  674. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  675. 1, 1, 1, 3, 3, 3, 3, 3, 3, 3,
  676. 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
  677. 3, 3, 3, 3, 3, 3, 5, 5, 5, 5,
  678. 5, 5, 9, 10, 9, 10, 15, 79, 15, 15,
  679. 9, 10, 17, 17, 30, 30, 78, 5, 6, 6,
  680. 6, 6, 6, 6, 28, 33, 28, 28, 33, 48,
  681. 77, 48, 48, 50, 50, 57, 75, 57, 57, 6,
  682. 7, 7, 7, 7, 7, 7, 59, 59, 63, 80,
  683. 7, 63, 80, 81, 83, 74, 81, 83, 69, 61,
  684. 54, 7, 8, 8, 8, 8, 8, 8, 53, 52,
  685. 25, 22, 8, 11, 0, 0, 0, 0, 0, 0,
  686. 0, 0, 0, 8, 13, 0, 13, 13, 0, 13,
  687. 26, 0, 26, 26, 0, 26, 45, 45, 0, 0,
  688. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  689. 0, 45, 45, 45, 85, 85, 85, 85, 85, 85,
  690. 85, 85, 85, 85, 86, 86, 86, 86, 86, 86,
  691. 86, 86, 86, 86, 87, 87, 87, 87, 87, 87,
  692. 87, 87, 87, 87, 88, 0, 0, 0, 0, 0,
  693. 0, 0, 0, 88, 89, 89, 89, 89, 89, 89,
  694. 89, 89, 89, 89, 90, 0, 0, 0, 0, 0,
  695. 0, 90, 0, 90, 91, 91, 91, 91, 91, 91,
  696. 91, 91, 91, 91, 92, 0, 0, 0, 0, 0,
  697. 92, 92, 92, 92, 93, 0, 0, 0, 0, 0,
  698. 93, 93, 93, 94, 94, 95, 95, 95, 0, 95,
  699. 0, 95, 95, 95, 96, 96, 96, 96, 96, 96,
  700. 96, 96, 96, 96, 97, 97, 0, 0, 97, 97,
  701. 97, 97, 97, 97, 98, 98, 98, 98, 98, 98,
  702. 98, 98, 98, 98, 99, 0, 0, 0, 0, 0,
  703. 0, 0, 0, 99, 100, 100, 0, 0, 100, 100,
  704. 100, 100, 100, 100, 101, 101, 101, 101, 101, 101,
  705. 101, 101, 101, 101, 102, 102, 102, 102, 102, 102,
  706. 102, 102, 0, 102, 84, 84, 84, 84, 84, 84,
  707. 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
  708. 84, 84, 84, 84, 84, 84, 84, 84
  709. } ;
  710. /* Table of booleans, true if rule could match eol. */
  711. static const flex_int32_t yy_rule_can_match_eol[40] =
  712. { 0,
  713. 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0,
  714. 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,
  715. };
  716. static const flex_int16_t yy_rule_linenum[39] =
  717. { 0,
  718. 71, 72, 73, 75, 76, 78, 79, 81, 86, 91,
  719. 96, 101, 107, 108, 109, 111, 113, 118, 125, 126,
  720. 128, 149, 155, 162, 165, 185, 188, 191, 194, 200,
  721. 201, 203, 223, 224, 225, 226, 227, 228
  722. } ;
  723. /* The intent behind this definition is that it'll catch
  724. * any uses of REJECT which flex missed.
  725. */
  726. #define REJECT reject_used_but_not_detected
  727. #define yymore() yymore_used_but_not_detected
  728. #define YY_MORE_ADJ 0
  729. #define YY_RESTORE_YY_MORE_OFFSET
  730. #line 1 "settings/settings_lexer.l"
  731. #line 2 "settings/settings_lexer.l"
  732. /*
  733. * Copyright (C) 2014-2018 Tobias Brunner
  734. * HSR Hochschule fuer Technik Rapperswil
  735. *
  736. * This program is free software; you can redistribute it and/or modify it
  737. * under the terms of the GNU General Public License as published by the
  738. * Free Software Foundation; either version 2 of the License, or (at your
  739. * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
  740. *
  741. * This program is distributed in the hope that it will be useful, but
  742. * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  743. * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  744. * for more details.
  745. */
  746. #include <utils/parser_helper.h>
  747. #include "settings_parser.h"
  748. bool settings_parser_open_next_file(parser_helper_t *ctx);
  749. static void include_files(parser_helper_t *ctx);
  750. #line 890 "settings/settings_lexer.c"
  751. /* use start conditions stack */
  752. /* do not declare unneeded functions */
  753. #define YY_NO_INPUT 1
  754. /* do not include unistd.h as it might conflict with our scanner states */
  755. #define YY_NO_UNISTD_H 1
  756. /* due to that disable interactive mode, which requires isatty() */
  757. /* don't use global variables, and interact properly with bison */
  758. /* maintain the line number */
  759. /* don't generate a default rule */
  760. /* prefix function/variable declarations */
  761. /* don't change the name of the output file otherwise autotools has issues */
  762. /* type of our extra data */
  763. /* state used to scan references */
  764. /* state used to scan values */
  765. /* state used to scan include file patterns */
  766. /* state used to scan quoted strings */
  767. /* pattern for section/key names */
  768. #line 912 "settings/settings_lexer.c"
  769. #define INITIAL 0
  770. #define ref 1
  771. #define val 2
  772. #define inc 3
  773. #define str 4
  774. #ifndef YY_NO_UNISTD_H
  775. /* Special case for "unistd.h", since it is non-ANSI. We include it way
  776. * down here because we want the user's section 1 to have been scanned first.
  777. * The user has a chance to override it with an option.
  778. */
  779. /* %if-c-only */
  780. #include <unistd.h>
  781. /* %endif */
  782. /* %if-c++-only */
  783. /* %endif */
  784. #endif
  785. #define YY_EXTRA_TYPE parser_helper_t*
  786. /* %if-c-only Reentrant structure and macros (non-C++). */
  787. /* %if-reentrant */
  788. /* Holds the entire state of the reentrant scanner. */
  789. struct yyguts_t
  790. {
  791. /* User-defined. Not touched by flex. */
  792. YY_EXTRA_TYPE yyextra_r;
  793. /* The rest are the same as the globals declared in the non-reentrant scanner. */
  794. FILE *yyin_r, *yyout_r;
  795. size_t yy_buffer_stack_top; /**< index of top of stack. */
  796. size_t yy_buffer_stack_max; /**< capacity of stack. */
  797. YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
  798. char yy_hold_char;
  799. int yy_n_chars;
  800. int yyleng_r;
  801. char *yy_c_buf_p;
  802. int yy_init;
  803. int yy_start;
  804. int yy_did_buffer_switch_on_eof;
  805. int yy_start_stack_ptr;
  806. int yy_start_stack_depth;
  807. int *yy_start_stack;
  808. yy_state_type yy_last_accepting_state;
  809. char* yy_last_accepting_cpos;
  810. int yylineno_r;
  811. int yy_flex_debug_r;
  812. char *yytext_r;
  813. int yy_more_flag;
  814. int yy_more_len;
  815. YYSTYPE * yylval_r;
  816. }; /* end struct yyguts_t */
  817. /* %if-c-only */
  818. static int yy_init_globals ( yyscan_t yyscanner );
  819. /* %endif */
  820. /* %if-reentrant */
  821. /* This must go here because YYSTYPE and YYLTYPE are included
  822. * from bison output in section 1.*/
  823. # define yylval yyg->yylval_r
  824. int yylex_init (yyscan_t* scanner);
  825. int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
  826. /* %endif */
  827. /* %endif End reentrant structures and macros. */
  828. /* Accessor methods to globals.
  829. These are made visible to non-reentrant scanners for convenience. */
  830. int yylex_destroy ( yyscan_t yyscanner );
  831. int yyget_debug ( yyscan_t yyscanner );
  832. void yyset_debug ( int debug_flag , yyscan_t yyscanner );
  833. YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
  834. void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
  835. FILE *yyget_in ( yyscan_t yyscanner );
  836. void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
  837. FILE *yyget_out ( yyscan_t yyscanner );
  838. void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
  839. int yyget_leng ( yyscan_t yyscanner );
  840. char *yyget_text ( yyscan_t yyscanner );
  841. int yyget_lineno ( yyscan_t yyscanner );
  842. void yyset_lineno ( int _line_number , yyscan_t yyscanner );
  843. int yyget_column ( yyscan_t yyscanner );
  844. void yyset_column ( int _column_no , yyscan_t yyscanner );
  845. /* %if-bison-bridge */
  846. YYSTYPE * yyget_lval ( yyscan_t yyscanner );
  847. void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner );
  848. /* %endif */
  849. /* Macros after this point can all be overridden by user definitions in
  850. * section 1.
  851. */
  852. #ifndef YY_SKIP_YYWRAP
  853. #ifdef __cplusplus
  854. extern "C" int yywrap ( yyscan_t yyscanner );
  855. #else
  856. extern int yywrap ( yyscan_t yyscanner );
  857. #endif
  858. #endif
  859. /* %not-for-header */
  860. #ifndef YY_NO_UNPUT
  861. static void yyunput ( int c, char *buf_ptr , yyscan_t yyscanner);
  862. #endif
  863. /* %ok-for-header */
  864. /* %endif */
  865. #ifndef yytext_ptr
  866. static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
  867. #endif
  868. #ifdef YY_NEED_STRLEN
  869. static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
  870. #endif
  871. #ifndef YY_NO_INPUT
  872. /* %if-c-only Standard (non-C++) definition */
  873. /* %not-for-header */
  874. #ifdef __cplusplus
  875. static int yyinput ( yyscan_t yyscanner );
  876. #else
  877. static int input ( yyscan_t yyscanner );
  878. #endif
  879. /* %ok-for-header */
  880. /* %endif */
  881. #endif
  882. /* %if-c-only */
  883. static void yy_push_state ( int _new_state , yyscan_t yyscanner);
  884. static void yy_pop_state ( yyscan_t yyscanner );
  885. static int yy_top_state ( yyscan_t yyscanner );
  886. /* %endif */
  887. /* Amount of stuff to slurp up with each read. */
  888. #ifndef YY_READ_BUF_SIZE
  889. #ifdef __ia64__
  890. /* On IA-64, the buffer size is 16k, not 8k */
  891. #define YY_READ_BUF_SIZE 16384
  892. #else
  893. #define YY_READ_BUF_SIZE 8192
  894. #endif /* __ia64__ */
  895. #endif
  896. /* Copy whatever the last rule matched to the standard output. */
  897. #ifndef ECHO
  898. /* %if-c-only Standard (non-C++) definition */
  899. /* This used to be an fputs(), but since the string might contain NUL's,
  900. * we now use fwrite().
  901. */
  902. #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
  903. /* %endif */
  904. /* %if-c++-only C++ definition */
  905. /* %endif */
  906. #endif
  907. /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
  908. * is returned in "result".
  909. */
  910. #ifndef YY_INPUT
  911. #define YY_INPUT(buf,result,max_size) \
  912. /* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
  913. if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
  914. { \
  915. int c = '*'; \
  916. int n; \
  917. for ( n = 0; n < max_size && \
  918. (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
  919. buf[n] = (char) c; \
  920. if ( c == '\n' ) \
  921. buf[n++] = (char) c; \
  922. if ( c == EOF && ferror( yyin ) ) \
  923. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  924. result = n; \
  925. } \
  926. else \
  927. { \
  928. errno=0; \
  929. while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
  930. { \
  931. if( errno != EINTR) \
  932. { \
  933. YY_FATAL_ERROR( "input in flex scanner failed" ); \
  934. break; \
  935. } \
  936. errno=0; \
  937. clearerr(yyin); \
  938. } \
  939. }\
  940. \
  941. /* %if-c++-only C++ definition \ */\
  942. /* %endif */
  943. #endif
  944. /* No semi-colon after return; correct usage is to write "yyterminate();" -
  945. * we don't want an extra ';' after the "return" because that will cause
  946. * some compilers to complain about unreachable statements.
  947. */
  948. #ifndef yyterminate
  949. #define yyterminate() return YY_NULL
  950. #endif
  951. /* Number of entries by which start-condition stack grows. */
  952. #ifndef YY_START_STACK_INCR
  953. #define YY_START_STACK_INCR 25
  954. #endif
  955. /* Report a fatal error. */
  956. #ifndef YY_FATAL_ERROR
  957. /* %if-c-only */
  958. #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
  959. /* %endif */
  960. /* %if-c++-only */
  961. /* %endif */
  962. #endif
  963. /* %if-tables-serialization structures and prototypes */
  964. /* %not-for-header */
  965. /* %ok-for-header */
  966. /* %not-for-header */
  967. /* %tables-yydmap generated elements */
  968. /* %endif */
  969. /* end tables serialization structures and prototypes */
  970. /* %ok-for-header */
  971. /* Default declaration of generated scanner - a define so the user can
  972. * easily add parameters.
  973. */
  974. #ifndef YY_DECL
  975. #define YY_DECL_IS_OURS 1
  976. /* %if-c-only Standard (non-C++) definition */
  977. extern int yylex \
  978. (YYSTYPE * yylval_param , yyscan_t yyscanner);
  979. #define YY_DECL int yylex \
  980. (YYSTYPE * yylval_param , yyscan_t yyscanner)
  981. /* %endif */
  982. /* %if-c++-only C++ definition */
  983. /* %endif */
  984. #endif /* !YY_DECL */
  985. /* Code executed at the beginning of each rule, after yytext and yyleng
  986. * have been set up.
  987. */
  988. #ifndef YY_USER_ACTION
  989. #define YY_USER_ACTION
  990. #endif
  991. /* Code executed at the end of each rule. */
  992. #ifndef YY_BREAK
  993. #define YY_BREAK /*LINTED*/break;
  994. #endif
  995. /* %% [6.0] YY_RULE_SETUP definition goes here */
  996. #define YY_RULE_SETUP \
  997. YY_USER_ACTION
  998. /* %not-for-header */
  999. /** The main scanner function which does all the work.
  1000. */
  1001. YY_DECL
  1002. {
  1003. yy_state_type yy_current_state;
  1004. char *yy_cp, *yy_bp;
  1005. int yy_act;
  1006. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1007. yylval = yylval_param;
  1008. if ( !yyg->yy_init )
  1009. {
  1010. yyg->yy_init = 1;
  1011. #ifdef YY_USER_INIT
  1012. YY_USER_INIT;
  1013. #endif
  1014. if ( ! yyg->yy_start )
  1015. yyg->yy_start = 1; /* first start state */
  1016. if ( ! yyin )
  1017. /* %if-c-only */
  1018. yyin = stdin;
  1019. /* %endif */
  1020. /* %if-c++-only */
  1021. /* %endif */
  1022. if ( ! yyout )
  1023. /* %if-c-only */
  1024. yyout = stdout;
  1025. /* %endif */
  1026. /* %if-c++-only */
  1027. /* %endif */
  1028. if ( ! YY_CURRENT_BUFFER ) {
  1029. yyensure_buffer_stack (yyscanner);
  1030. YY_CURRENT_BUFFER_LVALUE =
  1031. yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
  1032. }
  1033. yy_load_buffer_state( yyscanner );
  1034. }
  1035. {
  1036. /* %% [7.0] user's declarations go here */
  1037. #line 69 "settings/settings_lexer.l"
  1038. #line 1265 "settings/settings_lexer.c"
  1039. while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
  1040. {
  1041. /* %% [8.0] yymore()-related code goes here */
  1042. yy_cp = yyg->yy_c_buf_p;
  1043. /* Support of yytext. */
  1044. *yy_cp = yyg->yy_hold_char;
  1045. /* yy_bp points to the position in yy_ch_buf of the start of
  1046. * the current run.
  1047. */
  1048. yy_bp = yy_cp;
  1049. /* %% [9.0] code to set up and find next match goes here */
  1050. yy_current_state = yyg->yy_start;
  1051. yy_match:
  1052. do
  1053. {
  1054. YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
  1055. if ( yy_accept[yy_current_state] )
  1056. {
  1057. yyg->yy_last_accepting_state = yy_current_state;
  1058. yyg->yy_last_accepting_cpos = yy_cp;
  1059. }
  1060. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1061. {
  1062. yy_current_state = (int) yy_def[yy_current_state];
  1063. if ( yy_current_state >= 85 )
  1064. yy_c = yy_meta[yy_c];
  1065. }
  1066. yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  1067. ++yy_cp;
  1068. }
  1069. while ( yy_current_state != 84 );
  1070. yy_cp = yyg->yy_last_accepting_cpos;
  1071. yy_current_state = yyg->yy_last_accepting_state;
  1072. yy_find_action:
  1073. /* %% [10.0] code to find the action number goes here */
  1074. yy_act = yy_accept[yy_current_state];
  1075. YY_DO_BEFORE_ACTION;
  1076. /* %% [11.0] code for yylineno update goes here */
  1077. if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
  1078. {
  1079. int yyl;
  1080. for ( yyl = 0; yyl < yyleng; ++yyl )
  1081. if ( yytext[yyl] == '\n' )
  1082. do{ yylineno++;
  1083. yycolumn=0;
  1084. }while(0)
  1085. ;
  1086. }
  1087. do_action: /* This label is used only to access EOF actions. */
  1088. /* %% [12.0] debug code goes here */
  1089. if ( yy_flex_debug )
  1090. {
  1091. if ( yy_act == 0 )
  1092. fprintf( stderr, "--scanner backing up\n" );
  1093. else if ( yy_act < 39 )
  1094. fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
  1095. (long)yy_rule_linenum[yy_act], yytext );
  1096. else if ( yy_act == 39 )
  1097. fprintf( stderr, "--accepting default rule (\"%s\")\n",
  1098. yytext );
  1099. else if ( yy_act == 40 )
  1100. fprintf( stderr, "--(end of buffer or a NUL)\n" );
  1101. else
  1102. fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
  1103. }
  1104. switch ( yy_act )
  1105. { /* beginning of action switch */
  1106. /* %% [13.0] actions go here */
  1107. case 0: /* must back up */
  1108. /* undo the effects of YY_DO_BEFORE_ACTION */
  1109. *yy_cp = yyg->yy_hold_char;
  1110. yy_cp = yyg->yy_last_accepting_cpos;
  1111. yy_current_state = yyg->yy_last_accepting_state;
  1112. goto yy_find_action;
  1113. case 1:
  1114. YY_RULE_SETUP
  1115. #line 71 "settings/settings_lexer.l"
  1116. /* eat comments */
  1117. YY_BREAK
  1118. case 2:
  1119. YY_RULE_SETUP
  1120. #line 72 "settings/settings_lexer.l"
  1121. /* eat whitespace */
  1122. YY_BREAK
  1123. case 3:
  1124. /* rule 3 can match eol */
  1125. YY_RULE_SETUP
  1126. #line 73 "settings/settings_lexer.l"
  1127. /* eat newlines and comments at the end of a line */
  1128. YY_BREAK
  1129. case 4:
  1130. #line 76 "settings/settings_lexer.l"
  1131. case 5:
  1132. YY_RULE_SETUP
  1133. #line 76 "settings/settings_lexer.l"
  1134. return yytext[0];
  1135. YY_BREAK
  1136. case 6:
  1137. YY_RULE_SETUP
  1138. #line 78 "settings/settings_lexer.l"
  1139. return DOT;
  1140. YY_BREAK
  1141. case 7:
  1142. YY_RULE_SETUP
  1143. #line 79 "settings/settings_lexer.l"
  1144. return COMMA;
  1145. YY_BREAK
  1146. case 8:
  1147. YY_RULE_SETUP
  1148. #line 81 "settings/settings_lexer.l"
  1149. {
  1150. yy_push_state(ref, yyscanner);
  1151. return COLON;
  1152. }
  1153. YY_BREAK
  1154. case 9:
  1155. YY_RULE_SETUP
  1156. #line 86 "settings/settings_lexer.l"
  1157. {
  1158. yy_push_state(val, yyscanner);
  1159. return yytext[0];
  1160. }
  1161. YY_BREAK
  1162. case 10:
  1163. /* rule 10 can match eol */
  1164. *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
  1165. YY_LINENO_REWIND_TO(yy_cp - 1);
  1166. yyg->yy_c_buf_p = yy_cp -= 1;
  1167. YY_DO_BEFORE_ACTION; /* set up yytext again */
  1168. YY_RULE_SETUP
  1169. #line 91 "settings/settings_lexer.l"
  1170. {
  1171. yyextra->string_init(yyextra);
  1172. yy_push_state(inc, yyscanner);
  1173. }
  1174. YY_BREAK
  1175. case 11:
  1176. YY_RULE_SETUP
  1177. #line 96 "settings/settings_lexer.l"
  1178. {
  1179. PARSER_DBG1(yyextra, "unexpected string detected");
  1180. return STRING_ERROR;
  1181. }
  1182. YY_BREAK
  1183. case 12:
  1184. YY_RULE_SETUP
  1185. #line 101 "settings/settings_lexer.l"
  1186. {
  1187. yylval->s = strdup(yytext);
  1188. return NAME;
  1189. }
  1190. YY_BREAK
  1191. case 13:
  1192. YY_RULE_SETUP
  1193. #line 107 "settings/settings_lexer.l"
  1194. /* eat comments */
  1195. YY_BREAK
  1196. case 14:
  1197. YY_RULE_SETUP
  1198. #line 108 "settings/settings_lexer.l"
  1199. /* eat whitespace */
  1200. YY_BREAK
  1201. case 15:
  1202. /* rule 15 can match eol */
  1203. YY_RULE_SETUP
  1204. #line 109 "settings/settings_lexer.l"
  1205. /* eat newlines and comments at the end of a line */
  1206. YY_BREAK
  1207. case 16:
  1208. YY_RULE_SETUP
  1209. #line 111 "settings/settings_lexer.l"
  1210. return COMMA;
  1211. YY_BREAK
  1212. case 17:
  1213. YY_RULE_SETUP
  1214. #line 113 "settings/settings_lexer.l"
  1215. {
  1216. yylval->s = strdup(yytext);
  1217. return NAME;
  1218. }
  1219. YY_BREAK
  1220. case 18:
  1221. YY_RULE_SETUP
  1222. #line 118 "settings/settings_lexer.l"
  1223. {
  1224. unput(yytext[0]);
  1225. yy_pop_state(yyscanner);
  1226. }
  1227. YY_BREAK
  1228. case 19:
  1229. YY_RULE_SETUP
  1230. #line 125 "settings/settings_lexer.l"
  1231. /* just ignore these */
  1232. YY_BREAK
  1233. case 20:
  1234. YY_RULE_SETUP
  1235. #line 126 "settings/settings_lexer.l"
  1236. YY_BREAK
  1237. case YY_STATE_EOF(val):
  1238. #line 127 "settings/settings_lexer.l"
  1239. case 21:
  1240. /* rule 21 can match eol */
  1241. YY_RULE_SETUP
  1242. #line 128 "settings/settings_lexer.l"
  1243. {
  1244. if (*yytext)
  1245. {
  1246. switch (yytext[0])
  1247. {
  1248. case '\n':
  1249. /* put the newline back to fix the line numbers */
  1250. unput('\n');
  1251. yy_set_bol(0);
  1252. break;
  1253. case '#':
  1254. case '}':
  1255. /* these are parsed outside of this start condition */
  1256. unput(yytext[0]);
  1257. break;
  1258. }
  1259. }
  1260. yy_pop_state(yyscanner);
  1261. return NEWLINE;
  1262. }
  1263. YY_BREAK
  1264. case 22:
  1265. YY_RULE_SETUP
  1266. #line 149 "settings/settings_lexer.l"
  1267. {
  1268. yyextra->string_init(yyextra);
  1269. yy_push_state(str, yyscanner);
  1270. }
  1271. YY_BREAK
  1272. /* same as above, but allow more characters */
  1273. case 23:
  1274. YY_RULE_SETUP
  1275. #line 155 "settings/settings_lexer.l"
  1276. {
  1277. yylval->s = strdup(yytext);
  1278. return NAME;
  1279. }
  1280. YY_BREAK
  1281. case 24:
  1282. YY_RULE_SETUP
  1283. #line 162 "settings/settings_lexer.l"
  1284. /* just ignore these */
  1285. YY_BREAK
  1286. /* we allow all characters except #, } and spaces, they can be escaped */
  1287. case YY_STATE_EOF(inc):
  1288. #line 164 "settings/settings_lexer.l"
  1289. case 25:
  1290. /* rule 25 can match eol */
  1291. YY_RULE_SETUP
  1292. #line 165 "settings/settings_lexer.l"
  1293. {
  1294. if (*yytext)
  1295. {
  1296. switch (yytext[0])
  1297. {
  1298. case '\n':
  1299. /* put the newline back to fix the line numbers */
  1300. unput('\n');
  1301. yy_set_bol(0);
  1302. break;
  1303. case '#':
  1304. case '}':
  1305. /* these are parsed outside of this start condition */
  1306. unput(yytext[0]);
  1307. break;
  1308. }
  1309. }
  1310. include_files(yyextra);
  1311. yy_pop_state(yyscanner);
  1312. }
  1313. YY_BREAK
  1314. case 26:
  1315. YY_RULE_SETUP
  1316. #line 185 "settings/settings_lexer.l"
  1317. { /* string include */
  1318. yy_push_state(str, yyscanner);
  1319. }
  1320. YY_BREAK
  1321. case 27:
  1322. YY_RULE_SETUP
  1323. #line 188 "settings/settings_lexer.l"
  1324. {
  1325. yyextra->string_add(yyextra, yytext);
  1326. }
  1327. YY_BREAK
  1328. case 28:
  1329. YY_RULE_SETUP
  1330. #line 191 "settings/settings_lexer.l"
  1331. {
  1332. yyextra->string_add(yyextra, yytext+1);
  1333. }
  1334. YY_BREAK
  1335. case 29:
  1336. YY_RULE_SETUP
  1337. #line 194 "settings/settings_lexer.l"
  1338. {
  1339. yyextra->string_add(yyextra, yytext);
  1340. }
  1341. YY_BREAK
  1342. case 30:
  1343. YY_RULE_SETUP
  1344. #line 200 "settings/settings_lexer.l"
  1345. /* just ignore these */
  1346. YY_BREAK
  1347. case 31:
  1348. #line 202 "settings/settings_lexer.l"
  1349. YY_RULE_SETUP
  1350. case YY_STATE_EOF(str):
  1351. #line 202 "settings/settings_lexer.l"
  1352. case 32:
  1353. YY_RULE_SETUP
  1354. #line 203 "settings/settings_lexer.l"
  1355. {
  1356. if (!streq(yytext, "\""))
  1357. {
  1358. PARSER_DBG1(yyextra, "unterminated string detected");
  1359. return STRING_ERROR;
  1360. }
  1361. if (yy_top_state(yyscanner) == inc)
  1362. { /* string include */
  1363. include_files(yyextra);
  1364. yy_pop_state(yyscanner);
  1365. yy_pop_state(yyscanner);
  1366. }
  1367. else
  1368. {
  1369. yy_pop_state(yyscanner);
  1370. yylval->s = yyextra->string_get(yyextra);
  1371. return STRING;
  1372. }
  1373. }
  1374. YY_BREAK
  1375. case 33:
  1376. YY_RULE_SETUP
  1377. #line 223 "settings/settings_lexer.l"
  1378. yyextra->string_add(yyextra, "\n");
  1379. YY_BREAK
  1380. case 34:
  1381. YY_RULE_SETUP
  1382. #line 224 "settings/settings_lexer.l"
  1383. yyextra->string_add(yyextra, "\r");
  1384. YY_BREAK
  1385. case 35:
  1386. YY_RULE_SETUP
  1387. #line 225 "settings/settings_lexer.l"
  1388. yyextra->string_add(yyextra, "\t");
  1389. YY_BREAK
  1390. case 36:
  1391. /* rule 36 can match eol */
  1392. YY_RULE_SETUP
  1393. #line 226 "settings/settings_lexer.l"
  1394. /* merge lines that end with escaped EOL characters */
  1395. YY_BREAK
  1396. case 37:
  1397. YY_RULE_SETUP
  1398. #line 227 "settings/settings_lexer.l"
  1399. yyextra->string_add(yyextra, yytext+1);
  1400. YY_BREAK
  1401. case 38:
  1402. /* rule 38 can match eol */
  1403. YY_RULE_SETUP
  1404. #line 228 "settings/settings_lexer.l"
  1405. {
  1406. yyextra->string_add(yyextra, yytext);
  1407. }
  1408. YY_BREAK
  1409. case YY_STATE_EOF(INITIAL):
  1410. case YY_STATE_EOF(ref):
  1411. #line 233 "settings/settings_lexer.l"
  1412. {
  1413. settings_parser_pop_buffer_state(yyscanner);
  1414. if (!settings_parser_open_next_file(yyextra) && !YY_CURRENT_BUFFER)
  1415. {
  1416. yyterminate();
  1417. }
  1418. }
  1419. YY_BREAK
  1420. case 39:
  1421. YY_RULE_SETUP
  1422. #line 241 "settings/settings_lexer.l"
  1423. YY_FATAL_ERROR( "flex scanner jammed" );
  1424. YY_BREAK
  1425. #line 1674 "settings/settings_lexer.c"
  1426. case YY_END_OF_BUFFER:
  1427. {
  1428. /* Amount of text matched not including the EOB char. */
  1429. int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
  1430. /* Undo the effects of YY_DO_BEFORE_ACTION. */
  1431. *yy_cp = yyg->yy_hold_char;
  1432. YY_RESTORE_YY_MORE_OFFSET
  1433. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
  1434. {
  1435. /* We're scanning a new file or input source. It's
  1436. * possible that this happened because the user
  1437. * just pointed yyin at a new source and called
  1438. * yylex(). If so, then we have to assure
  1439. * consistency between YY_CURRENT_BUFFER and our
  1440. * globals. Here is the right place to do so, because
  1441. * this is the first action (other than possibly a
  1442. * back-up) that will match for the new input source.
  1443. */
  1444. yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  1445. /* %if-c-only */
  1446. YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
  1447. /* %endif */
  1448. /* %if-c++-only */
  1449. /* %endif */
  1450. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
  1451. }
  1452. /* Note that here we test for yy_c_buf_p "<=" to the position
  1453. * of the first EOB in the buffer, since yy_c_buf_p will
  1454. * already have been incremented past the NUL character
  1455. * (since all states make transitions on EOB to the
  1456. * end-of-buffer state). Contrast this with the test
  1457. * in input().
  1458. */
  1459. if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
  1460. { /* This was really a NUL. */
  1461. yy_state_type yy_next_state;
  1462. yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
  1463. yy_current_state = yy_get_previous_state( yyscanner );
  1464. /* Okay, we're now positioned to make the NUL
  1465. * transition. We couldn't have
  1466. * yy_get_previous_state() go ahead and do it
  1467. * for us because it doesn't know how to deal
  1468. * with the possibility of jamming (and we don't
  1469. * want to build jamming into it because then it
  1470. * will run more slowly).
  1471. */
  1472. yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
  1473. yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  1474. if ( yy_next_state )
  1475. {
  1476. /* Consume the NUL. */
  1477. yy_cp = ++yyg->yy_c_buf_p;
  1478. yy_current_state = yy_next_state;
  1479. goto yy_match;
  1480. }
  1481. else
  1482. {
  1483. /* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
  1484. yy_cp = yyg->yy_last_accepting_cpos;
  1485. yy_current_state = yyg->yy_last_accepting_state;
  1486. goto yy_find_action;
  1487. }
  1488. }
  1489. else switch ( yy_get_next_buffer( yyscanner ) )
  1490. {
  1491. case EOB_ACT_END_OF_FILE:
  1492. {
  1493. yyg->yy_did_buffer_switch_on_eof = 0;
  1494. if ( yywrap( yyscanner ) )
  1495. {
  1496. /* Note: because we've taken care in
  1497. * yy_get_next_buffer() to have set up
  1498. * yytext, we can now set up
  1499. * yy_c_buf_p so that if some total
  1500. * hoser (like flex itself) wants to
  1501. * call the scanner after we return the
  1502. * YY_NULL, it'll still work - another
  1503. * YY_NULL will get returned.
  1504. */
  1505. yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
  1506. yy_act = YY_STATE_EOF(YY_START);
  1507. goto do_action;
  1508. }
  1509. else
  1510. {
  1511. if ( ! yyg->yy_did_buffer_switch_on_eof )
  1512. YY_NEW_FILE;
  1513. }
  1514. break;
  1515. }
  1516. case EOB_ACT_CONTINUE_SCAN:
  1517. yyg->yy_c_buf_p =
  1518. yyg->yytext_ptr + yy_amount_of_matched_text;
  1519. yy_current_state = yy_get_previous_state( yyscanner );
  1520. yy_cp = yyg->yy_c_buf_p;
  1521. yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  1522. goto yy_match;
  1523. case EOB_ACT_LAST_MATCH:
  1524. yyg->yy_c_buf_p =
  1525. &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
  1526. yy_current_state = yy_get_previous_state( yyscanner );
  1527. yy_cp = yyg->yy_c_buf_p;
  1528. yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
  1529. goto yy_find_action;
  1530. }
  1531. break;
  1532. }
  1533. default:
  1534. YY_FATAL_ERROR(
  1535. "fatal flex scanner internal error--no action found" );
  1536. } /* end of action switch */
  1537. } /* end of scanning one token */
  1538. } /* end of user's declarations */
  1539. } /* end of yylex */
  1540. /* %ok-for-header */
  1541. /* %if-c++-only */
  1542. /* %not-for-header */
  1543. /* %ok-for-header */
  1544. /* %endif */
  1545. /* yy_get_next_buffer - try to read in a new buffer
  1546. *
  1547. * Returns a code representing an action:
  1548. * EOB_ACT_LAST_MATCH -
  1549. * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  1550. * EOB_ACT_END_OF_FILE - end of file
  1551. */
  1552. /* %if-c-only */
  1553. static int yy_get_next_buffer (yyscan_t yyscanner)
  1554. /* %endif */
  1555. /* %if-c++-only */
  1556. /* %endif */
  1557. {
  1558. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1559. char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
  1560. char *source = yyg->yytext_ptr;
  1561. int number_to_move, i;
  1562. int ret_val;
  1563. if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
  1564. YY_FATAL_ERROR(
  1565. "fatal flex scanner internal error--end of buffer missed" );
  1566. if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
  1567. { /* Don't try to fill the buffer, so this is an EOF. */
  1568. if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
  1569. {
  1570. /* We matched a single character, the EOB, so
  1571. * treat this as a final EOF.
  1572. */
  1573. return EOB_ACT_END_OF_FILE;
  1574. }
  1575. else
  1576. {
  1577. /* We matched some text prior to the EOB, first
  1578. * process it.
  1579. */
  1580. return EOB_ACT_LAST_MATCH;
  1581. }
  1582. }
  1583. /* Try to read more data. */
  1584. /* First move last chars to start of buffer. */
  1585. number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
  1586. for ( i = 0; i < number_to_move; ++i )
  1587. *(dest++) = *(source++);
  1588. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
  1589. /* don't do the read, it's not guaranteed to return an EOF,
  1590. * just force an EOF
  1591. */
  1592. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
  1593. else
  1594. {
  1595. int num_to_read =
  1596. YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
  1597. while ( num_to_read <= 0 )
  1598. { /* Not enough room in the buffer - grow it. */
  1599. /* just a shorter name for the current buffer */
  1600. YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
  1601. int yy_c_buf_p_offset =
  1602. (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
  1603. if ( b->yy_is_our_buffer )
  1604. {
  1605. int new_size = b->yy_buf_size * 2;
  1606. if ( new_size <= 0 )
  1607. b->yy_buf_size += b->yy_buf_size / 8;
  1608. else
  1609. b->yy_buf_size *= 2;
  1610. b->yy_ch_buf = (char *)
  1611. /* Include room in for 2 EOB chars. */
  1612. yyrealloc( (void *) b->yy_ch_buf,
  1613. (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
  1614. }
  1615. else
  1616. /* Can't grow it, we don't own it. */
  1617. b->yy_ch_buf = NULL;
  1618. if ( ! b->yy_ch_buf )
  1619. YY_FATAL_ERROR(
  1620. "fatal error - scanner input buffer overflow" );
  1621. yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
  1622. num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
  1623. number_to_move - 1;
  1624. }
  1625. if ( num_to_read > YY_READ_BUF_SIZE )
  1626. num_to_read = YY_READ_BUF_SIZE;
  1627. /* Read in more data. */
  1628. YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
  1629. yyg->yy_n_chars, num_to_read );
  1630. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
  1631. }
  1632. if ( yyg->yy_n_chars == 0 )
  1633. {
  1634. if ( number_to_move == YY_MORE_ADJ )
  1635. {
  1636. ret_val = EOB_ACT_END_OF_FILE;
  1637. yyrestart( yyin , yyscanner);
  1638. }
  1639. else
  1640. {
  1641. ret_val = EOB_ACT_LAST_MATCH;
  1642. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
  1643. YY_BUFFER_EOF_PENDING;
  1644. }
  1645. }
  1646. else
  1647. ret_val = EOB_ACT_CONTINUE_SCAN;
  1648. if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
  1649. /* Extend the array by 50%, plus the number we really need. */
  1650. int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
  1651. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
  1652. (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
  1653. if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
  1654. YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
  1655. /* "- 2" to take care of EOB's */
  1656. YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
  1657. }
  1658. yyg->yy_n_chars += number_to_move;
  1659. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  1660. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  1661. yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
  1662. return ret_val;
  1663. }
  1664. /* yy_get_previous_state - get the state just before the EOB char was reached */
  1665. /* %if-c-only */
  1666. /* %not-for-header */
  1667. static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
  1668. /* %endif */
  1669. /* %if-c++-only */
  1670. /* %endif */
  1671. {
  1672. yy_state_type yy_current_state;
  1673. char *yy_cp;
  1674. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1675. /* %% [15.0] code to get the start state into yy_current_state goes here */
  1676. yy_current_state = yyg->yy_start;
  1677. for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
  1678. {
  1679. /* %% [16.0] code to find the next state goes here */
  1680. YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
  1681. if ( yy_accept[yy_current_state] )
  1682. {
  1683. yyg->yy_last_accepting_state = yy_current_state;
  1684. yyg->yy_last_accepting_cpos = yy_cp;
  1685. }
  1686. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1687. {
  1688. yy_current_state = (int) yy_def[yy_current_state];
  1689. if ( yy_current_state >= 85 )
  1690. yy_c = yy_meta[yy_c];
  1691. }
  1692. yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  1693. }
  1694. return yy_current_state;
  1695. }
  1696. /* yy_try_NUL_trans - try to make a transition on the NUL character
  1697. *
  1698. * synopsis
  1699. * next_state = yy_try_NUL_trans( current_state );
  1700. */
  1701. /* %if-c-only */
  1702. static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
  1703. /* %endif */
  1704. /* %if-c++-only */
  1705. /* %endif */
  1706. {
  1707. int yy_is_jam;
  1708. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
  1709. /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
  1710. char *yy_cp = yyg->yy_c_buf_p;
  1711. YY_CHAR yy_c = 1;
  1712. if ( yy_accept[yy_current_state] )
  1713. {
  1714. yyg->yy_last_accepting_state = yy_current_state;
  1715. yyg->yy_last_accepting_cpos = yy_cp;
  1716. }
  1717. while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  1718. {
  1719. yy_current_state = (int) yy_def[yy_current_state];
  1720. if ( yy_current_state >= 85 )
  1721. yy_c = yy_meta[yy_c];
  1722. }
  1723. yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  1724. yy_is_jam = (yy_current_state == 84);
  1725. (void)yyg;
  1726. return yy_is_jam ? 0 : yy_current_state;
  1727. }
  1728. #ifndef YY_NO_UNPUT
  1729. /* %if-c-only */
  1730. static void yyunput (int c, char * yy_bp , yyscan_t yyscanner)
  1731. /* %endif */
  1732. /* %if-c++-only */
  1733. /* %endif */
  1734. {
  1735. char *yy_cp;
  1736. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1737. yy_cp = yyg->yy_c_buf_p;
  1738. /* undo effects of setting up yytext */
  1739. *yy_cp = yyg->yy_hold_char;
  1740. if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
  1741. { /* need to shift things up to make room */
  1742. /* +2 for EOB chars. */
  1743. int number_to_move = yyg->yy_n_chars + 2;
  1744. char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
  1745. YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
  1746. char *source =
  1747. &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
  1748. while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
  1749. *--dest = *--source;
  1750. yy_cp += (int) (dest - source);
  1751. yy_bp += (int) (dest - source);
  1752. YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
  1753. yyg->yy_n_chars = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
  1754. if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
  1755. YY_FATAL_ERROR( "flex scanner push-back overflow" );
  1756. }
  1757. *--yy_cp = (char) c;
  1758. /* %% [18.0] update yylineno here */
  1759. if ( c == '\n' ){
  1760. --yylineno;
  1761. }
  1762. yyg->yytext_ptr = yy_bp;
  1763. yyg->yy_hold_char = *yy_cp;
  1764. yyg->yy_c_buf_p = yy_cp;
  1765. }
  1766. /* %if-c-only */
  1767. /* %endif */
  1768. #endif
  1769. /* %if-c-only */
  1770. #ifndef YY_NO_INPUT
  1771. #ifdef __cplusplus
  1772. static int yyinput (yyscan_t yyscanner)
  1773. #else
  1774. static int input (yyscan_t yyscanner)
  1775. #endif
  1776. /* %endif */
  1777. /* %if-c++-only */
  1778. /* %endif */
  1779. {
  1780. int c;
  1781. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1782. *yyg->yy_c_buf_p = yyg->yy_hold_char;
  1783. if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  1784. {
  1785. /* yy_c_buf_p now points to the character we want to return.
  1786. * If this occurs *before* the EOB characters, then it's a
  1787. * valid NUL; if not, then we've hit the end of the buffer.
  1788. */
  1789. if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
  1790. /* This was really a NUL. */
  1791. *yyg->yy_c_buf_p = '\0';
  1792. else
  1793. { /* need more input */
  1794. int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
  1795. ++yyg->yy_c_buf_p;
  1796. switch ( yy_get_next_buffer( yyscanner ) )
  1797. {
  1798. case EOB_ACT_LAST_MATCH:
  1799. /* This happens because yy_g_n_b()
  1800. * sees that we've accumulated a
  1801. * token and flags that we need to
  1802. * try matching the token before
  1803. * proceeding. But for input(),
  1804. * there's no matching to consider.
  1805. * So convert the EOB_ACT_LAST_MATCH
  1806. * to EOB_ACT_END_OF_FILE.
  1807. */
  1808. /* Reset buffer status. */
  1809. yyrestart( yyin , yyscanner);
  1810. /*FALLTHROUGH*/
  1811. case EOB_ACT_END_OF_FILE:
  1812. {
  1813. if ( yywrap( yyscanner ) )
  1814. return 0;
  1815. if ( ! yyg->yy_did_buffer_switch_on_eof )
  1816. YY_NEW_FILE;
  1817. #ifdef __cplusplus
  1818. return yyinput(yyscanner);
  1819. #else
  1820. return input(yyscanner);
  1821. #endif
  1822. }
  1823. case EOB_ACT_CONTINUE_SCAN:
  1824. yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
  1825. break;
  1826. }
  1827. }
  1828. }
  1829. c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
  1830. *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
  1831. yyg->yy_hold_char = *++yyg->yy_c_buf_p;
  1832. /* %% [19.0] update BOL and yylineno */
  1833. if ( c == '\n' )
  1834. do{ yylineno++;
  1835. yycolumn=0;
  1836. }while(0)
  1837. ;
  1838. return c;
  1839. }
  1840. /* %if-c-only */
  1841. #endif /* ifndef YY_NO_INPUT */
  1842. /* %endif */
  1843. /** Immediately switch to a different input stream.
  1844. * @param input_file A readable stream.
  1845. * @param yyscanner The scanner object.
  1846. * @note This function does not reset the start condition to @c INITIAL .
  1847. */
  1848. /* %if-c-only */
  1849. void yyrestart (FILE * input_file , yyscan_t yyscanner)
  1850. /* %endif */
  1851. /* %if-c++-only */
  1852. /* %endif */
  1853. {
  1854. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1855. if ( ! YY_CURRENT_BUFFER ){
  1856. yyensure_buffer_stack (yyscanner);
  1857. YY_CURRENT_BUFFER_LVALUE =
  1858. yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
  1859. }
  1860. yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
  1861. yy_load_buffer_state( yyscanner );
  1862. }
  1863. /* %if-c++-only */
  1864. /* %endif */
  1865. /** Switch to a different input buffer.
  1866. * @param new_buffer The new input buffer.
  1867. * @param yyscanner The scanner object.
  1868. */
  1869. /* %if-c-only */
  1870. void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
  1871. /* %endif */
  1872. /* %if-c++-only */
  1873. /* %endif */
  1874. {
  1875. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1876. /* TODO. We should be able to replace this entire function body
  1877. * with
  1878. * yypop_buffer_state();
  1879. * yypush_buffer_state(new_buffer);
  1880. */
  1881. yyensure_buffer_stack (yyscanner);
  1882. if ( YY_CURRENT_BUFFER == new_buffer )
  1883. return;
  1884. if ( YY_CURRENT_BUFFER )
  1885. {
  1886. /* Flush out information for old buffer. */
  1887. *yyg->yy_c_buf_p = yyg->yy_hold_char;
  1888. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
  1889. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
  1890. }
  1891. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  1892. yy_load_buffer_state( yyscanner );
  1893. /* We don't actually know whether we did this switch during
  1894. * EOF (yywrap()) processing, but the only time this flag
  1895. * is looked at is after yywrap() is called, so it's safe
  1896. * to go ahead and always set it.
  1897. */
  1898. yyg->yy_did_buffer_switch_on_eof = 1;
  1899. }
  1900. /* %if-c-only */
  1901. static void yy_load_buffer_state (yyscan_t yyscanner)
  1902. /* %endif */
  1903. /* %if-c++-only */
  1904. /* %endif */
  1905. {
  1906. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1907. yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  1908. yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
  1909. /* %if-c-only */
  1910. yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
  1911. /* %endif */
  1912. /* %if-c++-only */
  1913. /* %endif */
  1914. yyg->yy_hold_char = *yyg->yy_c_buf_p;
  1915. }
  1916. /** Allocate and initialize an input buffer state.
  1917. * @param file A readable stream.
  1918. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
  1919. * @param yyscanner The scanner object.
  1920. * @return the allocated buffer state.
  1921. */
  1922. /* %if-c-only */
  1923. YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
  1924. /* %endif */
  1925. /* %if-c++-only */
  1926. /* %endif */
  1927. {
  1928. YY_BUFFER_STATE b;
  1929. b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
  1930. if ( ! b )
  1931. YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1932. b->yy_buf_size = size;
  1933. /* yy_ch_buf has to be 2 characters longer than the size given because
  1934. * we need to put in 2 end-of-buffer characters.
  1935. */
  1936. b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
  1937. if ( ! b->yy_ch_buf )
  1938. YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1939. b->yy_is_our_buffer = 1;
  1940. yy_init_buffer( b, file , yyscanner);
  1941. return b;
  1942. }
  1943. /* %if-c++-only */
  1944. /* %endif */
  1945. /** Destroy the buffer.
  1946. * @param b a buffer created with yy_create_buffer()
  1947. * @param yyscanner The scanner object.
  1948. */
  1949. /* %if-c-only */
  1950. void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
  1951. /* %endif */
  1952. /* %if-c++-only */
  1953. /* %endif */
  1954. {
  1955. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1956. if ( ! b )
  1957. return;
  1958. if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
  1959. YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
  1960. if ( b->yy_is_our_buffer )
  1961. yyfree( (void *) b->yy_ch_buf , yyscanner );
  1962. yyfree( (void *) b , yyscanner );
  1963. }
  1964. /* Initializes or reinitializes a buffer.
  1965. * This function is sometimes called more than once on the same buffer,
  1966. * such as during a yyrestart() or at EOF.
  1967. */
  1968. /* %if-c-only */
  1969. static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
  1970. /* %endif */
  1971. /* %if-c++-only */
  1972. /* %endif */
  1973. {
  1974. int oerrno = errno;
  1975. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  1976. yy_flush_buffer( b , yyscanner);
  1977. /* %if-c-only */
  1978. b->yy_input_file = file;
  1979. /* %endif */
  1980. /* %if-c++-only */
  1981. /* %endif */
  1982. b->yy_fill_buffer = 1;
  1983. /* If b is the current buffer, then yy_init_buffer was _probably_
  1984. * called from yyrestart() or through yy_get_next_buffer.
  1985. * In that case, we don't want to reset the lineno or column.
  1986. */
  1987. if (b != YY_CURRENT_BUFFER){
  1988. b->yy_bs_lineno = 1;
  1989. b->yy_bs_column = 0;
  1990. }
  1991. /* %if-c-only */
  1992. b->yy_is_interactive = 0;
  1993. /* %endif */
  1994. /* %if-c++-only */
  1995. /* %endif */
  1996. errno = oerrno;
  1997. }
  1998. /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
  1999. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
  2000. * @param yyscanner The scanner object.
  2001. */
  2002. /* %if-c-only */
  2003. void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
  2004. /* %endif */
  2005. /* %if-c++-only */
  2006. /* %endif */
  2007. {
  2008. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2009. if ( ! b )
  2010. return;
  2011. b->yy_n_chars = 0;
  2012. /* We always need two end-of-buffer characters. The first causes
  2013. * a transition to the end-of-buffer state. The second causes
  2014. * a jam in that state.
  2015. */
  2016. b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
  2017. b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  2018. b->yy_buf_pos = &b->yy_ch_buf[0];
  2019. b->yy_at_bol = 1;
  2020. b->yy_buffer_status = YY_BUFFER_NEW;
  2021. if ( b == YY_CURRENT_BUFFER )
  2022. yy_load_buffer_state( yyscanner );
  2023. }
  2024. /* %if-c-or-c++ */
  2025. /** Pushes the new state onto the stack. The new state becomes
  2026. * the current state. This function will allocate the stack
  2027. * if necessary.
  2028. * @param new_buffer The new state.
  2029. * @param yyscanner The scanner object.
  2030. */
  2031. /* %if-c-only */
  2032. void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
  2033. /* %endif */
  2034. /* %if-c++-only */
  2035. /* %endif */
  2036. {
  2037. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2038. if (new_buffer == NULL)
  2039. return;
  2040. yyensure_buffer_stack(yyscanner);
  2041. /* This block is copied from yy_switch_to_buffer. */
  2042. if ( YY_CURRENT_BUFFER )
  2043. {
  2044. /* Flush out information for old buffer. */
  2045. *yyg->yy_c_buf_p = yyg->yy_hold_char;
  2046. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
  2047. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
  2048. }
  2049. /* Only push if top exists. Otherwise, replace top. */
  2050. if (YY_CURRENT_BUFFER)
  2051. yyg->yy_buffer_stack_top++;
  2052. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  2053. /* copied from yy_switch_to_buffer. */
  2054. yy_load_buffer_state( yyscanner );
  2055. yyg->yy_did_buffer_switch_on_eof = 1;
  2056. }
  2057. /* %endif */
  2058. /* %if-c-or-c++ */
  2059. /** Removes and deletes the top of the stack, if present.
  2060. * The next element becomes the new top.
  2061. * @param yyscanner The scanner object.
  2062. */
  2063. /* %if-c-only */
  2064. void yypop_buffer_state (yyscan_t yyscanner)
  2065. /* %endif */
  2066. /* %if-c++-only */
  2067. /* %endif */
  2068. {
  2069. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2070. if (!YY_CURRENT_BUFFER)
  2071. return;
  2072. yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
  2073. YY_CURRENT_BUFFER_LVALUE = NULL;
  2074. if (yyg->yy_buffer_stack_top > 0)
  2075. --yyg->yy_buffer_stack_top;
  2076. if (YY_CURRENT_BUFFER) {
  2077. yy_load_buffer_state( yyscanner );
  2078. yyg->yy_did_buffer_switch_on_eof = 1;
  2079. }
  2080. }
  2081. /* %endif */
  2082. /* %if-c-or-c++ */
  2083. /* Allocates the stack if it does not exist.
  2084. * Guarantees space for at least one push.
  2085. */
  2086. /* %if-c-only */
  2087. static void yyensure_buffer_stack (yyscan_t yyscanner)
  2088. /* %endif */
  2089. /* %if-c++-only */
  2090. /* %endif */
  2091. {
  2092. yy_size_t num_to_alloc;
  2093. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2094. if (!yyg->yy_buffer_stack) {
  2095. /* First allocation is just for 2 elements, since we don't know if this
  2096. * scanner will even need a stack. We use 2 instead of 1 to avoid an
  2097. * immediate realloc on the next call.
  2098. */
  2099. num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
  2100. yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
  2101. (num_to_alloc * sizeof(struct yy_buffer_state*)
  2102. , yyscanner);
  2103. if ( ! yyg->yy_buffer_stack )
  2104. YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
  2105. memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
  2106. yyg->yy_buffer_stack_max = num_to_alloc;
  2107. yyg->yy_buffer_stack_top = 0;
  2108. return;
  2109. }
  2110. if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
  2111. /* Increase the buffer to prepare for a possible push. */
  2112. yy_size_t grow_size = 8 /* arbitrary grow size */;
  2113. num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
  2114. yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
  2115. (yyg->yy_buffer_stack,
  2116. num_to_alloc * sizeof(struct yy_buffer_state*)
  2117. , yyscanner);
  2118. if ( ! yyg->yy_buffer_stack )
  2119. YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
  2120. /* zero only the new slots.*/
  2121. memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
  2122. yyg->yy_buffer_stack_max = num_to_alloc;
  2123. }
  2124. }
  2125. /* %endif */
  2126. /* %if-c-only */
  2127. /** Setup the input buffer state to scan directly from a user-specified character buffer.
  2128. * @param base the character buffer
  2129. * @param size the size in bytes of the character buffer
  2130. * @param yyscanner The scanner object.
  2131. * @return the newly allocated buffer state object.
  2132. */
  2133. YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
  2134. {
  2135. YY_BUFFER_STATE b;
  2136. if ( size < 2 ||
  2137. base[size-2] != YY_END_OF_BUFFER_CHAR ||
  2138. base[size-1] != YY_END_OF_BUFFER_CHAR )
  2139. /* They forgot to leave room for the EOB's. */
  2140. return NULL;
  2141. b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
  2142. if ( ! b )
  2143. YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
  2144. b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
  2145. b->yy_buf_pos = b->yy_ch_buf = base;
  2146. b->yy_is_our_buffer = 0;
  2147. b->yy_input_file = NULL;
  2148. b->yy_n_chars = b->yy_buf_size;
  2149. b->yy_is_interactive = 0;
  2150. b->yy_at_bol = 1;
  2151. b->yy_fill_buffer = 0;
  2152. b->yy_buffer_status = YY_BUFFER_NEW;
  2153. yy_switch_to_buffer( b , yyscanner );
  2154. return b;
  2155. }
  2156. /* %endif */
  2157. /* %if-c-only */
  2158. /** Setup the input buffer state to scan a string. The next call to yylex() will
  2159. * scan from a @e copy of @a str.
  2160. * @param yystr a NUL-terminated string to scan
  2161. * @param yyscanner The scanner object.
  2162. * @return the newly allocated buffer state object.
  2163. * @note If you want to scan bytes that may contain NUL values, then use
  2164. * yy_scan_bytes() instead.
  2165. */
  2166. YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
  2167. {
  2168. return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
  2169. }
  2170. /* %endif */
  2171. /* %if-c-only */
  2172. /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
  2173. * scan from a @e copy of @a bytes.
  2174. * @param yybytes the byte buffer to scan
  2175. * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
  2176. * @param yyscanner The scanner object.
  2177. * @return the newly allocated buffer state object.
  2178. */
  2179. YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner)
  2180. {
  2181. YY_BUFFER_STATE b;
  2182. char *buf;
  2183. yy_size_t n;
  2184. int i;
  2185. /* Get memory for full buffer, including space for trailing EOB's. */
  2186. n = (yy_size_t) (_yybytes_len + 2);
  2187. buf = (char *) yyalloc( n , yyscanner );
  2188. if ( ! buf )
  2189. YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
  2190. for ( i = 0; i < _yybytes_len; ++i )
  2191. buf[i] = yybytes[i];
  2192. buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
  2193. b = yy_scan_buffer( buf, n , yyscanner);
  2194. if ( ! b )
  2195. YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
  2196. /* It's okay to grow etc. this buffer, and we should throw it
  2197. * away when we're done.
  2198. */
  2199. b->yy_is_our_buffer = 1;
  2200. return b;
  2201. }
  2202. /* %endif */
  2203. /* %if-c-only */
  2204. static void yy_push_state (int _new_state , yyscan_t yyscanner)
  2205. /* %endif */
  2206. /* %if-c++-only */
  2207. /* %endif */
  2208. {
  2209. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2210. if ( yyg->yy_start_stack_ptr >= yyg->yy_start_stack_depth )
  2211. {
  2212. yy_size_t new_size;
  2213. yyg->yy_start_stack_depth += YY_START_STACK_INCR;
  2214. new_size = (yy_size_t) yyg->yy_start_stack_depth * sizeof( int );
  2215. if ( ! yyg->yy_start_stack )
  2216. yyg->yy_start_stack = (int *) yyalloc( new_size , yyscanner );
  2217. else
  2218. yyg->yy_start_stack = (int *) yyrealloc(
  2219. (void *) yyg->yy_start_stack, new_size , yyscanner );
  2220. if ( ! yyg->yy_start_stack )
  2221. YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
  2222. }
  2223. yyg->yy_start_stack[yyg->yy_start_stack_ptr++] = YY_START;
  2224. BEGIN(_new_state);
  2225. }
  2226. /* %if-c-only */
  2227. static void yy_pop_state (yyscan_t yyscanner)
  2228. /* %endif */
  2229. /* %if-c++-only */
  2230. /* %endif */
  2231. {
  2232. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2233. if ( --yyg->yy_start_stack_ptr < 0 )
  2234. YY_FATAL_ERROR( "start-condition stack underflow" );
  2235. BEGIN(yyg->yy_start_stack[yyg->yy_start_stack_ptr]);
  2236. }
  2237. /* %if-c-only */
  2238. static int yy_top_state (yyscan_t yyscanner)
  2239. /* %endif */
  2240. /* %if-c++-only */
  2241. /* %endif */
  2242. {
  2243. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2244. return yyg->yy_start_stack[yyg->yy_start_stack_ptr - 1];
  2245. }
  2246. #ifndef YY_EXIT_FAILURE
  2247. #define YY_EXIT_FAILURE 2
  2248. #endif
  2249. /* %if-c-only */
  2250. static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
  2251. {
  2252. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2253. (void)yyg;
  2254. fprintf( stderr, "%s\n", msg );
  2255. exit( YY_EXIT_FAILURE );
  2256. }
  2257. /* %endif */
  2258. /* %if-c++-only */
  2259. /* %endif */
  2260. /* Redefine yyless() so it works in section 3 code. */
  2261. #undef yyless
  2262. #define yyless(n) \
  2263. do \
  2264. { \
  2265. /* Undo effects of setting up yytext. */ \
  2266. int yyless_macro_arg = (n); \
  2267. YY_LESS_LINENO(yyless_macro_arg);\
  2268. yytext[yyleng] = yyg->yy_hold_char; \
  2269. yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
  2270. yyg->yy_hold_char = *yyg->yy_c_buf_p; \
  2271. *yyg->yy_c_buf_p = '\0'; \
  2272. yyleng = yyless_macro_arg; \
  2273. } \
  2274. while ( 0 )
  2275. /* Accessor methods (get/set functions) to struct members. */
  2276. /* %if-c-only */
  2277. /* %if-reentrant */
  2278. /** Get the user-defined data for this scanner.
  2279. * @param yyscanner The scanner object.
  2280. */
  2281. YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner)
  2282. {
  2283. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2284. return yyextra;
  2285. }
  2286. /* %endif */
  2287. /** Get the current line number.
  2288. * @param yyscanner The scanner object.
  2289. */
  2290. int yyget_lineno (yyscan_t yyscanner)
  2291. {
  2292. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2293. if (! YY_CURRENT_BUFFER)
  2294. return 0;
  2295. return yylineno;
  2296. }
  2297. /** Get the current column number.
  2298. * @param yyscanner The scanner object.
  2299. */
  2300. int yyget_column (yyscan_t yyscanner)
  2301. {
  2302. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2303. if (! YY_CURRENT_BUFFER)
  2304. return 0;
  2305. return yycolumn;
  2306. }
  2307. /** Get the input stream.
  2308. * @param yyscanner The scanner object.
  2309. */
  2310. FILE *yyget_in (yyscan_t yyscanner)
  2311. {
  2312. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2313. return yyin;
  2314. }
  2315. /** Get the output stream.
  2316. * @param yyscanner The scanner object.
  2317. */
  2318. FILE *yyget_out (yyscan_t yyscanner)
  2319. {
  2320. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2321. return yyout;
  2322. }
  2323. /** Get the length of the current token.
  2324. * @param yyscanner The scanner object.
  2325. */
  2326. int yyget_leng (yyscan_t yyscanner)
  2327. {
  2328. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2329. return yyleng;
  2330. }
  2331. /** Get the current token.
  2332. * @param yyscanner The scanner object.
  2333. */
  2334. char *yyget_text (yyscan_t yyscanner)
  2335. {
  2336. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2337. return yytext;
  2338. }
  2339. /* %if-reentrant */
  2340. /** Set the user-defined data. This data is never touched by the scanner.
  2341. * @param user_defined The data to be associated with this scanner.
  2342. * @param yyscanner The scanner object.
  2343. */
  2344. void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
  2345. {
  2346. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2347. yyextra = user_defined ;
  2348. }
  2349. /* %endif */
  2350. /** Set the current line number.
  2351. * @param _line_number line number
  2352. * @param yyscanner The scanner object.
  2353. */
  2354. void yyset_lineno (int _line_number , yyscan_t yyscanner)
  2355. {
  2356. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2357. /* lineno is only valid if an input buffer exists. */
  2358. if (! YY_CURRENT_BUFFER )
  2359. YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
  2360. yylineno = _line_number;
  2361. }
  2362. /** Set the current column.
  2363. * @param _column_no column number
  2364. * @param yyscanner The scanner object.
  2365. */
  2366. void yyset_column (int _column_no , yyscan_t yyscanner)
  2367. {
  2368. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2369. /* column is only valid if an input buffer exists. */
  2370. if (! YY_CURRENT_BUFFER )
  2371. YY_FATAL_ERROR( "yyset_column called with no buffer" );
  2372. yycolumn = _column_no;
  2373. }
  2374. /** Set the input stream. This does not discard the current
  2375. * input buffer.
  2376. * @param _in_str A readable stream.
  2377. * @param yyscanner The scanner object.
  2378. * @see yy_switch_to_buffer
  2379. */
  2380. void yyset_in (FILE * _in_str , yyscan_t yyscanner)
  2381. {
  2382. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2383. yyin = _in_str ;
  2384. }
  2385. void yyset_out (FILE * _out_str , yyscan_t yyscanner)
  2386. {
  2387. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2388. yyout = _out_str ;
  2389. }
  2390. int yyget_debug (yyscan_t yyscanner)
  2391. {
  2392. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2393. return yy_flex_debug;
  2394. }
  2395. void yyset_debug (int _bdebug , yyscan_t yyscanner)
  2396. {
  2397. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2398. yy_flex_debug = _bdebug ;
  2399. }
  2400. /* %endif */
  2401. /* %if-reentrant */
  2402. /* Accessor methods for yylval and yylloc */
  2403. /* %if-bison-bridge */
  2404. YYSTYPE * yyget_lval (yyscan_t yyscanner)
  2405. {
  2406. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2407. return yylval;
  2408. }
  2409. void yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
  2410. {
  2411. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2412. yylval = yylval_param;
  2413. }
  2414. /* %endif */
  2415. /* User-visible API */
  2416. /* yylex_init is special because it creates the scanner itself, so it is
  2417. * the ONLY reentrant function that doesn't take the scanner as the last argument.
  2418. * That's why we explicitly handle the declaration, instead of using our macros.
  2419. */
  2420. int yylex_init(yyscan_t* ptr_yy_globals)
  2421. {
  2422. if (ptr_yy_globals == NULL){
  2423. errno = EINVAL;
  2424. return 1;
  2425. }
  2426. *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
  2427. if (*ptr_yy_globals == NULL){
  2428. errno = ENOMEM;
  2429. return 1;
  2430. }
  2431. /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
  2432. memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
  2433. return yy_init_globals ( *ptr_yy_globals );
  2434. }
  2435. /* yylex_init_extra has the same functionality as yylex_init, but follows the
  2436. * convention of taking the scanner as the last argument. Note however, that
  2437. * this is a *pointer* to a scanner, as it will be allocated by this call (and
  2438. * is the reason, too, why this function also must handle its own declaration).
  2439. * The user defined value in the first argument will be available to yyalloc in
  2440. * the yyextra field.
  2441. */
  2442. int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
  2443. {
  2444. struct yyguts_t dummy_yyguts;
  2445. yyset_extra (yy_user_defined, &dummy_yyguts);
  2446. if (ptr_yy_globals == NULL){
  2447. errno = EINVAL;
  2448. return 1;
  2449. }
  2450. *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
  2451. if (*ptr_yy_globals == NULL){
  2452. errno = ENOMEM;
  2453. return 1;
  2454. }
  2455. /* By setting to 0xAA, we expose bugs in
  2456. yy_init_globals. Leave at 0x00 for releases. */
  2457. memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
  2458. yyset_extra (yy_user_defined, *ptr_yy_globals);
  2459. return yy_init_globals ( *ptr_yy_globals );
  2460. }
  2461. /* %endif if-c-only */
  2462. /* %if-c-only */
  2463. static int yy_init_globals (yyscan_t yyscanner)
  2464. {
  2465. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2466. /* Initialization is the same as for the non-reentrant scanner.
  2467. * This function is called from yylex_destroy(), so don't allocate here.
  2468. */
  2469. yyg->yy_buffer_stack = NULL;
  2470. yyg->yy_buffer_stack_top = 0;
  2471. yyg->yy_buffer_stack_max = 0;
  2472. yyg->yy_c_buf_p = NULL;
  2473. yyg->yy_init = 0;
  2474. yyg->yy_start = 0;
  2475. yyg->yy_start_stack_ptr = 0;
  2476. yyg->yy_start_stack_depth = 0;
  2477. yyg->yy_start_stack = NULL;
  2478. /* Defined in main.c */
  2479. #ifdef YY_STDINIT
  2480. yyin = stdin;
  2481. yyout = stdout;
  2482. #else
  2483. yyin = NULL;
  2484. yyout = NULL;
  2485. #endif
  2486. /* For future reference: Set errno on error, since we are called by
  2487. * yylex_init()
  2488. */
  2489. return 0;
  2490. }
  2491. /* %endif */
  2492. /* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */
  2493. /* yylex_destroy is for both reentrant and non-reentrant scanners. */
  2494. int yylex_destroy (yyscan_t yyscanner)
  2495. {
  2496. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2497. /* Pop the buffer stack, destroying each element. */
  2498. while(YY_CURRENT_BUFFER){
  2499. yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
  2500. YY_CURRENT_BUFFER_LVALUE = NULL;
  2501. yypop_buffer_state(yyscanner);
  2502. }
  2503. /* Destroy the stack itself. */
  2504. yyfree(yyg->yy_buffer_stack , yyscanner);
  2505. yyg->yy_buffer_stack = NULL;
  2506. /* Destroy the start condition stack. */
  2507. yyfree( yyg->yy_start_stack , yyscanner );
  2508. yyg->yy_start_stack = NULL;
  2509. /* Reset the globals. This is important in a non-reentrant scanner so the next time
  2510. * yylex() is called, initialization will occur. */
  2511. yy_init_globals( yyscanner);
  2512. /* %if-reentrant */
  2513. /* Destroy the main struct (reentrant only). */
  2514. yyfree ( yyscanner , yyscanner );
  2515. yyscanner = NULL;
  2516. /* %endif */
  2517. return 0;
  2518. }
  2519. /* %endif */
  2520. /*
  2521. * Internal utility routines.
  2522. */
  2523. #ifndef yytext_ptr
  2524. static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
  2525. {
  2526. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2527. (void)yyg;
  2528. int i;
  2529. for ( i = 0; i < n; ++i )
  2530. s1[i] = s2[i];
  2531. }
  2532. #endif
  2533. #ifdef YY_NEED_STRLEN
  2534. static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
  2535. {
  2536. int n;
  2537. for ( n = 0; s[n]; ++n )
  2538. ;
  2539. return n;
  2540. }
  2541. #endif
  2542. void *yyalloc (yy_size_t size , yyscan_t yyscanner)
  2543. {
  2544. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2545. (void)yyg;
  2546. return malloc(size);
  2547. }
  2548. void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
  2549. {
  2550. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2551. (void)yyg;
  2552. /* The cast to (char *) in the following accommodates both
  2553. * implementations that use char* generic pointers, and those
  2554. * that use void* generic pointers. It works with the latter
  2555. * because both ANSI C and C++ allow castless assignment from
  2556. * any pointer type to void*, and deal with argument conversions
  2557. * as though doing an assignment.
  2558. */
  2559. return realloc(ptr, size);
  2560. }
  2561. void yyfree (void * ptr , yyscan_t yyscanner)
  2562. {
  2563. struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
  2564. (void)yyg;
  2565. free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
  2566. }
  2567. /* %if-tables-serialization definitions */
  2568. /* %define-yytables The name for this specific scanner's tables. */
  2569. #define YYTABLES_NAME "yytables"
  2570. /* %endif */
  2571. /* %ok-for-header */
  2572. #line 241 "settings/settings_lexer.l"
  2573. /**
  2574. * Open the next file, if any is queued and readable, otherwise returns FALSE.
  2575. */
  2576. bool settings_parser_open_next_file(parser_helper_t *ctx)
  2577. {
  2578. FILE *file;
  2579. file = ctx->file_next(ctx);
  2580. if (!file)
  2581. {
  2582. return FALSE;
  2583. }
  2584. settings_parser_set_in(file, ctx->scanner);
  2585. settings_parser_push_buffer_state(
  2586. settings_parser__create_buffer(file, YY_BUF_SIZE,
  2587. ctx->scanner), ctx->scanner);
  2588. return TRUE;
  2589. }
  2590. /**
  2591. * Assumes that the file pattern to include is currently stored as string on
  2592. * the helper object.
  2593. */
  2594. static void include_files(parser_helper_t *ctx)
  2595. {
  2596. char *pattern = ctx->string_get(ctx);
  2597. ctx->file_include(ctx, pattern);
  2598. free(pattern);
  2599. settings_parser_open_next_file(ctx);
  2600. }
  2601. /**
  2602. * Load the given string to be parsed next
  2603. */
  2604. void settings_parser_load_string(parser_helper_t *ctx, const char *content)
  2605. {
  2606. settings_parser__scan_string(content, ctx->scanner);
  2607. }