cmFortranLexer.cxx 73 KB

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