cmDependsFortranParser.cxx 58 KB

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