cmDependsFortranParser.cxx 58 KB

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