bison-patches
[Top][All Lists]
Advanced

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

FYI: Remove bison.hairy


From: Akim Demaille
Subject: FYI: Remove bison.hairy
Date: 02 May 2002 17:06:20 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp)

Well, really, even if someone wants to save this option, it will be
easier from a saner Bison.

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        Remove the so called hairy (semantic) parsers.

        * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
        * src/gram.h, src/gram.c (semantic_parser): Remove.
        (rule_t): Remove the guard and guard_line members.
        * src/lex.h (token_t): remove tok_guard.
        * src/options.c (option_table): Remove %guard and %semantic_parser
        support.
        * src/output.c, src/output.h (guards_output): Remove.
        (prepare): Adjust.
        (token_definitions_output): Don't output the `T'
        tokens (???).
        (output_skeleton): Don't output the guards.
        * src/files.c, src/files.c (attrsfile): Remove.
        * src/reader.c (symbol_list): Remove the guard and guard_line
        members.
        Adjust dependencies.
        (parse_guard): Remove.
        * data/bison.hairy: Remove.
        * doc/bison.texinfo (Environment Variables): Remove occurrences of
        BISON_HAIRY.

Index: NEWS
===================================================================
RCS file: /cvsroot/bison/bison/NEWS,v
retrieving revision 1.38
diff -u -u -r1.38 NEWS
--- NEWS 2 May 2002 09:25:54 -0000 1.38
+++ NEWS 2 May 2002 15:05:13 -0000
@@ -55,6 +55,10 @@
      %token YYEOF 0
   or
      %token YYEOF 0 "end of file"
+
+* Semantic parser
+  This old option, which has been broken for ages, is removed.
+
 
 Changes in version 1.35, 2002-03-25:
 
Index: TODO
===================================================================
RCS file: /cvsroot/bison/bison/TODO,v
retrieving revision 1.53
diff -u -u -r1.53 TODO
--- TODO 2 May 2002 14:33:48 -0000 1.53
+++ TODO 2 May 2002 15:05:13 -0000
@@ -214,7 +214,6 @@
 ** %no-lines           [ok]
 ** %no-parser          []
 ** %pure-parser                []
-** %semantic-parser    []
 ** %token-table                []
 ** Options which could use parse_dquoted_param ().
 Maybe transfered in lex.c.
Index: data/Makefile.am
===================================================================
RCS file: /cvsroot/bison/bison/data/Makefile.am,v
retrieving revision 1.2
diff -u -u -r1.2 Makefile.am
--- data/Makefile.am 5 Feb 2002 10:08:59 -0000 1.2
+++ data/Makefile.am 2 May 2002 15:05:13 -0000
@@ -1,4 +1,4 @@
-## Copyright 2002 Free Software Foundation, Inc.
+## Copyright (C) 2002 Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@
 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 ## 02111-1307  USA
 
-dist_pkgdata_DATA = bison.simple bison.hairy bison.c++
+dist_pkgdata_DATA = bison.simple bison.c++
 
 m4sugardir = $(pkgdatadir)/m4sugar
 dist_m4sugar_DATA = m4sugar/m4sugar.m4 m4sugar/version.m4
