flex.skl 105 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147
  1. %# -*-C-*- vi: set ft=c:
  2. %# This file is processed in several stages.
  3. %# Here are the stages, as best as I can describe:
  4. %#
  5. %# 1. flex.skl is processed through GNU m4 during the
  6. %# pre-compilation stage of flex. Only macros starting
  7. %# with `m4_' are processed, and quoting is normal.
  8. %#
  9. %# 2. The preprocessed skeleton is translated into a C array, saved
  10. %# as "skel.c" and compiled into the flex binary. The %# comment
  11. %# lines are removed.
  12. %#
  13. %# 3. At runtime, the skeleton is generated and filtered (again)
  14. %# through m4. Macros beginning with `m4_' will be processed.
  15. %# The quoting is "[[" and "]]" so we don't interfere with
  16. %# user code.
  17. %#
  18. %# All generated macros for the m4 stage contain the text "m4" or "M4"
  19. %# in them. This is to distinguish them from CPP macros.
  20. %# The exception to this rule is YY_G, which is an m4 macro,
  21. %# but it needs to be remain short because it is used everywhere.
  22. %#
  23. /* A lexical scanner generated by flex */
  24. %# Macros for preproc stage.
  25. %# Macros for runtime processing stage.
  26. m4_changecom
  27. m4_changequote
  28. m4_changequote([[, ]])
  29. %#
  30. %# Lines in this skeleton starting with a "%" character are "control lines"
  31. %# and affect the generation of the scanner. The possible control codes are
  32. %# listed and processed in misc.c.
  33. %#
  34. %# %# - A comment. The current line is omitted from the generated scanner.
  35. %# %if-c++-only - The following lines are printed for C++ scanners ONLY.
  36. %# %if-c-only - The following lines are NOT printed for C++ scanners.
  37. %# %if-c-or-c++ - The following lines are printed in BOTH C and C++ scanners.
  38. %# %if-reentrant - Print for reentrant scanners.(push)
  39. %# %if-not-reentrant - Print for non-reentrant scanners. (push)
  40. %# %if-bison-bridge - Print for bison-bridge. (push)
  41. %# %if-not-bison-bridge - Print for non-bison-bridge. (push)
  42. %# %endif - pop from the previous if code.
  43. %# %% - A stop-point, where code is inserted by flex.
  44. %# Each stop-point is numbered here and also in the code generator.
  45. %# (See gen.c, etc. for details.)
  46. %# %not-for-header - Begin code that should NOT appear in a ".h" file.
  47. %# %ok-for-header - %c and %e are used for building a header file.
  48. %# %if-tables-serialization
  49. %#
  50. %# All control-lines EXCEPT comment lines ("%#") will be inserted into
  51. %# the generated scanner as a C-style comment. This is to aid those who
  52. %# edit the skeleton.
  53. %#
  54. %not-for-header
  55. %if-c-only
  56. %if-not-reentrant
  57. m4_ifelse(M4_YY_PREFIX,yy,,
  58. #define yy_create_buffer M4_YY_PREFIX[[_create_buffer]]
  59. #define yy_delete_buffer M4_YY_PREFIX[[_delete_buffer]]
  60. #define yy_scan_buffer M4_YY_PREFIX[[_scan_buffer]]
  61. #define yy_scan_string M4_YY_PREFIX[[_scan_string]]
  62. #define yy_scan_bytes M4_YY_PREFIX[[_scan_bytes]]
  63. #define yy_init_buffer M4_YY_PREFIX[[_init_buffer]]
  64. #define yy_flush_buffer M4_YY_PREFIX[[_flush_buffer]]
  65. #define yy_load_buffer_state M4_YY_PREFIX[[_load_buffer_state]]
  66. #define yy_switch_to_buffer M4_YY_PREFIX[[_switch_to_buffer]]
  67. #define yypush_buffer_state M4_YY_PREFIX[[push_buffer_state]]
  68. #define yypop_buffer_state M4_YY_PREFIX[[pop_buffer_state]]
  69. #define yyensure_buffer_stack M4_YY_PREFIX[[ensure_buffer_stack]]
  70. #define yy_flex_debug M4_YY_PREFIX[[_flex_debug]]
  71. #define yyin M4_YY_PREFIX[[in]]
  72. #define yyleng M4_YY_PREFIX[[leng]]
  73. #define yylex M4_YY_PREFIX[[lex]]
  74. #define yylineno M4_YY_PREFIX[[lineno]]
  75. #define yyout M4_YY_PREFIX[[out]]
  76. #define yyrestart M4_YY_PREFIX[[restart]]
  77. #define yytext M4_YY_PREFIX[[text]]
  78. #define yywrap M4_YY_PREFIX[[wrap]]
  79. #define yyalloc M4_YY_PREFIX[[alloc]]
  80. #define yyrealloc M4_YY_PREFIX[[realloc]]
  81. #define yyfree M4_YY_PREFIX[[free]]
  82. )
  83. %endif
  84. %endif
  85. %ok-for-header
  86. #define FLEX_SCANNER
  87. #define YY_FLEX_MAJOR_VERSION 2
  88. #define YY_FLEX_MINOR_VERSION 6
  89. #define YY_FLEX_SUBMINOR_VERSION 4
  90. #if YY_FLEX_SUBMINOR_VERSION > 0
  91. #define FLEX_BETA
  92. #endif
  93. %# Some negated symbols
  94. m4_ifdef( [[M4_YY_IN_HEADER]], , [[m4_define([[M4_YY_NOT_IN_HEADER]], [[]])]])
  95. m4_ifdef( [[M4_YY_REENTRANT]], , [[m4_define([[M4_YY_NOT_REENTRANT]], [[]])]])
  96. %# This is the m4 way to say "(stack_used || is_reentrant)
  97. m4_ifdef( [[M4_YY_STACK_USED]], [[m4_define([[M4_YY_HAS_START_STACK_VARS]])]])
  98. m4_ifdef( [[M4_YY_REENTRANT]], [[m4_define([[M4_YY_HAS_START_STACK_VARS]])]])
  99. %# Prefixes.
  100. %# The complexity here is necessary so that m4 preserves
  101. %# the argument lists to each C function.
  102. m4_ifdef( [[M4_YY_PREFIX]],, [[m4_define([[M4_YY_PREFIX]], [[yy]])]])
  103. %if-c++-only
  104. /* The c++ scanner is a mess. The FlexLexer.h header file relies on the
  105. * following macro. This is required in order to pass the c++-multiple-scanners
  106. * test in the regression suite. We get reports that it breaks inheritance.
  107. * We will address this in a future release of flex, or omit the C++ scanner
  108. * altogether.
  109. */
  110. #define yyFlexLexer M4_YY_PREFIX[[FlexLexer]]
  111. %endif
  112. %if-c-only
  113. m4_ifelse(M4_YY_PREFIX,yy,,
  114. [[#ifdef yy_create_buffer
  115. #define ]]M4_YY_PREFIX[[_create_buffer_ALREADY_DEFINED
  116. #else
  117. #define yy_create_buffer ]]M4_YY_PREFIX[[_create_buffer
  118. #endif]]
  119. [[#ifdef yy_delete_buffer
  120. #define ]]M4_YY_PREFIX[[_delete_buffer_ALREADY_DEFINED
  121. #else
  122. #define yy_delete_buffer ]]M4_YY_PREFIX[[_delete_buffer
  123. #endif]]
  124. [[#ifdef yy_scan_buffer
  125. #define ]]M4_YY_PREFIX[[_scan_buffer_ALREADY_DEFINED
  126. #else
  127. #define yy_scan_buffer ]]M4_YY_PREFIX[[_scan_buffer
  128. #endif]]
  129. [[#ifdef yy_scan_string
  130. #define ]]M4_YY_PREFIX[[_scan_string_ALREADY_DEFINED
  131. #else
  132. #define yy_scan_string ]]M4_YY_PREFIX[[_scan_string
  133. #endif]]
  134. [[#ifdef yy_scan_bytes
  135. #define ]]M4_YY_PREFIX[[_scan_bytes_ALREADY_DEFINED
  136. #else
  137. #define yy_scan_bytes ]]M4_YY_PREFIX[[_scan_bytes
  138. #endif]]
  139. [[#ifdef yy_init_buffer
  140. #define ]]M4_YY_PREFIX[[_init_buffer_ALREADY_DEFINED
  141. #else
  142. #define yy_init_buffer ]]M4_YY_PREFIX[[_init_buffer
  143. #endif]]
  144. [[#ifdef yy_flush_buffer
  145. #define ]]M4_YY_PREFIX[[_flush_buffer_ALREADY_DEFINED
  146. #else
  147. #define yy_flush_buffer ]]M4_YY_PREFIX[[_flush_buffer
  148. #endif]]
  149. [[#ifdef yy_load_buffer_state
  150. #define ]]M4_YY_PREFIX[[_load_buffer_state_ALREADY_DEFINED
  151. #else
  152. #define yy_load_buffer_state ]]M4_YY_PREFIX[[_load_buffer_state
  153. #endif]]
  154. [[#ifdef yy_switch_to_buffer
  155. #define ]]M4_YY_PREFIX[[_switch_to_buffer_ALREADY_DEFINED
  156. #else
  157. #define yy_switch_to_buffer ]]M4_YY_PREFIX[[_switch_to_buffer
  158. #endif]]
  159. [[#ifdef yypush_buffer_state
  160. #define ]]M4_YY_PREFIX[[push_buffer_state_ALREADY_DEFINED
  161. #else
  162. #define yypush_buffer_state ]]M4_YY_PREFIX[[push_buffer_state
  163. #endif]]
  164. [[#ifdef yypop_buffer_state
  165. #define ]]M4_YY_PREFIX[[pop_buffer_state_ALREADY_DEFINED
  166. #else
  167. #define yypop_buffer_state ]]M4_YY_PREFIX[[pop_buffer_state
  168. #endif]]
  169. [[#ifdef yyensure_buffer_stack
  170. #define ]]M4_YY_PREFIX[[ensure_buffer_stack_ALREADY_DEFINED
  171. #else
  172. #define yyensure_buffer_stack ]]M4_YY_PREFIX[[ensure_buffer_stack
  173. #endif]]
  174. [[#ifdef yylex
  175. #define ]]M4_YY_PREFIX[[lex_ALREADY_DEFINED
  176. #else
  177. #define yylex ]]M4_YY_PREFIX[[lex
  178. #endif]]
  179. [[#ifdef yyrestart
  180. #define ]]M4_YY_PREFIX[[restart_ALREADY_DEFINED
  181. #else
  182. #define yyrestart ]]M4_YY_PREFIX[[restart
  183. #endif]]
  184. [[#ifdef yylex_init
  185. #define ]]M4_YY_PREFIX[[lex_init_ALREADY_DEFINED
  186. #else
  187. #define yylex_init ]]M4_YY_PREFIX[[lex_init
  188. #endif]]
  189. [[#ifdef yylex_init_extra
  190. #define ]]M4_YY_PREFIX[[lex_init_extra_ALREADY_DEFINED
  191. #else
  192. #define yylex_init_extra ]]M4_YY_PREFIX[[lex_init_extra
  193. #endif]]
  194. [[#ifdef yylex_destroy
  195. #define ]]M4_YY_PREFIX[[lex_destroy_ALREADY_DEFINED
  196. #else
  197. #define yylex_destroy ]]M4_YY_PREFIX[[lex_destroy
  198. #endif]]
  199. [[#ifdef yyget_debug
  200. #define ]]M4_YY_PREFIX[[get_debug_ALREADY_DEFINED
  201. #else
  202. #define yyget_debug ]]M4_YY_PREFIX[[get_debug
  203. #endif]]
  204. [[#ifdef yyset_debug
  205. #define ]]M4_YY_PREFIX[[set_debug_ALREADY_DEFINED
  206. #else
  207. #define yyset_debug ]]M4_YY_PREFIX[[set_debug
  208. #endif]]
  209. [[#ifdef yyget_extra
  210. #define ]]M4_YY_PREFIX[[get_extra_ALREADY_DEFINED
  211. #else
  212. #define yyget_extra ]]M4_YY_PREFIX[[get_extra
  213. #endif]]
  214. [[#ifdef yyset_extra
  215. #define ]]M4_YY_PREFIX[[set_extra_ALREADY_DEFINED
  216. #else
  217. #define yyset_extra ]]M4_YY_PREFIX[[set_extra
  218. #endif]]
  219. [[#ifdef yyget_in
  220. #define ]]M4_YY_PREFIX[[get_in_ALREADY_DEFINED
  221. #else
  222. #define yyget_in ]]M4_YY_PREFIX[[get_in
  223. #endif]]
  224. [[#ifdef yyset_in
  225. #define ]]M4_YY_PREFIX[[set_in_ALREADY_DEFINED
  226. #else
  227. #define yyset_in ]]M4_YY_PREFIX[[set_in
  228. #endif]]
  229. [[#ifdef yyget_out
  230. #define ]]M4_YY_PREFIX[[get_out_ALREADY_DEFINED
  231. #else
  232. #define yyget_out ]]M4_YY_PREFIX[[get_out
  233. #endif]]
  234. [[#ifdef yyset_out
  235. #define ]]M4_YY_PREFIX[[set_out_ALREADY_DEFINED
  236. #else
  237. #define yyset_out ]]M4_YY_PREFIX[[set_out
  238. #endif]]
  239. [[#ifdef yyget_leng
  240. #define ]]M4_YY_PREFIX[[get_leng_ALREADY_DEFINED
  241. #else
  242. #define yyget_leng ]]M4_YY_PREFIX[[get_leng
  243. #endif]]
  244. [[#ifdef yyget_text
  245. #define ]]M4_YY_PREFIX[[get_text_ALREADY_DEFINED
  246. #else
  247. #define yyget_text ]]M4_YY_PREFIX[[get_text
  248. #endif]]
  249. [[#ifdef yyget_lineno
  250. #define ]]M4_YY_PREFIX[[get_lineno_ALREADY_DEFINED
  251. #else
  252. #define yyget_lineno ]]M4_YY_PREFIX[[get_lineno
  253. #endif]]
  254. [[#ifdef yyset_lineno
  255. #define ]]M4_YY_PREFIX[[set_lineno_ALREADY_DEFINED
  256. #else
  257. #define yyset_lineno ]]M4_YY_PREFIX[[set_lineno
  258. #endif]]
  259. m4_ifdef( [[M4_YY_REENTRANT]],
  260. [[
  261. [[#ifdef yyget_column
  262. #define ]]M4_YY_PREFIX[[get_column_ALREADY_DEFINED
  263. #else
  264. #define yyget_column ]]M4_YY_PREFIX[[get_column
  265. #endif]]
  266. [[#ifdef yyset_column
  267. #define ]]M4_YY_PREFIX[[set_column_ALREADY_DEFINED
  268. #else
  269. #define yyset_column ]]M4_YY_PREFIX[[set_column
  270. #endif]]
  271. ]])
  272. [[#ifdef yywrap
  273. #define ]]M4_YY_PREFIX[[wrap_ALREADY_DEFINED
  274. #else
  275. #define yywrap ]]M4_YY_PREFIX[[wrap
  276. #endif]]
  277. )
  278. %endif
  279. m4_ifdef( [[M4_YY_BISON_LVAL]],
  280. [[
  281. [[#ifdef yyget_lval
  282. #define ]]M4_YY_PREFIX[[get_lval_ALREADY_DEFINED
  283. #else
  284. #define yyget_lval ]]M4_YY_PREFIX[[get_lval
  285. #endif]]
  286. [[#ifdef yyset_lval
  287. #define ]]M4_YY_PREFIX[[set_lval_ALREADY_DEFINED
  288. #else
  289. #define yyset_lval ]]M4_YY_PREFIX[[set_lval
  290. #endif]]
  291. ]])
  292. m4_ifdef( [[<M4_YY_BISON_LLOC>]],
  293. [[
  294. [[#ifdef yyget_lloc
  295. #define ]]M4_YY_PREFIX[[get_lloc_ALREADY_DEFINED
  296. #else
  297. #define yyget_lloc ]]M4_YY_PREFIX[[get_lloc
  298. #endif]]
  299. [[#ifdef yyset_lloc
  300. #define ]]M4_YY_PREFIX[[set_lloc_ALREADY_DEFINED
  301. #else
  302. #define yyset_lloc ]]M4_YY_PREFIX[[set_lloc
  303. #endif]]
  304. ]])
  305. m4_ifelse(M4_YY_PREFIX,yy,,
  306. [[#ifdef yyalloc
  307. #define ]]M4_YY_PREFIX[[alloc_ALREADY_DEFINED
  308. #else
  309. #define yyalloc ]]M4_YY_PREFIX[[alloc
  310. #endif]]
  311. [[#ifdef yyrealloc
  312. #define ]]M4_YY_PREFIX[[realloc_ALREADY_DEFINED
  313. #else
  314. #define yyrealloc ]]M4_YY_PREFIX[[realloc
  315. #endif]]
  316. [[#ifdef yyfree
  317. #define ]]M4_YY_PREFIX[[free_ALREADY_DEFINED
  318. #else
  319. #define yyfree ]]M4_YY_PREFIX[[free
  320. #endif]]
  321. )
  322. %if-c-only
  323. m4_ifelse(M4_YY_PREFIX,yy,,
  324. m4_ifdef( [[M4_YY_NOT_REENTRANT]],
  325. [[
  326. [[#ifdef yytext
  327. #define ]]M4_YY_PREFIX[[text_ALREADY_DEFINED
  328. #else
  329. #define yytext ]]M4_YY_PREFIX[[text
  330. #endif]]
  331. [[#ifdef yyleng
  332. #define ]]M4_YY_PREFIX[[leng_ALREADY_DEFINED
  333. #else
  334. #define yyleng ]]M4_YY_PREFIX[[leng
  335. #endif]]
  336. [[#ifdef yyin
  337. #define ]]M4_YY_PREFIX[[in_ALREADY_DEFINED
  338. #else
  339. #define yyin ]]M4_YY_PREFIX[[in
  340. #endif]]
  341. [[#ifdef yyout
  342. #define ]]M4_YY_PREFIX[[out_ALREADY_DEFINED
  343. #else
  344. #define yyout ]]M4_YY_PREFIX[[out
  345. #endif]]
  346. [[#ifdef yy_flex_debug
  347. #define ]]M4_YY_PREFIX[[_flex_debug_ALREADY_DEFINED
  348. #else
  349. #define yy_flex_debug ]]M4_YY_PREFIX[[_flex_debug
  350. #endif]]
  351. [[#ifdef yylineno
  352. #define ]]M4_YY_PREFIX[[lineno_ALREADY_DEFINED
  353. #else
  354. #define yylineno ]]M4_YY_PREFIX[[lineno
  355. #endif]]
  356. ]])
  357. )
  358. %endif
  359. m4_ifdef( [[M4_YY_TABLES_EXTERNAL]],
  360. [[
  361. [[#ifdef yytables_fload
  362. #define ]]M4_YY_PREFIX[[tables_fload_ALREADY_DEFINED
  363. #else
  364. #define yytables_fload ]]M4_YY_PREFIX[[tables_fload
  365. #endif]]
  366. [[#ifdef yytables_destroy
  367. #define ]]M4_YY_PREFIX[[tables_destroy_ALREADY_DEFINED
  368. #else
  369. #define yytables_destroy ]]M4_YY_PREFIX[[tables_destroy
  370. #endif]]
  371. [[#ifdef yyTABLES_NAME
  372. #define ]]M4_YY_PREFIX[[TABLES_NAME_ALREADY_DEFINED
  373. #else
  374. #define yyTABLES_NAME ]]M4_YY_PREFIX[[TABLES_NAME
  375. #endif]]
  376. ]])
  377. /* First, we deal with platform-specific or compiler-specific issues. */
  378. /* begin standard C headers. */
  379. %if-c-only
  380. m4_ifdef( [[M4_YY_ALWAYS_INTERACTIVE]], ,
  381. [[m4_ifdef( [[M4_YY_NEVER_INTERACTIVE]], ,
  382. [[/* Feature test macros. Flex uses functions that require a minimum set of
  383. * macros defined. As defining some macros may hide function declarations that
  384. * user code might use, be conservative and respect user's definitions as much
  385. * as possible. In glibc, feature test macros may not be all set up until one
  386. * of the libc header (that includes <features.h>) is included. This creates
  387. * a circular dependency when we check the macros. <assert.h> is the safest
  388. * header we can include and does not declare too many functions we don't need.
  389. */
  390. #if !defined(__GNU_LIBRARY__) && defined(__STDC__)
  391. #include <assert.h>
  392. #endif
  393. #if !(defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
  394. defined(_POSIX_SOURCE))
  395. # define _POSIX_C_SOURCE 1 /* Required for fileno() */
  396. # define _POSIX_SOURCE 1
  397. #endif]])]])
  398. #include <stdio.h>
  399. #include <string.h>
  400. #include <errno.h>
  401. #include <stdlib.h>
  402. %endif
  403. %if-tables-serialization
  404. #include <sys/types.h>
  405. #include <netinet/in.h>
  406. %endif
  407. /* end standard C headers. */
  408. /* begin standard C++ headers. */
  409. %if-c++-only
  410. #include <iostream>
  411. #include <errno.h>
  412. #include <cstdlib>
  413. #include <cstdio>
  414. #include <cstring>
  415. /* end standard C++ headers. */
  416. %endif
  417. %if-c-or-c++
  418. /* flex integer type definitions */
  419. #ifndef YYFLEX_INTTYPES_DEFINED
  420. #define YYFLEX_INTTYPES_DEFINED
  421. /* Prefer C99 integer types if available. */
  422. # if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  423. /* Include <inttypes.h> and not <stdint.h> because Solaris 2.6 has the former
  424. * and not the latter.
  425. */
  426. #include <inttypes.h>
  427. # define YYFLEX_USE_STDINT
  428. # else
  429. # if defined(_MSC_VER) && _MSC_VER >= 1600
  430. /* Visual C++ 2010 does not define __STDC_VERSION__ and has <stdint.h> but not
  431. * <inttypes.h>.
  432. */
  433. #include <stdint.h>
  434. # define YYFLEX_USE_STDINT
  435. # endif
  436. # endif
  437. # ifdef YYFLEX_USE_STDINT
  438. typedef int8_t flex_int8_t;
  439. typedef uint8_t flex_uint8_t;
  440. typedef int16_t flex_int16_t;
  441. typedef uint16_t flex_uint16_t;
  442. typedef int32_t flex_int32_t;
  443. typedef uint32_t flex_uint32_t;
  444. # else
  445. typedef unsigned char flex_uint8_t;
  446. typedef short int flex_int16_t;
  447. typedef unsigned short int flex_uint16_t;
  448. # ifdef __STDC__
  449. typedef signed char flex_int8_t;
  450. /* ISO C only requires at least 16 bits for int. */
  451. #include <limits.h>
  452. # if UINT_MAX >= 4294967295
  453. # define YYFLEX_INT32_DEFINED
  454. typedef int flex_int32_t;
  455. typedef unsigned int flex_uint32_t;
  456. # endif
  457. # else
  458. typedef char flex_int8_t;
  459. # endif
  460. # ifndef YYFLEX_INT32_DEFINED
  461. typedef long int flex_int32_t;
  462. typedef unsigned long int flex_uint32_t;
  463. # endif
  464. # endif
  465. #endif /* YYFLEX_INTTYPES_DEFINED */
  466. %endif
  467. /* TODO: this is always defined, so inline it */
  468. #define yyconst const
  469. #if defined(__GNUC__) && __GNUC__ >= 3
  470. #define yynoreturn __attribute__((__noreturn__))
  471. #else
  472. #define yynoreturn
  473. #endif
  474. %not-for-header
  475. /* Returned upon end-of-file. */
  476. #define YY_NULL 0
  477. %ok-for-header
  478. %not-for-header
  479. /* Promotes a possibly negative, possibly signed char to an
  480. * integer in range [0..255] for use as an array index.
  481. */
  482. #define YY_SC_TO_UI(c) ((YY_CHAR) (c))
  483. %ok-for-header
  484. %if-reentrant
  485. /* An opaque pointer. */
  486. #ifndef YY_TYPEDEF_YY_SCANNER_T
  487. #define YY_TYPEDEF_YY_SCANNER_T
  488. typedef void* yyscan_t;
  489. #endif
  490. %# Declare yyguts variable
  491. m4_define( [[M4_YY_DECL_GUTS_VAR]], [[struct yyguts_t * yyg = (struct yyguts_t*)yyscanner]])
  492. %# Perform a noop access on yyguts to prevent unused variable complains
  493. m4_define( [[M4_YY_NOOP_GUTS_VAR]], [[(void)yyg]])
  494. %# For use wherever a Global is accessed or assigned.
  495. m4_define( [[YY_G]], [[yyg->$1]])
  496. %# For use in function prototypes to append the additional argument.
  497. m4_define( [[M4_YY_PROTO_LAST_ARG]], [[, yyscan_t yyscanner]])
  498. m4_define( [[M4_YY_PROTO_ONLY_ARG]], [[yyscan_t yyscanner]])
  499. m4_define( [[M4_YY_DEF_LAST_ARG]], [[, yyscan_t yyscanner]])
  500. m4_define( [[M4_YY_DEF_ONLY_ARG]], [[yyscan_t yyscanner]])
  501. m4_define( [[M4_YY_DECL_LAST_ARG]], [[yyscan_t yyscanner;]])
  502. %# For use in function calls to pass the additional argument.
  503. m4_define( [[M4_YY_CALL_LAST_ARG]], [[, yyscanner]])
  504. m4_define( [[M4_YY_CALL_ONLY_ARG]], [[yyscanner]])
  505. %# For use in function documentation to adjust for additional argument.
  506. m4_define( [[M4_YY_DOC_PARAM]], [[@param yyscanner The scanner object.]])
  507. /* For convenience, these vars (plus the bison vars far below)
  508. are macros in the reentrant scanner. */
  509. #define yyin YY_G(yyin_r)
  510. #define yyout YY_G(yyout_r)
  511. #define yyextra YY_G(yyextra_r)
  512. #define yyleng YY_G(yyleng_r)
  513. #define yytext YY_G(yytext_r)
  514. #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
  515. #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
  516. #define yy_flex_debug YY_G(yy_flex_debug_r)
  517. m4_define( [[M4_YY_INCR_LINENO]],
  518. [[
  519. do{ yylineno++;
  520. yycolumn=0;
  521. }while(0)
  522. ]])
  523. %endif
  524. %if-not-reentrant
  525. m4_define( [[M4_YY_INCR_LINENO]],
  526. [[
  527. yylineno++;
  528. ]])
  529. %# Define these macros to be no-ops.
  530. m4_define( [[M4_YY_DECL_GUTS_VAR]], [[m4_dnl]])
  531. m4_define( [[M4_YY_NOOP_GUTS_VAR]], [[m4_dnl]])
  532. m4_define( [[YY_G]], [[($1)]])
  533. m4_define( [[M4_YY_PROTO_LAST_ARG]])
  534. m4_define( [[M4_YY_PROTO_ONLY_ARG]], [[void]])
  535. m4_define( [[M4_YY_DEF_LAST_ARG]])
  536. m4_define( [[M4_YY_DEF_ONLY_ARG]], [[void]])
  537. m4_define([[M4_YY_DECL_LAST_ARG]])
  538. m4_define([[M4_YY_CALL_LAST_ARG]])
  539. m4_define([[M4_YY_CALL_ONLY_ARG]])
  540. m4_define( [[M4_YY_DOC_PARAM]], )
  541. %endif
  542. %# Generate C99 function defs.
  543. m4_define( [[YYFARGS1]], [[($1 $2 M4_YY_DEF_LAST_ARG)]])
  544. m4_define( [[YYFARGS2]], [[($1 $2, $3 $4 M4_YY_DEF_LAST_ARG)]])
  545. m4_define( [[YYFARGS3]], [[($1 $2, $3 $4, $5 $6 M4_YY_DEF_LAST_ARG)]])
  546. m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
  547. [[
  548. /* Enter a start condition. This macro really ought to take a parameter,
  549. * but we do it the disgusting crufty way forced on us by the ()-less
  550. * definition of BEGIN.
  551. */
  552. #define BEGIN YY_G(yy_start) = 1 + 2 *
  553. /* Translate the current start state into a value that can be later handed
  554. * to BEGIN to return to the state. The YYSTATE alias is for lex
  555. * compatibility.
  556. */
  557. #define YY_START ((YY_G(yy_start) - 1) / 2)
  558. #define YYSTATE YY_START
  559. /* Action number for EOF rule of a given start state. */
  560. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  561. /* Special action meaning "start processing a new file". */
  562. #define YY_NEW_FILE yyrestart( yyin M4_YY_CALL_LAST_ARG )
  563. #define YY_END_OF_BUFFER_CHAR 0
  564. ]])
  565. /* Size of default input buffer. */
  566. #ifndef YY_BUF_SIZE
  567. #ifdef __ia64__
  568. /* On IA-64, the buffer size is 16k, not 8k.
  569. * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
  570. * Ditto for the __ia64__ case accordingly.
  571. */
  572. #define YY_BUF_SIZE 32768
  573. #else
  574. #define YY_BUF_SIZE 16384
  575. #endif /* __ia64__ */
  576. #endif
  577. m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
  578. [[
  579. /* The state buf must be large enough to hold one state per character in the main buffer.
  580. */
  581. #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
  582. ]])
  583. #ifndef YY_TYPEDEF_YY_BUFFER_STATE
  584. #define YY_TYPEDEF_YY_BUFFER_STATE
  585. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  586. #endif
  587. #ifndef YY_TYPEDEF_YY_SIZE_T
  588. #define YY_TYPEDEF_YY_SIZE_T
  589. typedef size_t yy_size_t;
  590. #endif
  591. %if-not-reentrant
  592. extern int yyleng;
  593. %endif
  594. %if-c-only
  595. %if-not-reentrant
  596. extern FILE *yyin, *yyout;
  597. %endif
  598. %endif
  599. m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
  600. [[
  601. #define EOB_ACT_CONTINUE_SCAN 0
  602. #define EOB_ACT_END_OF_FILE 1
  603. #define EOB_ACT_LAST_MATCH 2
  604. m4_ifdef( [[M4_YY_USE_LINENO]],
  605. [[
  606. /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
  607. * access to the local variable yy_act. Since yyless() is a macro, it would break
  608. * existing scanners that call yyless() from OUTSIDE yylex.
  609. * One obvious solution it to make yy_act a global. I tried that, and saw
  610. * a 5% performance hit in a non-yylineno scanner, because yy_act is
  611. * normally declared as a register variable-- so it is not worth it.
  612. */
  613. #define YY_LESS_LINENO(n) \
  614. do { \
  615. int yyl;\
  616. for ( yyl = n; yyl < yyleng; ++yyl )\
  617. if ( yytext[yyl] == '\n' )\
  618. --yylineno;\
  619. }while(0)
  620. #define YY_LINENO_REWIND_TO(dst) \
  621. do {\
  622. const char *p;\
  623. for ( p = yy_cp-1; p >= (dst); --p)\
  624. if ( *p == '\n' )\
  625. --yylineno;\
  626. }while(0)
  627. ]],
  628. [[
  629. #define YY_LESS_LINENO(n)
  630. #define YY_LINENO_REWIND_TO(ptr)
  631. ]])
  632. /* Return all but the first "n" matched characters back to the input stream. */
  633. #define yyless(n) \
  634. do \
  635. { \
  636. /* Undo effects of setting up yytext. */ \
  637. int yyless_macro_arg = (n); \
  638. YY_LESS_LINENO(yyless_macro_arg);\
  639. *yy_cp = YY_G(yy_hold_char); \
  640. YY_RESTORE_YY_MORE_OFFSET \
  641. YY_G(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
  642. YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  643. } \
  644. while ( 0 )
  645. #define unput(c) yyunput( c, YY_G(yytext_ptr) M4_YY_CALL_LAST_ARG )
  646. ]])
  647. #ifndef YY_STRUCT_YY_BUFFER_STATE
  648. #define YY_STRUCT_YY_BUFFER_STATE
  649. struct yy_buffer_state
  650. {
  651. %if-c-only
  652. FILE *yy_input_file;
  653. %endif
  654. %if-c++-only
  655. std::streambuf* yy_input_file;
  656. %endif
  657. char *yy_ch_buf; /* input buffer */
  658. char *yy_buf_pos; /* current position in input buffer */
  659. /* Size of input buffer in bytes, not including room for EOB
  660. * characters.
  661. */
  662. int yy_buf_size;
  663. /* Number of characters read into yy_ch_buf, not including EOB
  664. * characters.
  665. */
  666. int yy_n_chars;
  667. /* Whether we "own" the buffer - i.e., we know we created it,
  668. * and can realloc() it to grow it, and should free() it to
  669. * delete it.
  670. */
  671. int yy_is_our_buffer;
  672. /* Whether this is an "interactive" input source; if so, and
  673. * if we're using stdio for input, then we want to use getc()
  674. * instead of fread(), to make sure we stop fetching input after
  675. * each newline.
  676. */
  677. int yy_is_interactive;
  678. /* Whether we're considered to be at the beginning of a line.
  679. * If so, '^' rules will be active on the next match, otherwise
  680. * not.
  681. */
  682. int yy_at_bol;
  683. int yy_bs_lineno; /**< The line count. */
  684. int yy_bs_column; /**< The column count. */
  685. /* Whether to try to fill the input buffer when we reach the
  686. * end of it.
  687. */
  688. int yy_fill_buffer;
  689. int yy_buffer_status;
  690. m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
  691. [[
  692. #define YY_BUFFER_NEW 0
  693. #define YY_BUFFER_NORMAL 1
  694. /* When an EOF's been seen but there's still some text to process
  695. * then we mark the buffer as YY_EOF_PENDING, to indicate that we
  696. * shouldn't try reading from the input source any more. We might
  697. * still have a bunch of tokens to match, though, because of
  698. * possible backing-up.
  699. *
  700. * When we actually see the EOF, we change the status to "new"
  701. * (via yyrestart()), so that the user can continue scanning by
  702. * just pointing yyin at a new input file.
  703. */
  704. #define YY_BUFFER_EOF_PENDING 2
  705. ]])
  706. };
  707. #endif /* !YY_STRUCT_YY_BUFFER_STATE */
  708. %if-c-only Standard (non-C++) definition
  709. %not-for-header
  710. %if-not-reentrant
  711. /* Stack of input buffers. */
  712. static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
  713. static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
  714. static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
  715. %endif
  716. %ok-for-header
  717. %endif
  718. m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
  719. [[
  720. /* We provide macros for accessing buffer states in case in the
  721. * future we want to put the buffer states in a more general
  722. * "scanner state".
  723. *
  724. * Returns the top of the stack, or NULL.
  725. */
  726. #define YY_CURRENT_BUFFER ( YY_G(yy_buffer_stack) \
  727. ? YY_G(yy_buffer_stack)[YY_G(yy_buffer_stack_top)] \
  728. : NULL)
  729. /* Same as previous macro, but useful when we know that the buffer stack is not
  730. * NULL or when we need an lvalue. For internal use only.
  731. */
  732. #define YY_CURRENT_BUFFER_LVALUE YY_G(yy_buffer_stack)[YY_G(yy_buffer_stack_top)]
  733. ]])
  734. %if-c-only Standard (non-C++) definition
  735. %if-not-reentrant
  736. %not-for-header
  737. /* yy_hold_char holds the character lost when yytext is formed. */
  738. static char yy_hold_char;
  739. static int yy_n_chars; /* number of characters read into yy_ch_buf */
  740. int yyleng;
  741. /* Points to current character in buffer. */
  742. static char *yy_c_buf_p = NULL;
  743. static int yy_init = 0; /* whether we need to initialize */
  744. static int yy_start = 0; /* start state number */
  745. /* Flag which is used to allow yywrap()'s to do buffer switches
  746. * instead of setting up a fresh yyin. A bit of a hack ...
  747. */
  748. static int yy_did_buffer_switch_on_eof;
  749. %ok-for-header
  750. %endif
  751. void yyrestart ( FILE *input_file M4_YY_PROTO_LAST_ARG );
  752. void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer M4_YY_PROTO_LAST_ARG );
  753. YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size M4_YY_PROTO_LAST_ARG );
  754. void yy_delete_buffer ( YY_BUFFER_STATE b M4_YY_PROTO_LAST_ARG );
  755. void yy_flush_buffer ( YY_BUFFER_STATE b M4_YY_PROTO_LAST_ARG );
  756. void yypush_buffer_state ( YY_BUFFER_STATE new_buffer M4_YY_PROTO_LAST_ARG );
  757. void yypop_buffer_state ( M4_YY_PROTO_ONLY_ARG );
  758. m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
  759. [[
  760. static void yyensure_buffer_stack ( M4_YY_PROTO_ONLY_ARG );
  761. static void yy_load_buffer_state ( M4_YY_PROTO_ONLY_ARG );
  762. static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file M4_YY_PROTO_LAST_ARG );
  763. #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG)
  764. ]])
  765. YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size M4_YY_PROTO_LAST_ARG );
  766. YY_BUFFER_STATE yy_scan_string ( const char *yy_str M4_YY_PROTO_LAST_ARG );
  767. YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len M4_YY_PROTO_LAST_ARG );
  768. %endif
  769. void *yyalloc ( yy_size_t M4_YY_PROTO_LAST_ARG );
  770. void *yyrealloc ( void *, yy_size_t M4_YY_PROTO_LAST_ARG );
  771. void yyfree ( void * M4_YY_PROTO_LAST_ARG );
  772. m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
  773. [[
  774. #define yy_new_buffer yy_create_buffer
  775. #define yy_set_interactive(is_interactive) \
  776. { \
  777. if ( ! YY_CURRENT_BUFFER ){ \
  778. yyensure_buffer_stack (M4_YY_CALL_ONLY_ARG); \
  779. YY_CURRENT_BUFFER_LVALUE = \
  780. yy_create_buffer( yyin, YY_BUF_SIZE M4_YY_CALL_LAST_ARG); \
  781. } \
  782. YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
  783. }
  784. #define yy_set_bol(at_bol) \
  785. { \
  786. if ( ! YY_CURRENT_BUFFER ){\
  787. yyensure_buffer_stack (M4_YY_CALL_ONLY_ARG); \
  788. YY_CURRENT_BUFFER_LVALUE = \
  789. yy_create_buffer( yyin, YY_BUF_SIZE M4_YY_CALL_LAST_ARG); \
  790. } \
  791. YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
  792. }
  793. #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
  794. ]])
  795. %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here
  796. m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
  797. [[
  798. %% [1.5] DFA
  799. ]])
  800. %if-c-only Standard (non-C++) definition
  801. m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
  802. [[
  803. static yy_state_type yy_get_previous_state ( M4_YY_PROTO_ONLY_ARG );
  804. static yy_state_type yy_try_NUL_trans ( yy_state_type current_state M4_YY_PROTO_LAST_ARG);
  805. static int yy_get_next_buffer ( M4_YY_PROTO_ONLY_ARG );
  806. static void yynoreturn yy_fatal_error ( const char* msg M4_YY_PROTO_LAST_ARG );
  807. ]])
  808. %endif
  809. m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
  810. [[
  811. /* Done after the current pattern has been matched and before the
  812. * corresponding action - sets up yytext.
  813. */
  814. #define YY_DO_BEFORE_ACTION \
  815. YY_G(yytext_ptr) = yy_bp; \
  816. %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \
  817. YY_G(yy_hold_char) = *yy_cp; \
  818. *yy_cp = '\0'; \
  819. %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \
  820. YY_G(yy_c_buf_p) = yy_cp;
  821. %% [4.0] data tables for the DFA and the user's section 1 definitions go here
  822. ]])
  823. m4_ifdef( [[M4_YY_IN_HEADER]], [[#ifdef YY_HEADER_EXPORT_START_CONDITIONS]])
  824. M4_YY_SC_DEFS
  825. m4_ifdef( [[M4_YY_IN_HEADER]], [[#endif]])
  826. m4_ifdef( [[M4_YY_NO_UNISTD_H]],,
  827. [[
  828. #ifndef YY_NO_UNISTD_H
  829. /* Special case for "unistd.h", since it is non-ANSI. We include it way
  830. * down here because we want the user's section 1 to have been scanned first.
  831. * The user has a chance to override it with an option.
  832. */
  833. %if-c-only
  834. #include <unistd.h>
  835. %endif
  836. %if-c++-only
  837. #include <unistd.h>
  838. %endif
  839. #endif
  840. ]])
  841. m4_ifdef( [[M4_EXTRA_TYPE_DEFS]],
  842. [[
  843. #define YY_EXTRA_TYPE M4_EXTRA_TYPE_DEFS
  844. ]],
  845. [[
  846. #ifndef YY_EXTRA_TYPE
  847. #define YY_EXTRA_TYPE void *
  848. #endif
  849. ]]
  850. )
  851. %if-c-only Reentrant structure and macros (non-C++).
  852. %if-reentrant
  853. m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
  854. [[
  855. /* Holds the entire state of the reentrant scanner. */
  856. struct yyguts_t
  857. {
  858. /* User-defined. Not touched by flex. */
  859. YY_EXTRA_TYPE yyextra_r;
  860. /* The rest are the same as the globals declared in the non-reentrant scanner. */
  861. FILE *yyin_r, *yyout_r;
  862. size_t yy_buffer_stack_top; /**< index of top of stack. */
  863. size_t yy_buffer_stack_max; /**< capacity of stack. */
  864. YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
  865. char yy_hold_char;
  866. int yy_n_chars;
  867. int yyleng_r;
  868. char *yy_c_buf_p;
  869. int yy_init;
  870. int yy_start;
  871. int yy_did_buffer_switch_on_eof;
  872. int yy_start_stack_ptr;
  873. int yy_start_stack_depth;
  874. int *yy_start_stack;
  875. yy_state_type yy_last_accepting_state;
  876. char* yy_last_accepting_cpos;
  877. int yylineno_r;
  878. int yy_flex_debug_r;
  879. m4_ifdef( [[M4_YY_USES_REJECT]],
  880. [[
  881. yy_state_type *yy_state_buf;
  882. yy_state_type *yy_state_ptr;
  883. char *yy_full_match;
  884. int yy_lp;
  885. /* These are only needed for trailing context rules,
  886. * but there's no conditional variable for that yet. */
  887. int yy_looking_for_trail_begin;
  888. int yy_full_lp;
  889. int *yy_full_state;
  890. ]])
  891. m4_ifdef( [[M4_YY_TEXT_IS_ARRAY]],
  892. [[
  893. char yytext_r[YYLMAX];
  894. char *yytext_ptr;
  895. int yy_more_offset;
  896. int yy_prev_more_offset;
  897. ]],
  898. [[
  899. char *yytext_r;
  900. int yy_more_flag;
  901. int yy_more_len;
  902. ]])
  903. m4_ifdef( [[M4_YY_BISON_LVAL]],
  904. [[
  905. YYSTYPE * yylval_r;
  906. ]])
  907. m4_ifdef( [[<M4_YY_BISON_LLOC>]],
  908. [[
  909. YYLTYPE * yylloc_r;
  910. ]])
  911. }; /* end struct yyguts_t */
  912. ]])
  913. %if-c-only
  914. m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
  915. [[
  916. static int yy_init_globals ( M4_YY_PROTO_ONLY_ARG );
  917. ]])
  918. %endif
  919. %if-reentrant
  920. m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
  921. [[
  922. m4_ifdef( [[M4_YY_BISON_LVAL]],
  923. [[
  924. /* This must go here because YYSTYPE and YYLTYPE are included
  925. * from bison output in section 1.*/
  926. # define yylval YY_G(yylval_r)
  927. ]])
  928. m4_ifdef( [[<M4_YY_BISON_LLOC>]],
  929. [[
  930. # define yylloc YY_G(yylloc_r)
  931. ]])
  932. ]])
  933. int yylex_init (yyscan_t* scanner);
  934. int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
  935. %endif
  936. %endif End reentrant structures and macros.
  937. /* Accessor methods to globals.
  938. These are made visible to non-reentrant scanners for convenience. */
  939. m4_ifdef( [[M4_YY_NO_DESTROY]],,
  940. [[
  941. int yylex_destroy ( M4_YY_PROTO_ONLY_ARG );
  942. ]])
  943. m4_ifdef( [[M4_YY_NO_GET_DEBUG]],,
  944. [[
  945. int yyget_debug ( M4_YY_PROTO_ONLY_ARG );
  946. ]])
  947. m4_ifdef( [[M4_YY_NO_SET_DEBUG]],,
  948. [[
  949. void yyset_debug ( int debug_flag M4_YY_PROTO_LAST_ARG );
  950. ]])
  951. m4_ifdef( [[M4_YY_NO_GET_EXTRA]],,
  952. [[
  953. YY_EXTRA_TYPE yyget_extra ( M4_YY_PROTO_ONLY_ARG );
  954. ]])
  955. m4_ifdef( [[M4_YY_NO_SET_EXTRA]],,
  956. [[
  957. void yyset_extra ( YY_EXTRA_TYPE user_defined M4_YY_PROTO_LAST_ARG );
  958. ]])
  959. m4_ifdef( [[M4_YY_NO_GET_IN]],,
  960. [[
  961. FILE *yyget_in ( M4_YY_PROTO_ONLY_ARG );
  962. ]])
  963. m4_ifdef( [[M4_YY_NO_SET_IN]],,
  964. [[
  965. void yyset_in ( FILE * _in_str M4_YY_PROTO_LAST_ARG );
  966. ]])
  967. m4_ifdef( [[M4_YY_NO_GET_OUT]],,
  968. [[
  969. FILE *yyget_out ( M4_YY_PROTO_ONLY_ARG );
  970. ]])
  971. m4_ifdef( [[M4_YY_NO_SET_OUT]],,
  972. [[
  973. void yyset_out ( FILE * _out_str M4_YY_PROTO_LAST_ARG );
  974. ]])
  975. m4_ifdef( [[M4_YY_NO_GET_LENG]],,
  976. [[
  977. int yyget_leng ( M4_YY_PROTO_ONLY_ARG );
  978. ]])
  979. m4_ifdef( [[M4_YY_NO_GET_TEXT]],,
  980. [[
  981. char *yyget_text ( M4_YY_PROTO_ONLY_ARG );
  982. ]])
  983. m4_ifdef( [[M4_YY_NO_GET_LINENO]],,
  984. [[
  985. int yyget_lineno ( M4_YY_PROTO_ONLY_ARG );
  986. ]])
  987. m4_ifdef( [[M4_YY_NO_SET_LINENO]],,
  988. [[
  989. void yyset_lineno ( int _line_number M4_YY_PROTO_LAST_ARG );
  990. ]])
  991. m4_ifdef( [[M4_YY_REENTRANT]],
  992. [[
  993. m4_ifdef( [[M4_YY_NO_GET_COLUMN]],,
  994. [[
  995. int yyget_column ( M4_YY_PROTO_ONLY_ARG );
  996. ]])
  997. ]])
  998. m4_ifdef( [[M4_YY_REENTRANT]],
  999. [[
  1000. m4_ifdef( [[M4_YY_NO_SET_COLUMN]],,
  1001. [[
  1002. void yyset_column ( int _column_no M4_YY_PROTO_LAST_ARG );
  1003. ]])
  1004. ]])
  1005. %if-bison-bridge
  1006. m4_ifdef( [[M4_YY_NO_GET_LVAL]],,
  1007. [[
  1008. YYSTYPE * yyget_lval ( M4_YY_PROTO_ONLY_ARG );
  1009. ]])
  1010. void yyset_lval ( YYSTYPE * yylval_param M4_YY_PROTO_LAST_ARG );
  1011. m4_ifdef( [[<M4_YY_BISON_LLOC>]],
  1012. [[
  1013. m4_ifdef( [[M4_YY_NO_GET_LLOC]],,
  1014. [[
  1015. YYLTYPE *yyget_lloc ( M4_YY_PROTO_ONLY_ARG );
  1016. ]])
  1017. m4_ifdef( [[M4_YY_NO_SET_LLOC]],,
  1018. [[
  1019. void yyset_lloc ( YYLTYPE * yylloc_param M4_YY_PROTO_LAST_ARG );
  1020. ]])
  1021. ]])
  1022. %endif
  1023. /* Macros after this point can all be overridden by user definitions in
  1024. * section 1.
  1025. */
  1026. #ifndef YY_SKIP_YYWRAP
  1027. #ifdef __cplusplus
  1028. extern "C" int yywrap ( M4_YY_PROTO_ONLY_ARG );
  1029. #else
  1030. extern int yywrap ( M4_YY_PROTO_ONLY_ARG );
  1031. #endif
  1032. #endif
  1033. %not-for-header
  1034. #ifndef YY_NO_UNPUT
  1035. m4_ifdef( [[M4_YY_NO_UNPUT]],,
  1036. [[
  1037. static void yyunput ( int c, char *buf_ptr M4_YY_PROTO_LAST_ARG);
  1038. ]])
  1039. #endif
  1040. %ok-for-header
  1041. %endif
  1042. #ifndef yytext_ptr
  1043. static void yy_flex_strncpy ( char *, const char *, int M4_YY_PROTO_LAST_ARG);
  1044. #endif
  1045. #ifdef YY_NEED_STRLEN
  1046. static int yy_flex_strlen ( const char * M4_YY_PROTO_LAST_ARG);
  1047. #endif
  1048. #ifndef YY_NO_INPUT
  1049. %if-c-only Standard (non-C++) definition
  1050. %not-for-header
  1051. #ifdef __cplusplus
  1052. static int yyinput ( M4_YY_PROTO_ONLY_ARG );
  1053. #else
  1054. static int input ( M4_YY_PROTO_ONLY_ARG );
  1055. #endif
  1056. %ok-for-header
  1057. %endif
  1058. #endif
  1059. %if-c-only
  1060. %# TODO: This is messy.
  1061. m4_ifdef( [[M4_YY_STACK_USED]],
  1062. [[
  1063. m4_ifdef( [[M4_YY_NOT_REENTRANT]],
  1064. [[
  1065. m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
  1066. [[
  1067. static int yy_start_stack_ptr = 0;
  1068. static int yy_start_stack_depth = 0;
  1069. static int *yy_start_stack = NULL;
  1070. ]])
  1071. ]])
  1072. m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
  1073. [[
  1074. m4_ifdef( [[M4_YY_NO_PUSH_STATE]],,
  1075. [[
  1076. static void yy_push_state ( int _new_state M4_YY_PROTO_LAST_ARG);
  1077. ]])
  1078. m4_ifdef( [[M4_YY_NO_POP_STATE]],,
  1079. [[
  1080. static void yy_pop_state ( M4_YY_PROTO_ONLY_ARG );
  1081. ]])
  1082. m4_ifdef( [[M4_YY_NO_TOP_STATE]],,
  1083. [[
  1084. static int yy_top_state ( M4_YY_PROTO_ONLY_ARG );
  1085. ]])
  1086. ]])
  1087. ]],
  1088. [[
  1089. m4_define( [[M4_YY_NO_PUSH_STATE]])
  1090. m4_define( [[M4_YY_NO_POP_STATE]])
  1091. m4_define( [[M4_YY_NO_TOP_STATE]])
  1092. ]])
  1093. %endif
  1094. /* Amount of stuff to slurp up with each read. */
  1095. #ifndef YY_READ_BUF_SIZE
  1096. #ifdef __ia64__
  1097. /* On IA-64, the buffer size is 16k, not 8k */
  1098. #define YY_READ_BUF_SIZE 16384
  1099. #else
  1100. #define YY_READ_BUF_SIZE 8192
  1101. #endif /* __ia64__ */
  1102. #endif
  1103. m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
  1104. [[
  1105. /* Copy whatever the last rule matched to the standard output. */
  1106. #ifndef ECHO
  1107. %if-c-only Standard (non-C++) definition
  1108. /* This used to be an fputs(), but since the string might contain NUL's,
  1109. * we now use fwrite().
  1110. */
  1111. #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
  1112. %endif
  1113. %if-c++-only C++ definition
  1114. #define ECHO LexerOutput( yytext, yyleng )
  1115. %endif
  1116. #endif
  1117. ]])
  1118. m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
  1119. [[
  1120. /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
  1121. * is returned in "result".
  1122. */
  1123. #ifndef YY_INPUT
  1124. #define YY_INPUT(buf,result,max_size) \
  1125. %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \
  1126. \
  1127. %if-c++-only C++ definition \
  1128. if ( (int)(result = LexerInput( (char *) buf, max_size )) < 0 ) \
  1129. YY_FATAL_ERROR( "input in flex scanner failed" );
  1130. %endif
  1131. #endif
  1132. ]])
  1133. m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
  1134. [[
  1135. /* No semi-colon after return; correct usage is to write "yyterminate();" -
  1136. * we don't want an extra ';' after the "return" because that will cause
  1137. * some compilers to complain about unreachable statements.
  1138. */
  1139. #ifndef yyterminate
  1140. #define yyterminate() return YY_NULL
  1141. #endif
  1142. ]])
  1143. /* Number of entries by which start-condition stack grows. */
  1144. #ifndef YY_START_STACK_INCR
  1145. #define YY_START_STACK_INCR 25
  1146. #endif
  1147. m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
  1148. [[
  1149. /* Report a fatal error. */
  1150. #ifndef YY_FATAL_ERROR
  1151. %if-c-only
  1152. #define YY_FATAL_ERROR(msg) yy_fatal_error( msg M4_YY_CALL_LAST_ARG)
  1153. %endif
  1154. %if-c++-only
  1155. #define YY_FATAL_ERROR(msg) LexerError( msg )
  1156. %endif
  1157. #endif
  1158. ]])
  1159. %if-tables-serialization structures and prototypes
  1160. #ifdef FLEX_SCANNER
  1161. /*
  1162. dnl tables_shared.h - tables serialization header
  1163. dnl
  1164. dnl Copyright (c) 1990 The Regents of the University of California.
  1165. dnl All rights reserved.
  1166. dnl
  1167. dnl This code is derived from software contributed to Berkeley by
  1168. dnl Vern Paxson.
  1169. dnl
  1170. dnl The United States Government has rights in this work pursuant
  1171. dnl to contract no. DE-AC03-76SF00098 between the United States
  1172. dnl Department of Energy and the University of California.
  1173. dnl
  1174. dnl This file is part of flex.
  1175. dnl
  1176. dnl Redistribution and use in source and binary forms, with or without
  1177. dnl modification, are permitted provided that the following conditions
  1178. dnl are met:
  1179. dnl
  1180. dnl 1. Redistributions of source code must retain the above copyright
  1181. dnl notice, this list of conditions and the following disclaimer.
  1182. dnl 2. Redistributions in binary form must reproduce the above copyright
  1183. dnl notice, this list of conditions and the following disclaimer in the
  1184. dnl documentation and/or other materials provided with the distribution.
  1185. dnl
  1186. dnl Neither the name of the University nor the names of its contributors
  1187. dnl may be used to endorse or promote products derived from this software
  1188. dnl without specific prior written permission.
  1189. dnl
  1190. dnl THIS SOFTWARE IS PROVIDED `AS IS' AND WITHOUT ANY EXPRESS OR
  1191. dnl IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  1192. dnl WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  1193. dnl PURPOSE.
  1194. dnl
  1195. dnl This file is meant to be included in both the skeleton and the actual
  1196. dnl flex code (hence the name "_shared").
  1197. */
  1198. #ifndef yyskel_static
  1199. #define yyskel_static static
  1200. #endif
  1201. #else
  1202. #ifndef yyskel_static
  1203. #define yyskel_static
  1204. #endif
  1205. #endif
  1206. /* Structures and prototypes for serializing flex tables. The
  1207. * binary format is documented in the manual.
  1208. *
  1209. * Design considerations:
  1210. *
  1211. * - The format allows many tables per file.
  1212. * - The tables can be streamed.
  1213. * - All data is stored in network byte order.
  1214. * - We do not hinder future unicode support.
  1215. * - We can lookup tables by name.
  1216. */
  1217. /** Magic number for serialized format. */
  1218. #ifndef YYTBL_MAGIC
  1219. #define YYTBL_MAGIC 0xF13C57B1
  1220. #endif
  1221. #ifndef YYTABLES_TYPES
  1222. #define YYTABLES_TYPES
  1223. /** Possible values for td_id field. Each one corresponds to a
  1224. * scanner table of the same name.
  1225. */
  1226. enum yytbl_id {
  1227. YYTD_ID_ACCEPT = 0x01, /**< 1-dim ints */
  1228. YYTD_ID_BASE = 0x02, /**< 1-dim ints */
  1229. YYTD_ID_CHK = 0x03, /**< 1-dim ints */
  1230. YYTD_ID_DEF = 0x04, /**< 1-dim ints */
  1231. YYTD_ID_EC = 0x05, /**< 1-dim ints */
  1232. YYTD_ID_META = 0x06, /**< 1-dim ints */
  1233. YYTD_ID_NUL_TRANS = 0x07, /**< 1-dim ints, maybe indices */
  1234. YYTD_ID_NXT = 0x08, /**< may be 2 dimensional ints */
  1235. YYTD_ID_RULE_CAN_MATCH_EOL = 0x09, /**< 1-dim ints */
  1236. YYTD_ID_START_STATE_LIST = 0x0A, /**< 1-dim indices into trans tbl */
  1237. YYTD_ID_TRANSITION = 0x0B, /**< structs */
  1238. YYTD_ID_ACCLIST = 0x0C /**< 1-dim ints */
  1239. };
  1240. /** bit flags for t_flags field of struct yytbl_data */
  1241. enum yytbl_flags {
  1242. /* These first three are mutually exclusive */
  1243. YYTD_DATA8 = 0x01, /**< data is an array of type flex_int8_t */
  1244. YYTD_DATA16 = 0x02, /**< data is an array of type flex_int16_t */
  1245. YYTD_DATA32 = 0x04, /**< data is an array of type flex_int32_t */
  1246. /* These two are mutually exclusive. */
  1247. YYTD_PTRANS = 0x08, /**< data is a list of indexes of entries
  1248. into the expanded yy_transition
  1249. array. See notes in manual. */
  1250. YYTD_STRUCT = 0x10 /**< data consists of yy_trans_info structs */
  1251. };
  1252. /* The serialized tables header. */
  1253. struct yytbl_hdr {
  1254. flex_uint32_t th_magic; /**< Must be 0xF13C57B1 (comes from "Flex Table") */
  1255. flex_uint32_t th_hsize; /**< Size of this header in bytes. */
  1256. flex_uint32_t th_ssize; /**< Size of this dataset, in bytes, including header. */
  1257. flex_uint16_t th_flags; /**< Currently unused, must be 0 */
  1258. char *th_version; /**< Flex version string. NUL terminated. */
  1259. char *th_name; /**< The name of this table set. NUL terminated. */
  1260. };
  1261. /** A single serialized table */
  1262. struct yytbl_data {
  1263. flex_uint16_t td_id; /**< enum yytbl_id table identifier */
  1264. flex_uint16_t td_flags; /**< how to interpret this data */
  1265. flex_uint32_t td_hilen; /**< num elements in highest dimension array */
  1266. flex_uint32_t td_lolen; /**< num elements in lowest dimension array */
  1267. void *td_data; /**< table data */
  1268. };
  1269. #endif
  1270. /** Extract corresponding data size_t from td_flags */
  1271. #ifndef YYTDFLAGS2BYTES
  1272. #define YYTDFLAGS2BYTES(td_flags)\
  1273. (((td_flags) & YYTD_DATA8)\
  1274. ? sizeof(flex_int8_t)\
  1275. :(((td_flags) & YYTD_DATA16)\
  1276. ? sizeof(flex_int16_t)\
  1277. :sizeof(flex_int32_t)))
  1278. #endif
  1279. #ifdef FLEX_SCANNER
  1280. %not-for-header
  1281. #endif
  1282. yyskel_static flex_int32_t yytbl_calc_total_len (const struct yytbl_data *tbl);
  1283. #ifdef FLEX_SCANNER
  1284. %ok-for-header
  1285. #endif
  1286. /* vim:set noexpandtab cindent tabstop=8 softtabstop=0 shiftwidth=8 textwidth=0: */
  1287. /* Load the DFA tables from the given stream. */
  1288. int yytables_fload (FILE * fp M4_YY_PROTO_LAST_ARG);
  1289. /* Unload the tables from memory. */
  1290. int yytables_destroy (M4_YY_PROTO_ONLY_ARG);
  1291. %not-for-header
  1292. /** Describes a mapping from a serialized table id to its deserialized state in
  1293. * this scanner. This is the bridge between our "generic" deserialization code
  1294. * and the specifics of this scanner.
  1295. */
  1296. struct yytbl_dmap {
  1297. enum yytbl_id dm_id;/**< table identifier */
  1298. void **dm_arr; /**< address of pointer to store the deserialized table. */
  1299. size_t dm_sz; /**< local sizeof() each element in table. */
  1300. };
  1301. /** A {0,0,0}-terminated list of structs, forming the map */
  1302. static struct yytbl_dmap yydmap[] =
  1303. {
  1304. %tables-yydmap generated elements
  1305. {0,0,0}
  1306. };
  1307. /** A tables-reader object to maintain some state in the read. */
  1308. struct yytbl_reader {
  1309. FILE * fp; /**< input stream */
  1310. flex_uint32_t bread; /**< bytes read since beginning of current tableset */
  1311. };
  1312. %endif
  1313. /* end tables serialization structures and prototypes */
  1314. %ok-for-header
  1315. /* Default declaration of generated scanner - a define so the user can
  1316. * easily add parameters.
  1317. */
  1318. #ifndef YY_DECL
  1319. #define YY_DECL_IS_OURS 1
  1320. %if-c-only Standard (non-C++) definition
  1321. m4_define( [[M4_YY_LEX_PROTO]], [[(M4_YY_PROTO_ONLY_ARG)]])
  1322. m4_define( [[M4_YY_LEX_DECLARATION]], [[(M4_YY_DEF_ONLY_ARG)]])
  1323. m4_ifdef( [[M4_YY_BISON_LVAL]],
  1324. [[
  1325. m4_dnl The bison pure parser is used. Redefine yylex to
  1326. m4_dnl accept the lval parameter.
  1327. m4_define( [[M4_YY_LEX_PROTO]], [[\]]
  1328. [[(YYSTYPE * yylval_param M4_YY_PROTO_LAST_ARG)]])
  1329. m4_define( [[M4_YY_LEX_DECLARATION]], [[\]]
  1330. [[YYFARGS1(YYSTYPE *,yylval_param)]])
  1331. ]])
  1332. m4_ifdef( [[<M4_YY_BISON_LLOC>]],
  1333. [[
  1334. m4_dnl Locations are used. yylex should also accept the ylloc parameter.
  1335. m4_define( [[M4_YY_LEX_PROTO]], [[\]]
  1336. [[(YYSTYPE * yylval_param, YYLTYPE * yylloc_param M4_YY_PROTO_LAST_ARG)]])
  1337. m4_define( [[M4_YY_LEX_DECLARATION]], [[\]]
  1338. [[YYFARGS2(YYSTYPE *,yylval_param, YYLTYPE *,yylloc_param)]])
  1339. ]])
  1340. extern int yylex M4_YY_LEX_PROTO;
  1341. #define YY_DECL int yylex M4_YY_LEX_DECLARATION
  1342. %endif
  1343. %if-c++-only C++ definition
  1344. #define YY_DECL int yyFlexLexer::yylex()
  1345. %endif
  1346. #endif /* !YY_DECL */
  1347. m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
  1348. [[
  1349. /* Code executed at the beginning of each rule, after yytext and yyleng
  1350. * have been set up.
  1351. */
  1352. #ifndef YY_USER_ACTION
  1353. #define YY_USER_ACTION
  1354. #endif
  1355. ]])
  1356. m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
  1357. [[
  1358. /* Code executed at the end of each rule. */
  1359. #ifndef YY_BREAK
  1360. #define YY_BREAK /*LINTED*/break;
  1361. #endif
  1362. ]])
  1363. m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
  1364. [[
  1365. %% [6.0] YY_RULE_SETUP definition goes here
  1366. ]])
  1367. %not-for-header
  1368. /** The main scanner function which does all the work.
  1369. */
  1370. YY_DECL
  1371. {
  1372. yy_state_type yy_current_state;
  1373. char *yy_cp, *yy_bp;
  1374. int yy_act;
  1375. M4_YY_DECL_GUTS_VAR();
  1376. m4_ifdef( [[M4_YY_NOT_REENTRANT]],
  1377. [[
  1378. m4_ifdef( [[M4_YY_BISON_LVAL]],
  1379. [[
  1380. YYSTYPE * yylval;
  1381. ]])
  1382. m4_ifdef( [[<M4_YY_BISON_LLOC>]],
  1383. [[
  1384. YYLTYPE * yylloc;
  1385. ]])
  1386. ]])
  1387. m4_ifdef( [[M4_YY_BISON_LVAL]],
  1388. [[
  1389. yylval = yylval_param;
  1390. ]])
  1391. m4_ifdef( [[<M4_YY_BISON_LLOC>]],
  1392. [[
  1393. yylloc = yylloc_param;
  1394. ]])
  1395. if ( !YY_G(yy_init) )
  1396. {
  1397. YY_G(yy_init) = 1;
  1398. #ifdef YY_USER_INIT
  1399. YY_USER_INIT;
  1400. #endif
  1401. m4_ifdef( [[M4_YY_USES_REJECT]],
  1402. [[
  1403. /* Create the reject buffer large enough to save one state per allowed character. */
  1404. if ( ! YY_G(yy_state_buf) )
  1405. YY_G(yy_state_buf) = (yy_state_type *)yyalloc(YY_STATE_BUF_SIZE M4_YY_CALL_LAST_ARG);
  1406. if ( ! YY_G(yy_state_buf) )
  1407. YY_FATAL_ERROR( "out of dynamic memory in yylex()" );
  1408. ]])
  1409. if ( ! YY_G(yy_start) )
  1410. YY_G(yy_start) = 1; /* first start state */
  1411. if ( ! yyin )
  1412. %if-c-only
  1413. yyin = stdin;
  1414. %endif
  1415. %if-c++-only
  1416. yyin.rdbuf(std::cin.rdbuf());
  1417. %endif
  1418. if ( ! yyout )
  1419. %if-c-only
  1420. yyout = stdout;
  1421. %endif
  1422. %if-c++-only
  1423. yyout.rdbuf(std::cout.rdbuf());
  1424. %endif
  1425. if ( ! YY_CURRENT_BUFFER ) {
  1426. yyensure_buffer_stack (M4_YY_CALL_ONLY_ARG);
  1427. YY_CURRENT_BUFFER_LVALUE =
  1428. yy_create_buffer( yyin, YY_BUF_SIZE M4_YY_CALL_LAST_ARG);
  1429. }
  1430. yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );
  1431. }
  1432. {
  1433. %% [7.0] user's declarations go here
  1434. while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
  1435. {
  1436. %% [8.0] yymore()-related code goes here
  1437. yy_cp = YY_G(yy_c_buf_p);
  1438. /* Support of yytext. */
  1439. *yy_cp = YY_G(yy_hold_char);
  1440. /* yy_bp points to the position in yy_ch_buf of the start of
  1441. * the current run.
  1442. */
  1443. yy_bp = yy_cp;
  1444. %% [9.0] code to set up and find next match goes here - scan-build says array subscript is undefined at the generated code yy_nxt[yy_current_state][ YY_SC_TO_UI(*yy_cp) ])
  1445. yy_find_action:
  1446. %% [10.0] code to find the action number goes here
  1447. YY_DO_BEFORE_ACTION;
  1448. %% [11.0] code for yylineno update goes here
  1449. do_action: /* This label is used only to access EOF actions. */
  1450. %% [12.0] debug code goes here
  1451. switch ( yy_act )
  1452. { /* beginning of action switch */
  1453. %% [13.0] actions go here
  1454. case YY_END_OF_BUFFER:
  1455. {
  1456. /* Amount of text matched not including the EOB char. */
  1457. int yy_amount_of_matched_text = (int) (yy_cp - YY_G(yytext_ptr)) - 1;
  1458. /* Undo the effects of YY_DO_BEFORE_ACTION. */
  1459. *yy_cp = YY_G(yy_hold_char);
  1460. YY_RESTORE_YY_MORE_OFFSET
  1461. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
  1462. {
  1463. /* We're scanning a new file or input source. It's
  1464. * possible that this happened because the user
  1465. * just pointed yyin at a new source and called
  1466. * yylex(). If so, then we have to assure
  1467. * consistency between YY_CURRENT_BUFFER and our
  1468. * globals. Here is the right place to do so, because
  1469. * this is the first action (other than possibly a
  1470. * back-up) that will match for the new input source.
  1471. */
  1472. YY_G(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  1473. %if-c-only
  1474. YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
  1475. %endif
  1476. %if-c++-only
  1477. YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin.rdbuf();
  1478. %endif
  1479. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
  1480. }
  1481. /* Note that here we test for yy_c_buf_p "<=" to the position
  1482. * of the first EOB in the buffer, since yy_c_buf_p will
  1483. * already have been incremented past the NUL character
  1484. * (since all states make transitions on EOB to the
  1485. * end-of-buffer state). Contrast this with the test
  1486. * in input().
  1487. */
  1488. if ( YY_G(yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars)] )
  1489. { /* This was really a NUL. */
  1490. yy_state_type yy_next_state;
  1491. YY_G(yy_c_buf_p) = YY_G(yytext_ptr) + yy_amount_of_matched_text;
  1492. yy_current_state = yy_get_previous_state( M4_YY_CALL_ONLY_ARG );
  1493. /* Okay, we're now positioned to make the NUL
  1494. * transition. We couldn't have
  1495. * yy_get_previous_state() go ahead and do it
  1496. * for us because it doesn't know how to deal
  1497. * with the possibility of jamming (and we don't
  1498. * want to build jamming into it because then it
  1499. * will run more slowly).
  1500. */
  1501. yy_next_state = yy_try_NUL_trans( yy_current_state M4_YY_CALL_LAST_ARG);
  1502. yy_bp = YY_G(yytext_ptr) + YY_MORE_ADJ;
  1503. if ( yy_next_state )
  1504. {
  1505. /* Consume the NUL. */
  1506. yy_cp = ++YY_G(yy_c_buf_p);
  1507. yy_current_state = yy_next_state;
  1508. goto yy_match;
  1509. }
  1510. else
  1511. {
  1512. %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here
  1513. goto yy_find_action;
  1514. }
  1515. }
  1516. else switch ( yy_get_next_buffer( M4_YY_CALL_ONLY_ARG ) )
  1517. {
  1518. case EOB_ACT_END_OF_FILE:
  1519. {
  1520. YY_G(yy_did_buffer_switch_on_eof) = 0;
  1521. if ( yywrap( M4_YY_CALL_ONLY_ARG ) )
  1522. {
  1523. /* Note: because we've taken care in
  1524. * yy_get_next_buffer() to have set up
  1525. * yytext, we can now set up
  1526. * yy_c_buf_p so that if some total
  1527. * hoser (like flex itself) wants to
  1528. * call the scanner after we return the
  1529. * YY_NULL, it'll still work - another
  1530. * YY_NULL will get returned.
  1531. */
  1532. YY_G(yy_c_buf_p) = YY_G(yytext_ptr) + YY_MORE_ADJ;
  1533. yy_act = YY_STATE_EOF(YY_START);
  1534. goto do_action;
  1535. }
  1536. else
  1537. {
  1538. if ( ! YY_G(yy_did_buffer_switch_on_eof) )
  1539. YY_NEW_FILE;
  1540. }
  1541. break;
  1542. }
  1543. case EOB_ACT_CONTINUE_SCAN:
  1544. YY_G(yy_c_buf_p) =
  1545. YY_G(yytext_ptr) + yy_amount_of_matched_text;
  1546. yy_current_state = yy_get_previous_state( M4_YY_CALL_ONLY_ARG );
  1547. yy_cp = YY_G(yy_c_buf_p);
  1548. yy_bp = YY_G(yytext_ptr) + YY_MORE_ADJ;
  1549. goto yy_match;
  1550. case EOB_ACT_LAST_MATCH:
  1551. YY_G(yy_c_buf_p) =
  1552. &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars)];
  1553. yy_current_state = yy_get_previous_state( M4_YY_CALL_ONLY_ARG );
  1554. yy_cp = YY_G(yy_c_buf_p);
  1555. yy_bp = YY_G(yytext_ptr) + YY_MORE_ADJ;
  1556. goto yy_find_action;
  1557. }
  1558. break;
  1559. }
  1560. default:
  1561. YY_FATAL_ERROR(
  1562. "fatal flex scanner internal error--no action found" );
  1563. break;
  1564. } /* end of action switch */
  1565. } /* end of scanning one token */
  1566. } /* end of user's declarations */
  1567. } /* end of yylex */
  1568. %ok-for-header
  1569. %if-c++-only
  1570. %not-for-header
  1571. /* The contents of this function are C++ specific, so the YY_G macro is not used.
  1572. * This constructor simply maintains backward compatibility.
  1573. * DEPRECATED
  1574. */
  1575. yyFlexLexer::yyFlexLexer( std::istream* arg_yyin, std::ostream* arg_yyout ):
  1576. yyin(arg_yyin ? arg_yyin->rdbuf() : std::cin.rdbuf()),
  1577. yyout(arg_yyout ? arg_yyout->rdbuf() : std::cout.rdbuf())
  1578. {
  1579. ctor_common();
  1580. }
  1581. /* The contents of this function are C++ specific, so the YY_G macro is not used.
  1582. */
  1583. yyFlexLexer::yyFlexLexer( std::istream& arg_yyin, std::ostream& arg_yyout ):
  1584. yyin(arg_yyin.rdbuf()),
  1585. yyout(arg_yyout.rdbuf())
  1586. {
  1587. ctor_common();
  1588. }
  1589. /* The contents of this function are C++ specific, so the YY_G macro is not used.
  1590. */
  1591. void yyFlexLexer::ctor_common()
  1592. {
  1593. yy_c_buf_p = 0;
  1594. yy_init = 0;
  1595. yy_start = 0;
  1596. yy_flex_debug = 0;
  1597. yylineno = 1; // this will only get updated if %option yylineno
  1598. yy_did_buffer_switch_on_eof = 0;
  1599. yy_looking_for_trail_begin = 0;
  1600. yy_more_flag = 0;
  1601. yy_more_len = 0;
  1602. yy_more_offset = yy_prev_more_offset = 0;
  1603. yy_start_stack_ptr = yy_start_stack_depth = 0;
  1604. yy_start_stack = NULL;
  1605. yy_buffer_stack = NULL;
  1606. yy_buffer_stack_top = 0;
  1607. yy_buffer_stack_max = 0;
  1608. m4_ifdef( [[M4_YY_USES_REJECT]],
  1609. [[
  1610. yy_state_buf = new yy_state_type[YY_STATE_BUF_SIZE];
  1611. ]],
  1612. [[
  1613. yy_state_buf = 0;
  1614. ]])
  1615. }
  1616. /* The contents of this function are C++ specific, so the YY_G macro is not used.
  1617. */
  1618. yyFlexLexer::~yyFlexLexer()
  1619. {
  1620. delete [] yy_state_buf;
  1621. yyfree( yy_start_stack M4_YY_CALL_LAST_ARG );
  1622. yy_delete_buffer( YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG);
  1623. yyfree( yy_buffer_stack M4_YY_CALL_LAST_ARG );
  1624. }
  1625. /* The contents of this function are C++ specific, so the YY_G macro is not used.
  1626. */
  1627. void yyFlexLexer::switch_streams( std::istream& new_in, std::ostream& new_out )
  1628. {
  1629. // was if( new_in )
  1630. yy_delete_buffer( YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG);
  1631. yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE M4_YY_CALL_LAST_ARG) M4_YY_CALL_LAST_ARG);
  1632. // was if( new_out )
  1633. yyout.rdbuf(new_out.rdbuf());
  1634. }
  1635. /* The contents of this function are C++ specific, so the YY_G macro is not used.
  1636. */
  1637. void yyFlexLexer::switch_streams( std::istream* new_in, std::ostream* new_out )
  1638. {
  1639. if( ! new_in ) {
  1640. new_in = &yyin;
  1641. }
  1642. if ( ! new_out ) {
  1643. new_out = &yyout;
  1644. }
  1645. switch_streams(*new_in, *new_out);
  1646. }
  1647. #ifdef YY_INTERACTIVE
  1648. int yyFlexLexer::LexerInput( char* buf, int /* max_size */ )
  1649. #else
  1650. int yyFlexLexer::LexerInput( char* buf, int max_size )
  1651. #endif
  1652. {
  1653. if ( yyin.eof() || yyin.fail() )
  1654. return 0;
  1655. #ifdef YY_INTERACTIVE
  1656. yyin.get( buf[0] );
  1657. if ( yyin.eof() )
  1658. return 0;
  1659. if ( yyin.bad() )
  1660. return -1;
  1661. return 1;
  1662. #else
  1663. (void) yyin.read( buf, max_size );
  1664. if ( yyin.bad() )
  1665. return -1;
  1666. else
  1667. return yyin.gcount();
  1668. #endif
  1669. }
  1670. void yyFlexLexer::LexerOutput( const char* buf, int size )
  1671. {
  1672. (void) yyout.write( buf, size );
  1673. }
  1674. %ok-for-header
  1675. %endif
  1676. m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
  1677. [[
  1678. /* yy_get_next_buffer - try to read in a new buffer
  1679. *
  1680. * Returns a code representing an action:
  1681. * EOB_ACT_LAST_MATCH -
  1682. * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  1683. * EOB_ACT_END_OF_FILE - end of file
  1684. */
  1685. %if-c-only
  1686. static int yy_get_next_buffer (M4_YY_DEF_ONLY_ARG)
  1687. %endif
  1688. %if-c++-only
  1689. int yyFlexLexer::yy_get_next_buffer()
  1690. %endif
  1691. {
  1692. M4_YY_DECL_GUTS_VAR();
  1693. char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
  1694. char *source = YY_G(yytext_ptr);
  1695. int number_to_move, i;
  1696. int ret_val;
  1697. if ( YY_G(yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars) + 1] )
  1698. YY_FATAL_ERROR(
  1699. "fatal flex scanner internal error--end of buffer missed" );
  1700. if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
  1701. { /* Don't try to fill the buffer, so this is an EOF. */
  1702. if ( YY_G(yy_c_buf_p) - YY_G(yytext_ptr) - YY_MORE_ADJ == 1 )
  1703. {
  1704. /* We matched a single character, the EOB, so
  1705. * treat this as a final EOF.
  1706. */
  1707. return EOB_ACT_END_OF_FILE;
  1708. }
  1709. else
  1710. {
  1711. /* We matched some text prior to the EOB, first
  1712. * process it.
  1713. */
  1714. return EOB_ACT_LAST_MATCH;
  1715. }
  1716. }
  1717. /* Try to read more data. */
  1718. /* First move last chars to start of buffer. */
  1719. number_to_move = (int) (YY_G(yy_c_buf_p) - YY_G(yytext_ptr) - 1);
  1720. for ( i = 0; i < number_to_move; ++i )
  1721. *(dest++) = *(source++);
  1722. if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
  1723. /* don't do the read, it's not guaranteed to return an EOF,
  1724. * just force an EOF
  1725. */
  1726. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = YY_G(yy_n_chars) = 0;
  1727. else
  1728. {
  1729. int num_to_read =
  1730. YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
  1731. while ( num_to_read <= 0 )
  1732. { /* Not enough room in the buffer - grow it. */
  1733. m4_ifdef( [[M4_YY_USES_REJECT]],
  1734. [[
  1735. YY_FATAL_ERROR(
  1736. "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
  1737. ]],
  1738. [[
  1739. /* just a shorter name for the current buffer */
  1740. YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
  1741. int yy_c_buf_p_offset =
  1742. (int) (YY_G(yy_c_buf_p) - b->yy_ch_buf);
  1743. if ( b->yy_is_our_buffer )
  1744. {
  1745. int new_size = b->yy_buf_size * 2;
  1746. if ( new_size <= 0 )
  1747. b->yy_buf_size += b->yy_buf_size / 8;
  1748. else
  1749. b->yy_buf_size *= 2;
  1750. b->yy_ch_buf = (char *)
  1751. /* Include room in for 2 EOB chars. */
  1752. yyrealloc( (void *) b->yy_ch_buf,
  1753. (yy_size_t) (b->yy_buf_size + 2) M4_YY_CALL_LAST_ARG );
  1754. }
  1755. else
  1756. /* Can't grow it, we don't own it. */
  1757. b->yy_ch_buf = NULL;
  1758. if ( ! b->yy_ch_buf )
  1759. YY_FATAL_ERROR(
  1760. "fatal error - scanner input buffer overflow" );
  1761. YY_G(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
  1762. num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
  1763. number_to_move - 1;
  1764. ]])
  1765. }
  1766. if ( num_to_read > YY_READ_BUF_SIZE )
  1767. num_to_read = YY_READ_BUF_SIZE;
  1768. /* Read in more data. */
  1769. YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
  1770. YY_G(yy_n_chars), num_to_read );
  1771. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = YY_G(yy_n_chars);
  1772. }
  1773. if ( YY_G(yy_n_chars) == 0 )
  1774. {
  1775. if ( number_to_move == YY_MORE_ADJ )
  1776. {
  1777. ret_val = EOB_ACT_END_OF_FILE;
  1778. yyrestart( yyin M4_YY_CALL_LAST_ARG);
  1779. }
  1780. else
  1781. {
  1782. ret_val = EOB_ACT_LAST_MATCH;
  1783. YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
  1784. YY_BUFFER_EOF_PENDING;
  1785. }
  1786. }
  1787. else
  1788. ret_val = EOB_ACT_CONTINUE_SCAN;
  1789. if ((YY_G(yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
  1790. /* Extend the array by 50%, plus the number we really need. */
  1791. int new_size = YY_G(yy_n_chars) + number_to_move + (YY_G(yy_n_chars) >> 1);
  1792. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
  1793. (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size M4_YY_CALL_LAST_ARG );
  1794. if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
  1795. YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
  1796. /* "- 2" to take care of EOB's */
  1797. YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
  1798. }
  1799. YY_G(yy_n_chars) += number_to_move;
  1800. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
  1801. YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
  1802. YY_G(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
  1803. return ret_val;
  1804. }
  1805. ]])
  1806. /* yy_get_previous_state - get the state just before the EOB char was reached */
  1807. %if-c-only
  1808. %not-for-header
  1809. static yy_state_type yy_get_previous_state (M4_YY_DEF_ONLY_ARG)
  1810. %endif
  1811. %if-c++-only
  1812. yy_state_type yyFlexLexer::yy_get_previous_state()
  1813. %endif
  1814. {
  1815. yy_state_type yy_current_state;
  1816. char *yy_cp;
  1817. M4_YY_DECL_GUTS_VAR();
  1818. %% [15.0] code to get the start state into yy_current_state goes here
  1819. for ( yy_cp = YY_G(yytext_ptr) + YY_MORE_ADJ; yy_cp < YY_G(yy_c_buf_p); ++yy_cp )
  1820. {
  1821. %% [16.0] code to find the next state goes here
  1822. }
  1823. return yy_current_state;
  1824. }
  1825. /* yy_try_NUL_trans - try to make a transition on the NUL character
  1826. *
  1827. * synopsis
  1828. * next_state = yy_try_NUL_trans( current_state );
  1829. */
  1830. %if-c-only
  1831. static yy_state_type yy_try_NUL_trans YYFARGS1( yy_state_type, yy_current_state)
  1832. %endif
  1833. %if-c++-only
  1834. yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state )
  1835. %endif
  1836. {
  1837. int yy_is_jam;
  1838. M4_YY_DECL_GUTS_VAR(); /* This var may be unused depending upon options. */
  1839. %% [17.0] code to find the next state, and perhaps do backing up, goes here
  1840. M4_YY_NOOP_GUTS_VAR();
  1841. return yy_is_jam ? 0 : yy_current_state;
  1842. }
  1843. #ifndef YY_NO_UNPUT
  1844. %if-c-only
  1845. m4_ifdef( [[M4_YY_NO_UNPUT]],,
  1846. [[
  1847. static void yyunput YYFARGS2( int,c, char *,yy_bp)
  1848. %endif
  1849. %if-c++-only
  1850. void yyFlexLexer::yyunput( int c, char* yy_bp)
  1851. %endif
  1852. {
  1853. char *yy_cp;
  1854. M4_YY_DECL_GUTS_VAR();
  1855. yy_cp = YY_G(yy_c_buf_p);
  1856. /* undo effects of setting up yytext */
  1857. *yy_cp = YY_G(yy_hold_char);
  1858. if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
  1859. { /* need to shift things up to make room */
  1860. /* +2 for EOB chars. */
  1861. int number_to_move = YY_G(yy_n_chars) + 2;
  1862. char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
  1863. YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
  1864. char *source =
  1865. &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
  1866. while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
  1867. *--dest = *--source;
  1868. yy_cp += (int) (dest - source);
  1869. yy_bp += (int) (dest - source);
  1870. YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
  1871. YY_G(yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
  1872. if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
  1873. YY_FATAL_ERROR( "flex scanner push-back overflow" );
  1874. }
  1875. *--yy_cp = (char) c;
  1876. %% [18.0] update yylineno here
  1877. m4_ifdef( [[M4_YY_USE_LINENO]],
  1878. [[
  1879. if ( c == '\n' ){
  1880. --yylineno;
  1881. }
  1882. ]])
  1883. YY_G(yytext_ptr) = yy_bp;
  1884. YY_G(yy_hold_char) = *yy_cp;
  1885. YY_G(yy_c_buf_p) = yy_cp;
  1886. }
  1887. %if-c-only
  1888. ]])
  1889. %endif
  1890. #endif
  1891. %if-c-only
  1892. #ifndef YY_NO_INPUT
  1893. #ifdef __cplusplus
  1894. static int yyinput (M4_YY_DEF_ONLY_ARG)
  1895. #else
  1896. static int input (M4_YY_DEF_ONLY_ARG)
  1897. #endif
  1898. %endif
  1899. %if-c++-only
  1900. int yyFlexLexer::yyinput()
  1901. %endif
  1902. {
  1903. int c;
  1904. M4_YY_DECL_GUTS_VAR();
  1905. *YY_G(yy_c_buf_p) = YY_G(yy_hold_char);
  1906. if ( *YY_G(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
  1907. {
  1908. /* yy_c_buf_p now points to the character we want to return.
  1909. * If this occurs *before* the EOB characters, then it's a
  1910. * valid NUL; if not, then we've hit the end of the buffer.
  1911. */
  1912. if ( YY_G(yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars)] )
  1913. /* This was really a NUL. */
  1914. *YY_G(yy_c_buf_p) = '\0';
  1915. else
  1916. { /* need more input */
  1917. int offset = (int) (YY_G(yy_c_buf_p) - YY_G(yytext_ptr));
  1918. ++YY_G(yy_c_buf_p);
  1919. switch ( yy_get_next_buffer( M4_YY_CALL_ONLY_ARG ) )
  1920. {
  1921. case EOB_ACT_LAST_MATCH:
  1922. /* This happens because yy_g_n_b()
  1923. * sees that we've accumulated a
  1924. * token and flags that we need to
  1925. * try matching the token before
  1926. * proceeding. But for input(),
  1927. * there's no matching to consider.
  1928. * So convert the EOB_ACT_LAST_MATCH
  1929. * to EOB_ACT_END_OF_FILE.
  1930. */
  1931. /* Reset buffer status. */
  1932. yyrestart( yyin M4_YY_CALL_LAST_ARG);
  1933. /*FALLTHROUGH*/
  1934. case EOB_ACT_END_OF_FILE:
  1935. {
  1936. if ( yywrap( M4_YY_CALL_ONLY_ARG ) )
  1937. return 0;
  1938. if ( ! YY_G(yy_did_buffer_switch_on_eof) )
  1939. YY_NEW_FILE;
  1940. #ifdef __cplusplus
  1941. return yyinput(M4_YY_CALL_ONLY_ARG);
  1942. #else
  1943. return input(M4_YY_CALL_ONLY_ARG);
  1944. #endif
  1945. }
  1946. case EOB_ACT_CONTINUE_SCAN:
  1947. YY_G(yy_c_buf_p) = YY_G(yytext_ptr) + offset;
  1948. break;
  1949. }
  1950. }
  1951. }
  1952. c = *(unsigned char *) YY_G(yy_c_buf_p); /* cast for 8-bit char's */
  1953. *YY_G(yy_c_buf_p) = '\0'; /* preserve yytext */
  1954. YY_G(yy_hold_char) = *++YY_G(yy_c_buf_p);
  1955. %% [19.0] update BOL and yylineno
  1956. return c;
  1957. }
  1958. %if-c-only
  1959. #endif /* ifndef YY_NO_INPUT */
  1960. %endif
  1961. /** Immediately switch to a different input stream.
  1962. * @param input_file A readable stream.
  1963. * M4_YY_DOC_PARAM
  1964. * @note This function does not reset the start condition to @c INITIAL .
  1965. */
  1966. %if-c-only
  1967. void yyrestart YYFARGS1( FILE *,input_file)
  1968. %endif
  1969. %if-c++-only
  1970. void yyFlexLexer::yyrestart( std::istream& input_file )
  1971. %endif
  1972. {
  1973. M4_YY_DECL_GUTS_VAR();
  1974. if ( ! YY_CURRENT_BUFFER ){
  1975. yyensure_buffer_stack (M4_YY_CALL_ONLY_ARG);
  1976. YY_CURRENT_BUFFER_LVALUE =
  1977. yy_create_buffer( yyin, YY_BUF_SIZE M4_YY_CALL_LAST_ARG);
  1978. }
  1979. yy_init_buffer( YY_CURRENT_BUFFER, input_file M4_YY_CALL_LAST_ARG);
  1980. yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );
  1981. }
  1982. %if-c++-only
  1983. /** Delegate to the new version that takes an istream reference.
  1984. * @param input_file A readable stream.
  1985. * M4_YY_DOC_PARAM
  1986. * @note This function does not reset the start condition to @c INITIAL .
  1987. */
  1988. void yyFlexLexer::yyrestart( std::istream* input_file )
  1989. {
  1990. if( ! input_file ) {
  1991. input_file = &yyin;
  1992. }
  1993. yyrestart( *input_file );
  1994. }
  1995. %endif
  1996. /** Switch to a different input buffer.
  1997. * @param new_buffer The new input buffer.
  1998. * M4_YY_DOC_PARAM
  1999. */
  2000. %if-c-only
  2001. void yy_switch_to_buffer YYFARGS1( YY_BUFFER_STATE ,new_buffer)
  2002. %endif
  2003. %if-c++-only
  2004. void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
  2005. %endif
  2006. {
  2007. M4_YY_DECL_GUTS_VAR();
  2008. /* TODO. We should be able to replace this entire function body
  2009. * with
  2010. * yypop_buffer_state();
  2011. * yypush_buffer_state(new_buffer);
  2012. */
  2013. yyensure_buffer_stack (M4_YY_CALL_ONLY_ARG);
  2014. if ( YY_CURRENT_BUFFER == new_buffer )
  2015. return;
  2016. if ( YY_CURRENT_BUFFER )
  2017. {
  2018. /* Flush out information for old buffer. */
  2019. *YY_G(yy_c_buf_p) = YY_G(yy_hold_char);
  2020. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = YY_G(yy_c_buf_p);
  2021. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = YY_G(yy_n_chars);
  2022. }
  2023. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  2024. yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );
  2025. /* We don't actually know whether we did this switch during
  2026. * EOF (yywrap()) processing, but the only time this flag
  2027. * is looked at is after yywrap() is called, so it's safe
  2028. * to go ahead and always set it.
  2029. */
  2030. YY_G(yy_did_buffer_switch_on_eof) = 1;
  2031. }
  2032. %if-c-only
  2033. static void yy_load_buffer_state (M4_YY_DEF_ONLY_ARG)
  2034. %endif
  2035. %if-c++-only
  2036. void yyFlexLexer::yy_load_buffer_state()
  2037. %endif
  2038. {
  2039. M4_YY_DECL_GUTS_VAR();
  2040. YY_G(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
  2041. YY_G(yytext_ptr) = YY_G(yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
  2042. %if-c-only
  2043. yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
  2044. %endif
  2045. %if-c++-only
  2046. yyin.rdbuf(YY_CURRENT_BUFFER_LVALUE->yy_input_file);
  2047. %endif
  2048. YY_G(yy_hold_char) = *YY_G(yy_c_buf_p);
  2049. }
  2050. /** Allocate and initialize an input buffer state.
  2051. * @param file A readable stream.
  2052. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
  2053. * M4_YY_DOC_PARAM
  2054. * @return the allocated buffer state.
  2055. */
  2056. %if-c-only
  2057. YY_BUFFER_STATE yy_create_buffer YYFARGS2( FILE *,file, int ,size)
  2058. %endif
  2059. %if-c++-only
  2060. YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream& file, int size )
  2061. %endif
  2062. {
  2063. YY_BUFFER_STATE b;
  2064. m4_dnl M4_YY_DECL_GUTS_VAR();
  2065. b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) M4_YY_CALL_LAST_ARG );
  2066. if ( ! b )
  2067. YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  2068. b->yy_buf_size = size;
  2069. /* yy_ch_buf has to be 2 characters longer than the size given because
  2070. * we need to put in 2 end-of-buffer characters.
  2071. */
  2072. b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) M4_YY_CALL_LAST_ARG );
  2073. if ( ! b->yy_ch_buf ) {
  2074. yyfree (b);
  2075. YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  2076. }
  2077. b->yy_is_our_buffer = 1;
  2078. yy_init_buffer( b, file M4_YY_CALL_LAST_ARG);
  2079. return b;
  2080. }
  2081. %if-c++-only
  2082. /** Delegate creation of buffers to the new version that takes an istream reference.
  2083. * @param file A readable stream.
  2084. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
  2085. * M4_YY_DOC_PARAM
  2086. * @return the allocated buffer state.
  2087. */
  2088. YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size )
  2089. {
  2090. return yy_create_buffer( *file, size );
  2091. }
  2092. %endif
  2093. /** Destroy the buffer.
  2094. * @param b a buffer created with yy_create_buffer()
  2095. * M4_YY_DOC_PARAM
  2096. */
  2097. %if-c-only
  2098. void yy_delete_buffer YYFARGS1( YY_BUFFER_STATE ,b)
  2099. %endif
  2100. %if-c++-only
  2101. void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b )
  2102. %endif
  2103. {
  2104. M4_YY_DECL_GUTS_VAR();
  2105. if ( ! b )
  2106. return;
  2107. if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
  2108. YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
  2109. if ( b->yy_is_our_buffer )
  2110. yyfree( (void *) b->yy_ch_buf M4_YY_CALL_LAST_ARG );
  2111. yyfree( (void *) b M4_YY_CALL_LAST_ARG );
  2112. }
  2113. /* Initializes or reinitializes a buffer.
  2114. * This function is sometimes called more than once on the same buffer,
  2115. * such as during a yyrestart() or at EOF.
  2116. */
  2117. %if-c-only
  2118. static void yy_init_buffer YYFARGS2( YY_BUFFER_STATE ,b, FILE *,file)
  2119. %endif
  2120. %if-c++-only
  2121. void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, std::istream& file )
  2122. %endif
  2123. {
  2124. int oerrno = errno;
  2125. M4_YY_DECL_GUTS_VAR();
  2126. if (b == NULL) {
  2127. /* shouldnothappen */
  2128. return;
  2129. }
  2130. yy_flush_buffer( b M4_YY_CALL_LAST_ARG);
  2131. %if-c-only
  2132. b->yy_input_file = file;
  2133. %endif
  2134. %if-c++-only
  2135. b->yy_input_file = file.rdbuf();
  2136. %endif
  2137. b->yy_fill_buffer = 1;
  2138. /* If b is the current buffer, then yy_init_buffer was _probably_
  2139. * called from yyrestart() or through yy_get_next_buffer.
  2140. * In that case, we don't want to reset the lineno or column.
  2141. */
  2142. if (b != YY_CURRENT_BUFFER){
  2143. b->yy_bs_lineno = 1;
  2144. b->yy_bs_column = 0;
  2145. }
  2146. %if-c-only
  2147. m4_ifdef( [[M4_YY_ALWAYS_INTERACTIVE]],
  2148. [[
  2149. b->yy_is_interactive = 1;
  2150. ]],
  2151. [[
  2152. m4_ifdef( [[M4_YY_NEVER_INTERACTIVE]],
  2153. [[
  2154. b->yy_is_interactive = 0;
  2155. ]],
  2156. [[
  2157. b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
  2158. ]])
  2159. ]])
  2160. %endif
  2161. %if-c++-only
  2162. b->yy_is_interactive = 0;
  2163. %endif
  2164. errno = oerrno;
  2165. }
  2166. /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
  2167. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
  2168. * M4_YY_DOC_PARAM
  2169. */
  2170. %if-c-only
  2171. void yy_flush_buffer YYFARGS1( YY_BUFFER_STATE ,b)
  2172. %endif
  2173. %if-c++-only
  2174. void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b )
  2175. %endif
  2176. {
  2177. M4_YY_DECL_GUTS_VAR();
  2178. if ( ! b )
  2179. return;
  2180. b->yy_n_chars = 0;
  2181. /* We always need two end-of-buffer characters. The first causes
  2182. * a transition to the end-of-buffer state. The second causes
  2183. * a jam in that state.
  2184. */
  2185. b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
  2186. b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  2187. b->yy_buf_pos = &b->yy_ch_buf[0];
  2188. b->yy_at_bol = 1;
  2189. b->yy_buffer_status = YY_BUFFER_NEW;
  2190. if ( b == YY_CURRENT_BUFFER )
  2191. yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );
  2192. }
  2193. %if-c-or-c++
  2194. /** Pushes the new state onto the stack. The new state becomes
  2195. * the current state. This function will allocate the stack
  2196. * if necessary.
  2197. * @param new_buffer The new state.
  2198. * M4_YY_DOC_PARAM
  2199. */
  2200. %if-c-only
  2201. void yypush_buffer_state YYFARGS1(YY_BUFFER_STATE,new_buffer)
  2202. %endif
  2203. %if-c++-only
  2204. void yyFlexLexer::yypush_buffer_state (YY_BUFFER_STATE new_buffer)
  2205. %endif
  2206. {
  2207. M4_YY_DECL_GUTS_VAR();
  2208. if (new_buffer == NULL)
  2209. return;
  2210. yyensure_buffer_stack(M4_YY_CALL_ONLY_ARG);
  2211. /* This block is copied from yy_switch_to_buffer. */
  2212. if ( YY_CURRENT_BUFFER )
  2213. {
  2214. /* Flush out information for old buffer. */
  2215. *YY_G(yy_c_buf_p) = YY_G(yy_hold_char);
  2216. YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = YY_G(yy_c_buf_p);
  2217. YY_CURRENT_BUFFER_LVALUE->yy_n_chars = YY_G(yy_n_chars);
  2218. }
  2219. /* Only push if top exists. Otherwise, replace top. */
  2220. if (YY_CURRENT_BUFFER)
  2221. YY_G(yy_buffer_stack_top)++;
  2222. YY_CURRENT_BUFFER_LVALUE = new_buffer;
  2223. /* copied from yy_switch_to_buffer. */
  2224. yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );
  2225. YY_G(yy_did_buffer_switch_on_eof) = 1;
  2226. }
  2227. %endif
  2228. %if-c-or-c++
  2229. /** Removes and deletes the top of the stack, if present.
  2230. * The next element becomes the new top.
  2231. * M4_YY_DOC_PARAM
  2232. */
  2233. %if-c-only
  2234. void yypop_buffer_state (M4_YY_DEF_ONLY_ARG)
  2235. %endif
  2236. %if-c++-only
  2237. void yyFlexLexer::yypop_buffer_state (void)
  2238. %endif
  2239. {
  2240. M4_YY_DECL_GUTS_VAR();
  2241. if (!YY_CURRENT_BUFFER)
  2242. return;
  2243. yy_delete_buffer(YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG);
  2244. YY_CURRENT_BUFFER_LVALUE = NULL;
  2245. if (YY_G(yy_buffer_stack_top) > 0)
  2246. --YY_G(yy_buffer_stack_top);
  2247. if (YY_CURRENT_BUFFER) {
  2248. yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );
  2249. YY_G(yy_did_buffer_switch_on_eof) = 1;
  2250. }
  2251. }
  2252. %endif
  2253. %if-c-or-c++
  2254. /* Allocates the stack if it does not exist.
  2255. * Guarantees space for at least one push.
  2256. */
  2257. %if-c-only
  2258. static void yyensure_buffer_stack (M4_YY_DEF_ONLY_ARG)
  2259. %endif
  2260. %if-c++-only
  2261. void yyFlexLexer::yyensure_buffer_stack(void)
  2262. %endif
  2263. {
  2264. yy_size_t num_to_alloc;
  2265. M4_YY_DECL_GUTS_VAR();
  2266. if (!YY_G(yy_buffer_stack)) {
  2267. /* First allocation is just for 2 elements, since we don't know if this
  2268. * scanner will even need a stack. We use 2 instead of 1 to avoid an
  2269. * immediate realloc on the next call.
  2270. */
  2271. num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
  2272. YY_G(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
  2273. (num_to_alloc * sizeof(struct yy_buffer_state*)
  2274. M4_YY_CALL_LAST_ARG);
  2275. if ( ! YY_G(yy_buffer_stack) )
  2276. YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
  2277. memset(YY_G(yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
  2278. YY_G(yy_buffer_stack_max) = num_to_alloc;
  2279. YY_G(yy_buffer_stack_top) = 0;
  2280. return;
  2281. }
  2282. if (YY_G(yy_buffer_stack_top) >= (YY_G(yy_buffer_stack_max)) - 1){
  2283. /* Increase the buffer to prepare for a possible push. */
  2284. yy_size_t grow_size = 8 /* arbitrary grow size */;
  2285. num_to_alloc = YY_G(yy_buffer_stack_max) + grow_size;
  2286. YY_G(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
  2287. (YY_G(yy_buffer_stack),
  2288. num_to_alloc * sizeof(struct yy_buffer_state*)
  2289. M4_YY_CALL_LAST_ARG);
  2290. if ( ! YY_G(yy_buffer_stack) )
  2291. YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
  2292. /* zero only the new slots.*/
  2293. memset(YY_G(yy_buffer_stack) + YY_G(yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
  2294. YY_G(yy_buffer_stack_max) = num_to_alloc;
  2295. }
  2296. }
  2297. %endif
  2298. m4_ifdef( [[M4_YY_NO_SCAN_BUFFER]],,
  2299. [[
  2300. %if-c-only
  2301. /** Setup the input buffer state to scan directly from a user-specified character buffer.
  2302. * @param base the character buffer
  2303. * @param size the size in bytes of the character buffer
  2304. * M4_YY_DOC_PARAM
  2305. * @return the newly allocated buffer state object.
  2306. */
  2307. YY_BUFFER_STATE yy_scan_buffer YYFARGS2( char *,base, yy_size_t ,size)
  2308. {
  2309. YY_BUFFER_STATE b;
  2310. m4_dnl M4_YY_DECL_GUTS_VAR();
  2311. if ( size < 2 ||
  2312. base[size-2] != YY_END_OF_BUFFER_CHAR ||
  2313. base[size-1] != YY_END_OF_BUFFER_CHAR )
  2314. /* They forgot to leave room for the EOB's. */
  2315. return NULL;
  2316. b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) M4_YY_CALL_LAST_ARG );
  2317. if ( ! b ) {
  2318. YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
  2319. }
  2320. b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
  2321. b->yy_buf_pos = b->yy_ch_buf = base;
  2322. b->yy_is_our_buffer = 0;
  2323. b->yy_input_file = NULL;
  2324. b->yy_n_chars = b->yy_buf_size;
  2325. b->yy_is_interactive = 0;
  2326. b->yy_at_bol = 1;
  2327. b->yy_fill_buffer = 0;
  2328. b->yy_buffer_status = YY_BUFFER_NEW;
  2329. yy_switch_to_buffer( b M4_YY_CALL_LAST_ARG );
  2330. return b;
  2331. }
  2332. %endif
  2333. ]])
  2334. m4_ifdef( [[M4_YY_NO_SCAN_STRING]],,
  2335. [[
  2336. %if-c-only
  2337. /** Setup the input buffer state to scan a string. The next call to yylex() will
  2338. * scan from a @e copy of @a str.
  2339. * @param yystr a NUL-terminated string to scan
  2340. * M4_YY_DOC_PARAM
  2341. * @return the newly allocated buffer state object.
  2342. * @note If you want to scan bytes that may contain NUL values, then use
  2343. * yy_scan_bytes() instead.
  2344. */
  2345. YY_BUFFER_STATE yy_scan_string YYFARGS1( const char *, yystr)
  2346. {
  2347. m4_dnl M4_YY_DECL_GUTS_VAR();
  2348. return yy_scan_bytes( yystr, (int) strlen(yystr) M4_YY_CALL_LAST_ARG);
  2349. }
  2350. %endif
  2351. ]])
  2352. m4_ifdef( [[M4_YY_NO_SCAN_BYTES]],,
  2353. [[
  2354. %if-c-only
  2355. /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
  2356. * scan from a @e copy of @a bytes.
  2357. * @param yybytes the byte buffer to scan
  2358. * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
  2359. * M4_YY_DOC_PARAM
  2360. * @return the newly allocated buffer state object.
  2361. */
  2362. YY_BUFFER_STATE yy_scan_bytes YYFARGS2( const char *,yybytes, int ,_yybytes_len)
  2363. {
  2364. YY_BUFFER_STATE b;
  2365. char *buf;
  2366. yy_size_t n;
  2367. int i;
  2368. m4_dnl M4_YY_DECL_GUTS_VAR();
  2369. /* Get memory for full buffer, including space for trailing EOB's. */
  2370. n = (yy_size_t) (_yybytes_len + 2);
  2371. buf = (char *) yyalloc( n M4_YY_CALL_LAST_ARG );
  2372. if ( ! buf )
  2373. YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
  2374. for ( i = 0; i < _yybytes_len; ++i )
  2375. buf[i] = yybytes[i];
  2376. buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
  2377. b = yy_scan_buffer( buf, n M4_YY_CALL_LAST_ARG);
  2378. if ( ! b ) {
  2379. yyfree (buf);
  2380. YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
  2381. }
  2382. /* It's okay to grow etc. this buffer, and we should throw it
  2383. * away when we're done.
  2384. */
  2385. b->yy_is_our_buffer = 1;
  2386. return b;
  2387. }
  2388. %endif
  2389. ]])
  2390. m4_ifdef( [[M4_YY_NO_PUSH_STATE]],,
  2391. [[
  2392. %if-c-only
  2393. static void yy_push_state YYFARGS1( int ,_new_state)
  2394. %endif
  2395. %if-c++-only
  2396. void yyFlexLexer::yy_push_state( int _new_state )
  2397. %endif
  2398. {
  2399. M4_YY_DECL_GUTS_VAR();
  2400. if ( YY_G(yy_start_stack_ptr) >= YY_G(yy_start_stack_depth) )
  2401. {
  2402. yy_size_t new_size;
  2403. YY_G(yy_start_stack_depth) += YY_START_STACK_INCR;
  2404. new_size = (yy_size_t) YY_G(yy_start_stack_depth) * sizeof( int );
  2405. if ( ! YY_G(yy_start_stack) )
  2406. YY_G(yy_start_stack) = (int *) yyalloc( new_size M4_YY_CALL_LAST_ARG );
  2407. else
  2408. YY_G(yy_start_stack) = (int *) yyrealloc(
  2409. (void *) YY_G(yy_start_stack), new_size M4_YY_CALL_LAST_ARG );
  2410. if ( ! YY_G(yy_start_stack) )
  2411. YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
  2412. }
  2413. YY_G(yy_start_stack)[YY_G(yy_start_stack_ptr)++] = YY_START;
  2414. BEGIN(_new_state);
  2415. }
  2416. ]])
  2417. m4_ifdef( [[M4_YY_NO_POP_STATE]],,
  2418. [[
  2419. %if-c-only
  2420. static void yy_pop_state (M4_YY_DEF_ONLY_ARG)
  2421. %endif
  2422. %if-c++-only
  2423. void yyFlexLexer::yy_pop_state()
  2424. %endif
  2425. {
  2426. M4_YY_DECL_GUTS_VAR();
  2427. if ( --YY_G(yy_start_stack_ptr) < 0 )
  2428. YY_FATAL_ERROR( "start-condition stack underflow" );
  2429. BEGIN(YY_G(yy_start_stack)[YY_G(yy_start_stack_ptr)]);
  2430. }
  2431. ]])
  2432. m4_ifdef( [[M4_YY_NO_TOP_STATE]],,
  2433. [[
  2434. %if-c-only
  2435. static int yy_top_state (M4_YY_DEF_ONLY_ARG)
  2436. %endif
  2437. %if-c++-only
  2438. int yyFlexLexer::yy_top_state()
  2439. %endif
  2440. {
  2441. M4_YY_DECL_GUTS_VAR();
  2442. return YY_G(yy_start_stack_ptr) > 0 ? YY_G(yy_start_stack)[YY_G(yy_start_stack_ptr) - 1] : YY_START;
  2443. }
  2444. ]])
  2445. #ifndef YY_EXIT_FAILURE
  2446. #define YY_EXIT_FAILURE 2
  2447. #endif
  2448. %if-c-only
  2449. static void yynoreturn yy_fatal_error YYFARGS1(const char*, msg)
  2450. {
  2451. M4_YY_DECL_GUTS_VAR();
  2452. M4_YY_NOOP_GUTS_VAR();
  2453. fprintf( stderr, "%s\n", msg );
  2454. exit( YY_EXIT_FAILURE );
  2455. }
  2456. %endif
  2457. %if-c++-only
  2458. void yyFlexLexer::LexerError( const char* msg )
  2459. {
  2460. M4_YY_DECL_GUTS_VAR();
  2461. std::cerr << msg << std::endl;
  2462. exit( YY_EXIT_FAILURE );
  2463. }
  2464. %endif
  2465. /* Redefine yyless() so it works in section 3 code. */
  2466. #undef yyless
  2467. #define yyless(n) \
  2468. do \
  2469. { \
  2470. /* Undo effects of setting up yytext. */ \
  2471. int yyless_macro_arg = (n); \
  2472. YY_LESS_LINENO(yyless_macro_arg);\
  2473. yytext[yyleng] = YY_G(yy_hold_char); \
  2474. YY_G(yy_c_buf_p) = yytext + yyless_macro_arg; \
  2475. YY_G(yy_hold_char) = *YY_G(yy_c_buf_p); \
  2476. *YY_G(yy_c_buf_p) = '\0'; \
  2477. yyleng = yyless_macro_arg; \
  2478. } \
  2479. while ( 0 )
  2480. /* Accessor methods (get/set functions) to struct members. */
  2481. %if-c-only
  2482. %if-reentrant
  2483. m4_ifdef( [[M4_YY_NO_GET_EXTRA]],,
  2484. [[
  2485. /** Get the user-defined data for this scanner.
  2486. * M4_YY_DOC_PARAM
  2487. */
  2488. YY_EXTRA_TYPE yyget_extra (M4_YY_DEF_ONLY_ARG)
  2489. {
  2490. M4_YY_DECL_GUTS_VAR();
  2491. return yyextra;
  2492. }
  2493. ]])
  2494. %endif
  2495. m4_ifdef( [[M4_YY_NO_GET_LINENO]],,
  2496. [[
  2497. /** Get the current line number.
  2498. * M4_YY_DOC_PARAM
  2499. */
  2500. int yyget_lineno (M4_YY_DEF_ONLY_ARG)
  2501. {
  2502. M4_YY_DECL_GUTS_VAR();
  2503. m4_ifdef( [[M4_YY_REENTRANT]],
  2504. [[
  2505. if (! YY_CURRENT_BUFFER)
  2506. return 0;
  2507. ]])
  2508. return yylineno;
  2509. }
  2510. ]])
  2511. m4_ifdef( [[M4_YY_REENTRANT]],
  2512. [[
  2513. m4_ifdef( [[M4_YY_NO_GET_COLUMN]],,
  2514. [[
  2515. /** Get the current column number.
  2516. * M4_YY_DOC_PARAM
  2517. */
  2518. int yyget_column (M4_YY_DEF_ONLY_ARG)
  2519. {
  2520. M4_YY_DECL_GUTS_VAR();
  2521. m4_ifdef( [[M4_YY_REENTRANT]],
  2522. [[
  2523. if (! YY_CURRENT_BUFFER)
  2524. return 0;
  2525. ]])
  2526. return yycolumn;
  2527. }
  2528. ]])
  2529. ]])
  2530. m4_ifdef( [[M4_YY_NO_GET_IN]],,
  2531. [[
  2532. /** Get the input stream.
  2533. * M4_YY_DOC_PARAM
  2534. */
  2535. FILE *yyget_in (M4_YY_DEF_ONLY_ARG)
  2536. {
  2537. M4_YY_DECL_GUTS_VAR();
  2538. return yyin;
  2539. }
  2540. ]])
  2541. m4_ifdef( [[M4_YY_NO_GET_OUT]],,
  2542. [[
  2543. /** Get the output stream.
  2544. * M4_YY_DOC_PARAM
  2545. */
  2546. FILE *yyget_out (M4_YY_DEF_ONLY_ARG)
  2547. {
  2548. M4_YY_DECL_GUTS_VAR();
  2549. return yyout;
  2550. }
  2551. ]])
  2552. m4_ifdef( [[M4_YY_NO_GET_LENG]],,
  2553. [[
  2554. /** Get the length of the current token.
  2555. * M4_YY_DOC_PARAM
  2556. */
  2557. int yyget_leng (M4_YY_DEF_ONLY_ARG)
  2558. {
  2559. M4_YY_DECL_GUTS_VAR();
  2560. return yyleng;
  2561. }
  2562. ]])
  2563. /** Get the current token.
  2564. * M4_YY_DOC_PARAM
  2565. */
  2566. m4_ifdef( [[M4_YY_NO_GET_TEXT]],,
  2567. [[
  2568. char *yyget_text (M4_YY_DEF_ONLY_ARG)
  2569. {
  2570. M4_YY_DECL_GUTS_VAR();
  2571. return yytext;
  2572. }
  2573. ]])
  2574. %if-reentrant
  2575. m4_ifdef( [[M4_YY_NO_SET_EXTRA]],,
  2576. [[
  2577. /** Set the user-defined data. This data is never touched by the scanner.
  2578. * @param user_defined The data to be associated with this scanner.
  2579. * M4_YY_DOC_PARAM
  2580. */
  2581. void yyset_extra YYFARGS1( YY_EXTRA_TYPE ,user_defined)
  2582. {
  2583. M4_YY_DECL_GUTS_VAR();
  2584. yyextra = user_defined ;
  2585. }
  2586. ]])
  2587. %endif
  2588. m4_ifdef( [[M4_YY_NO_SET_LINENO]],,
  2589. [[
  2590. /** Set the current line number.
  2591. * @param _line_number line number
  2592. * M4_YY_DOC_PARAM
  2593. */
  2594. void yyset_lineno YYFARGS1( int ,_line_number)
  2595. {
  2596. M4_YY_DECL_GUTS_VAR();
  2597. m4_ifdef( [[M4_YY_REENTRANT]],
  2598. [[
  2599. /* lineno is only valid if an input buffer exists. */
  2600. if (! YY_CURRENT_BUFFER )
  2601. YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
  2602. ]])
  2603. yylineno = _line_number;
  2604. }
  2605. ]])
  2606. m4_ifdef( [[M4_YY_REENTRANT]],
  2607. [[
  2608. m4_ifdef( [[M4_YY_NO_SET_COLUMN]],,
  2609. [[
  2610. /** Set the current column.
  2611. * @param _column_no column number
  2612. * M4_YY_DOC_PARAM
  2613. */
  2614. void yyset_column YYFARGS1( int , _column_no)
  2615. {
  2616. M4_YY_DECL_GUTS_VAR();
  2617. m4_ifdef( [[M4_YY_REENTRANT]],
  2618. [[
  2619. /* column is only valid if an input buffer exists. */
  2620. if (! YY_CURRENT_BUFFER )
  2621. YY_FATAL_ERROR( "yyset_column called with no buffer" );
  2622. ]])
  2623. yycolumn = _column_no;
  2624. }
  2625. ]])
  2626. ]])
  2627. m4_ifdef( [[M4_YY_NO_SET_IN]],,
  2628. [[
  2629. /** Set the input stream. This does not discard the current
  2630. * input buffer.
  2631. * @param _in_str A readable stream.
  2632. * M4_YY_DOC_PARAM
  2633. * @see yy_switch_to_buffer
  2634. */
  2635. void yyset_in YYFARGS1( FILE * ,_in_str)
  2636. {
  2637. M4_YY_DECL_GUTS_VAR();
  2638. yyin = _in_str ;
  2639. }
  2640. ]])
  2641. m4_ifdef( [[M4_YY_NO_SET_OUT]],,
  2642. [[
  2643. void yyset_out YYFARGS1( FILE * ,_out_str)
  2644. {
  2645. M4_YY_DECL_GUTS_VAR();
  2646. yyout = _out_str ;
  2647. }
  2648. ]])
  2649. m4_ifdef( [[M4_YY_NO_GET_DEBUG]],,
  2650. [[
  2651. int yyget_debug (M4_YY_DEF_ONLY_ARG)
  2652. {
  2653. M4_YY_DECL_GUTS_VAR();
  2654. return yy_flex_debug;
  2655. }
  2656. ]])
  2657. m4_ifdef( [[M4_YY_NO_SET_DEBUG]],,
  2658. [[
  2659. void yyset_debug YYFARGS1( int ,_bdebug)
  2660. {
  2661. M4_YY_DECL_GUTS_VAR();
  2662. yy_flex_debug = _bdebug ;
  2663. }
  2664. ]])
  2665. %endif
  2666. %if-reentrant
  2667. /* Accessor methods for yylval and yylloc */
  2668. %if-bison-bridge
  2669. m4_ifdef( [[M4_YY_NO_GET_LVAL]],,
  2670. [[
  2671. YYSTYPE * yyget_lval (M4_YY_DEF_ONLY_ARG)
  2672. {
  2673. M4_YY_DECL_GUTS_VAR();
  2674. return yylval;
  2675. }
  2676. ]])
  2677. m4_ifdef( [[M4_YY_NO_SET_LVAL]],,
  2678. [[
  2679. void yyset_lval YYFARGS1( YYSTYPE * ,yylval_param)
  2680. {
  2681. M4_YY_DECL_GUTS_VAR();
  2682. yylval = yylval_param;
  2683. }
  2684. ]])
  2685. m4_ifdef( [[<M4_YY_BISON_LLOC>]],
  2686. [[
  2687. m4_ifdef( [[M4_YY_NO_GET_LLOC]],,
  2688. [[
  2689. YYLTYPE *yyget_lloc (M4_YY_DEF_ONLY_ARG)
  2690. {
  2691. M4_YY_DECL_GUTS_VAR();
  2692. return yylloc;
  2693. }
  2694. ]])
  2695. m4_ifdef( [[M4_YY_NO_SET_LLOC]],,
  2696. [[
  2697. void yyset_lloc YYFARGS1( YYLTYPE * ,yylloc_param)
  2698. {
  2699. M4_YY_DECL_GUTS_VAR();
  2700. yylloc = yylloc_param;
  2701. }
  2702. ]])
  2703. ]])
  2704. %endif
  2705. /* User-visible API */
  2706. /* yylex_init is special because it creates the scanner itself, so it is
  2707. * the ONLY reentrant function that doesn't take the scanner as the last argument.
  2708. * That's why we explicitly handle the declaration, instead of using our macros.
  2709. */
  2710. int yylex_init(yyscan_t* ptr_yy_globals)
  2711. {
  2712. if (ptr_yy_globals == NULL){
  2713. errno = EINVAL;
  2714. return 1;
  2715. }
  2716. *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
  2717. if (*ptr_yy_globals == NULL){
  2718. errno = ENOMEM;
  2719. return 1;
  2720. }
  2721. /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
  2722. memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
  2723. return yy_init_globals ( *ptr_yy_globals );
  2724. }
  2725. /* yylex_init_extra has the same functionality as yylex_init, but follows the
  2726. * convention of taking the scanner as the last argument. Note however, that
  2727. * this is a *pointer* to a scanner, as it will be allocated by this call (and
  2728. * is the reason, too, why this function also must handle its own declaration).
  2729. * The user defined value in the first argument will be available to yyalloc in
  2730. * the yyextra field.
  2731. */
  2732. int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
  2733. {
  2734. struct yyguts_t dummy_yyguts;
  2735. yyset_extra (yy_user_defined, &dummy_yyguts);
  2736. if (ptr_yy_globals == NULL){
  2737. errno = EINVAL;
  2738. return 1;
  2739. }
  2740. *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
  2741. if (*ptr_yy_globals == NULL){
  2742. errno = ENOMEM;
  2743. return 1;
  2744. }
  2745. /* By setting to 0xAA, we expose bugs in
  2746. yy_init_globals. Leave at 0x00 for releases. */
  2747. memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
  2748. yyset_extra (yy_user_defined, *ptr_yy_globals);
  2749. return yy_init_globals ( *ptr_yy_globals );
  2750. }
  2751. %endif if-c-only
  2752. %# Actually, that ended an if-rentrant section
  2753. %if-c-only
  2754. static int yy_init_globals (M4_YY_DEF_ONLY_ARG)
  2755. {
  2756. M4_YY_DECL_GUTS_VAR();
  2757. /* Initialization is the same as for the non-reentrant scanner.
  2758. * This function is called from yylex_destroy(), so don't allocate here.
  2759. */
  2760. m4_ifdef( [[M4_YY_USE_LINENO]],
  2761. [[
  2762. m4_ifdef( [[M4_YY_NOT_REENTRANT]],
  2763. [[
  2764. /* We do not touch yylineno unless the option is enabled. */
  2765. yylineno = 1;
  2766. ]])
  2767. ]])
  2768. YY_G(yy_buffer_stack) = NULL;
  2769. YY_G(yy_buffer_stack_top) = 0;
  2770. YY_G(yy_buffer_stack_max) = 0;
  2771. YY_G(yy_c_buf_p) = NULL;
  2772. YY_G(yy_init) = 0;
  2773. YY_G(yy_start) = 0;
  2774. m4_ifdef( [[M4_YY_HAS_START_STACK_VARS]],
  2775. [[
  2776. YY_G(yy_start_stack_ptr) = 0;
  2777. YY_G(yy_start_stack_depth) = 0;
  2778. YY_G(yy_start_stack) = NULL;
  2779. ]])
  2780. m4_ifdef( [[M4_YY_USES_REJECT]],
  2781. [[
  2782. YY_G(yy_state_buf) = 0;
  2783. YY_G(yy_state_ptr) = 0;
  2784. YY_G(yy_full_match) = 0;
  2785. YY_G(yy_lp) = 0;
  2786. ]])
  2787. m4_ifdef( [[M4_YY_TEXT_IS_ARRAY]],
  2788. [[
  2789. YY_G(yytext_ptr) = 0;
  2790. YY_G(yy_more_offset) = 0;
  2791. YY_G(yy_prev_more_offset) = 0;
  2792. ]])
  2793. /* Defined in main.c */
  2794. #ifdef YY_STDINIT
  2795. yyin = stdin;
  2796. yyout = stdout;
  2797. #else
  2798. yyin = NULL;
  2799. yyout = NULL;
  2800. #endif
  2801. /* For future reference: Set errno on error, since we are called by
  2802. * yylex_init()
  2803. */
  2804. return 0;
  2805. }
  2806. %endif
  2807. %if-c-only SNIP! this currently causes conflicts with the c++ scanner
  2808. /* yylex_destroy is for both reentrant and non-reentrant scanners. */
  2809. int yylex_destroy (M4_YY_DEF_ONLY_ARG)
  2810. {
  2811. M4_YY_DECL_GUTS_VAR();
  2812. /* Pop the buffer stack, destroying each element. */
  2813. while(YY_CURRENT_BUFFER){
  2814. yy_delete_buffer( YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG );
  2815. YY_CURRENT_BUFFER_LVALUE = NULL;
  2816. yypop_buffer_state(M4_YY_CALL_ONLY_ARG);
  2817. }
  2818. /* Destroy the stack itself. */
  2819. yyfree(YY_G(yy_buffer_stack) M4_YY_CALL_LAST_ARG);
  2820. YY_G(yy_buffer_stack) = NULL;
  2821. m4_ifdef( [[M4_YY_HAS_START_STACK_VARS]],
  2822. [[
  2823. /* Destroy the start condition stack. */
  2824. yyfree( YY_G(yy_start_stack) M4_YY_CALL_LAST_ARG );
  2825. YY_G(yy_start_stack) = NULL;
  2826. ]])
  2827. m4_ifdef( [[M4_YY_USES_REJECT]],
  2828. [[
  2829. yyfree ( YY_G(yy_state_buf) M4_YY_CALL_LAST_ARG);
  2830. YY_G(yy_state_buf) = NULL;
  2831. ]])
  2832. /* Reset the globals. This is important in a non-reentrant scanner so the next time
  2833. * yylex() is called, initialization will occur. */
  2834. yy_init_globals( M4_YY_CALL_ONLY_ARG);
  2835. %if-reentrant
  2836. /* Destroy the main struct (reentrant only). */
  2837. yyfree ( yyscanner M4_YY_CALL_LAST_ARG );
  2838. yyscanner = NULL;
  2839. %endif
  2840. return 0;
  2841. }
  2842. %endif
  2843. m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
  2844. [[
  2845. /*
  2846. * Internal utility routines.
  2847. */
  2848. ]])
  2849. m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
  2850. [[
  2851. #ifndef yytext_ptr
  2852. static void yy_flex_strncpy YYFARGS3( char*,s1, const char *,s2, int,n)
  2853. {
  2854. M4_YY_DECL_GUTS_VAR();
  2855. M4_YY_NOOP_GUTS_VAR();
  2856. int i;
  2857. for ( i = 0; i < n; ++i )
  2858. s1[i] = s2[i];
  2859. }
  2860. #endif
  2861. ]])
  2862. m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
  2863. [[
  2864. #ifdef YY_NEED_STRLEN
  2865. static int yy_flex_strlen YYFARGS1( const char *,s)
  2866. {
  2867. int n;
  2868. for ( n = 0; s[n]; ++n )
  2869. ;
  2870. return n;
  2871. }
  2872. #endif
  2873. ]])
  2874. m4_ifdef( [[M4_YY_NO_FLEX_ALLOC]],,
  2875. [[
  2876. void *yyalloc YYFARGS1( yy_size_t ,size)
  2877. {
  2878. M4_YY_DECL_GUTS_VAR();
  2879. M4_YY_NOOP_GUTS_VAR();
  2880. void *ret = NULL;
  2881. ret = calloc(1,size);
  2882. if (ret == NULL) {
  2883. /* option here to do exit (1); */
  2884. }
  2885. return (ret);
  2886. }
  2887. ]])
  2888. m4_ifdef( [[M4_YY_NO_FLEX_REALLOC]],,
  2889. [[
  2890. void *yyrealloc YYFARGS2( void *,ptr, yy_size_t ,size)
  2891. {
  2892. M4_YY_DECL_GUTS_VAR();
  2893. M4_YY_NOOP_GUTS_VAR();
  2894. void *ret = NULL;
  2895. /* The cast to (char *) in the following accommodates both
  2896. * implementations that use char* generic pointers, and those
  2897. * that use void* generic pointers. It works with the latter
  2898. * because both ANSI C and C++ allow castless assignment from
  2899. * any pointer type to void*, and deal with argument conversions
  2900. * as though doing an assignment.
  2901. */
  2902. ret = realloc(ptr, size);
  2903. if (size) {
  2904. if (ret == NULL) {
  2905. /* option here to do exit (1); */
  2906. }
  2907. }
  2908. return (ret);
  2909. }
  2910. ]])
  2911. m4_ifdef( [[M4_YY_NO_FLEX_FREE]],,
  2912. [[
  2913. void yyfree YYFARGS1( void *,ptr)
  2914. {
  2915. M4_YY_DECL_GUTS_VAR();
  2916. M4_YY_NOOP_GUTS_VAR();
  2917. if (ptr) { free( (char *) ptr ); } /* see yyrealloc() for (char *) cast */
  2918. }
  2919. ]])
  2920. %if-tables-serialization definitions
  2921. #ifdef FLEX_SCANNER
  2922. /*
  2923. dnl tables_shared.c - tables serialization code
  2924. dnl
  2925. dnl Copyright (c) 1990 The Regents of the University of California.
  2926. dnl All rights reserved.
  2927. dnl
  2928. dnl This code is derived from software contributed to Berkeley by
  2929. dnl Vern Paxson.
  2930. dnl
  2931. dnl The United States Government has rights in this work pursuant
  2932. dnl to contract no. DE-AC03-76SF00098 between the United States
  2933. dnl Department of Energy and the University of California.
  2934. dnl
  2935. dnl This file is part of flex.
  2936. dnl
  2937. dnl Redistribution and use in source and binary forms, with or without
  2938. dnl modification, are permitted provided that the following conditions
  2939. dnl are met:
  2940. dnl
  2941. dnl 1. Redistributions of source code must retain the above copyright
  2942. dnl notice, this list of conditions and the following disclaimer.
  2943. dnl 2. Redistributions in binary form must reproduce the above copyright
  2944. dnl notice, this list of conditions and the following disclaimer in the
  2945. dnl documentation and/or other materials provided with the distribution.
  2946. dnl
  2947. dnl Neither the name of the University nor the names of its contributors
  2948. dnl may be used to endorse or promote products derived from this software
  2949. dnl without specific prior written permission.
  2950. dnl
  2951. dnl THIS SOFTWARE IS PROVIDED `AS IS' AND WITHOUT ANY EXPRESS OR
  2952. dnl IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  2953. dnl WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  2954. dnl PURPOSE.
  2955. dnl
  2956. */
  2957. /* This file is meant to be included in both the skeleton and the actual
  2958. * flex code (hence the name "_shared").
  2959. */
  2960. #ifndef yyskel_static
  2961. #define yyskel_static static
  2962. #endif
  2963. #else
  2964. #include "flexdef.h"
  2965. #include "tables.h"
  2966. #ifndef yyskel_static
  2967. #define yyskel_static
  2968. #endif
  2969. #endif
  2970. /** Get the number of integers in this table. This is NOT the
  2971. * same thing as the number of elements.
  2972. * @param tbl the table
  2973. * @return the number of integers in the table
  2974. */
  2975. yyskel_static flex_int32_t yytbl_calc_total_len (const struct yytbl_data *tbl)
  2976. {
  2977. flex_uint32_t n;
  2978. /* total number of ints */
  2979. n = tbl->td_lolen;
  2980. if (tbl->td_hilen > 0)
  2981. n *= tbl->td_hilen;
  2982. if (tbl->td_id == YYTD_ID_TRANSITION)
  2983. n *= 2;
  2984. return (flex_int32_t) n;
  2985. }
  2986. static int yytbl_read8 (void *v, struct yytbl_reader * rd)
  2987. {
  2988. errno = 0;
  2989. if (fread (v, sizeof (flex_uint8_t), 1, rd->fp) != 1){
  2990. errno = EIO;
  2991. return -1;
  2992. }
  2993. rd->bread += (flex_uint32_t) sizeof(flex_uint8_t);
  2994. return 0;
  2995. }
  2996. static int yytbl_read16 (void *v, struct yytbl_reader * rd)
  2997. {
  2998. errno = 0;
  2999. if (fread (v, sizeof (flex_uint16_t), 1, rd->fp) != 1){
  3000. errno = EIO;
  3001. return -1;
  3002. }
  3003. *((flex_uint16_t *) v) = ntohs (*((flex_uint16_t *) v));
  3004. rd->bread += (flex_uint32_t) sizeof(flex_uint16_t);
  3005. return 0;
  3006. }
  3007. static int yytbl_read32 (void *v, struct yytbl_reader * rd)
  3008. {
  3009. errno = 0;
  3010. if (fread (v, sizeof (flex_uint32_t), 1, rd->fp) != 1){
  3011. errno = EIO;
  3012. return -1;
  3013. }
  3014. *((flex_uint32_t *) v) = ntohl (*((flex_uint32_t *) v));
  3015. rd->bread += (flex_uint32_t) sizeof(flex_uint32_t);
  3016. return 0;
  3017. }
  3018. /** Read the header */
  3019. static int yytbl_hdr_read YYFARGS2(struct yytbl_hdr *, th, struct yytbl_reader *, rd)
  3020. {
  3021. size_t bytes;
  3022. memset (th, 0, sizeof (struct yytbl_hdr));
  3023. if (yytbl_read32 (&(th->th_magic), rd) != 0)
  3024. return -1;
  3025. if (th->th_magic != YYTBL_MAGIC){
  3026. YY_FATAL_ERROR( "bad magic number" ); /* TODO: not fatal. */
  3027. return -1;
  3028. }
  3029. if (yytbl_read32 (&(th->th_hsize), rd) != 0
  3030. || yytbl_read32 (&(th->th_ssize), rd) != 0
  3031. || yytbl_read16 (&(th->th_flags), rd) != 0)
  3032. return -1;
  3033. /* Sanity check on header size. Greater than 1k suggests some funny business. */
  3034. if (th->th_hsize < 16 || th->th_hsize > 1024){
  3035. YY_FATAL_ERROR( "insane header size detected" ); /* TODO: not fatal. */
  3036. return -1;
  3037. }
  3038. /* Allocate enough space for the version and name fields */
  3039. bytes = th->th_hsize - 14;
  3040. th->th_version = (char *) yyalloc (bytes M4_YY_CALL_LAST_ARG);
  3041. if ( ! th->th_version )
  3042. YY_FATAL_ERROR( "out of dynamic memory in yytbl_hdr_read()" );
  3043. /* we read it all into th_version, and point th_name into that data */
  3044. if (fread (th->th_version, 1, bytes, rd->fp) != bytes){
  3045. errno = EIO;
  3046. yyfree(th->th_version M4_YY_CALL_LAST_ARG);
  3047. th->th_version = NULL;
  3048. return -1;
  3049. }
  3050. else
  3051. rd->bread += (flex_uint32_t) bytes;
  3052. th->th_name = th->th_version + strlen (th->th_version) + 1;
  3053. return 0;
  3054. }
  3055. /** lookup id in the dmap list.
  3056. * @param dmap pointer to first element in list
  3057. * @return NULL if not found.
  3058. */
  3059. static struct yytbl_dmap *yytbl_dmap_lookup YYFARGS2(struct yytbl_dmap *, dmap,
  3060. int, id)
  3061. {
  3062. M4_YY_DECL_GUTS_VAR();
  3063. M4_YY_NOOP_GUTS_VAR();
  3064. while (dmap->dm_id)
  3065. if ((int)(dmap->dm_id) == id)
  3066. return dmap;
  3067. else
  3068. dmap++;
  3069. return NULL;
  3070. }
  3071. /** Read a table while mapping its contents to the local array.
  3072. * @param dmap used to performing mapping
  3073. * @return 0 on success
  3074. */
  3075. static int yytbl_data_load YYFARGS2(struct yytbl_dmap *, dmap, struct yytbl_reader*, rd)
  3076. {
  3077. struct yytbl_data td;
  3078. struct yytbl_dmap *transdmap=0;
  3079. int len, i, rv, inner_loop_count;
  3080. void *p=0;
  3081. memset (&td, 0, sizeof (struct yytbl_data));
  3082. if (yytbl_read16 (&td.td_id, rd) != 0
  3083. || yytbl_read16 (&td.td_flags, rd) != 0
  3084. || yytbl_read32 (&td.td_hilen, rd) != 0
  3085. || yytbl_read32 (&td.td_lolen, rd) != 0)
  3086. return -1;
  3087. /* Lookup the map for the transition table so we have it in case we need it
  3088. * inside the loop below. This scanner might not even have a transition
  3089. * table, which is ok.
  3090. */
  3091. transdmap = yytbl_dmap_lookup (dmap, YYTD_ID_TRANSITION M4_YY_CALL_LAST_ARG);
  3092. if ((dmap = yytbl_dmap_lookup (dmap, td.td_id M4_YY_CALL_LAST_ARG)) == NULL){
  3093. YY_FATAL_ERROR( "table id not found in map." ); /* TODO: not fatal. */
  3094. return -1;
  3095. }
  3096. /* Allocate space for table.
  3097. * The --full yy_transition table is a special case, since we
  3098. * need the dmap.dm_sz entry to tell us the sizeof the individual
  3099. * struct members.
  3100. */
  3101. {
  3102. size_t bytes;
  3103. if ((td.td_flags & YYTD_STRUCT))
  3104. bytes = sizeof(struct yy_trans_info) * td.td_lolen * (td.td_hilen ? td.td_hilen : 1);
  3105. else
  3106. bytes = td.td_lolen * (td.td_hilen ? td.td_hilen : 1) * dmap->dm_sz;
  3107. if(M4_YY_TABLES_VERIFY)
  3108. /* We point to the array itself */
  3109. p = dmap->dm_arr;
  3110. else
  3111. /* We point to the address of a pointer. */
  3112. *dmap->dm_arr = p = (void *) yyalloc (bytes M4_YY_CALL_LAST_ARG);
  3113. if ( ! p )
  3114. YY_FATAL_ERROR( "out of dynamic memory in yytbl_data_load()" );
  3115. }
  3116. /* If it's a struct, we read 2 integers to get one element */
  3117. if ((td.td_flags & YYTD_STRUCT) != 0)
  3118. inner_loop_count = 2;
  3119. else
  3120. inner_loop_count = 1;
  3121. /* read and map each element.
  3122. * This loop iterates once for each element of the td_data array.
  3123. * Notice that we increment 'i' in the inner loop.
  3124. */
  3125. len = yytbl_calc_total_len (&td);
  3126. for (i = 0; i < len; ){
  3127. int j;
  3128. /* This loop really executes exactly 1 or 2 times.
  3129. * The second time is to handle the second member of the
  3130. * YYTD_STRUCT for the yy_transition array.
  3131. */
  3132. for (j = 0; j < inner_loop_count; j++, i++) {
  3133. flex_int32_t t32;
  3134. /* read into t32 no matter what the real size is. */
  3135. {
  3136. flex_int16_t t16;
  3137. flex_int8_t t8;
  3138. switch (YYTDFLAGS2BYTES (td.td_flags)) {
  3139. case sizeof (flex_int32_t):
  3140. rv = yytbl_read32 (&t32, rd);
  3141. break;
  3142. case sizeof (flex_int16_t):
  3143. rv = yytbl_read16 (&t16, rd);
  3144. t32 = t16;
  3145. break;
  3146. case sizeof (flex_int8_t):
  3147. rv = yytbl_read8 (&t8, rd);
  3148. t32 = t8;
  3149. break;
  3150. default:
  3151. YY_FATAL_ERROR( "invalid td_flags" ); /* TODO: not fatal. */
  3152. return -1;
  3153. }
  3154. }
  3155. if (rv != 0)
  3156. return -1;
  3157. /* copy into the deserialized array... */
  3158. if ((td.td_flags & YYTD_STRUCT)) {
  3159. /* t32 is the j'th member of a two-element struct. */
  3160. void *v;
  3161. v = j == 0 ? &(((struct yy_trans_info *) p)->yy_verify)
  3162. : &(((struct yy_trans_info *) p)->yy_nxt);
  3163. switch (dmap->dm_sz) {
  3164. case sizeof (flex_int32_t):
  3165. if (M4_YY_TABLES_VERIFY){
  3166. if( ((flex_int32_t *) v)[0] != (flex_int32_t) t32)
  3167. YY_FATAL_ERROR( "tables verification failed at YYTD_STRUCT flex_int32_t" );
  3168. }else
  3169. ((flex_int32_t *) v)[0] = (flex_int32_t) t32;
  3170. break;
  3171. case sizeof (flex_int16_t):
  3172. if (M4_YY_TABLES_VERIFY ){
  3173. if(((flex_int16_t *) v)[0] != (flex_int16_t) t32)
  3174. YY_FATAL_ERROR( "tables verification failed at YYTD_STRUCT flex_int16_t" );
  3175. }else
  3176. ((flex_int16_t *) v)[0] = (flex_int16_t) t32;
  3177. break;
  3178. case sizeof(flex_int8_t):
  3179. if (M4_YY_TABLES_VERIFY ){
  3180. if( ((flex_int8_t *) v)[0] != (flex_int8_t) t32)
  3181. YY_FATAL_ERROR( "tables verification failed at YYTD_STRUCT flex_int8_t" );
  3182. }else
  3183. ((flex_int8_t *) v)[0] = (flex_int8_t) t32;
  3184. break;
  3185. default:
  3186. YY_FATAL_ERROR( "invalid dmap->dm_sz for struct" ); /* TODO: not fatal. */
  3187. return -1;
  3188. }
  3189. /* if we're done with j, increment p */
  3190. if (j == 1)
  3191. p = (struct yy_trans_info *) p + 1;
  3192. }
  3193. else if ((td.td_flags & YYTD_PTRANS)) {
  3194. /* t32 is an index into the transition array. */
  3195. struct yy_trans_info *v;
  3196. if (!transdmap){
  3197. YY_FATAL_ERROR( "transition table not found" ); /* TODO: not fatal. */
  3198. return -1;
  3199. }
  3200. if( M4_YY_TABLES_VERIFY)
  3201. v = &(((struct yy_trans_info *) (transdmap->dm_arr))[t32]);
  3202. else
  3203. v = &((*((struct yy_trans_info **) (transdmap->dm_arr)))[t32]);
  3204. if(M4_YY_TABLES_VERIFY ){
  3205. if( ((struct yy_trans_info **) p)[0] != v)
  3206. YY_FATAL_ERROR( "tables verification failed at YYTD_PTRANS" );
  3207. }else
  3208. ((struct yy_trans_info **) p)[0] = v;
  3209. /* increment p */
  3210. p = (struct yy_trans_info **) p + 1;
  3211. }
  3212. else {
  3213. /* t32 is a plain int. copy data, then incrememnt p. */
  3214. switch (dmap->dm_sz) {
  3215. case sizeof (flex_int32_t):
  3216. if(M4_YY_TABLES_VERIFY ){
  3217. if( ((flex_int32_t *) p)[0] != (flex_int32_t) t32)
  3218. YY_FATAL_ERROR( "tables verification failed at flex_int32_t" );
  3219. }else
  3220. ((flex_int32_t *) p)[0] = (flex_int32_t) t32;
  3221. p = ((flex_int32_t *) p) + 1;
  3222. break;
  3223. case sizeof (flex_int16_t):
  3224. if(M4_YY_TABLES_VERIFY ){
  3225. if( ((flex_int16_t *) p)[0] != (flex_int16_t) t32)
  3226. YY_FATAL_ERROR( "tables verification failed at flex_int16_t" );
  3227. }else
  3228. ((flex_int16_t *) p)[0] = (flex_int16_t) t32;
  3229. p = ((flex_int16_t *) p) + 1;
  3230. break;
  3231. case sizeof (flex_int8_t):
  3232. if(M4_YY_TABLES_VERIFY ){
  3233. if( ((flex_int8_t *) p)[0] != (flex_int8_t) t32)
  3234. YY_FATAL_ERROR( "tables verification failed at flex_int8_t" );
  3235. }else
  3236. ((flex_int8_t *) p)[0] = (flex_int8_t) t32;
  3237. p = ((flex_int8_t *) p) + 1;
  3238. break;
  3239. default:
  3240. YY_FATAL_ERROR( "invalid dmap->dm_sz for plain int" ); /* TODO: not fatal. */
  3241. return -1;
  3242. }
  3243. }
  3244. }
  3245. }
  3246. /* Now eat padding. */
  3247. {
  3248. while (rd->bread % (8 * sizeof(flex_uint8_t)) > 0) {
  3249. flex_int8_t t8;
  3250. if(yytbl_read8(&t8,rd) != 0)
  3251. return -1;
  3252. }
  3253. }
  3254. return 0;
  3255. }
  3256. %define-yytables The name for this specific scanner's tables.
  3257. /* Find the key and load the DFA tables from the given stream. */
  3258. static int yytbl_fload YYFARGS2(FILE *, fp, const char *, key)
  3259. {
  3260. int rv=0;
  3261. struct yytbl_hdr th;
  3262. struct yytbl_reader rd;
  3263. rd.fp = fp;
  3264. th.th_version = NULL;
  3265. /* Keep trying until we find the right set of tables or end of file. */
  3266. while (!feof(rd.fp)) {
  3267. rd.bread = 0;
  3268. if (yytbl_hdr_read (&th, &rd M4_YY_CALL_LAST_ARG) != 0){
  3269. rv = -1;
  3270. goto return_rv;
  3271. }
  3272. /* A NULL key means choose the first set of tables. */
  3273. if (key == NULL)
  3274. break;
  3275. if (strcmp(th.th_name,key) != 0){
  3276. /* Skip ahead to next set */
  3277. fseek(rd.fp, th.th_ssize - th.th_hsize, SEEK_CUR);
  3278. yyfree(th.th_version M4_YY_CALL_LAST_ARG);
  3279. th.th_version = NULL;
  3280. }
  3281. else
  3282. break;
  3283. }
  3284. while (rd.bread < th.th_ssize){
  3285. /* Load the data tables */
  3286. if(yytbl_data_load (yydmap,&rd M4_YY_CALL_LAST_ARG) != 0){
  3287. rv = -1;
  3288. goto return_rv;
  3289. }
  3290. }
  3291. return_rv:
  3292. if(th.th_version){
  3293. yyfree(th.th_version M4_YY_CALL_LAST_ARG);
  3294. th.th_version = NULL;
  3295. }
  3296. return rv;
  3297. }
  3298. /** Load the DFA tables for this scanner from the given stream. */
  3299. int yytables_fload YYFARGS1(FILE *, fp)
  3300. {
  3301. if( yytbl_fload(fp, YYTABLES_NAME M4_YY_CALL_LAST_ARG) != 0)
  3302. return -1;
  3303. return 0;
  3304. }
  3305. /** Destroy the loaded tables, freeing memory, etc.. */
  3306. int yytables_destroy (M4_YY_DEF_ONLY_ARG)
  3307. {
  3308. struct yytbl_dmap *dmap=0;
  3309. if(!M4_YY_TABLES_VERIFY){
  3310. /* Walk the dmap, freeing the pointers */
  3311. for(dmap=yydmap; dmap->dm_id; dmap++) {
  3312. void * v;
  3313. v = dmap->dm_arr;
  3314. if(v && *(char**)v){
  3315. yyfree(*(char**)v M4_YY_CALL_LAST_ARG);
  3316. *(char**)v = NULL;
  3317. }
  3318. }
  3319. }
  3320. return 0;
  3321. }
  3322. /* end table serialization code definitions */
  3323. %endif
  3324. m4_ifdef([[M4_YY_MAIN]], [[
  3325. int main (void);
  3326. int main ()
  3327. {
  3328. %if-reentrant
  3329. yyscan_t lexer;
  3330. yylex_init(&lexer);
  3331. yylex( lexer );
  3332. yylex_destroy( lexer);
  3333. %endif
  3334. %if-not-reentrant
  3335. yylex();
  3336. %endif
  3337. return 0;
  3338. }
  3339. ]])
  3340. %ok-for-header
  3341. m4_ifdef( [[M4_YY_IN_HEADER]],
  3342. [[
  3343. #undef YY_NEW_FILE
  3344. #undef YY_FLUSH_BUFFER
  3345. #undef yy_set_bol
  3346. #undef yy_new_buffer
  3347. #undef yy_set_interactive
  3348. #undef YY_DO_BEFORE_ACTION
  3349. #ifdef YY_DECL_IS_OURS
  3350. #undef YY_DECL_IS_OURS
  3351. #undef YY_DECL
  3352. #endif
  3353. [[#ifndef ]]M4_YY_PREFIX[[_create_buffer_ALREADY_DEFINED
  3354. #undef yy_create_buffer
  3355. #endif]]
  3356. [[#ifndef ]]M4_YY_PREFIX[[_delete_buffer_ALREADY_DEFINED
  3357. #undef yy_delete_buffer
  3358. #endif]]
  3359. [[#ifndef ]]M4_YY_PREFIX[[_scan_buffer_ALREADY_DEFINED
  3360. #undef yy_scan_buffer
  3361. #endif]]
  3362. [[#ifndef ]]M4_YY_PREFIX[[_scan_string_ALREADY_DEFINED
  3363. #undef yy_scan_string
  3364. #endif]]
  3365. [[#ifndef ]]M4_YY_PREFIX[[_scan_bytes_ALREADY_DEFINED
  3366. #undef yy_scan_bytes
  3367. #endif]]
  3368. [[#ifndef ]]M4_YY_PREFIX[[_init_buffer_ALREADY_DEFINED
  3369. #undef yy_init_buffer
  3370. #endif]]
  3371. [[#ifndef ]]M4_YY_PREFIX[[_flush_buffer_ALREADY_DEFINED
  3372. #undef yy_flush_buffer
  3373. #endif]]
  3374. [[#ifndef ]]M4_YY_PREFIX[[_load_buffer_state_ALREADY_DEFINED
  3375. #undef yy_load_buffer_state
  3376. #endif]]
  3377. [[#ifndef ]]M4_YY_PREFIX[[_switch_to_buffer_ALREADY_DEFINED
  3378. #undef yy_switch_to_buffer
  3379. #endif]]
  3380. [[#ifndef ]]M4_YY_PREFIX[[push_buffer_state_ALREADY_DEFINED
  3381. #undef yypush_buffer_state
  3382. #endif]]
  3383. [[#ifndef ]]M4_YY_PREFIX[[pop_buffer_state_ALREADY_DEFINED
  3384. #undef yypop_buffer_state
  3385. #endif]]
  3386. [[#ifndef ]]M4_YY_PREFIX[[ensure_buffer_stack_ALREADY_DEFINED
  3387. #undef yyensure_buffer_stack
  3388. #endif]]
  3389. [[#ifndef ]]M4_YY_PREFIX[[lex_ALREADY_DEFINED
  3390. #undef yylex
  3391. #endif]]
  3392. [[#ifndef ]]M4_YY_PREFIX[[restart_ALREADY_DEFINED
  3393. #undef yyrestart
  3394. #endif]]
  3395. [[#ifndef ]]M4_YY_PREFIX[[lex_init_ALREADY_DEFINED
  3396. #undef yylex_init
  3397. #endif]]
  3398. [[#ifndef ]]M4_YY_PREFIX[[lex_init_extra_ALREADY_DEFINED
  3399. #undef yylex_init_extra
  3400. #endif]]
  3401. [[#ifndef ]]M4_YY_PREFIX[[lex_destroy_ALREADY_DEFINED
  3402. #undef yylex_destroy
  3403. #endif]]
  3404. [[#ifndef ]]M4_YY_PREFIX[[get_debug_ALREADY_DEFINED
  3405. #undef yyget_debug
  3406. #endif]]
  3407. [[#ifndef ]]M4_YY_PREFIX[[set_debug_ALREADY_DEFINED
  3408. #undef yyset_debug
  3409. #endif]]
  3410. [[#ifndef ]]M4_YY_PREFIX[[get_extra_ALREADY_DEFINED
  3411. #undef yyget_extra
  3412. #endif]]
  3413. [[#ifndef ]]M4_YY_PREFIX[[set_extra_ALREADY_DEFINED
  3414. #undef yyset_extra
  3415. #endif]]
  3416. [[#ifndef ]]M4_YY_PREFIX[[get_in_ALREADY_DEFINED
  3417. #undef yyget_in
  3418. #endif]]
  3419. [[#ifndef ]]M4_YY_PREFIX[[set_in_ALREADY_DEFINED
  3420. #undef yyset_in
  3421. #endif]]
  3422. [[#ifndef ]]M4_YY_PREFIX[[get_out_ALREADY_DEFINED
  3423. #undef yyget_out
  3424. #endif]]
  3425. [[#ifndef ]]M4_YY_PREFIX[[set_out_ALREADY_DEFINED
  3426. #undef yyset_out
  3427. #endif]]
  3428. [[#ifndef ]]M4_YY_PREFIX[[get_leng_ALREADY_DEFINED
  3429. #undef yyget_leng
  3430. #endif]]
  3431. [[#ifndef ]]M4_YY_PREFIX[[get_text_ALREADY_DEFINED
  3432. #undef yyget_text
  3433. #endif]]
  3434. [[#ifndef ]]M4_YY_PREFIX[[get_lineno_ALREADY_DEFINED
  3435. #undef yyget_lineno
  3436. #endif]]
  3437. [[#ifndef ]]M4_YY_PREFIX[[set_lineno_ALREADY_DEFINED
  3438. #undef yyset_lineno
  3439. #endif]]
  3440. [[#ifndef ]]M4_YY_PREFIX[[get_column_ALREADY_DEFINED
  3441. #undef yyget_column
  3442. #endif]]
  3443. [[#ifndef ]]M4_YY_PREFIX[[set_column_ALREADY_DEFINED
  3444. #undef yyset_column
  3445. #endif]]
  3446. [[#ifndef ]]M4_YY_PREFIX[[wrap_ALREADY_DEFINED
  3447. #undef yywrap
  3448. #endif]]
  3449. [[#ifndef ]]M4_YY_PREFIX[[get_lval_ALREADY_DEFINED
  3450. #undef yyget_lval
  3451. #endif]]
  3452. [[#ifndef ]]M4_YY_PREFIX[[set_lval_ALREADY_DEFINED
  3453. #undef yyset_lval
  3454. #endif]]
  3455. [[#ifndef ]]M4_YY_PREFIX[[get_lloc_ALREADY_DEFINED
  3456. #undef yyget_lloc
  3457. #endif]]
  3458. [[#ifndef ]]M4_YY_PREFIX[[set_lloc_ALREADY_DEFINED
  3459. #undef yyset_lloc
  3460. #endif]]
  3461. [[#ifndef ]]M4_YY_PREFIX[[alloc_ALREADY_DEFINED
  3462. #undef yyalloc
  3463. #endif]]
  3464. [[#ifndef ]]M4_YY_PREFIX[[realloc_ALREADY_DEFINED
  3465. #undef yyrealloc
  3466. #endif]]
  3467. [[#ifndef ]]M4_YY_PREFIX[[free_ALREADY_DEFINED
  3468. #undef yyfree
  3469. #endif]]
  3470. [[#ifndef ]]M4_YY_PREFIX[[text_ALREADY_DEFINED
  3471. #undef yytext
  3472. #endif]]
  3473. [[#ifndef ]]M4_YY_PREFIX[[leng_ALREADY_DEFINED
  3474. #undef yyleng
  3475. #endif]]
  3476. [[#ifndef ]]M4_YY_PREFIX[[in_ALREADY_DEFINED
  3477. #undef yyin
  3478. #endif]]
  3479. [[#ifndef ]]M4_YY_PREFIX[[out_ALREADY_DEFINED
  3480. #undef yyout
  3481. #endif]]
  3482. [[#ifndef ]]M4_YY_PREFIX[[_flex_debug_ALREADY_DEFINED
  3483. #undef yy_flex_debug
  3484. #endif]]
  3485. [[#ifndef ]]M4_YY_PREFIX[[lineno_ALREADY_DEFINED
  3486. #undef yylineno
  3487. #endif]]
  3488. [[#ifndef ]]M4_YY_PREFIX[[tables_fload_ALREADY_DEFINED
  3489. #undef yytables_fload
  3490. #endif]]
  3491. [[#ifndef ]]M4_YY_PREFIX[[tables_destroy_ALREADY_DEFINED
  3492. #undef yytables_destroy
  3493. #endif]]
  3494. [[#ifndef ]]M4_YY_PREFIX[[TABLES_NAME_ALREADY_DEFINED
  3495. #undef yyTABLES_NAME
  3496. #endif]]
  3497. ]])