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

Diff of /bison/tests/calc.at

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

revision 1.5.2.1 by akim, Thu Aug 30 15:36:37 2001 UTC revision 1.5.2.2 by akim, Mon Sep 10 09:31:50 2001 UTC
# Line 220  power (int base, int exponent) Line 220  power (int base, int exponent)
220  }  }
221    
222  int  int
223  main (int argn, const char **argv)  main (int argc, const char **argv)
224  {  {
225    if (argn == 2)    yyin = NULL;
226    
227      if (argc == 2)
228      yyin = fopen (argv[1], "r");      yyin = fopen (argv[1], "r");
229    else    else
230      yyin = stdin;      yyin = stdin;
231    
232    if (!stdin)    if (!yyin)
233      {      {
234        perror (argv[1]);        perror (argv[1]);
235        exit (1);        exit (1);
# Line 252  main (int argn, const char **argv) Line 254  main (int argn, const char **argv)
254  # Produce `calc.y'.  # Produce `calc.y'.
255  m4_define([AT_DATA_CALC_Y],  m4_define([AT_DATA_CALC_Y],
256  [_AT_DATA_CALC_Y($[1], $[2], $[3],  [_AT_DATA_CALC_Y($[1], $[2], $[3],
257                   [m4_if(m4_regexp([$1], [--yyerror-verbose]),                   [m4_match([$1], [--yyerror-verbose],
258                          [-1], [],                             [[#define YYERROR_VERBOSE]])])])
                         [[#define YYERROR_VERBOSE]])])])  
259    
260    
261    
# Line 268  m4_define([_AT_CHECK_CALC], Line 269  m4_define([_AT_CHECK_CALC],
269  [AT_DATA([[input]],  [AT_DATA([[input]],
270  [[$2  [[$2
271  ]])  ]])
272  m4_if(m4_regexp([$1], [--debug]),  m4_match([$1], [--debug],
273    [-1],            [AT_CHECK([calc ./input 2>&1 >/dev/null | grep 'parse error' >&2],
274       [AT_CHECK([./calc <input],                      [1], [], [])],
275                 [0], [], [])],            [AT_CHECK([./calc <input],
276       [AT_CHECK([calc ./input 2>&1 >/dev/null | grep 'parse error' >&2],                 [0], [], [])])dnl
277                 [1], [], [])])])  ])
278    
279    
280  # _AT_CHECK_CALC_ERROR(BISON-OPTIONS, INPUT,  # _AT_CHECK_CALC_ERROR(BISON-OPTIONS, INPUT,
# Line 286  m4_define([_AT_CHECK_CALC_ERROR], Line 287  m4_define([_AT_CHECK_CALC_ERROR],
287  ]])  ]])
288    
289  AT_CHECK([./calc <input 2>&1 >/dev/null | grep 'parse error' >&2], 0,  AT_CHECK([./calc <input 2>&1 >/dev/null | grep 'parse error' >&2], 0,
290            [],           [],
291  [m4_if(m4_regexp([$1], [--location]),  [m4_match([$1], [--location], [$3: ])[]dnl
        [-1], [], [$3: ])[]dnl  
292  parse error[]dnl  parse error[]dnl
293  m4_if(m4_regexp([$1], [--yyerror-verbose]),  m4_match([$1], [--yyerror-verbose], [$4])[]dnl
       [-1], [], [$4])[]dnl  
294    
295  ])])  ])])
296    

Legend:
Removed from v.1.5.2.1  
changed lines
  Added in v.1.5.2.2

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