From 60a777aa240edc33c9b42f38c5abc1d32ae39e26 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Wed, 19 Feb 2003 14:33:27 +0000 Subject: [PATCH] * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_): Remove, useless. (YYABORT, YYACCEPT, YYERROR): New. * tests/calc.at: Renable the lalr1.cc test. --- ChangeLog | 7 +++++++ data/lalr1.cc | 15 +++++++++------ tests/calc.at | 3 +-- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index d722b41e..e092838d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-02-19 Akim Demaille + + * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_): + Remove, useless. + (YYABORT, YYACCEPT, YYERROR): New. + * tests/calc.at: Renable the lalr1.cc test. + 2003-02-19 Akim Demaille * tests/calc.at (AT_CHECK_CALC): Check different scenarios of diff --git a/data/lalr1.cc b/data/lalr1.cc index 670b68e1..214adb27 100644 --- a/data/lalr1.cc +++ b/data/lalr1.cc @@ -21,9 +21,6 @@ m4_divert(-1) ## Default values. ## ## ---------------- ## -# Stack parameters. -m4_define_default([b4_stack_depth_init], [200]) - # Default Parser class name. m4_define_default([b4_parser_class_name], [Parser]) @@ -248,7 +245,6 @@ namespace yy static const int terror_; static const int errcode_; static const int ntokens_; - static const int initdepth_; static const unsigned user_token_number_max_; static const TokenNumberType undef_token_; @@ -296,6 +292,11 @@ m4_if(b4_defines_flag, 0, [], [#include @output_header_name@])[ # define YYCDEBUG if (0) cdebug_ #endif /* !YYDEBUG */ +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrlab1 + + int yy::]b4_parser_class_name[::parse () { @@ -515,7 +516,10 @@ b4_syncline([@oline@], [@ofile@])[ } goto yyerrlab1; - /* Error raised explicitly by an action. */ + + /*----------------------------------------------------. + | yyerrlab1 -- error raised explicitly by an action. | + `----------------------------------------------------*/ yyerrlab1: if (errstatus == 3) { @@ -762,7 +766,6 @@ const int yy::]b4_parser_class_name[::final_ = ]b4_final_state_number[; const int yy::]b4_parser_class_name[::terror_ = 1; const int yy::]b4_parser_class_name[::errcode_ = 256; const int yy::]b4_parser_class_name[::ntokens_ = ]b4_tokens_number[; -const int yy::]b4_parser_class_name[::initdepth_ = ]b4_stack_depth_init[; const unsigned yy::]b4_parser_class_name[::user_token_number_max_ = ]b4_user_token_number_max[; const yy::]b4_parser_class_name[::TokenNumberType yy::]b4_parser_class_name[::undef_token_ = ]b4_undef_token_number[; diff --git a/tests/calc.at b/tests/calc.at index a768fffe..4346fb09 100644 --- a/tests/calc.at +++ b/tests/calc.at @@ -696,8 +696,7 @@ m4_define([AT_CHECK_CALC_LALR1_CC], # AT_CHECK_CALC_LALR1_CC() -# FIXME: YYERROR is not supported -# AT_CHECK_CALC_LALR1_CC([%defines %pure-parser %locations]) +AT_CHECK_CALC_LALR1_CC([%defines %pure-parser %locations]) # AT_CHECK_CALC_LALR1_CC([%defines]) # AT_CHECK_CALC_LALR1_CC([%locations]) -- 2.45.2