Index: data/bison.hairy
===================================================================
RCS file: data/bison.hairy
diff -N data/bison.hairy
--- data/bison.hairy 5 Feb 2002 09:57:52 -0000 1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,336 +0,0 @@
-%%{section} %%{output-prefix} %%{output-infix} %%".c"
-                                                         /* -*- C -*- */
-
-/* YYERROR and YYCOST are set by guards. If yyerror is set to a
-   nonzero value by a guard, the reduction with which the guard is
-   associated is not performed, and the error recovery mechanism is
-   invoked.  Yycost indicates the cost of performing the reduction
-   given the attributes of the symbols.  */
-static int yyerror;
-static int yycost;
-
-/* YYMAXDEPTH indicates the size of the parser's state and value
-   stacks.  */
-
-#ifndef        YYMAXDEPTH
-# define YYMAXDEPTH 500
-#endif
-
-/* YYMAXRULES must be at least as large as the number of rules that
-   could be placed in the rule queue.  That number could be determined
-   from the grammar and the size of the stack, but, as yet, it is not.
-   */
-
-#ifndef        YYMAXRULES
-# define YYMAXRULES 100
-#endif
-
-#ifndef        YYMAXBACKUP
-# define YYMAXBACKUP 100
-#endif
-
-
-/* The state stack. */
-static short yyss[YYMAXDEPTH];
-/* The semantic value stack.  */
-static YYSTYPE yyvs[YYMAXDEPTH];
-/* The location stack.  */
-static YYLTYPE yyls[YYMAXDEPTH];
-/* The rule queue. */
-static short yyrq[YYMAXRULES];
-/* The lookahead symbol. */
-static int yychar;
-
-/* the semantic value of the lookahead symbol.  */
-static YYSTYPE yylval;
-
-/* the semantic value for the state at the top of the state stack.  */
-static YYSTYPE yytval;
-
-/* the variable used to return semantic values from the action
-   routines.  */
-static YYSTYPE yyval;
-
-/* location data for the lookahead symbol.  */
-static YYLTYPE yylloc;
-
-/* location data for the state at the top of the state stack.  */
-static YYLTYPE yytloc;
-
-
-static int yynunlexed;
-static short yyunchar[YYMAXBACKUP];
-static YYSTYPE yyunval[YYMAXBACKUP];
-static YYLTYPE yyunloc[YYMAXBACKUP];
-
-/* a pointer to the top of the state stack; only set during error
-   recovery.  */
-static short *yygssp;
-
-/* a pointer to the top of the value stack; only set during error
-   recovery.  */
-static YYSTYPE *yygvsp;
-
-/* a pointer to the top of the location stack; only set during error
-   recovery.  */
-static YYLTYPE *yyglsp;
-
-
-/*--------------------------------------------------------------------.
-| Yyget is an interface between the parser and the lexical analyzer.  |
-| It is costly to provide such an interface, but it avoids requiring  |
-| the lexical analyzer to be able to back up the scan.                |
-`--------------------------------------------------------------------*/
-
-static inline void
-yyget (void)
-{
-  if (yynunlexed > 0)
-    {
-      yynunlexed--;
-      yychar = yyunchar[yynunlexed];
-      yylval = yyunval[yynunlexed];
-      yylloc = yyunloc[yynunlexed];
-    }
-  else if (yychar <= 0)
-    yychar = 0;
-  else
-    {
-      yychar = yylex ();
-      if (yychar < 0)
-       yychar = 0;
-      else
-       yychar = YYTRANSLATE (yychar);
-    }
-}
-
-
-static inline void
-yyunlex (int chr, YYSTYPE val, YYLTYPE loc)
-{
-  yyunchar[yynunlexed] = chr;
-  yyunval[yynunlexed] = val;
-  yyunloc[yynunlexed] = loc;
-  yynunlexed++;
-}
-
-
-static inline void
-yyrestore (short *first, short *last)
-{
-  short *ssp;
-  short *rp;
-  int symbol;
-  int state;
-  int tvalsaved;
-
-  ssp = yygssp;
-  yyunlex (yychar, yylval, yylloc);
-
-  tvalsaved = 0;
-  while (first != last)
-    {
-      symbol = yystos[*ssp];
-      if (symbol < YYNTBASE)
-       {
-         yyunlex (symbol, yytval, yytloc);
-         tvalsaved = 1;
-         ssp--;
-       }
-
-      ssp--;
-
-      if (first == yyrq)
-       first = yyrq + YYMAXRULES;
-
-      first--;
-
-      for (rp = yyrhs + yyprhs[*first]; symbol = *rp; rp++)
-       {
-         if (symbol < YYNTBASE)
-           state = yytable[yypact[*ssp] + symbol];
-         else
-           {
-             state = yypgoto[symbol - YYNTBASE] + *ssp;
-
-             if (state >= 0 && state <= YYLAST && yycheck[state] == *ssp)
-               state = yytable[state];
-             else
-               state = yydefgoto[symbol - YYNTBASE];
-           }
-
-         *++ssp = state;
-       }
-    }
-
-  if (!tvalsaved && ssp > yyss)
-    {
-      yyunlex (yystos[*ssp], yytval, yytloc);
-      ssp--;
-    }
-
-  yygssp = ssp;
-}
-
-
-
-int
-yyparse (void)
-{
-  int yystate;
-  int yyn;
-  short *yyssp;
-  short *yyrq0;
-  short *yyptr;
-  YYSTYPE *yyvsp;
-
-  int yylen;
-  YYLTYPE *yylsp;
-  short *yyrq1;
-  short *yyrq2;
-
-  yystate = 0;
-  yyssp = yyss - 1;
-  yyvsp = yyvs - 1;
-  yylsp = yyls - 1;
-  yyrq0 = yyrq;
-  yyrq1 = yyrq0;
-  yyrq2 = yyrq0;
-
-  yychar = yylex ();
-  if (yychar < 0)
-    yychar = 0;
-  else
-    yychar = YYTRANSLATE (yychar);
-
-yynewstate:
-
-  if (yyssp >= yyss + YYMAXDEPTH - 1)
-    {
-      yyabort ("Parser Stack Overflow");
-      YYABORT;
-    }
-
-  *++yyssp = yystate;
-
-yyresume:
-
-  yyn = yypact[yystate];
-  if (yyn == YYFLAG)
-    goto yydefault;
-
-  yyn += yychar;
-  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar)
-    goto yydefault;
-
-  yyn = yytable[yyn];
-  if (yyn < 0)
-    {
-      yyn = -yyn;
-      goto yyreduce;
-    }
-  else if (yyn == 0)
-    goto yyerrlab;
-
-  yystate = yyn;
-
-  yyptr = yyrq2;
-  while (yyptr != yyrq1)
-    {
-      yyn = *yyptr++;
-      yylen = yyr2[yyn];
-      yyvsp -= yylen;
-      yylsp -= yylen;
-
-      yyguard (yyn, yyvsp, yylsp);
-      if (yyerror)
-       goto yysemerr;
-
-      yyaction (yyn, yyvsp, yylsp);
-      *++yyvsp = yyval;
-
-      yylsp++;
-      if (yylen == 0)
-       {
-         yylsp->first_line = yytloc.first_line;
-         yylsp->first_column = yytloc.first_column;
-         yylsp->last_line = (yylsp - 1)->last_line;
-         yylsp->last_column = (yylsp - 1)->last_column;
-         yylsp->text = 0;
-       }
-      else
-       {
-         yylsp->last_line = (yylsp + yylen - 1)->last_line;
-         yylsp->last_column = (yylsp + yylen - 1)->last_column;
-       }
-
-      if (yyptr == yyrq + YYMAXRULES)
-       yyptr = yyrq;
-    }
-
-  if (yystate == YYFINAL)
-    YYACCEPT;
-
-  yyrq2 = yyptr;
-  yyrq1 = yyrq0;
-
-  *++yyvsp = yytval;
-  *++yylsp = yytloc;
-  yytval = yylval;
-  yytloc = yylloc;
-  yyget ();
-
-  goto yynewstate;
-
-yydefault:
-
-  yyn = yydefact[yystate];
-  if (yyn == 0)
-    goto yyerrlab;
-
-yyreduce:
-
-  *yyrq0++ = yyn;
-
-  if (yyrq0 == yyrq + YYMAXRULES)
-    yyrq0 = yyrq;
-
-  if (yyrq0 == yyrq2)
-    {
-      yyabort ("Parser Rule Queue Overflow");
-      YYABORT;
-    }
-
-  yyssp -= yyr2[yyn];
-  yyn = yyr1[yyn];
-
-  yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
-  if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
-    yystate = yytable[yystate];
-  else
-    yystate = yydefgoto[yyn - YYNTBASE];
-
-  goto yynewstate;
-
-yysemerr:
-  *--yyptr = yyn;
-  yyrq2 = yyptr;
-  yyvsp += yyr2[yyn];
-
-yyerrlab:
-
-  yygssp = yyssp;
-  yygvsp = yyvsp;
-  yyglsp = yylsp;
-  yyrestore (yyrq0, yyrq2);
-  yyrecover ();
-  yystate = *yygssp;
-  yyssp = yygssp;
-  yyvsp = yygvsp;
-  yyrq0 = yyrq;
-  yyrq1 = yyrq0;
-  yyrq2 = yyrq0;
-  goto yyresume;
-}
-
-%%{actions}
Index: data/bison.simple
===================================================================
RCS file: /cvsroot/bison/bison/data/bison.simple,v
retrieving revision 1.17
diff -u -u -r1.17 bison.simple
--- data/bison.simple 2 May 2002 14:33:48 -0000 1.17
+++ data/bison.simple 2 May 2002 15:05:13 -0000
@@ -116,8 +116,8 @@
 
 /* This is the parser code that is written into each bison parser when
    the %semantic_parser declaration is not specified in the grammar.
-   It was written by Richard Stallman by simplifying the hairy parser
-   used when %semantic_parser is specified.  */
+   It was written by Richard Stallman by simplifying the original so
+   called ``semantic'' parser.  */
 
 /* All symbols defined below should begin with yy or YY, to avoid
    infringing on user name space.  This should be done even for local
Index: doc/bison.texinfo
===================================================================
RCS file: /cvsroot/bison/bison/doc/bison.texinfo,v
retrieving revision 1.58
diff -u -u -r1.58 bison.texinfo
--- doc/bison.texinfo 22 Apr 2002 22:10:22 -0000 1.58
+++ doc/bison.texinfo 2 May 2002 15:05:14 -0000
@@ -5233,7 +5233,6 @@
 @node Environment Variables
 @section Environment Variables
 @cindex environment variables
address@hidden BISON_HAIRY
 @cindex BISON_SIMPLE
 
 Here is a list of environment variables which affect the way Bison
@@ -5241,18 +5240,11 @@
 
 @table @samp
 @item BISON_SIMPLE
address@hidden BISON_HAIRY
 Much of the parser generated by Bison is copied verbatim from a file
 called @file{bison.simple}.  If Bison cannot find that file, or if you
 would like to direct Bison to use a different copy, setting the
 environment variable @code{BISON_SIMPLE} to the path of the file will
 cause Bison to use that copy instead.
-
-When the @samp{%semantic-parser} declaration is used, Bison copies from
-a file called @file{bison.hairy} instead.  The location of this file can
-also be specified or overridden in a similar fashion, with the
address@hidden environment variable.
-
 @end table
 
 @node Option Cross Key
Index: src/files.c
===================================================================
RCS file: /cvsroot/bison/bison/src/files.c,v
retrieving revision 1.71
diff -u -u -r1.71 files.c
--- src/files.c 24 Apr 2002 16:22:56 -0000 1.71
+++ src/files.c 2 May 2002 15:05:14 -0000
@@ -53,7 +53,6 @@
 char *parser_file_name = NULL;
 
 char *infile = NULL;
-char *attrsfile = NULL;
 
 static char *full_base_name = NULL;
 
@@ -423,10 +422,10 @@
     src_extension = ".c";
   if (!header_extension)
     header_extension = ".h";
-  
+
   parser_file_name =
     spec_outfile ? spec_outfile : stringappend (full_base_name, src_extension);
-  
+
   /* It the defines filename if not given, we create it.  */
   if (!spec_defines_file)
     spec_defines_file = stringappend (full_base_name, header_extension);
