This commit is contained in:
christos 2018-05-19 01:53:24 +00:00
parent d6b914290e
commit a18d7413b9
2 changed files with 22 additions and 26 deletions

View File

@ -1,10 +1,8 @@
/* $NetBSD: btyaccpar.c,v 1.4 2017/06/05 18:54:30 christos Exp $ */
/* This file generated automatically using /* This file generated automatically using
* @Id: skel2c,v 1.4 2016/06/07 00:26:09 tom Exp @ * Id: skel2c,v 1.4 2016/06/07 00:26:09 tom Exp
*/ */
/* @Id: btyaccpar.skel,v 1.6 2017/04/30 23:40:34 tom Exp @ */ /* Id: btyaccpar.skel,v 1.7 2017/05/01 00:13:19 tom Exp */
#include "defs.h" #include "defs.h"
@ -109,17 +107,17 @@ const char *const hdr_defs[] =
"{ \\", "{ \\",
" if (n == 0) \\", " if (n == 0) \\",
" { \\", " { \\",
" (loc).first_line = ((rhs)[-1]).last_line; \\", " (loc).first_line = YYRHSLOC(rhs, 0).last_line; \\",
" (loc).first_column = ((rhs)[-1]).last_column; \\", " (loc).first_column = YYRHSLOC(rhs, 0).last_column; \\",
" (loc).last_line = ((rhs)[-1]).last_line; \\", " (loc).last_line = YYRHSLOC(rhs, 0).last_line; \\",
" (loc).last_column = ((rhs)[-1]).last_column; \\", " (loc).last_column = YYRHSLOC(rhs, 0).last_column; \\",
" } \\", " } \\",
" else \\", " else \\",
" { \\", " { \\",
" (loc).first_line = ((rhs)[ 0 ]).first_line; \\", " (loc).first_line = YYRHSLOC(rhs, 1).first_line; \\",
" (loc).first_column = ((rhs)[ 0 ]).first_column; \\", " (loc).first_column = YYRHSLOC(rhs, 1).first_column; \\",
" (loc).last_line = ((rhs)[n-1]).last_line; \\", " (loc).last_line = YYRHSLOC(rhs, n).last_line; \\",
" (loc).last_column = ((rhs)[n-1]).last_column; \\", " (loc).last_column = YYRHSLOC(rhs, n).last_column; \\",
" } \\", " } \\",
"} while (0)", "} while (0)",
"#endif /* YYLLOC_DEFAULT */", "#endif /* YYLLOC_DEFAULT */",
@ -322,7 +320,7 @@ const char *const body_1[] =
" 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 = realloc(data->s_base, newsize * sizeof(*newss));",
" if (newss == 0)", " if (newss == 0)",
" return YYENOMEM;", " return YYENOMEM;",
"", "",
@ -387,13 +385,13 @@ const char *const body_1[] =
"#endif", "#endif",
" return p;", " return p;",
" }", " }",
" p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));", " p->yystack.s_base = malloc(size * sizeof(YYINT));",
" if (p->yystack.s_base == NULL) return NULL;", " if (p->yystack.s_base == NULL) return NULL;",
" p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));", " p->yystack.l_base = malloc(size * sizeof(YYSTYPE));",
" if (p->yystack.l_base == NULL) return NULL;", " if (p->yystack.l_base == NULL) return NULL;",
" memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE));", " memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE));",
"#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)", "#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)",
" p->yystack.p_base = (YYLTYPE *) malloc(size * sizeof(YYLTYPE));", " p->yystack.p_base = malloc(size * sizeof(YYLTYPE));",
" if (p->yystack.p_base == NULL) return NULL;", " if (p->yystack.p_base == NULL) return NULL;",
" memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE));", " memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE));",
"#endif", "#endif",
@ -438,7 +436,7 @@ const char *const body_2[] =
"#endif /* YYBTYACC */", "#endif /* YYBTYACC */",
#endif /* defined(YYBTYACC) */ #endif /* defined(YYBTYACC) */
"#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)", "#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)",
" YYLTYPE yyerror_loc_range[2]; /* position of error start & end */", " YYLTYPE yyerror_loc_range[3]; /* position of error start&end (0 unused) */",
"#endif", "#endif",
"#if YYDEBUG", "#if YYDEBUG",
" const char *yys;", " const char *yys;",
@ -860,7 +858,7 @@ const char *const body_3[] =
"", "",
" YYERROR_CALL(\"syntax error\");", " YYERROR_CALL(\"syntax error\");",
"#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)", "#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)",
" yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */", " yyerror_loc_range[1] = yylloc; /* lookahead position is error start position */",
"#endif", "#endif",
"", "",
"#if !YYBTYACC", "#if !YYBTYACC",
@ -889,7 +887,7 @@ const char *const body_3[] =
" *++yystack.l_mark = yylval;", " *++yystack.l_mark = yylval;",
"#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)", "#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)",
" /* lookahead position is error end position */", " /* lookahead position is error end position */",
" yyerror_loc_range[1] = yylloc;", " yyerror_loc_range[2] = yylloc;",
" YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */", " YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */",
" *++yystack.p_mark = yyloc;", " *++yystack.p_mark = yyloc;",
"#endif", "#endif",
@ -905,7 +903,7 @@ const char *const body_3[] =
" if (yystack.s_mark <= yystack.s_base) goto yyabort;", " if (yystack.s_mark <= yystack.s_base) goto yyabort;",
"#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)", "#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)",
" /* the current TOS position is the error start position */", " /* the current TOS position is the error start position */",
" yyerror_loc_range[0] = *yystack.p_mark;", " yyerror_loc_range[1] = *yystack.p_mark;",
"#endif", "#endif",
"#if defined(YYDESTRUCT_CALL)", "#if defined(YYDESTRUCT_CALL)",
#if defined(YYBTYACC) #if defined(YYBTYACC)
@ -999,10 +997,10 @@ const char *const body_3[] =
"#endif /* YYBTYACC */", "#endif /* YYBTYACC */",
#endif /* defined(YYBTYACC) */ #endif /* defined(YYBTYACC) */
" {", " {",
" YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym);", " YYLLOC_DEFAULT(yyloc, &yystack.p_mark[-yym], yym);",
" /* just in case YYERROR is invoked within the action, save", " /* just in case YYERROR is invoked within the action, save",
" the start of the rhs as the error start position */", " the start of the rhs as the error start position */",
" yyerror_loc_range[0] = yystack.p_mark[1-yym];", " yyerror_loc_range[1] = yystack.p_mark[1-yym];",
" }", " }",
"#endif", "#endif",
"", "",

View File

@ -1,10 +1,8 @@
/* $NetBSD: yaccpar.c,v 1.5 2017/06/05 18:54:30 christos Exp $ */
/* This file generated automatically using /* This file generated automatically using
* @Id: skel2c,v 1.4 2016/06/07 00:26:09 tom Exp @ * Id: skel2c,v 1.4 2016/06/07 00:26:09 tom Exp
*/ */
/* @Id: yaccpar.skel,v 1.8 2016/12/02 21:44:42 tom Exp @ */ /* Id: yaccpar.skel,v 1.9 2017/04/30 23:28:17 tom Exp */
#include "defs.h" #include "defs.h"