/[bison]/bison/tests/actions.at
ViewVC logotype

Diff of /bison/tests/actions.at

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.16 by eggert, Mon Oct 14 08:43:36 2002 UTC revision 1.17 by akim, Tue Nov 12 09:03:13 2002 UTC
# Line 167  AT_DATA([[input.y]], Line 167  AT_DATA([[input.y]],
167  #include <stdlib.h>  #include <stdlib.h>
168  #include <assert.h>  #include <assert.h>
169    
170  #define YYERROR_VERBOSE 1  static int yylex (void);
171  #define YYDEBUG 1  static void yyerror (const char *msg);
172  %}  %}
173    %error-verbose
174    %debug
175  %verbose  %verbose
176    %locations
177  %union  %union
178  {  {
179    int ival;    int ival;
# Line 181  AT_DATA([[input.y]], Line 184  AT_DATA([[input.y]],
184     input line thing 'x'     input line thing 'x'
185    
186  %destructor  %destructor
187    {    { fprintf (stdout, "Freeing nterm input (%d from %d)\n", $$, @$.first_line); }
188      fprintf (stdout, "Freeing ");    input
     /* FIXME: Ouch: INTERNAL DETAILS EXPOSED HERE. */  
     /* Cannot use $$ which is the union member, not the union itself. */  
     yysymprint (stdout, yytype, yyvalue, @$);  
     fprintf (stdout, "\n");  
   }  
   input line thing 'x'  
189    
190  %{  %destructor
191  static int yylex (void);    { fprintf (stdout, "Freeing nterm line (%d from %d)\n", $$, @$.first_line); }
192  static void yyerror (const char *msg);    line
193  %}  
194    %destructor
195      { fprintf (stdout, "Freeing nterm thing (%d from %d)\n", $$, @$.first_line); }
196      thing
197    
198    %destructor
199      { fprintf (stdout, "Freeing token 'x' (%d from %d)\n", $$, @$.first_line); }
200      'x'
201    
202  %%  %%
203  input:  input:
# Line 295  main (void) Line 298  main (void)
298  }  }
299  ]])  ]])
300    
301  AT_CHECK([bison --location -d -v -o input.c input.y])  AT_CHECK([bison -o input.c input.y])
302  AT_COMPILE([input])  AT_COMPILE([input])
303  AT_PARSER_CHECK([./input], 1,  AT_PARSER_CHECK([./input], 1,
304  [[sending: 'x' (value = 0, line 0)  [[sending: 'x' (value = 0, line 0)

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26