X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/9bf32be3a065900ecb103ce1b5fbbd210f7ca5ea..7b30971d7b915f5d9f7bccd24ab5f5b0e18680e1:/tests/calc.at diff --git a/tests/calc.at b/tests/calc.at index d245dd18..d4775f0f 100644 --- a/tests/calc.at +++ b/tests/calc.at @@ -1,6 +1,6 @@ # Simple calculator. -*- Autotest -*- -# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software +# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software # Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -41,7 +41,7 @@ AT_DATA_GRAMMAR([calc.y], [[/* Infix notation calculator--calc */ ]$4 AT_SKEL_CC_IF( -[%define "global_tokens_and_yystype"])[ +[%define global_tokens_and_yystype])[ %{ #include @@ -336,17 +336,7 @@ main (int argc, const char **argv) ]AT_SKEL_CC_IF([], [m4_bmatch([$4], [%debug], [ yydebug = 1;])])[ -]AT_PUSH_IF([ - { - struct yypstate *pstate = yypstate_new (); - YYSTYPE my_lval; - ]AT_LOCATION_IF([YYLTYPE my_lloc;])[ - do { - status = yypush_parse (pstate, yylex (&my_lval]AT_LOCATION_IF([[, &my_lloc]])[), &my_lval]AT_LOCATION_IF([[, &my_lloc]])[); - } while (status == YYPUSH_MORE); - yypstate_delete (pstate); - }],[ - status = yyparse (]AT_PARAM_IF([[&result, &count]])[);])[ + status = yyparse (]AT_PARAM_IF([[&result, &count]])[); fclose (input); if (global_result != result) abort (); @@ -572,7 +562,7 @@ AT_CHECK_CALC_LALR([%yacc]) AT_CHECK_CALC_LALR([%error-verbose]) AT_CHECK_CALC_LALR([%pure-parser %locations]) -AT_CHECK_CALC_LALR([%push-parser %locations %skeleton "push.c"]) +AT_CHECK_CALC_LALR([%push-pull-parser %pure-parser %locations]) AT_CHECK_CALC_LALR([%error-verbose %locations]) AT_CHECK_CALC_LALR([%error-verbose %locations %defines %name-prefix "calc" %verbose %yacc]) @@ -581,7 +571,7 @@ AT_CHECK_CALC_LALR([%debug]) AT_CHECK_CALC_LALR([%error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc]) AT_CHECK_CALC_LALR([%pure-parser %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc]) -AT_CHECK_CALC_LALR([%push-parser %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %skeleton "push.c"]) +AT_CHECK_CALC_LALR([%push-pull-parser %pure-parser %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc]) AT_CHECK_CALC_LALR([%pure-parser %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}]) @@ -628,12 +618,15 @@ AT_CHECK_CALC_GLR([%pure-parser %error-verbose %debug %locations %defines %name- AT_BANNER([[Simple LALR(1) C++ Calculator.]]) +# First let's try using %skeleton +AT_CHECK_CALC([%skeleton "lalr1.cc" %defines %locations]) + # AT_CHECK_CALC_LALR1_CC([BISON-OPTIONS]) # --------------------------------------- # Start a testing chunk which compiles `calc' grammar with # the C++ skeleton, and performs several tests over the parser. m4_define([AT_CHECK_CALC_LALR1_CC], -[AT_CHECK_CALC([%skeleton "lalr1.cc" %defines %locations] $@)]) +[AT_CHECK_CALC([%language "C++" %defines %locations] $@)]) AT_CHECK_CALC_LALR1_CC([]) AT_CHECK_CALC_LALR1_CC([%error-verbose %name-prefix "calc" %verbose %yacc]) @@ -652,12 +645,15 @@ AT_CHECK_CALC_LALR1_CC([%pure-parser %error-verbose %debug %name-prefix "calc" % AT_BANNER([[Simple GLR C++ Calculator.]]) +# Again, we try also using %skeleton. +AT_CHECK_CALC([%skeleton "glr.cc" %defines %locations]) + # AT_CHECK_CALC_GLR_CC([BISON-OPTIONS]) # ------------------------------------- # Start a testing chunk which compiles `calc' grammar with # the GLR C++ skeleton, and performs several tests over the parser. m4_define([AT_CHECK_CALC_GLR_CC], -[AT_CHECK_CALC([%skeleton "glr.cc" %defines %locations] $@)]) +[AT_CHECK_CALC([%language "C++" %glr-parser %defines %locations] $@)]) AT_CHECK_CALC_GLR_CC([]) AT_CHECK_CALC_GLR_CC([%error-verbose %name-prefix "calc" %verbose %yacc])