@@ -436,6 +435,4 @@
     spec_graph_file = stringappend (short_base_name, ".vcg");
 
   spec_verbose_file = stringappend (short_base_name, EXT_OUTPUT);
-
-  attrsfile = stringappend (short_base_name, EXT_STYPE_H);
 }
Index: src/files.h
===================================================================
RCS file: /cvsroot/bison/bison/src/files.h,v
retrieving revision 1.28
diff -u -u -r1.28 files.h
--- src/files.h 24 Apr 2002 16:22:56 -0000 1.28
+++ src/files.h 2 May 2002 15:05:14 -0000
@@ -57,7 +57,6 @@
 extern struct obstack output_obstack;
 
 extern char *infile;
-extern char *attrsfile;
 
 void compute_output_file_names PARAMS((void));
 
Index: src/gram.c
===================================================================
RCS file: /cvsroot/bison/bison/src/gram.c,v
retrieving revision 1.30
diff -u -u -r1.30 gram.c
--- src/gram.c 22 Apr 2002 08:23:07 -0000 1.30
+++ src/gram.c 2 May 2002 15:05:14 -0000
@@ -45,8 +45,6 @@
 
 int max_user_token_number = 256;
 
-int semantic_parser = 0;
-
 int pure_parser = 0;
 
 
Index: src/gram.h
===================================================================
RCS file: /cvsroot/bison/bison/src/gram.h,v
retrieving revision 1.32
diff -u -u -r1.32 gram.h
--- src/gram.h 22 Apr 2002 08:23:07 -0000 1.32
+++ src/gram.h 2 May 2002 15:05:14 -0000
@@ -47,7 +47,7 @@
    Therefore 0 cannot be used, since it would be both the rule number
    0, and the token EOF).
 
