cmDependsFortranParser.cxx 64 KB

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