summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2021-02-03 08:35:47 +0100
committerAkim Demaille <akim.demaille@gmail.com>2021-02-09 06:59:50 +0100
commite0ab5c324aaf7d04788eb380c93da0390ee337e5 (patch)
tree4395581c6e4be701b671b18831598ea1f5750327 /examples
parentc80b404dfa8a26659f0df5ba43d48f58a12ab148 (diff)
downloadbison-e0ab5c324aaf7d04788eb380c93da0390ee337e5.tar.gz
examples: use YYLOCATION_PRINT
* examples/c/bistromathic/parse.y, examples/c/glr/c++-types.y, * examples/c/lexcalc/parse.y: Don't use the private internal detail `YY_LOCATION_PRINT`, use `YYLOCATION_PRINT`.
Diffstat (limited to 'examples')
-rw-r--r--examples/c/bistromathic/parse.y6
-rw-r--r--examples/c/glr/c++-types.y8
-rw-r--r--examples/c/lexcalc/parse.y2
3 files changed, 8 insertions, 8 deletions
diff --git a/examples/c/bistromathic/parse.y b/examples/c/bistromathic/parse.y
index ad025e66..e10d99ce 100644
--- a/examples/c/bistromathic/parse.y
+++ b/examples/c/bistromathic/parse.y
@@ -96,7 +96,7 @@
%code {
// Print *LOC on OUT.
static void location_print (FILE *out, YYLTYPE const * const loc);
- #define YY_LOCATION_PRINT(Out, Loc) location_print(Out, &(Loc))
+ #define YYLOCATION_PRINT location_print
#if defined ENABLE_NLS && ENABLE_NLS
# define _(Msgid) gettext (Msgid)
@@ -427,7 +427,7 @@ yyreport_syntax_error (const yypcontext_t *ctx, const user_context *uctx)
// %@: location.
if (format[0] == '%' && format[1] == '@')
{
- YY_LOCATION_PRINT (stderr, *loc);
+ YYLOCATION_PRINT (stderr, loc);
format += 2;
}
// %u: unexpected token.
@@ -471,7 +471,7 @@ void yyerror (YYLTYPE *loc, const user_context *uctx, char const *format, ...)
if (uctx->silent)
return;
- YY_LOCATION_PRINT (stderr, *loc);
+ YYLOCATION_PRINT (stderr, loc);
fputs (": ", stderr);
va_list args;
va_start (args, format);
diff --git a/examples/c/glr/c++-types.y b/examples/c/glr/c++-types.y
index 4a1722ca..a96ef70c 100644
--- a/examples/c/glr/c++-types.y
+++ b/examples/c/glr/c++-types.y
@@ -91,7 +91,7 @@
prog : %empty
| prog stmt {
- YY_LOCATION_PRINT (stdout, @2);
+ YYLOCATION_PRINT (stdout, &@2);
fputs (": ", stdout);
node_print (stdout, $2);
putc ('\n', stdout);
@@ -127,10 +127,10 @@ declarator
%%
/* A C error reporting function. */
-static
-void yyerror (YYLTYPE const * const llocp, const char *msg)
+static void
+yyerror (YYLTYPE const * const loc, const char *msg)
{
- YY_LOCATION_PRINT (stderr, *llocp);
+ YYLOCATION_PRINT (stderr, loc);
fprintf (stderr, ": %s\n", msg);
}
diff --git a/examples/c/lexcalc/parse.y b/examples/c/lexcalc/parse.y
index d2fcb713..9c137b58 100644
--- a/examples/c/lexcalc/parse.y
+++ b/examples/c/lexcalc/parse.y
@@ -120,7 +120,7 @@ exp:
void yyerror (YYLTYPE *loc, const char *msg)
{
- YY_LOCATION_PRINT (stderr, *loc);
+ YYLOCATION_PRINT (stderr, loc);
fprintf (stderr, ": %s\n", msg);
}