cmDependsFortranParser.cxx 61 KB

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