bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: YYERROR and lalr1.cc


From: Akim Demaille
Subject: FYI: YYERROR and lalr1.cc
Date: Wed, 19 Feb 2003 15:16:55 +0100
User-agent: Gnus/5.090015 (Oort Gnus v0.15) Emacs/21.2

Index: ChangeLog
from   2003-02-19  Akim Demaille  <address@hidden>

        * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
        Remove, useless.
        (YYABORT, YYACCEPT, YYERROR): New.
        * tests/calc.at: Renable the lalr1.cc test.

Index: data/lalr1.cc
===================================================================
RCS file: /cvsroot/bison/bison/data/lalr1.cc,v
retrieving revision 1.23
diff -u -u -r1.23 lalr1.cc
--- data/lalr1.cc 6 Feb 2003 10:04:29 -0000 1.23
+++ data/lalr1.cc 19 Feb 2003 14:15:08 -0000
@@ -21,9 +21,6 @@
 ## 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 @@
     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 @@
 # 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 @@
     }
   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[::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[;
Index: tests/calc.at
===================================================================
RCS file: /cvsroot/bison/bison/tests/calc.at,v
retrieving revision 1.51
diff -u -u -r1.51 calc.at
--- tests/calc.at 19 Feb 2003 13:40:53 -0000 1.51
+++ tests/calc.at 19 Feb 2003 14:15:10 -0000
@@ -696,8 +696,7 @@
 
 # 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])




reply via email to

[Prev in Thread] Current Thread [Next in Thread]