X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/3cd5bcdd19537bafd3ae7d0851cda452a3422e98..9b3add5bebc553f9bc1a10a9a6a489135f2a9d4d:/src/bison.simple diff --git a/src/bison.simple b/src/bison.simple index 57190178..0482a0ea 100644 --- a/src/bison.simple +++ b/src/bison.simple @@ -1,7 +1,8 @@ +%%{section} %%{body} %%".c" %%{yacc} /* -*- C -*- */ -/* A Bison parser, made from %%filename - by GNU bison %%version. */ +/* A Bison parser, made from %%{filename} + by GNU bison %%{version}. */ /* Skeleton output parser for bison, Copyright 1984, 1989, 1990, 2000, 2001 Free Software Foundation, Inc. @@ -35,31 +36,31 @@ #define YYBISON 1 /* Pure parsers. */ -#define YYPURE %%pure +#define YYPURE %%{pure} /* Using locations. */ -#define YYLSP_NEEDED %%locations-flag +#define YYLSP_NEEDED %%{locations-flag} /* If NAME_PREFIX is specified substitute the variables and functions names. */ -#define yyparse %%prefix##parse -#define yylex %%prefix##lex -#define yyerror %%prefix##error -#define yylval %%prefix##lval -#define yychar %%prefix##char -#define yydebug %%prefix##debug -#define yynerrs %%prefix##nerrs +#define yyparse %%{prefix}parse +#define yylex %%{prefix}lex +#define yyerror %%{prefix}error +#define yylval %%{prefix}lval +#define yychar %%{prefix}char +#define yydebug %%{prefix}debug +#define yynerrs %%{prefix}nerrs #if YYLSP_NEEDED -# define yylloc %%prefix##lloc +# define yylloc %%{prefix}lloc #endif /* Copy the user declarations. */ -%%prologue +%%{prologue} /* Enabling traces. */ #ifndef YYDEBUG -# define YYDEBUG %%debug +# define YYDEBUG %%{debug} #endif /* Enabling verbose error messages. */ @@ -67,11 +68,11 @@ # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else -# define YYERROR_VERBOSE %%error-verbose +# define YYERROR_VERBOSE %%{error-verbose} #endif #ifndef YYSTYPE -typedef %%stype yystype; +typedef %%{stype} yystype; # define YYSTYPE yystype #endif @@ -83,11 +84,11 @@ typedef struct yyltype int last_line; int last_column; } yyltype; -# define YYLTYPE %%ltype +# define YYLTYPE %%{ltype} #endif -/* Line %%skeleton-line of %%skeleton. */ -#line %%line "%%parser-file-name" +/* Line %%{skeleton-line} of %%{skeleton}. */ +#line %%{line} "%%{parser-file-name}" /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local @@ -184,30 +185,30 @@ union yyalloc #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ /* Tokens. */ -%%tokendef +%%{tokendef} /* YYFINAL -- State number of the termination state. */ -#define YYFINAL %%final -#define YYFLAG %%flag -#define YYLAST %%last +#define YYFINAL %%{final} +#define YYFLAG %%{flag} +#define YYLAST %%{last} /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS %%ntokens +#define YYNTOKENS %%{ntokens} /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS %%nnts +#define YYNNTS %%{nnts} /* YYNRULES -- Number of rules. */ -#define YYNRULES %%nrules +#define YYNRULES %%{nrules} /* YYNRULES -- Number of states. */ -#define YYNSTATES %%nstates -#define YYMAXUTOK %%maxtok +#define YYNSTATES %%{nstates} +#define YYMAXUTOK %%{maxtok} /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYTRANSLATE(x) ((unsigned)(x) <= %%maxtok ? yytranslate[x] : %%nsym) +#define YYTRANSLATE(x) ((unsigned)(x) <= %%{maxtok} ? yytranslate[x] : %%{nsym}) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const char yytranslate[] = { - %%translate + %%{translate} }; #if YYDEBUG @@ -215,19 +216,19 @@ static const char yytranslate[] = YYRHS. */ static const short yyprhs[] = { - %%prhs + %%{prhs} }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const short yyrhs[] = { - %%rhs + %%{rhs} }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const short yyrline[] = { - %%rline + %%{rline} }; #endif @@ -236,26 +237,26 @@ static const short yyrline[] = First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - %%tname + %%{tname} }; #endif /* YYTOKNUM[YYN] -- Index in YYTNAME corresponding to YYLEX. */ static const short yytoknum[] = { - %%toknum + %%{toknum} }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const short yyr1[] = { - %%r1 + %%{r1} }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const short yyr2[] = { - %%r2 + %%{r2} }; /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE @@ -263,26 +264,26 @@ static const short yyr2[] = error. */ static const short yydefact[] = { - %%defact + %%{defact} }; /* YYPGOTO[NTERM-NUM]. */ static const short yydefgoto[] = { - %%defgoto + %%{defgoto} }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const short yypact[] = { - %%pact + %%{pact} }; /* YYPGOTO[NTERM-NUM]. */ static const short yypgoto[] = { - %%pgoto + %%{pgoto} }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -290,12 +291,12 @@ static const short yypgoto[] = number is the opposite. If zero, do what YYDEFACT says. */ static const short yytable[] = { - %%table + %%{table} }; static const short yycheck[] = { - %%check + %%{check} }; @@ -419,7 +420,7 @@ int yydebug; /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH -# define YYINITDEPTH %%initdepth +# define YYINITDEPTH %%{initdepth} #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only @@ -434,7 +435,7 @@ int yydebug; #endif #ifndef YYMAXDEPTH -# define YYMAXDEPTH %%maxdepth +# define YYMAXDEPTH %%{maxdepth} #endif @@ -903,11 +904,11 @@ yyreduce: #endif switch (yyn) { -%%actions + %%{actions} } -/* Line %%skeleton-line of %%skeleton. */ -#line %%line "%%parser-file-name" +/* Line %%{skeleton-line} of %%{skeleton}. */ +#line %%{line} "%%{parser-file-name}" yyvsp -= yylen; yyssp -= yylen; @@ -1138,4 +1139,4 @@ yyreturn: return yyresult; } -%%epilogue +%%{epilogue}