-   Actions and guards are accessed via the rule number.
+   Actions are accessed via the rule number.
 
    The rules themselves are described by several arrays: amongst which
    RITEM, and RULES.
@@ -150,9 +150,6 @@
 
   const char *action;
   int action_line;
-
-  const char *guard;
-  int guard_line;
 } rule_t;
 
 extern struct rule_s *rules;
@@ -166,11 +163,6 @@
 extern token_number_t *token_translations;
 extern int max_user_token_number;
 
-/* SEMANTIC_PARSER is nonzero if the input file says to use the hairy
-   parser that provides for semantic error recovery.  If it is zero,
-   the yacc-compatible simplified parser is used.  */
-
-extern int semantic_parser;
 
 /* PURE_PARSER is nonzero if should generate a parser that is all pure
    and reentrant.  */
Index: src/lex.h
===================================================================
RCS file: /cvsroot/bison/bison/src/lex.h,v
retrieving revision 1.26
diff -u -u -r1.26 lex.h
--- src/lex.h 7 Apr 2002 17:43:41 -0000 1.26
+++ src/lex.h 2 May 2002 15:05:14 -0000
@@ -36,7 +36,6 @@
     tok_percent_left_curly,
     tok_token,
     tok_nterm,
-    tok_guard,
     tok_type,
     tok_union,
     tok_start,
Index: src/options.c
===================================================================
RCS file: /cvsroot/bison/bison/src/options.c,v
retrieving revision 1.13
diff -u -u -r1.13 options.c
--- src/options.c 7 Apr 2002 17:38:22 -0000 1.13
+++ src/options.c 2 May 2002 15:05:14 -0000
@@ -83,7 +83,6 @@
   DRTV ("term",                no,             NULL, tok_token)
   DRTV ("nterm",       no,             NULL, tok_nterm)
   DRTV ("type",                no,             NULL, tok_type)
-  DRTV ("guard",       no,             NULL, tok_guard)
   DRTV ("union",       no,             NULL, tok_union)
   DRTV ("expect",      no,             NULL, tok_expect)
   DRTV ("thong",       no,             NULL, tok_thong)
@@ -104,7 +103,6 @@
   BOTH ("name-prefix", required, &spec_name_prefix, tok_stropt, 'p')
 
   DRTV ("define",      no,               NULL, tok_define)
-  DRTV ("semantic-parser",no, &semantic_parser, tok_intopt)
   DRTV ("pure-parser", no,       &pure_parser, tok_intopt)
 
   /*
Index: src/output.c
===================================================================
RCS file: /cvsroot/bison/bison/src/output.c,v
retrieving revision 1.148
diff -u -u -r1.148 output.c
--- src/output.c 24 Apr 2002 16:22:56 -0000 1.148
+++ src/output.c 2 May 2002 15:05:14 -0000
@@ -568,30 +568,6 @@
 }
 
 
-/*----------------------------.
-| Output the guards to OOUT.  |
-`----------------------------*/
-
-void
-guards_output (FILE *out)
-{
-  int rule;
-  for (rule = 1; rule < nrules + 1; ++rule)
-    if (rules[rule].guard)
-      {
-       fprintf (out, "  case %d:\n", rule);
-
-       if (!no_lines_flag)
-         fprintf (out, muscle_find ("linef"),
-                  rules[rule].guard_line,
-                  quotearg_style (c_quoting_style,
-                                  muscle_find ("filename")));
-       fprintf (out, "{ %s; }\n    break;\n\n",
-                rules[rule].guard);
-      }
-}
-
-
 /*---------------------------------------.
 | Output the tokens definition to OOUT.  |
 `---------------------------------------*/
@@ -629,10 +605,6 @@
 
       fprintf (out, "%s  [[[%s]], [%d]]",
               first ? "" : ",\n", symbol->tag, number);
-      if (semantic_parser)
-       /* FIXME: This is probably wrong, and should be just as
-          above. --akim.  */
-       fprintf (out, "# define T%s\t%d\n", symbol->tag, symbol->number);
       first = 0;
     }
 }
@@ -1020,10 +992,6 @@
   actions_output (out);
   fputs ("]])\n\n", out);
 
-  fputs ("m4_define([b4_guards], \n[[", out);
-  guards_output (out);
-  fputs ("]])\n\n", out);
-
   fputs ("m4_define([b4_tokens], \n[", out);
   token_definitions_output (out);
   fputs ("])\n\n", out);
@@ -1099,12 +1067,7 @@
 
   /* Find the right skeleton file.  */
   if (!skeleton)
-    {
-      if (semantic_parser)
-       skeleton = "bison.hairy";
-      else
-       skeleton = "bison.simple";
-    }
+    skeleton = "bison.simple";
 
   /* Parse the skeleton file and output the needed parsers.  */
   muscle_insert ("skeleton", skeleton);
Index: src/output.h
===================================================================
RCS file: /cvsroot/bison/bison/src/output.h,v
retrieving revision 1.8
diff -u -u -r1.8 output.h
--- src/output.h 22 Apr 2002 08:21:19 -0000 1.8
+++ src/output.h 2 May 2002 15:05:14 -0000
@@ -27,7 +27,6 @@
 void output PARAMS ((void));
 
 void actions_output PARAMS ((FILE *out));
-void guards_output PARAMS ((FILE *out));
 void token_definitions_output PARAMS ((FILE *out));
 
 extern struct obstack muscle_obstack;
Index: src/reader.c
===================================================================
RCS file: /cvsroot/bison/bison/src/reader.c,v
retrieving revision 1.171
diff -u -u -r1.171 reader.c
--- src/reader.c 2 May 2002 14:33:48 -0000 1.171
+++ src/reader.c 2 May 2002 15:05:14 -0000
@@ -45,9 +45,6 @@
   const char *action;
   int action_line;
 
-  /* The guard is attached to the LHS of a rule. */
-  const char *guard;
-  int guard_line;
   symbol_t *ruleprec;
 } symbol_list;
 
@@ -80,8 +77,6 @@
   res->line = lineno;
   res->action = NULL;
   res->action_line = 0;
-  res->guard = NULL;
-  res->guard_line = 0;
   res->ruleprec = NULL;
   return res;
 }
@@ -1273,9 +1268,7 @@
 | values in the current rule so far, which says where to find `$0'  |
 | with respect to the top of the stack.                             |
 |                                                                   |
-| This routine is used both for actions and guards.  Only           |
-| ACTION_OBSTACK is used, but this is fine, since we use only       |
-| pointers to relevant portions inside this obstack.                |
+| This routine is used for actions.                                 |
 `------------------------------------------------------------------*/
 
 static void
@@ -1341,18 +1334,6 @@
   rule->action = obstack_finish (&action_obstack);
 }
 
-
-static void
-parse_guard (symbol_list *rule, int rule_length)
-{
-  token_t t = lex ();
-  if (t != tok_left_curly)
-    complain (_("invalid %s declaration"), "%guard");
-  rule->guard_line = lineno;
-  parse_braces (rule, rule_length);
-  rule->guard = obstack_finish (&action_obstack);
-}
-
 
 
 /*-------------------------------------------------------------------.
@@ -1384,8 +1365,8 @@
 | null pointer instead of a symbol to terminate the rule.  The next  |
 | symbol is the lhs of the following rule.                           |
 |                                                                    |
-| All guards and actions are copied out to the appropriate files,    |
-| labelled by the rule number they apply to.                         |
+| All actions are copied out, labelled by the rule number they apply |
+| to.                                                                |
 |                                                                    |
 | Bison used to allow some %directives in the rules sections, but    |
 | this is no longer consider appropriate: (i) the documented grammar |
@@ -1582,15 +1563,6 @@
            t = lex ();
          }
 
-       if (t == tok_guard)
-         {
-           if (!semantic_parser)
-             complain (_("%%guard present but %%semantic_parser not 
specified"));
-
-           parse_guard (crule, rulelength);
-           t = lex ();
-         }
-
        if (t == tok_left_curly)
          {
            /* This case never occurs -wjh */
@@ -1791,8 +1763,6 @@
       rules[ruleno].useful = TRUE;
       rules[ruleno].action = p->action;
       rules[ruleno].action_line = p->action_line;
-      rules[ruleno].guard = p->guard;
-      rules[ruleno].guard_line = p->guard_line;
 
       p = p->next;
       while (p && p->sym)
@@ -1829,13 +1799,12 @@
     ritem_print (stderr);
 }
 
-/*-------------------------------------------------------------------.
-| Read in the grammar specification and record it in the format      |
-| described in gram.h.  All guards are copied into the GUARD_OBSTACK |
-| and all actions into ACTION_OBSTACK, in each case forming the body |
-| of a C function (YYGUARD or YYACTION) which contains a switch      |
-| statement to decide which guard or action to execute.              |
-`-------------------------------------------------------------------*/
+/*------------------------------------------------------------------.
+| Read in the grammar specification and record it in the format     |
+| described in gram.h.  All actions are copied into ACTION_OBSTACK, |
+| in each case forming the body of a C function (YYACTION) which    |
+| contains a switch statement to decide which action to execute.    |
+`------------------------------------------------------------------*/
 
 void
 reader (void)
@@ -1889,7 +1858,7 @@
     }
 
   /* Read in the grammar, build grammar in list form.  Write out
-     guards and actions.  */
+     actions.  */
   readgram ();
   /* Some C code is given at the end of the grammar file. */
   read_additionnal_code ();
Index: src/reader.h
===================================================================
RCS file: /cvsroot/bison/bison/src/reader.h,v
retrieving revision 1.11
diff -u -u -r1.11 reader.h
--- src/reader.h 7 Apr 2002 17:43:41 -0000 1.11
+++ src/reader.h 2 May 2002 15:05:14 -0000
@@ -24,10 +24,7 @@
 #include "symtab.h"
 
 /* Read in the grammar specification and record it in the format
-   described in gram.h.  All guards are copied into the FGUARD file
-   and all actions into FACTION, in each case forming the body of a C
-   function (YYGUARD or YYACTION) which contains a switch statement to
-   decide which guard or action to execute.  */
+   described in gram.h.  */
 
 void reader PARAMS ((void));
 
