Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/lex/initparse.c
/* $FreeBSD$ */ | /* $FreeBSD$ */ | ||||
/* original parser id follows */ | /* original parser id follows */ | ||||
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ | /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ | ||||
/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ | /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ | ||||
#define YYBYACC 1 | #define YYBYACC 1 | ||||
#define YYMAJOR 1 | #define YYMAJOR 1 | ||||
#define YYMINOR 9 | #define YYMINOR 9 | ||||
#define YYPATCH 20170430 | #define YYPATCH 20200330 | ||||
#define YYEMPTY (-1) | #define YYEMPTY (-1) | ||||
#define yyclearin (yychar = YYEMPTY) | #define yyclearin (yychar = YYEMPTY) | ||||
#define yyerrok (yyerrflag = 0) | #define yyerrok (yyerrflag = 0) | ||||
#define YYRECOVERING() (yyerrflag != 0) | #define YYRECOVERING() (yyerrflag != 0) | ||||
#define YYENOMEM (-2) | #define YYENOMEM (-2) | ||||
#define YYEOF 0 | #define YYEOF 0 | ||||
#define YYPREFIX "yy" | #define YYPREFIX "yy" | ||||
▲ Show 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | |||||
#ifdef YYLEX_PARAM | #ifdef YYLEX_PARAM | ||||
# define YYLEX_DECL() yylex(void *YYLEX_PARAM) | # define YYLEX_DECL() yylex(void *YYLEX_PARAM) | ||||
# define YYLEX yylex(YYLEX_PARAM) | # define YYLEX yylex(YYLEX_PARAM) | ||||
#else | #else | ||||
# define YYLEX_DECL() yylex(void) | # define YYLEX_DECL() yylex(void) | ||||
# define YYLEX yylex() | # define YYLEX yylex() | ||||
#endif | #endif | ||||
#if !(defined(yylex) || defined(YYSTATE)) | |||||
int YYLEX_DECL(); | |||||
#endif | |||||
/* Parameters sent to yyerror. */ | /* Parameters sent to yyerror. */ | ||||
#ifndef YYERROR_DECL | #ifndef YYERROR_DECL | ||||
#define YYERROR_DECL() yyerror(const char *s) | #define YYERROR_DECL() yyerror(const char *s) | ||||
#endif | #endif | ||||
#ifndef YYERROR_CALL | #ifndef YYERROR_CALL | ||||
#define YYERROR_CALL(msg) yyerror(msg) | #define YYERROR_CALL(msg) yyerror(msg) | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 342 Lines • ▼ Show 20 Lines | |||||
"ccl_expr : CCE_NEG_LOWER", | "ccl_expr : CCE_NEG_LOWER", | ||||
"ccl_expr : CCE_NEG_UPPER", | "ccl_expr : CCE_NEG_UPPER", | ||||
"string : string CHAR", | "string : string CHAR", | ||||
"string :", | "string :", | ||||
}; | }; | ||||
#endif | #endif | ||||
#if YYDEBUG | |||||
int yydebug; | int yydebug; | ||||
int yynerrs; | #endif | ||||
int yyerrflag; | int yyerrflag; | ||||
int yychar; | int yychar; | ||||
YYSTYPE yyval; | YYSTYPE yyval; | ||||
YYSTYPE yylval; | YYSTYPE yylval; | ||||
int yynerrs; | |||||
/* define the initial stack-sizes */ | /* define the initial stack-sizes */ | ||||
#ifdef YYSTACKSIZE | #ifdef YYSTACKSIZE | ||||
#undef YYMAXDEPTH | #undef YYMAXDEPTH | ||||
#define YYMAXDEPTH YYSTACKSIZE | #define YYMAXDEPTH YYSTACKSIZE | ||||
#else | #else | ||||
#ifdef YYMAXDEPTH | #ifdef YYMAXDEPTH | ||||
#define YYSTACKSIZE YYMAXDEPTH | #define YYSTACKSIZE YYMAXDEPTH | ||||
▲ Show 20 Lines • Show All 144 Lines • ▼ Show 20 Lines | |||||
/* yyerror - eat up an error message from the parser; | /* yyerror - eat up an error message from the parser; | ||||
* currently, messages are ignore | * currently, messages are ignore | ||||
*/ | */ | ||||
void yyerror( const char *msg ) | void yyerror( const char *msg ) | ||||
{ | { | ||||
(void)msg; | (void)msg; | ||||
} | } | ||||
#line 656 "parse.c" | #line 662 "parse.c" | ||||
#if YYDEBUG | #if YYDEBUG | ||||
#include <stdio.h> /* needed for printf */ | #include <stdio.h> /* needed for printf */ | ||||
#endif | #endif | ||||
#include <stdlib.h> /* needed for malloc, etc */ | #include <stdlib.h> /* needed for malloc, etc */ | ||||
#include <string.h> /* needed for memset */ | #include <string.h> /* needed for memset */ | ||||
Show All 9 Lines | if ((newsize = data->stacksize) == 0) | ||||
newsize = YYINITSTACKSIZE; | newsize = YYINITSTACKSIZE; | ||||
else if (newsize >= YYMAXDEPTH) | else if (newsize >= YYMAXDEPTH) | ||||
return YYENOMEM; | return YYENOMEM; | ||||
else if ((newsize *= 2) > YYMAXDEPTH) | else if ((newsize *= 2) > YYMAXDEPTH) | ||||
newsize = YYMAXDEPTH; | newsize = YYMAXDEPTH; | ||||
i = (int) (data->s_mark - data->s_base); | i = (int) (data->s_mark - data->s_base); | ||||
newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); | newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); | ||||
if (newss == NULL) | if (newss == 0) | ||||
return YYENOMEM; | return YYENOMEM; | ||||
data->s_base = newss; | data->s_base = newss; | ||||
data->s_mark = newss + i; | data->s_mark = newss + i; | ||||
newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); | newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); | ||||
if (newvs == NULL) | if (newvs == 0) | ||||
return YYENOMEM; | return YYENOMEM; | ||||
data->l_base = newvs; | data->l_base = newvs; | ||||
data->l_mark = newvs + i; | data->l_mark = newvs + i; | ||||
data->stacksize = newsize; | data->stacksize = newsize; | ||||
data->s_last = data->s_base + newsize - 1; | data->s_last = data->s_base + newsize - 1; | ||||
return 0; | return 0; | ||||
Show All 17 Lines | |||||
int | int | ||||
YYPARSE_DECL() | YYPARSE_DECL() | ||||
{ | { | ||||
int yym, yyn, yystate; | int yym, yyn, yystate; | ||||
#if YYDEBUG | #if YYDEBUG | ||||
const char *yys; | const char *yys; | ||||
if ((yys = getenv("YYDEBUG")) != NULL) | if ((yys = getenv("YYDEBUG")) != 0) | ||||
{ | { | ||||
yyn = *yys; | yyn = *yys; | ||||
if (yyn >= '0' && yyn <= '9') | if (yyn >= '0' && yyn <= '9') | ||||
yydebug = yyn - '0'; | yydebug = yyn - '0'; | ||||
} | } | ||||
#endif | #endif | ||||
yym = 0; | yym = 0; | ||||
▲ Show 20 Lines • Show All 1,042 Lines • ▼ Show 20 Lines | #line 931 "parse.y" | ||||
yyval = link_machines( yystack.l_mark[-1], yyval); | yyval = link_machines( yystack.l_mark[-1], yyval); | ||||
} | } | ||||
break; | break; | ||||
case 96: | case 96: | ||||
#line 946 "parse.y" | #line 946 "parse.y" | ||||
{ yyval = mkstate( SYM_EPSILON ); } | { yyval = mkstate( SYM_EPSILON ); } | ||||
break; | break; | ||||
#line 1782 "parse.c" | #line 1788 "parse.c" | ||||
} | } | ||||
yystack.s_mark -= yym; | yystack.s_mark -= yym; | ||||
yystate = *yystack.s_mark; | yystate = *yystack.s_mark; | ||||
yystack.l_mark -= yym; | yystack.l_mark -= yym; | ||||
yym = yylhs[yyn]; | yym = yylhs[yyn]; | ||||
if (yystate == 0 && yym == 0) | if (yystate == 0 && yym == 0) | ||||
{ | { | ||||
#if YYDEBUG | #if YYDEBUG | ||||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |