cmFortranLexer.cxx 73 KB

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