82 |
|
|
83 |
AT_DATA([input.y], |
AT_DATA([input.y], |
84 |
[%locations |
[%locations |
85 |
|
|
86 |
|
%name-prefix="my_" |
87 |
%{ |
%{ |
88 |
#include <stdio.h> |
#include <stdio.h> |
89 |
#include <stdlib.h> |
#include <stdlib.h> |
90 |
|
|
91 |
static int |
static int |
92 |
yylex (void) |
my_lex (void) |
93 |
{ |
{ |
94 |
return EOF; |
return EOF; |
95 |
} |
} |
96 |
|
|
97 |
static void |
static void |
98 |
yyerror (const char *msg) |
my_error (const char *msg) |
99 |
{ |
{ |
100 |
fprintf (stderr, "%s\n", msg); |
fprintf (stderr, "%s\n", msg); |
101 |
} |
} |
107 |
|
|
108 |
AT_CHECK([bison --defines input.y -o input.c]) |
AT_CHECK([bison --defines input.y -o input.c]) |
109 |
|
|
110 |
# YYLTYPE should be defined, and YYLLOC declared. |
# YYLTYPE should be defined, and MY_LLOC declared. |
111 |
AT_DATA([caller.c], |
AT_DATA([caller.c], |
112 |
[[#include "input.h" |
[[#include "input.h" |
113 |
YYLTYPE *yyllocp = &yylloc; |
YYLTYPE *my_llocp = &my_lloc; |
114 |
|
|
115 |
int yyparse (void); |
int my_parse (void); |
116 |
|
|
117 |
int |
int |
118 |
main (void) |
main (void) |
119 |
{ |
{ |
120 |
return yyparse (); |
return my_parse (); |
121 |
} |
} |
122 |
]]) |
]]) |
123 |
|
|
124 |
# Link and execute, just to make sure everything is fine (and in |
# Link and execute, just to make sure everything is fine (and in |
125 |
# particular, that YYLLOC is indeed defined somewhere). |
# particular, that MY_LLOC is indeed defined somewhere). |
126 |
AT_CHECK([$CC $CFLAGS $CPPFLAGS caller.c input.c -o caller], 0, [], [ignore]) |
AT_CHECK([$CC $CFLAGS $CPPFLAGS caller.c input.c -o caller], 0, [], [ignore]) |
127 |
AT_CHECK([caller]) |
AT_CHECK([caller]) |
128 |
|
|