Index: src/system.h
===================================================================
RCS file: /cvsroot/bison/bison/src/system.h,v
retrieving revision 1.44
diff -u -u -r1.44 system.h
--- src/system.h 10 Apr 2002 17:13:58 -0000 1.44
+++ src/system.h 2 May 2002 15:05:14 -0000
@@ -238,21 +238,15 @@
   /* VMS. */
 # define EXT_TAB       "_tab"
 # define EXT_OUTPUT    ".output"
-# define EXT_STYPE_H   "_stype"
-# define EXT_GUARD_C   "_guard"
 #else /* ! VMS */
 # ifdef MSDOS
    /* MS DOS. */
 #  define EXT_TAB      "_tab"
 #  define EXT_OUTPUT   ".out"
-#  define EXT_STYPE_H  ".sth"
-#  define EXT_GUARD_C  ".guc"
 # else /* ! MSDOS */
   /* Standard. */
 #  define EXT_TAB      ".tab"
 #  define EXT_OUTPUT   ".output"
-#  define EXT_STYPE_H  ".stype"
-#  define EXT_GUARD_C  ".guard"
 # endif /* ! MSDOS */
 #endif /* ! VMS */
 
Index: tests/Makefile.am
===================================================================
RCS file: /cvsroot/bison/bison/tests/Makefile.am,v
retrieving revision 1.21
diff -u -u -r1.21 Makefile.am
--- tests/Makefile.am 7 Apr 2002 17:44:38 -0000 1.21
+++ tests/Makefile.am 2 May 2002 15:05:14 -0000
@@ -1,7 +1,7 @@
 ## Process this file with automake to create Makefile.in.
 
 ## Makefile for Bison testsuite.
-## Copyright 2000, 2001, 2002  Free Software Foundation, Inc.
+## Copyright (C) 2000, 2001, 2002  Free Software Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -49,8 +49,7 @@
        output.at sets.at reduce.at \
        synclines.at headers.at actions.at conflicts.at \
        calc.at \
-        torture.at existing.at regression.at \
-        semantic.at
+        torture.at existing.at regression.at
 
 TESTSUITE = $(srcdir)/testsuite
 
Index: tests/semantic.at
===================================================================
RCS file: tests/semantic.at
diff -N tests/semantic.at
--- tests/semantic.at 4 Mar 2002 16:23:35 -0000 1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,47 +0,0 @@
-# Bison Semantic Parsers.                               -*- Autotest -*-
-# Copyright 2001 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-AT_BANNER([[Semantic Parsers.]])
-
-# Well, nothing, or almost, is known about semantic parsers.  For the
-# time being, just make sure we still parse them properly.
-
-## ---------------- ##
-## Parsing Guards.  ##
-## ---------------- ##
-
-
-AT_SETUP([Parsing Guards])
-
-AT_DATA([input.y],
-[[%semantic-parser
-%union {
-  int ival;
-}
-%token <ival> INT
-%type  <ival> exp
-%%
-exp: exp '+' exp { $$ = $1 + $3 }
-   | exp '/' exp %guard { if ($3 == 0) yyerror = 1 } { $$ = $1 / $3 }
-   | INT;
-%%
-]])
-
-AT_CHECK([bison -v input.y -o input.c], 0, ignore, ignore)
-
-AT_CLEANUP
Index: tests/testsuite.at
===================================================================
RCS file: /cvsroot/bison/bison/tests/testsuite.at,v
retrieving revision 1.13
diff -u -u -r1.13 testsuite.at
--- tests/testsuite.at 7 Apr 2002 17:44:38 -0000 1.13
+++ tests/testsuite.at 2 May 2002 15:05:14 -0000
@@ -61,6 +61,3 @@
 
 # Some old bugs.
 m4_include([regression.at])
-
-# Exercising bison.hairy, before it gets really removed...
-m4_include([semantic.at])



reply via email to

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