cmFortranParser.cxx 66 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988
  1. /* A Bison parser, made by GNU Bison 3.0.4. */
  2. /* Bison implementation for Yacc-like parsers in C
  3. Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  14. /* As a special exception, you may create a larger work that contains
  15. part or all of the Bison parser skeleton and distribute that work
  16. under terms of your choice, so long as that work isn't itself a
  17. parser generator using the skeleton or a modified version thereof
  18. as a parser skeleton. Alternatively, if you modify or redistribute
  19. the parser skeleton itself, you may (at your option) remove this
  20. special exception, which will cause the skeleton and the resulting
  21. Bison output files to be licensed under the GNU General Public
  22. License without this special exception.
  23. This special exception was added by the Free Software Foundation in
  24. version 2.2 of Bison. */
  25. /* C LALR(1) parser skeleton written by Richard Stallman, by
  26. simplifying the original so-called "semantic" parser. */
  27. /* All symbols defined below should begin with yy or YY, to avoid
  28. infringing on user name space. This should be done even for local
  29. variables, as they might otherwise be expanded by user macros.
  30. There are some unavoidable exceptions within include files to
  31. define necessary library symbols; they are noted "INFRINGES ON
  32. USER NAME SPACE" below. */
  33. /* Identify Bison output. */
  34. #define YYBISON 1
  35. /* Bison version. */
  36. #define YYBISON_VERSION "3.0.4"
  37. /* Skeleton name. */
  38. #define YYSKELETON_NAME "yacc.c"
  39. /* Pure parsers. */
  40. #define YYPURE 1
  41. /* Push parsers. */
  42. #define YYPUSH 0
  43. /* Pull parsers. */
  44. #define YYPULL 1
  45. /* Substitute the variable and function names. */
  46. #define yyparse cmFortran_yyparse
  47. #define yylex cmFortran_yylex
  48. #define yyerror cmFortran_yyerror
  49. #define yydebug cmFortran_yydebug
  50. #define yynerrs cmFortran_yynerrs
  51. /* Copy the first part of user declarations. */
  52. #line 1 "cmFortranParser.y" /* yacc.c:339 */
  53. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  54. file Copyright.txt or https://cmake.org/licensing for details. */
  55. /*-------------------------------------------------------------------------
  56. Portions of this source have been derived from makedepf90 version 2.8.8,
  57. Copyright (C) 2000--2006 Erik Edelmann <erik.edelmann@iki.fi>
  58. The code was originally distributed under the GPL but permission
  59. from the copyright holder has been obtained to distribute this
  60. derived work under the CMake license.
  61. -------------------------------------------------------------------------*/
  62. /*
  63. This file must be translated to C and modified to build everywhere.
  64. Run bison like this:
  65. bison --yacc --name-prefix=cmFortran_yy
  66. --defines=cmFortranParserTokens.h
  67. -ocmFortranParser.cxx
  68. cmFortranParser.y
  69. Modify cmFortranParser.cxx:
  70. - "#if 0" out yyerrorlab block in range ["goto yyerrlab1", "yyerrlab1:"]
  71. */
  72. #include "cmConfigure.h" // IWYU pragma: keep
  73. #include "cmsys/String.h"
  74. #include <stdlib.h>
  75. #include <string.h>
  76. /*-------------------------------------------------------------------------*/
  77. #define cmFortranParser_cxx
  78. #include "cmFortranParser.h" /* Interface to parser object. */
  79. #include "cmFortranParserTokens.h" /* Need YYSTYPE for YY_DECL. */
  80. /* Forward declare the lexer entry point. */
  81. YY_DECL;
  82. /* Helper function to forward error callback from parser. */
  83. static void cmFortran_yyerror(yyscan_t yyscanner, const char* message)
  84. {
  85. cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
  86. cmFortranParser_Error(parser, message);
  87. }
  88. /* Disable some warnings in the generated code. */
  89. #ifdef _MSC_VER
  90. # pragma warning (disable: 4102) /* Unused goto label. */
  91. # pragma warning (disable: 4065) /* Switch contains default but no case. */
  92. # pragma warning (disable: 4701) /* Local variable may not be initialized. */
  93. # pragma warning (disable: 4702) /* Unreachable code. */
  94. # pragma warning (disable: 4127) /* Conditional expression is constant. */
  95. # pragma warning (disable: 4244) /* Conversion to smaller type, data loss. */
  96. #endif
  97. #line 132 "cmFortranParser.cxx" /* yacc.c:339 */
  98. # ifndef YY_NULLPTR
  99. # if defined __cplusplus && 201103L <= __cplusplus
  100. # define YY_NULLPTR nullptr
  101. # else
  102. # define YY_NULLPTR 0
  103. # endif
  104. # endif
  105. /* Enabling verbose error messages. */
  106. #ifdef YYERROR_VERBOSE
  107. # undef YYERROR_VERBOSE
  108. # define YYERROR_VERBOSE 1
  109. #else
  110. # define YYERROR_VERBOSE 1
  111. #endif
  112. /* In a future release of Bison, this section will be replaced
  113. by #include "cmFortranParserTokens.h". */
  114. #ifndef YY_CMFORTRAN_YY_CMFORTRANPARSERTOKENS_H_INCLUDED
  115. # define YY_CMFORTRAN_YY_CMFORTRANPARSERTOKENS_H_INCLUDED
  116. /* Debug traces. */
  117. #ifndef YYDEBUG
  118. # define YYDEBUG 0
  119. #endif
  120. #if YYDEBUG
  121. extern int cmFortran_yydebug;
  122. #endif
  123. /* Token type. */
  124. #ifndef YYTOKENTYPE
  125. # define YYTOKENTYPE
  126. enum yytokentype
  127. {
  128. EOSTMT = 258,
  129. ASSIGNMENT_OP = 259,
  130. GARBAGE = 260,
  131. CPP_LINE_DIRECTIVE = 261,
  132. CPP_INCLUDE = 262,
  133. F90PPR_INCLUDE = 263,
  134. COCO_INCLUDE = 264,
  135. F90PPR_DEFINE = 265,
  136. CPP_DEFINE = 266,
  137. F90PPR_UNDEF = 267,
  138. CPP_UNDEF = 268,
  139. CPP_IFDEF = 269,
  140. CPP_IFNDEF = 270,
  141. CPP_IF = 271,
  142. CPP_ELSE = 272,
  143. CPP_ELIF = 273,
  144. CPP_ENDIF = 274,
  145. F90PPR_IFDEF = 275,
  146. F90PPR_IFNDEF = 276,
  147. F90PPR_IF = 277,
  148. F90PPR_ELSE = 278,
  149. F90PPR_ELIF = 279,
  150. F90PPR_ENDIF = 280,
  151. COMMA = 281,
  152. COLON = 282,
  153. DCOLON = 283,
  154. LPAREN = 284,
  155. RPAREN = 285,
  156. UNTERMINATED_STRING = 286,
  157. STRING = 287,
  158. WORD = 288,
  159. CPP_INCLUDE_ANGLE = 289,
  160. END = 290,
  161. INCLUDE = 291,
  162. INTERFACE = 292,
  163. MODULE = 293,
  164. SUBMODULE = 294,
  165. USE = 295
  166. };
  167. #endif
  168. /* Tokens. */
  169. #define EOSTMT 258
  170. #define ASSIGNMENT_OP 259
  171. #define GARBAGE 260
  172. #define CPP_LINE_DIRECTIVE 261
  173. #define CPP_INCLUDE 262
  174. #define F90PPR_INCLUDE 263
  175. #define COCO_INCLUDE 264
  176. #define F90PPR_DEFINE 265
  177. #define CPP_DEFINE 266
  178. #define F90PPR_UNDEF 267
  179. #define CPP_UNDEF 268
  180. #define CPP_IFDEF 269
  181. #define CPP_IFNDEF 270
  182. #define CPP_IF 271
  183. #define CPP_ELSE 272
  184. #define CPP_ELIF 273
  185. #define CPP_ENDIF 274
  186. #define F90PPR_IFDEF 275
  187. #define F90PPR_IFNDEF 276
  188. #define F90PPR_IF 277
  189. #define F90PPR_ELSE 278
  190. #define F90PPR_ELIF 279
  191. #define F90PPR_ENDIF 280
  192. #define COMMA 281
  193. #define COLON 282
  194. #define DCOLON 283
  195. #define LPAREN 284
  196. #define RPAREN 285
  197. #define UNTERMINATED_STRING 286
  198. #define STRING 287
  199. #define WORD 288
  200. #define CPP_INCLUDE_ANGLE 289
  201. #define END 290
  202. #define INCLUDE 291
  203. #define INTERFACE 292
  204. #define MODULE 293
  205. #define SUBMODULE 294
  206. #define USE 295
  207. /* Value type. */
  208. #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
  209. union YYSTYPE
  210. {
  211. #line 70 "cmFortranParser.y" /* yacc.c:355 */
  212. char* string;
  213. #line 256 "cmFortranParser.cxx" /* yacc.c:355 */
  214. };
  215. typedef union YYSTYPE YYSTYPE;
  216. # define YYSTYPE_IS_TRIVIAL 1
  217. # define YYSTYPE_IS_DECLARED 1
  218. #endif
  219. int cmFortran_yyparse (yyscan_t yyscanner);
  220. #endif /* !YY_CMFORTRAN_YY_CMFORTRANPARSERTOKENS_H_INCLUDED */
  221. /* Copy the second part of user declarations. */
  222. #line 272 "cmFortranParser.cxx" /* yacc.c:358 */
  223. #ifdef short
  224. # undef short
  225. #endif
  226. #ifdef YYTYPE_UINT8
  227. typedef YYTYPE_UINT8 yytype_uint8;
  228. #else
  229. typedef unsigned char yytype_uint8;
  230. #endif
  231. #ifdef YYTYPE_INT8
  232. typedef YYTYPE_INT8 yytype_int8;
  233. #else
  234. typedef signed char yytype_int8;
  235. #endif
  236. #ifdef YYTYPE_UINT16
  237. typedef YYTYPE_UINT16 yytype_uint16;
  238. #else
  239. typedef unsigned short int yytype_uint16;
  240. #endif
  241. #ifdef YYTYPE_INT16
  242. typedef YYTYPE_INT16 yytype_int16;
  243. #else
  244. typedef short int yytype_int16;
  245. #endif
  246. #ifndef YYSIZE_T
  247. # ifdef __SIZE_TYPE__
  248. # define YYSIZE_T __SIZE_TYPE__
  249. # elif defined size_t
  250. # define YYSIZE_T size_t
  251. # elif ! defined YYSIZE_T
  252. # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
  253. # define YYSIZE_T size_t
  254. # else
  255. # define YYSIZE_T unsigned int
  256. # endif
  257. #endif
  258. #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
  259. #ifndef YY_
  260. # if defined YYENABLE_NLS && YYENABLE_NLS
  261. # if ENABLE_NLS
  262. # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
  263. # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
  264. # endif
  265. # endif
  266. # ifndef YY_
  267. # define YY_(Msgid) Msgid
  268. # endif
  269. #endif
  270. #ifndef YY_ATTRIBUTE
  271. # if (defined __GNUC__ \
  272. && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
  273. || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
  274. # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
  275. # else
  276. # define YY_ATTRIBUTE(Spec) /* empty */
  277. # endif
  278. #endif
  279. #ifndef YY_ATTRIBUTE_PURE
  280. # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
  281. #endif
  282. #ifndef YY_ATTRIBUTE_UNUSED
  283. # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
  284. #endif
  285. #if !defined _Noreturn \
  286. && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
  287. # if defined _MSC_VER && 1200 <= _MSC_VER
  288. # define _Noreturn __declspec (noreturn)
  289. # else
  290. # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
  291. # endif
  292. #endif
  293. /* Suppress unused-variable warnings by "using" E. */
  294. #if ! defined lint || defined __GNUC__
  295. # define YYUSE(E) ((void) (E))
  296. #else
  297. # define YYUSE(E) /* empty */
  298. #endif
  299. #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
  300. /* Suppress an incorrect diagnostic about yylval being uninitialized. */
  301. # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
  302. _Pragma ("GCC diagnostic push") \
  303. _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
  304. _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
  305. # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
  306. _Pragma ("GCC diagnostic pop")
  307. #else
  308. # define YY_INITIAL_VALUE(Value) Value
  309. #endif
  310. #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  311. # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  312. # define YY_IGNORE_MAYBE_UNINITIALIZED_END
  313. #endif
  314. #ifndef YY_INITIAL_VALUE
  315. # define YY_INITIAL_VALUE(Value) /* Nothing. */
  316. #endif
  317. #if ! defined yyoverflow || YYERROR_VERBOSE
  318. /* The parser invokes alloca or malloc; define the necessary symbols. */
  319. # ifdef YYSTACK_USE_ALLOCA
  320. # if YYSTACK_USE_ALLOCA
  321. # ifdef __GNUC__
  322. # define YYSTACK_ALLOC __builtin_alloca
  323. # elif defined __BUILTIN_VA_ARG_INCR
  324. # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
  325. # elif defined _AIX
  326. # define YYSTACK_ALLOC __alloca
  327. # elif defined _MSC_VER
  328. # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
  329. # define alloca _alloca
  330. # else
  331. # define YYSTACK_ALLOC alloca
  332. # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
  333. # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  334. /* Use EXIT_SUCCESS as a witness for stdlib.h. */
  335. # ifndef EXIT_SUCCESS
  336. # define EXIT_SUCCESS 0
  337. # endif
  338. # endif
  339. # endif
  340. # endif
  341. # endif
  342. # ifdef YYSTACK_ALLOC
  343. /* Pacify GCC's 'empty if-body' warning. */
  344. # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
  345. # ifndef YYSTACK_ALLOC_MAXIMUM
  346. /* The OS might guarantee only one guard page at the bottom of the stack,
  347. and a page size can be as small as 4096 bytes. So we cannot safely
  348. invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
  349. to allow for a few compiler-allocated temporary stack slots. */
  350. # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
  351. # endif
  352. # else
  353. # define YYSTACK_ALLOC YYMALLOC
  354. # define YYSTACK_FREE YYFREE
  355. # ifndef YYSTACK_ALLOC_MAXIMUM
  356. # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
  357. # endif
  358. # if (defined __cplusplus && ! defined EXIT_SUCCESS \
  359. && ! ((defined YYMALLOC || defined malloc) \
  360. && (defined YYFREE || defined free)))
  361. # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  362. # ifndef EXIT_SUCCESS
  363. # define EXIT_SUCCESS 0
  364. # endif
  365. # endif
  366. # ifndef YYMALLOC
  367. # define YYMALLOC malloc
  368. # if ! defined malloc && ! defined EXIT_SUCCESS
  369. void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
  370. # endif
  371. # endif
  372. # ifndef YYFREE
  373. # define YYFREE free
  374. # if ! defined free && ! defined EXIT_SUCCESS
  375. void free (void *); /* INFRINGES ON USER NAME SPACE */
  376. # endif
  377. # endif
  378. # endif
  379. #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
  380. #if (! defined yyoverflow \
  381. && (! defined __cplusplus \
  382. || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
  383. /* A type that is properly aligned for any stack member. */
  384. union yyalloc
  385. {
  386. yytype_int16 yyss_alloc;
  387. YYSTYPE yyvs_alloc;
  388. };
  389. /* The size of the maximum gap between one aligned stack and the next. */
  390. # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
  391. /* The size of an array large to enough to hold all stacks, each with
  392. N elements. */
  393. # define YYSTACK_BYTES(N) \
  394. ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
  395. + YYSTACK_GAP_MAXIMUM)
  396. # define YYCOPY_NEEDED 1
  397. /* Relocate STACK from its old location to the new one. The
  398. local variables YYSIZE and YYSTACKSIZE give the old and new number of
  399. elements in the stack, and YYPTR gives the new location of the
  400. stack. Advance YYPTR to a properly aligned location for the next
  401. stack. */
  402. # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
  403. do \
  404. { \
  405. YYSIZE_T yynewbytes; \
  406. YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
  407. Stack = &yyptr->Stack_alloc; \
  408. yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
  409. yyptr += yynewbytes / sizeof (*yyptr); \
  410. } \
  411. while (0)
  412. #endif
  413. #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
  414. /* Copy COUNT objects from SRC to DST. The source and destination do
  415. not overlap. */
  416. # ifndef YYCOPY
  417. # if defined __GNUC__ && 1 < __GNUC__
  418. # define YYCOPY(Dst, Src, Count) \
  419. __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
  420. # else
  421. # define YYCOPY(Dst, Src, Count) \
  422. do \
  423. { \
  424. YYSIZE_T yyi; \
  425. for (yyi = 0; yyi < (Count); yyi++) \
  426. (Dst)[yyi] = (Src)[yyi]; \
  427. } \
  428. while (0)
  429. # endif
  430. # endif
  431. #endif /* !YYCOPY_NEEDED */
  432. /* YYFINAL -- State number of the termination state. */
  433. #define YYFINAL 2
  434. /* YYLAST -- Last index in YYTABLE. */
  435. #define YYLAST 593
  436. /* YYNTOKENS -- Number of terminals. */
  437. #define YYNTOKENS 41
  438. /* YYNNTS -- Number of nonterminals. */
  439. #define YYNNTS 14
  440. /* YYNRULES -- Number of rules. */
  441. #define YYNRULES 63
  442. /* YYNSTATES -- Number of states. */
  443. #define YYNSTATES 126
  444. /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
  445. by yylex, with out-of-bounds checking. */
  446. #define YYUNDEFTOK 2
  447. #define YYMAXUTOK 295
  448. #define YYTRANSLATE(YYX) \
  449. ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
  450. /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
  451. as returned by yylex, without out-of-bounds checking. */
  452. static const yytype_uint8 yytranslate[] =
  453. {
  454. 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  455. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  456. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  457. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  458. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  459. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  460. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  461. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  462. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  463. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  464. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  465. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  466. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  467. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  468. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  469. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  470. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  471. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  472. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  473. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  474. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  475. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  476. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  477. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  478. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  479. 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
  480. 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
  481. 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
  482. 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
  483. 35, 36, 37, 38, 39, 40
  484. };
  485. #if YYDEBUG
  486. /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
  487. static const yytype_uint8 yyrline[] =
  488. {
  489. 0, 98, 98, 98, 101, 105, 110, 119, 125, 132,
  490. 137, 141, 146, 154, 159, 164, 169, 174, 179, 184,
  491. 189, 194, 198, 202, 206, 210, 211, 216, 216, 216,
  492. 217, 217, 218, 218, 219, 219, 220, 220, 221, 221,
  493. 222, 222, 223, 223, 224, 224, 225, 225, 228, 229,
  494. 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  495. 240, 241, 242, 243
  496. };
  497. #endif
  498. #if YYDEBUG || YYERROR_VERBOSE || 1
  499. /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
  500. First, the terminals, then, starting at YYNTOKENS, nonterminals. */
  501. static const char *const yytname[] =
  502. {
  503. "$end", "error", "$undefined", "EOSTMT", "ASSIGNMENT_OP", "GARBAGE",
  504. "CPP_LINE_DIRECTIVE", "CPP_INCLUDE", "F90PPR_INCLUDE", "COCO_INCLUDE",
  505. "F90PPR_DEFINE", "CPP_DEFINE", "F90PPR_UNDEF", "CPP_UNDEF", "CPP_IFDEF",
  506. "CPP_IFNDEF", "CPP_IF", "CPP_ELSE", "CPP_ELIF", "CPP_ENDIF",
  507. "F90PPR_IFDEF", "F90PPR_IFNDEF", "F90PPR_IF", "F90PPR_ELSE",
  508. "F90PPR_ELIF", "F90PPR_ENDIF", "COMMA", "COLON", "DCOLON", "LPAREN",
  509. "RPAREN", "UNTERMINATED_STRING", "STRING", "WORD", "CPP_INCLUDE_ANGLE",
  510. "END", "INCLUDE", "INTERFACE", "MODULE", "SUBMODULE", "USE", "$accept",
  511. "code", "stmt", "include", "define", "undef", "ifdef", "ifndef", "if",
  512. "elif", "else", "endif", "other", "misc_code", YY_NULLPTR
  513. };
  514. #endif
  515. # ifdef YYPRINT
  516. /* YYTOKNUM[NUM] -- (External) token number corresponding to the
  517. (internal) symbol number NUM (which must be that of a token). */
  518. static const yytype_uint16 yytoknum[] =
  519. {
  520. 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
  521. 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
  522. 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
  523. 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
  524. 295
  525. };
  526. # endif
  527. #define YYPACT_NINF -39
  528. #define yypact_value_is_default(Yystate) \
  529. (!!((Yystate) == (-39)))
  530. #define YYTABLE_NINF -1
  531. #define yytable_value_is_error(Yytable_value) \
  532. 0
  533. /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
  534. STATE-NUM. */
  535. static const yytype_int16 yypact[] =
  536. {
  537. -39, 21, -39, 1, -39, -20, -39, -39, -39, -39,
  538. -39, -39, -39, -39, -39, -39, -39, -39, -39, -39,
  539. -39, -39, -39, -39, -39, -39, -24, -18, 20, -8,
  540. -3, 39, -39, 15, 16, 18, 19, 33, -39, -39,
  541. -39, -39, -39, -39, 59, -39, -39, -39, -39, -39,
  542. 35, 36, 37, -39, -39, -39, -39, -39, -39, 76,
  543. 114, 129, 167, 182, -39, -39, -39, -39, -39, -39,
  544. -39, -39, -39, -39, -39, -39, -39, -39, -39, -39,
  545. -39, -39, 220, 235, 273, 288, -21, 26, -39, 326,
  546. 341, 379, 394, 432, 447, -39, -39, -39, -39, -39,
  547. -39, -39, -39, -39, 38, 40, 41, 485, -39, -39,
  548. -39, -39, -39, -39, 45, -39, -39, -39, 43, 500,
  549. 538, -39, -39, -39, 553, -39
  550. };
  551. /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
  552. Performed when YYTABLE does not specify something else to do. Zero
  553. means the default is an error. */
  554. static const yytype_uint8 yydefact[] =
  555. {
  556. 2, 0, 1, 0, 25, 0, 27, 28, 29, 31,
  557. 30, 33, 32, 34, 36, 38, 42, 40, 44, 35,
  558. 37, 39, 43, 41, 45, 46, 0, 0, 0, 0,
  559. 0, 0, 3, 0, 0, 0, 0, 0, 46, 46,
  560. 46, 46, 26, 46, 0, 46, 46, 4, 46, 46,
  561. 0, 0, 0, 46, 46, 46, 46, 46, 46, 0,
  562. 0, 0, 0, 0, 15, 57, 56, 62, 58, 59,
  563. 60, 61, 63, 55, 48, 49, 50, 51, 52, 53,
  564. 54, 47, 0, 0, 0, 0, 0, 0, 46, 0,
  565. 0, 0, 0, 0, 0, 21, 22, 23, 24, 14,
  566. 10, 13, 9, 6, 0, 0, 0, 0, 5, 16,
  567. 17, 18, 19, 20, 0, 46, 46, 11, 0, 0,
  568. 0, 46, 7, 12, 0, 8
  569. };
  570. /* YYPGOTO[NTERM-NUM]. */
  571. static const yytype_int8 yypgoto[] =
  572. {
  573. -39, -39, -39, -39, -39, -39, -39, -39, -39, -39,
  574. -39, -39, -38, -39
  575. };
  576. /* YYDEFGOTO[NTERM-NUM]. */
  577. static const yytype_int8 yydefgoto[] =
  578. {
  579. -1, 1, 32, 33, 34, 35, 36, 37, 38, 39,
  580. 40, 41, 44, 81
  581. };
  582. /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
  583. positive, shift that token. If negative, reduce the rule whose
  584. number is the opposite. If YYTABLE_NINF, syntax error. */
  585. static const yytype_uint8 yytable[] =
  586. {
  587. 59, 60, 61, 62, 42, 63, 104, 82, 83, 105,
  588. 84, 85, 43, 45, 46, 89, 90, 91, 92, 93,
  589. 94, 2, 3, 47, 4, 49, 50, 5, 6, 7,
  590. 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
  591. 18, 19, 20, 21, 22, 23, 24, 54, 0, 55,
  592. 107, 56, 57, 48, 106, 25, 26, 27, 28, 29,
  593. 30, 31, 64, 65, 66, 51, 58, 52, 86, 87,
  594. 88, 114, 53, 115, 116, 118, 121, 119, 120, 95,
  595. 65, 66, 0, 124, 0, 67, 68, 69, 70, 71,
  596. 72, 73, 74, 0, 75, 76, 77, 78, 79, 80,
  597. 0, 0, 67, 68, 69, 70, 71, 72, 73, 74,
  598. 0, 75, 76, 77, 78, 79, 80, 96, 65, 66,
  599. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  600. 0, 0, 97, 65, 66, 0, 0, 0, 0, 0,
  601. 67, 68, 69, 70, 71, 72, 73, 74, 0, 75,
  602. 76, 77, 78, 79, 80, 67, 68, 69, 70, 71,
  603. 72, 73, 74, 0, 75, 76, 77, 78, 79, 80,
  604. 98, 65, 66, 0, 0, 0, 0, 0, 0, 0,
  605. 0, 0, 0, 0, 0, 99, 65, 66, 0, 0,
  606. 0, 0, 0, 67, 68, 69, 70, 71, 72, 73,
  607. 74, 0, 75, 76, 77, 78, 79, 80, 67, 68,
  608. 69, 70, 71, 72, 73, 74, 0, 75, 76, 77,
  609. 78, 79, 80, 100, 65, 66, 0, 0, 0, 0,
  610. 0, 0, 0, 0, 0, 0, 0, 0, 101, 65,
  611. 66, 0, 0, 0, 0, 0, 67, 68, 69, 70,
  612. 71, 72, 73, 74, 0, 75, 76, 77, 78, 79,
  613. 80, 67, 68, 69, 70, 71, 72, 73, 74, 0,
  614. 75, 76, 77, 78, 79, 80, 102, 65, 66, 0,
  615. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  616. 0, 103, 65, 66, 0, 0, 0, 0, 0, 67,
  617. 68, 69, 70, 71, 72, 73, 74, 0, 75, 76,
  618. 77, 78, 79, 80, 67, 68, 69, 70, 71, 72,
  619. 73, 74, 0, 75, 76, 77, 78, 79, 80, 108,
  620. 65, 66, 0, 0, 0, 0, 0, 0, 0, 0,
  621. 0, 0, 0, 0, 109, 65, 66, 0, 0, 0,
  622. 0, 0, 67, 68, 69, 70, 71, 72, 73, 74,
  623. 0, 75, 76, 77, 78, 79, 80, 67, 68, 69,
  624. 70, 71, 72, 73, 74, 0, 75, 76, 77, 78,
  625. 79, 80, 110, 65, 66, 0, 0, 0, 0, 0,
  626. 0, 0, 0, 0, 0, 0, 0, 111, 65, 66,
  627. 0, 0, 0, 0, 0, 67, 68, 69, 70, 71,
  628. 72, 73, 74, 0, 75, 76, 77, 78, 79, 80,
  629. 67, 68, 69, 70, 71, 72, 73, 74, 0, 75,
  630. 76, 77, 78, 79, 80, 112, 65, 66, 0, 0,
  631. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  632. 113, 65, 66, 0, 0, 0, 0, 0, 67, 68,
  633. 69, 70, 71, 72, 73, 74, 0, 75, 76, 77,
  634. 78, 79, 80, 67, 68, 69, 70, 71, 72, 73,
  635. 74, 0, 75, 76, 77, 78, 79, 80, 117, 65,
  636. 66, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  637. 0, 0, 0, 122, 65, 66, 0, 0, 0, 0,
  638. 0, 67, 68, 69, 70, 71, 72, 73, 74, 0,
  639. 75, 76, 77, 78, 79, 80, 67, 68, 69, 70,
  640. 71, 72, 73, 74, 0, 75, 76, 77, 78, 79,
  641. 80, 123, 65, 66, 0, 0, 0, 0, 0, 0,
  642. 0, 0, 0, 0, 0, 0, 125, 65, 66, 0,
  643. 0, 0, 0, 0, 67, 68, 69, 70, 71, 72,
  644. 73, 74, 0, 75, 76, 77, 78, 79, 80, 67,
  645. 68, 69, 70, 71, 72, 73, 74, 0, 75, 76,
  646. 77, 78, 79, 80
  647. };
  648. static const yytype_int8 yycheck[] =
  649. {
  650. 38, 39, 40, 41, 3, 43, 27, 45, 46, 30,
  651. 48, 49, 32, 37, 32, 53, 54, 55, 56, 57,
  652. 58, 0, 1, 3, 3, 33, 29, 6, 7, 8,
  653. 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
  654. 19, 20, 21, 22, 23, 24, 25, 32, -1, 33,
  655. 88, 33, 33, 33, 28, 34, 35, 36, 37, 38,
  656. 39, 40, 3, 4, 5, 26, 33, 28, 33, 33,
  657. 33, 33, 33, 33, 33, 30, 33, 115, 116, 3,
  658. 4, 5, -1, 121, -1, 26, 27, 28, 29, 30,
  659. 31, 32, 33, -1, 35, 36, 37, 38, 39, 40,
  660. -1, -1, 26, 27, 28, 29, 30, 31, 32, 33,
  661. -1, 35, 36, 37, 38, 39, 40, 3, 4, 5,
  662. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  663. -1, -1, 3, 4, 5, -1, -1, -1, -1, -1,
  664. 26, 27, 28, 29, 30, 31, 32, 33, -1, 35,
  665. 36, 37, 38, 39, 40, 26, 27, 28, 29, 30,
  666. 31, 32, 33, -1, 35, 36, 37, 38, 39, 40,
  667. 3, 4, 5, -1, -1, -1, -1, -1, -1, -1,
  668. -1, -1, -1, -1, -1, 3, 4, 5, -1, -1,
  669. -1, -1, -1, 26, 27, 28, 29, 30, 31, 32,
  670. 33, -1, 35, 36, 37, 38, 39, 40, 26, 27,
  671. 28, 29, 30, 31, 32, 33, -1, 35, 36, 37,
  672. 38, 39, 40, 3, 4, 5, -1, -1, -1, -1,
  673. -1, -1, -1, -1, -1, -1, -1, -1, 3, 4,
  674. 5, -1, -1, -1, -1, -1, 26, 27, 28, 29,
  675. 30, 31, 32, 33, -1, 35, 36, 37, 38, 39,
  676. 40, 26, 27, 28, 29, 30, 31, 32, 33, -1,
  677. 35, 36, 37, 38, 39, 40, 3, 4, 5, -1,
  678. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  679. -1, 3, 4, 5, -1, -1, -1, -1, -1, 26,
  680. 27, 28, 29, 30, 31, 32, 33, -1, 35, 36,
  681. 37, 38, 39, 40, 26, 27, 28, 29, 30, 31,
  682. 32, 33, -1, 35, 36, 37, 38, 39, 40, 3,
  683. 4, 5, -1, -1, -1, -1, -1, -1, -1, -1,
  684. -1, -1, -1, -1, 3, 4, 5, -1, -1, -1,
  685. -1, -1, 26, 27, 28, 29, 30, 31, 32, 33,
  686. -1, 35, 36, 37, 38, 39, 40, 26, 27, 28,
  687. 29, 30, 31, 32, 33, -1, 35, 36, 37, 38,
  688. 39, 40, 3, 4, 5, -1, -1, -1, -1, -1,
  689. -1, -1, -1, -1, -1, -1, -1, 3, 4, 5,
  690. -1, -1, -1, -1, -1, 26, 27, 28, 29, 30,
  691. 31, 32, 33, -1, 35, 36, 37, 38, 39, 40,
  692. 26, 27, 28, 29, 30, 31, 32, 33, -1, 35,
  693. 36, 37, 38, 39, 40, 3, 4, 5, -1, -1,
  694. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  695. 3, 4, 5, -1, -1, -1, -1, -1, 26, 27,
  696. 28, 29, 30, 31, 32, 33, -1, 35, 36, 37,
  697. 38, 39, 40, 26, 27, 28, 29, 30, 31, 32,
  698. 33, -1, 35, 36, 37, 38, 39, 40, 3, 4,
  699. 5, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  700. -1, -1, -1, 3, 4, 5, -1, -1, -1, -1,
  701. -1, 26, 27, 28, 29, 30, 31, 32, 33, -1,
  702. 35, 36, 37, 38, 39, 40, 26, 27, 28, 29,
  703. 30, 31, 32, 33, -1, 35, 36, 37, 38, 39,
  704. 40, 3, 4, 5, -1, -1, -1, -1, -1, -1,
  705. -1, -1, -1, -1, -1, -1, 3, 4, 5, -1,
  706. -1, -1, -1, -1, 26, 27, 28, 29, 30, 31,
  707. 32, 33, -1, 35, 36, 37, 38, 39, 40, 26,
  708. 27, 28, 29, 30, 31, 32, 33, -1, 35, 36,
  709. 37, 38, 39, 40
  710. };
  711. /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
  712. symbol of state STATE-NUM. */
  713. static const yytype_uint8 yystos[] =
  714. {
  715. 0, 42, 0, 1, 3, 6, 7, 8, 9, 10,
  716. 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
  717. 21, 22, 23, 24, 25, 34, 35, 36, 37, 38,
  718. 39, 40, 43, 44, 45, 46, 47, 48, 49, 50,
  719. 51, 52, 3, 32, 53, 37, 32, 3, 33, 33,
  720. 29, 26, 28, 33, 32, 33, 33, 33, 33, 53,
  721. 53, 53, 53, 53, 3, 4, 5, 26, 27, 28,
  722. 29, 30, 31, 32, 33, 35, 36, 37, 38, 39,
  723. 40, 54, 53, 53, 53, 53, 33, 33, 33, 53,
  724. 53, 53, 53, 53, 53, 3, 3, 3, 3, 3,
  725. 3, 3, 3, 3, 27, 30, 28, 53, 3, 3,
  726. 3, 3, 3, 3, 33, 33, 33, 3, 30, 53,
  727. 53, 33, 3, 3, 53, 3
  728. };
  729. /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
  730. static const yytype_uint8 yyr1[] =
  731. {
  732. 0, 41, 42, 42, 43, 43, 43, 43, 43, 43,
  733. 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
  734. 43, 43, 43, 43, 43, 43, 43, 44, 44, 44,
  735. 45, 45, 46, 46, 47, 47, 48, 48, 49, 49,
  736. 50, 50, 51, 51, 52, 52, 53, 53, 54, 54,
  737. 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
  738. 54, 54, 54, 54
  739. };
  740. /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
  741. static const yytype_uint8 yyr2[] =
  742. {
  743. 0, 2, 0, 2, 2, 4, 4, 7, 9, 4,
  744. 4, 5, 7, 4, 4, 3, 4, 4, 4, 4,
  745. 4, 3, 3, 3, 3, 1, 2, 1, 1, 1,
  746. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  747. 1, 1, 1, 1, 1, 1, 0, 2, 1, 1,
  748. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  749. 1, 1, 1, 1
  750. };
  751. #define yyerrok (yyerrstatus = 0)
  752. #define yyclearin (yychar = YYEMPTY)
  753. #define YYEMPTY (-2)
  754. #define YYEOF 0
  755. #define YYACCEPT goto yyacceptlab
  756. #define YYABORT goto yyabortlab
  757. #define YYERROR goto yyerrorlab
  758. #define YYRECOVERING() (!!yyerrstatus)
  759. #define YYBACKUP(Token, Value) \
  760. do \
  761. if (yychar == YYEMPTY) \
  762. { \
  763. yychar = (Token); \
  764. yylval = (Value); \
  765. YYPOPSTACK (yylen); \
  766. yystate = *yyssp; \
  767. goto yybackup; \
  768. } \
  769. else \
  770. { \
  771. yyerror (yyscanner, YY_("syntax error: cannot back up")); \
  772. YYERROR; \
  773. } \
  774. while (0)
  775. /* Error token number */
  776. #define YYTERROR 1
  777. #define YYERRCODE 256
  778. /* Enable debugging if requested. */
  779. #if YYDEBUG
  780. # ifndef YYFPRINTF
  781. # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
  782. # define YYFPRINTF fprintf
  783. # endif
  784. # define YYDPRINTF(Args) \
  785. do { \
  786. if (yydebug) \
  787. YYFPRINTF Args; \
  788. } while (0)
  789. /* This macro is provided for backward compatibility. */
  790. #ifndef YY_LOCATION_PRINT
  791. # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
  792. #endif
  793. # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
  794. do { \
  795. if (yydebug) \
  796. { \
  797. YYFPRINTF (stderr, "%s ", Title); \
  798. yy_symbol_print (stderr, \
  799. Type, Value, yyscanner); \
  800. YYFPRINTF (stderr, "\n"); \
  801. } \
  802. } while (0)
  803. /*----------------------------------------.
  804. | Print this symbol's value on YYOUTPUT. |
  805. `----------------------------------------*/
  806. static void
  807. yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, yyscan_t yyscanner)
  808. {
  809. FILE *yyo = yyoutput;
  810. YYUSE (yyo);
  811. YYUSE (yyscanner);
  812. if (!yyvaluep)
  813. return;
  814. # ifdef YYPRINT
  815. if (yytype < YYNTOKENS)
  816. YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
  817. # endif
  818. YYUSE (yytype);
  819. }
  820. /*--------------------------------.
  821. | Print this symbol on YYOUTPUT. |
  822. `--------------------------------*/
  823. static void
  824. yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, yyscan_t yyscanner)
  825. {
  826. YYFPRINTF (yyoutput, "%s %s (",
  827. yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
  828. yy_symbol_value_print (yyoutput, yytype, yyvaluep, yyscanner);
  829. YYFPRINTF (yyoutput, ")");
  830. }
  831. /*------------------------------------------------------------------.
  832. | yy_stack_print -- Print the state stack from its BOTTOM up to its |
  833. | TOP (included). |
  834. `------------------------------------------------------------------*/
  835. static void
  836. yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
  837. {
  838. YYFPRINTF (stderr, "Stack now");
  839. for (; yybottom <= yytop; yybottom++)
  840. {
  841. int yybot = *yybottom;
  842. YYFPRINTF (stderr, " %d", yybot);
  843. }
  844. YYFPRINTF (stderr, "\n");
  845. }
  846. # define YY_STACK_PRINT(Bottom, Top) \
  847. do { \
  848. if (yydebug) \
  849. yy_stack_print ((Bottom), (Top)); \
  850. } while (0)
  851. /*------------------------------------------------.
  852. | Report that the YYRULE is going to be reduced. |
  853. `------------------------------------------------*/
  854. static void
  855. yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, yyscan_t yyscanner)
  856. {
  857. unsigned long int yylno = yyrline[yyrule];
  858. int yynrhs = yyr2[yyrule];
  859. int yyi;
  860. YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
  861. yyrule - 1, yylno);
  862. /* The symbols being reduced. */
  863. for (yyi = 0; yyi < yynrhs; yyi++)
  864. {
  865. YYFPRINTF (stderr, " $%d = ", yyi + 1);
  866. yy_symbol_print (stderr,
  867. yystos[yyssp[yyi + 1 - yynrhs]],
  868. &(yyvsp[(yyi + 1) - (yynrhs)])
  869. , yyscanner);
  870. YYFPRINTF (stderr, "\n");
  871. }
  872. }
  873. # define YY_REDUCE_PRINT(Rule) \
  874. do { \
  875. if (yydebug) \
  876. yy_reduce_print (yyssp, yyvsp, Rule, yyscanner); \
  877. } while (0)
  878. /* Nonzero means print parse trace. It is left uninitialized so that
  879. multiple parsers can coexist. */
  880. int yydebug;
  881. #else /* !YYDEBUG */
  882. # define YYDPRINTF(Args)
  883. # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
  884. # define YY_STACK_PRINT(Bottom, Top)
  885. # define YY_REDUCE_PRINT(Rule)
  886. #endif /* !YYDEBUG */
  887. /* YYINITDEPTH -- initial size of the parser's stacks. */
  888. #ifndef YYINITDEPTH
  889. # define YYINITDEPTH 200
  890. #endif
  891. /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
  892. if the built-in stack extension method is used).
  893. Do not make this value too large; the results are undefined if
  894. YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
  895. evaluated with infinite-precision integer arithmetic. */
  896. #ifndef YYMAXDEPTH
  897. # define YYMAXDEPTH 10000
  898. #endif
  899. #if YYERROR_VERBOSE
  900. # ifndef yystrlen
  901. # if defined __GLIBC__ && defined _STRING_H
  902. # define yystrlen strlen
  903. # else
  904. /* Return the length of YYSTR. */
  905. static YYSIZE_T
  906. yystrlen (const char *yystr)
  907. {
  908. YYSIZE_T yylen;
  909. for (yylen = 0; yystr[yylen]; yylen++)
  910. continue;
  911. return yylen;
  912. }
  913. # endif
  914. # endif
  915. # ifndef yystpcpy
  916. # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
  917. # define yystpcpy stpcpy
  918. # else
  919. /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
  920. YYDEST. */
  921. static char *
  922. yystpcpy (char *yydest, const char *yysrc)
  923. {
  924. char *yyd = yydest;
  925. const char *yys = yysrc;
  926. while ((*yyd++ = *yys++) != '\0')
  927. continue;
  928. return yyd - 1;
  929. }
  930. # endif
  931. # endif
  932. # ifndef yytnamerr
  933. /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
  934. quotes and backslashes, so that it's suitable for yyerror. The
  935. heuristic is that double-quoting is unnecessary unless the string
  936. contains an apostrophe, a comma, or backslash (other than
  937. backslash-backslash). YYSTR is taken from yytname. If YYRES is
  938. null, do not copy; instead, return the length of what the result
  939. would have been. */
  940. static YYSIZE_T
  941. yytnamerr (char *yyres, const char *yystr)
  942. {
  943. if (*yystr == '"')
  944. {
  945. YYSIZE_T yyn = 0;
  946. char const *yyp = yystr;
  947. for (;;)
  948. switch (*++yyp)
  949. {
  950. case '\'':
  951. case ',':
  952. goto do_not_strip_quotes;
  953. case '\\':
  954. if (*++yyp != '\\')
  955. goto do_not_strip_quotes;
  956. /* Fall through. */
  957. default:
  958. if (yyres)
  959. yyres[yyn] = *yyp;
  960. yyn++;
  961. break;
  962. case '"':
  963. if (yyres)
  964. yyres[yyn] = '\0';
  965. return yyn;
  966. }
  967. do_not_strip_quotes: ;
  968. }
  969. if (! yyres)
  970. return yystrlen (yystr);
  971. return yystpcpy (yyres, yystr) - yyres;
  972. }
  973. # endif
  974. /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
  975. about the unexpected token YYTOKEN for the state stack whose top is
  976. YYSSP.
  977. Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
  978. not large enough to hold the message. In that case, also set
  979. *YYMSG_ALLOC to the required number of bytes. Return 2 if the
  980. required number of bytes is too large to store. */
  981. static int
  982. yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
  983. yytype_int16 *yyssp, int yytoken)
  984. {
  985. YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
  986. YYSIZE_T yysize = yysize0;
  987. enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
  988. /* Internationalized format string. */
  989. const char *yyformat = YY_NULLPTR;
  990. /* Arguments of yyformat. */
  991. char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
  992. /* Number of reported tokens (one for the "unexpected", one per
  993. "expected"). */
  994. int yycount = 0;
  995. /* There are many possibilities here to consider:
  996. - If this state is a consistent state with a default action, then
  997. the only way this function was invoked is if the default action
  998. is an error action. In that case, don't check for expected
  999. tokens because there are none.
  1000. - The only way there can be no lookahead present (in yychar) is if
  1001. this state is a consistent state with a default action. Thus,
  1002. detecting the absence of a lookahead is sufficient to determine
  1003. that there is no unexpected or expected token to report. In that
  1004. case, just report a simple "syntax error".
  1005. - Don't assume there isn't a lookahead just because this state is a
  1006. consistent state with a default action. There might have been a
  1007. previous inconsistent state, consistent state with a non-default
  1008. action, or user semantic action that manipulated yychar.
  1009. - Of course, the expected token list depends on states to have
  1010. correct lookahead information, and it depends on the parser not
  1011. to perform extra reductions after fetching a lookahead from the
  1012. scanner and before detecting a syntax error. Thus, state merging
  1013. (from LALR or IELR) and default reductions corrupt the expected
  1014. token list. However, the list is correct for canonical LR with
  1015. one exception: it will still contain any token that will not be
  1016. accepted due to an error action in a later state.
  1017. */
  1018. if (yytoken != YYEMPTY)
  1019. {
  1020. int yyn = yypact[*yyssp];
  1021. yyarg[yycount++] = yytname[yytoken];
  1022. if (!yypact_value_is_default (yyn))
  1023. {
  1024. /* Start YYX at -YYN if negative to avoid negative indexes in
  1025. YYCHECK. In other words, skip the first -YYN actions for
  1026. this state because they are default actions. */
  1027. int yyxbegin = yyn < 0 ? -yyn : 0;
  1028. /* Stay within bounds of both yycheck and yytname. */
  1029. int yychecklim = YYLAST - yyn + 1;
  1030. int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
  1031. int yyx;
  1032. for (yyx = yyxbegin; yyx < yyxend; ++yyx)
  1033. if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
  1034. && !yytable_value_is_error (yytable[yyx + yyn]))
  1035. {
  1036. if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
  1037. {
  1038. yycount = 1;
  1039. yysize = yysize0;
  1040. break;
  1041. }
  1042. yyarg[yycount++] = yytname[yyx];
  1043. {
  1044. YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
  1045. if (! (yysize <= yysize1
  1046. && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
  1047. return 2;
  1048. yysize = yysize1;
  1049. }
  1050. }
  1051. }
  1052. }
  1053. switch (yycount)
  1054. {
  1055. # define YYCASE_(N, S) \
  1056. case N: \
  1057. yyformat = S; \
  1058. break
  1059. YYCASE_(0, YY_("syntax error"));
  1060. YYCASE_(1, YY_("syntax error, unexpected %s"));
  1061. YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
  1062. YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
  1063. YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
  1064. YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
  1065. # undef YYCASE_
  1066. }
  1067. {
  1068. YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
  1069. if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
  1070. return 2;
  1071. yysize = yysize1;
  1072. }
  1073. if (*yymsg_alloc < yysize)
  1074. {
  1075. *yymsg_alloc = 2 * yysize;
  1076. if (! (yysize <= *yymsg_alloc
  1077. && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
  1078. *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
  1079. return 1;
  1080. }
  1081. /* Avoid sprintf, as that infringes on the user's name space.
  1082. Don't have undefined behavior even if the translation
  1083. produced a string with the wrong number of "%s"s. */
  1084. {
  1085. char *yyp = *yymsg;
  1086. int yyi = 0;
  1087. while ((*yyp = *yyformat) != '\0')
  1088. if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
  1089. {
  1090. yyp += yytnamerr (yyp, yyarg[yyi++]);
  1091. yyformat += 2;
  1092. }
  1093. else
  1094. {
  1095. yyp++;
  1096. yyformat++;
  1097. }
  1098. }
  1099. return 0;
  1100. }
  1101. #endif /* YYERROR_VERBOSE */
  1102. /*-----------------------------------------------.
  1103. | Release the memory associated to this symbol. |
  1104. `-----------------------------------------------*/
  1105. static void
  1106. yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, yyscan_t yyscanner)
  1107. {
  1108. YYUSE (yyvaluep);
  1109. YYUSE (yyscanner);
  1110. if (!yymsg)
  1111. yymsg = "Deleting";
  1112. YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
  1113. YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  1114. YYUSE (yytype);
  1115. YY_IGNORE_MAYBE_UNINITIALIZED_END
  1116. }
  1117. /*----------.
  1118. | yyparse. |
  1119. `----------*/
  1120. int
  1121. yyparse (yyscan_t yyscanner)
  1122. {
  1123. /* The lookahead symbol. */
  1124. int yychar;
  1125. /* The semantic value of the lookahead symbol. */
  1126. /* Default value used for initialization, for pacifying older GCCs
  1127. or non-GCC compilers. */
  1128. YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
  1129. YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
  1130. /* Number of syntax errors so far. */
  1131. int yynerrs;
  1132. int yystate;
  1133. /* Number of tokens to shift before error messages enabled. */
  1134. int yyerrstatus;
  1135. /* The stacks and their tools:
  1136. 'yyss': related to states.
  1137. 'yyvs': related to semantic values.
  1138. Refer to the stacks through separate pointers, to allow yyoverflow
  1139. to reallocate them elsewhere. */
  1140. /* The state stack. */
  1141. yytype_int16 yyssa[YYINITDEPTH];
  1142. yytype_int16 *yyss;
  1143. yytype_int16 *yyssp;
  1144. /* The semantic value stack. */
  1145. YYSTYPE yyvsa[YYINITDEPTH];
  1146. YYSTYPE *yyvs;
  1147. YYSTYPE *yyvsp;
  1148. YYSIZE_T yystacksize;
  1149. int yyn;
  1150. int yyresult;
  1151. /* Lookahead token as an internal (translated) token number. */
  1152. int yytoken = 0;
  1153. /* The variables used to return semantic value and location from the
  1154. action routines. */
  1155. YYSTYPE yyval;
  1156. #if YYERROR_VERBOSE
  1157. /* Buffer for error messages, and its allocated size. */
  1158. char yymsgbuf[128];
  1159. char *yymsg = yymsgbuf;
  1160. YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
  1161. #endif
  1162. #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
  1163. /* The number of symbols on the RHS of the reduced rule.
  1164. Keep to zero when no symbol should be popped. */
  1165. int yylen = 0;
  1166. yyssp = yyss = yyssa;
  1167. yyvsp = yyvs = yyvsa;
  1168. yystacksize = YYINITDEPTH;
  1169. YYDPRINTF ((stderr, "Starting parse\n"));
  1170. yystate = 0;
  1171. yyerrstatus = 0;
  1172. yynerrs = 0;
  1173. yychar = YYEMPTY; /* Cause a token to be read. */
  1174. goto yysetstate;
  1175. /*------------------------------------------------------------.
  1176. | yynewstate -- Push a new state, which is found in yystate. |
  1177. `------------------------------------------------------------*/
  1178. yynewstate:
  1179. /* In all cases, when you get here, the value and location stacks
  1180. have just been pushed. So pushing a state here evens the stacks. */
  1181. yyssp++;
  1182. yysetstate:
  1183. *yyssp = yystate;
  1184. if (yyss + yystacksize - 1 <= yyssp)
  1185. {
  1186. /* Get the current used size of the three stacks, in elements. */
  1187. YYSIZE_T yysize = yyssp - yyss + 1;
  1188. #ifdef yyoverflow
  1189. {
  1190. /* Give user a chance to reallocate the stack. Use copies of
  1191. these so that the &'s don't force the real ones into
  1192. memory. */
  1193. YYSTYPE *yyvs1 = yyvs;
  1194. yytype_int16 *yyss1 = yyss;
  1195. /* Each stack pointer address is followed by the size of the
  1196. data in use in that stack, in bytes. This used to be a
  1197. conditional around just the two extra args, but that might
  1198. be undefined if yyoverflow is a macro. */
  1199. yyoverflow (YY_("memory exhausted"),
  1200. &yyss1, yysize * sizeof (*yyssp),
  1201. &yyvs1, yysize * sizeof (*yyvsp),
  1202. &yystacksize);
  1203. yyss = yyss1;
  1204. yyvs = yyvs1;
  1205. }
  1206. #else /* no yyoverflow */
  1207. # ifndef YYSTACK_RELOCATE
  1208. goto yyexhaustedlab;
  1209. # else
  1210. /* Extend the stack our own way. */
  1211. if (YYMAXDEPTH <= yystacksize)
  1212. goto yyexhaustedlab;
  1213. yystacksize *= 2;
  1214. if (YYMAXDEPTH < yystacksize)
  1215. yystacksize = YYMAXDEPTH;
  1216. {
  1217. yytype_int16 *yyss1 = yyss;
  1218. union yyalloc *yyptr =
  1219. (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
  1220. if (! yyptr)
  1221. goto yyexhaustedlab;
  1222. YYSTACK_RELOCATE (yyss_alloc, yyss);
  1223. YYSTACK_RELOCATE (yyvs_alloc, yyvs);
  1224. # undef YYSTACK_RELOCATE
  1225. if (yyss1 != yyssa)
  1226. YYSTACK_FREE (yyss1);
  1227. }
  1228. # endif
  1229. #endif /* no yyoverflow */
  1230. yyssp = yyss + yysize - 1;
  1231. yyvsp = yyvs + yysize - 1;
  1232. YYDPRINTF ((stderr, "Stack size increased to %lu\n",
  1233. (unsigned long int) yystacksize));
  1234. if (yyss + yystacksize - 1 <= yyssp)
  1235. YYABORT;
  1236. }
  1237. YYDPRINTF ((stderr, "Entering state %d\n", yystate));
  1238. if (yystate == YYFINAL)
  1239. YYACCEPT;
  1240. goto yybackup;
  1241. /*-----------.
  1242. | yybackup. |
  1243. `-----------*/
  1244. yybackup:
  1245. /* Do appropriate processing given the current state. Read a
  1246. lookahead token if we need one and don't already have one. */
  1247. /* First try to decide what to do without reference to lookahead token. */
  1248. yyn = yypact[yystate];
  1249. if (yypact_value_is_default (yyn))
  1250. goto yydefault;
  1251. /* Not known => get a lookahead token if don't already have one. */
  1252. /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
  1253. if (yychar == YYEMPTY)
  1254. {
  1255. YYDPRINTF ((stderr, "Reading a token: "));
  1256. yychar = yylex (&yylval, yyscanner);
  1257. }
  1258. if (yychar <= YYEOF)
  1259. {
  1260. yychar = yytoken = YYEOF;
  1261. YYDPRINTF ((stderr, "Now at end of input.\n"));
  1262. }
  1263. else
  1264. {
  1265. yytoken = YYTRANSLATE (yychar);
  1266. YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
  1267. }
  1268. /* If the proper action on seeing token YYTOKEN is to reduce or to
  1269. detect an error, take that action. */
  1270. yyn += yytoken;
  1271. if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
  1272. goto yydefault;
  1273. yyn = yytable[yyn];
  1274. if (yyn <= 0)
  1275. {
  1276. if (yytable_value_is_error (yyn))
  1277. goto yyerrlab;
  1278. yyn = -yyn;
  1279. goto yyreduce;
  1280. }
  1281. /* Count tokens shifted since error; after three, turn off error
  1282. status. */
  1283. if (yyerrstatus)
  1284. yyerrstatus--;
  1285. /* Shift the lookahead token. */
  1286. YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
  1287. /* Discard the shifted token. */
  1288. yychar = YYEMPTY;
  1289. yystate = yyn;
  1290. YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  1291. *++yyvsp = yylval;
  1292. YY_IGNORE_MAYBE_UNINITIALIZED_END
  1293. goto yynewstate;
  1294. /*-----------------------------------------------------------.
  1295. | yydefault -- do the default action for the current state. |
  1296. `-----------------------------------------------------------*/
  1297. yydefault:
  1298. yyn = yydefact[yystate];
  1299. if (yyn == 0)
  1300. goto yyerrlab;
  1301. goto yyreduce;
  1302. /*-----------------------------.
  1303. | yyreduce -- Do a reduction. |
  1304. `-----------------------------*/
  1305. yyreduce:
  1306. /* yyn is the number of a rule to reduce with. */
  1307. yylen = yyr2[yyn];
  1308. /* If YYLEN is nonzero, implement the default value of the action:
  1309. '$$ = $1'.
  1310. Otherwise, the following line sets YYVAL to garbage.
  1311. This behavior is undocumented and Bison
  1312. users should not rely upon it. Assigning to YYVAL
  1313. unconditionally makes the parser a bit smaller, and it avoids a
  1314. GCC warning that YYVAL may be used uninitialized. */
  1315. yyval = yyvsp[1-yylen];
  1316. YY_REDUCE_PRINT (yyn);
  1317. switch (yyn)
  1318. {
  1319. case 4:
  1320. #line 101 "cmFortranParser.y" /* yacc.c:1646 */
  1321. {
  1322. cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
  1323. cmFortranParser_SetInInterface(parser, true);
  1324. }
  1325. #line 1536 "cmFortranParser.cxx" /* yacc.c:1646 */
  1326. break;
  1327. case 5:
  1328. #line 105 "cmFortranParser.y" /* yacc.c:1646 */
  1329. {
  1330. cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
  1331. cmFortranParser_RuleUse(parser, (yyvsp[-2].string));
  1332. free((yyvsp[-2].string));
  1333. }
  1334. #line 1546 "cmFortranParser.cxx" /* yacc.c:1646 */
  1335. break;
  1336. case 6:
  1337. #line 110 "cmFortranParser.y" /* yacc.c:1646 */
  1338. {
  1339. cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
  1340. if (cmsysString_strcasecmp((yyvsp[-2].string), "function") != 0 &&
  1341. cmsysString_strcasecmp((yyvsp[-2].string), "procedure") != 0 &&
  1342. cmsysString_strcasecmp((yyvsp[-2].string), "subroutine") != 0) {
  1343. cmFortranParser_RuleModule(parser, (yyvsp[-2].string));
  1344. }
  1345. free((yyvsp[-2].string));
  1346. }
  1347. #line 1560 "cmFortranParser.cxx" /* yacc.c:1646 */
  1348. break;
  1349. case 7:
  1350. #line 119 "cmFortranParser.y" /* yacc.c:1646 */
  1351. {
  1352. cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
  1353. cmFortranParser_RuleUse(parser, (yyvsp[-4].string));
  1354. free((yyvsp[-4].string));
  1355. free((yyvsp[-2].string));
  1356. }
  1357. #line 1571 "cmFortranParser.cxx" /* yacc.c:1646 */
  1358. break;
  1359. case 8:
  1360. #line 125 "cmFortranParser.y" /* yacc.c:1646 */
  1361. {
  1362. cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
  1363. cmFortranParser_RuleUse(parser, (yyvsp[-6].string));
  1364. free((yyvsp[-6].string));
  1365. free((yyvsp[-4].string));
  1366. free((yyvsp[-2].string));
  1367. }
  1368. #line 1583 "cmFortranParser.cxx" /* yacc.c:1646 */
  1369. break;
  1370. case 9:
  1371. #line 132 "cmFortranParser.y" /* yacc.c:1646 */
  1372. {
  1373. cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
  1374. cmFortranParser_SetInInterface(parser, true);
  1375. free((yyvsp[-2].string));
  1376. }
  1377. #line 1593 "cmFortranParser.cxx" /* yacc.c:1646 */
  1378. break;
  1379. case 10:
  1380. #line 137 "cmFortranParser.y" /* yacc.c:1646 */
  1381. {
  1382. cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
  1383. cmFortranParser_SetInInterface(parser, false);
  1384. }
  1385. #line 1602 "cmFortranParser.cxx" /* yacc.c:1646 */
  1386. break;
  1387. case 11:
  1388. #line 141 "cmFortranParser.y" /* yacc.c:1646 */
  1389. {
  1390. cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
  1391. cmFortranParser_RuleUse(parser, (yyvsp[-2].string));
  1392. free((yyvsp[-2].string));
  1393. }
  1394. #line 1612 "cmFortranParser.cxx" /* yacc.c:1646 */
  1395. break;
  1396. case 12:
  1397. #line 146 "cmFortranParser.y" /* yacc.c:1646 */
  1398. {
  1399. if (cmsysString_strcasecmp((yyvsp[-4].string), "non_intrinsic") == 0) {
  1400. cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
  1401. cmFortranParser_RuleUse(parser, (yyvsp[-2].string));
  1402. }
  1403. free((yyvsp[-4].string));
  1404. free((yyvsp[-2].string));
  1405. }
  1406. #line 1625 "cmFortranParser.cxx" /* yacc.c:1646 */
  1407. break;
  1408. case 13:
  1409. #line 154 "cmFortranParser.y" /* yacc.c:1646 */
  1410. {
  1411. cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
  1412. cmFortranParser_RuleInclude(parser, (yyvsp[-2].string));
  1413. free((yyvsp[-2].string));
  1414. }
  1415. #line 1635 "cmFortranParser.cxx" /* yacc.c:1646 */
  1416. break;
  1417. case 14:
  1418. #line 159 "cmFortranParser.y" /* yacc.c:1646 */
  1419. {
  1420. cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
  1421. cmFortranParser_RuleLineDirective(parser, (yyvsp[-2].string));
  1422. free((yyvsp[-2].string));
  1423. }
  1424. #line 1645 "cmFortranParser.cxx" /* yacc.c:1646 */
  1425. break;
  1426. case 15:
  1427. #line 164 "cmFortranParser.y" /* yacc.c:1646 */
  1428. {
  1429. cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
  1430. cmFortranParser_RuleInclude(parser, (yyvsp[-2].string));
  1431. free((yyvsp[-2].string));
  1432. }
  1433. #line 1655 "cmFortranParser.cxx" /* yacc.c:1646 */
  1434. break;
  1435. case 16:
  1436. #line 169 "cmFortranParser.y" /* yacc.c:1646 */
  1437. {
  1438. cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
  1439. cmFortranParser_RuleInclude(parser, (yyvsp[-2].string));
  1440. free((yyvsp[-2].string));
  1441. }
  1442. #line 1665 "cmFortranParser.cxx" /* yacc.c:1646 */
  1443. break;
  1444. case 17:
  1445. #line 174 "cmFortranParser.y" /* yacc.c:1646 */
  1446. {
  1447. cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
  1448. cmFortranParser_RuleDefine(parser, (yyvsp[-2].string));
  1449. free((yyvsp[-2].string));
  1450. }
  1451. #line 1675 "cmFortranParser.cxx" /* yacc.c:1646 */
  1452. break;
  1453. case 18:
  1454. #line 179 "cmFortranParser.y" /* yacc.c:1646 */
  1455. {
  1456. cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
  1457. cmFortranParser_RuleUndef(parser, (yyvsp[-2].string));
  1458. free((yyvsp[-2].string));
  1459. }
  1460. #line 1685 "cmFortranParser.cxx" /* yacc.c:1646 */
  1461. break;
  1462. case 19:
  1463. #line 184 "cmFortranParser.y" /* yacc.c:1646 */
  1464. {
  1465. cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
  1466. cmFortranParser_RuleIfdef(parser, (yyvsp[-2].string));
  1467. free((yyvsp[-2].string));
  1468. }
  1469. #line 1695 "cmFortranParser.cxx" /* yacc.c:1646 */
  1470. break;
  1471. case 20:
  1472. #line 189 "cmFortranParser.y" /* yacc.c:1646 */
  1473. {
  1474. cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
  1475. cmFortranParser_RuleIfndef(parser, (yyvsp[-2].string));
  1476. free((yyvsp[-2].string));
  1477. }
  1478. #line 1705 "cmFortranParser.cxx" /* yacc.c:1646 */
  1479. break;
  1480. case 21:
  1481. #line 194 "cmFortranParser.y" /* yacc.c:1646 */
  1482. {
  1483. cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
  1484. cmFortranParser_RuleIf(parser);
  1485. }
  1486. #line 1714 "cmFortranParser.cxx" /* yacc.c:1646 */
  1487. break;
  1488. case 22:
  1489. #line 198 "cmFortranParser.y" /* yacc.c:1646 */
  1490. {
  1491. cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
  1492. cmFortranParser_RuleElif(parser);
  1493. }
  1494. #line 1723 "cmFortranParser.cxx" /* yacc.c:1646 */
  1495. break;
  1496. case 23:
  1497. #line 202 "cmFortranParser.y" /* yacc.c:1646 */
  1498. {
  1499. cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
  1500. cmFortranParser_RuleElse(parser);
  1501. }
  1502. #line 1732 "cmFortranParser.cxx" /* yacc.c:1646 */
  1503. break;
  1504. case 24:
  1505. #line 206 "cmFortranParser.y" /* yacc.c:1646 */
  1506. {
  1507. cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
  1508. cmFortranParser_RuleEndif(parser);
  1509. }
  1510. #line 1741 "cmFortranParser.cxx" /* yacc.c:1646 */
  1511. break;
  1512. case 48:
  1513. #line 228 "cmFortranParser.y" /* yacc.c:1646 */
  1514. { free ((yyvsp[0].string)); }
  1515. #line 1747 "cmFortranParser.cxx" /* yacc.c:1646 */
  1516. break;
  1517. case 55:
  1518. #line 235 "cmFortranParser.y" /* yacc.c:1646 */
  1519. { free ((yyvsp[0].string)); }
  1520. #line 1753 "cmFortranParser.cxx" /* yacc.c:1646 */
  1521. break;
  1522. #line 1757 "cmFortranParser.cxx" /* yacc.c:1646 */
  1523. default: break;
  1524. }
  1525. /* User semantic actions sometimes alter yychar, and that requires
  1526. that yytoken be updated with the new translation. We take the
  1527. approach of translating immediately before every use of yytoken.
  1528. One alternative is translating here after every semantic action,
  1529. but that translation would be missed if the semantic action invokes
  1530. YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
  1531. if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
  1532. incorrect destructor might then be invoked immediately. In the
  1533. case of YYERROR or YYBACKUP, subsequent parser actions might lead
  1534. to an incorrect destructor call or verbose syntax error message
  1535. before the lookahead is translated. */
  1536. YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
  1537. YYPOPSTACK (yylen);
  1538. yylen = 0;
  1539. YY_STACK_PRINT (yyss, yyssp);
  1540. *++yyvsp = yyval;
  1541. /* Now 'shift' the result of the reduction. Determine what state
  1542. that goes to, based on the state we popped back to and the rule
  1543. number reduced by. */
  1544. yyn = yyr1[yyn];
  1545. yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
  1546. if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  1547. yystate = yytable[yystate];
  1548. else
  1549. yystate = yydefgoto[yyn - YYNTOKENS];
  1550. goto yynewstate;
  1551. /*--------------------------------------.
  1552. | yyerrlab -- here on detecting error. |
  1553. `--------------------------------------*/
  1554. yyerrlab:
  1555. /* Make sure we have latest lookahead translation. See comments at
  1556. user semantic actions for why this is necessary. */
  1557. yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
  1558. /* If not already recovering from an error, report this error. */
  1559. if (!yyerrstatus)
  1560. {
  1561. ++yynerrs;
  1562. #if ! YYERROR_VERBOSE
  1563. yyerror (yyscanner, YY_("syntax error"));
  1564. #else
  1565. # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
  1566. yyssp, yytoken)
  1567. {
  1568. char const *yymsgp = YY_("syntax error");
  1569. int yysyntax_error_status;
  1570. yysyntax_error_status = YYSYNTAX_ERROR;
  1571. if (yysyntax_error_status == 0)
  1572. yymsgp = yymsg;
  1573. else if (yysyntax_error_status == 1)
  1574. {
  1575. if (yymsg != yymsgbuf)
  1576. YYSTACK_FREE (yymsg);
  1577. yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
  1578. if (!yymsg)
  1579. {
  1580. yymsg = yymsgbuf;
  1581. yymsg_alloc = sizeof yymsgbuf;
  1582. yysyntax_error_status = 2;
  1583. }
  1584. else
  1585. {
  1586. yysyntax_error_status = YYSYNTAX_ERROR;
  1587. yymsgp = yymsg;
  1588. }
  1589. }
  1590. yyerror (yyscanner, yymsgp);
  1591. if (yysyntax_error_status == 2)
  1592. goto yyexhaustedlab;
  1593. }
  1594. # undef YYSYNTAX_ERROR
  1595. #endif
  1596. }
  1597. if (yyerrstatus == 3)
  1598. {
  1599. /* If just tried and failed to reuse lookahead token after an
  1600. error, discard it. */
  1601. if (yychar <= YYEOF)
  1602. {
  1603. /* Return failure if at end of input. */
  1604. if (yychar == YYEOF)
  1605. YYABORT;
  1606. }
  1607. else
  1608. {
  1609. yydestruct ("Error: discarding",
  1610. yytoken, &yylval, yyscanner);
  1611. yychar = YYEMPTY;
  1612. }
  1613. }
  1614. #if 0
  1615. /* Else will try to reuse lookahead token after shifting the error
  1616. token. */
  1617. goto yyerrlab1;
  1618. /*---------------------------------------------------.
  1619. | yyerrorlab -- error raised explicitly by YYERROR. |
  1620. `---------------------------------------------------*/
  1621. yyerrorlab:
  1622. /* Pacify compilers like GCC when the user code never invokes
  1623. YYERROR and the label yyerrorlab therefore never appears in user
  1624. code. */
  1625. if (/*CONSTCOND*/ 0)
  1626. goto yyerrorlab;
  1627. /* Do not reclaim the symbols of the rule whose action triggered
  1628. this YYERROR. */
  1629. YYPOPSTACK (yylen);
  1630. yylen = 0;
  1631. YY_STACK_PRINT (yyss, yyssp);
  1632. yystate = *yyssp;
  1633. goto yyerrlab1;
  1634. /*-------------------------------------------------------------.
  1635. | yyerrlab1 -- common code for both syntax error and YYERROR. |
  1636. `-------------------------------------------------------------*/
  1637. yyerrlab1:
  1638. #endif
  1639. yyerrstatus = 3; /* Each real token shifted decrements this. */
  1640. for (;;)
  1641. {
  1642. yyn = yypact[yystate];
  1643. if (!yypact_value_is_default (yyn))
  1644. {
  1645. yyn += YYTERROR;
  1646. if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
  1647. {
  1648. yyn = yytable[yyn];
  1649. if (0 < yyn)
  1650. break;
  1651. }
  1652. }
  1653. /* Pop the current state because it cannot handle the error token. */
  1654. if (yyssp == yyss)
  1655. YYABORT;
  1656. yydestruct ("Error: popping",
  1657. yystos[yystate], yyvsp, yyscanner);
  1658. YYPOPSTACK (1);
  1659. yystate = *yyssp;
  1660. YY_STACK_PRINT (yyss, yyssp);
  1661. }
  1662. YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  1663. *++yyvsp = yylval;
  1664. YY_IGNORE_MAYBE_UNINITIALIZED_END
  1665. /* Shift the error token. */
  1666. YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
  1667. yystate = yyn;
  1668. goto yynewstate;
  1669. /*-------------------------------------.
  1670. | yyacceptlab -- YYACCEPT comes here. |
  1671. `-------------------------------------*/
  1672. yyacceptlab:
  1673. yyresult = 0;
  1674. goto yyreturn;
  1675. /*-----------------------------------.
  1676. | yyabortlab -- YYABORT comes here. |
  1677. `-----------------------------------*/
  1678. yyabortlab:
  1679. yyresult = 1;
  1680. goto yyreturn;
  1681. #if !defined yyoverflow || YYERROR_VERBOSE
  1682. /*-------------------------------------------------.
  1683. | yyexhaustedlab -- memory exhaustion comes here. |
  1684. `-------------------------------------------------*/
  1685. yyexhaustedlab:
  1686. yyerror (yyscanner, YY_("memory exhausted"));
  1687. yyresult = 2;
  1688. /* Fall through. */
  1689. #endif
  1690. yyreturn:
  1691. if (yychar != YYEMPTY)
  1692. {
  1693. /* Make sure we have latest lookahead translation. See comments at
  1694. user semantic actions for why this is necessary. */
  1695. yytoken = YYTRANSLATE (yychar);
  1696. yydestruct ("Cleanup: discarding lookahead",
  1697. yytoken, &yylval, yyscanner);
  1698. }
  1699. /* Do not reclaim the symbols of the rule whose action triggered
  1700. this YYABORT or YYACCEPT. */
  1701. YYPOPSTACK (yylen);
  1702. YY_STACK_PRINT (yyss, yyssp);
  1703. while (yyssp != yyss)
  1704. {
  1705. yydestruct ("Cleanup: popping",
  1706. yystos[*yyssp], yyvsp, yyscanner);
  1707. YYPOPSTACK (1);
  1708. }
  1709. #ifndef yyoverflow
  1710. if (yyss != yyssa)
  1711. YYSTACK_FREE (yyss);
  1712. #endif
  1713. #if YYERROR_VERBOSE
  1714. if (yymsg != yymsgbuf)
  1715. YYSTACK_FREE (yymsg);
  1716. #endif
  1717. return yyresult;
  1718. }
  1719. #line 246 "cmFortranParser.y" /* yacc.c:1906 */
  1720. /* End of grammar */