cmFortranLexer.cxx 73 KB

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