bison-patches
[Top][All Lists]
Advanced

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

02-predefined-symbols.patch


From: Akim Demaille
Subject: 02-predefined-symbols.patch
Date: Tue, 30 Jul 2002 14:14:54 +0200

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
        
        * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
        (endtoken, accept): these.
        * src/reader.c (reader): Set endtoken's default tag to "$end".
        Set undeftoken's tag to "$undefined" instead of "$undefined.".
        * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
        Adjust.
        
        
Index: TODO
--- TODO Tue, 23 Jul 2002 20:15:05 +0200 akim
+++ TODO Sun, 28 Jul 2002 16:03:36 +0200 akim
@@ -4,6 +4,11 @@
 Write a first documentation for C++ output.
 
 
+* Documentation
+Before releasing, make sure the documentation refers to the current
+`output' format.
+
+
 * Error messages
 Some are really funky.  For instance
 
@@ -120,13 +125,6 @@ parsing: Theory and Practice' is impossi
 
 
 * Documentation
-
-** Vocabulary
-Explain $axiom (and maybe change its name: BTYacc names it `goal',
-byacc `$accept' probably based on AT&T Yacc, Meta `Start'...).
-Complete the glossary (item, axiom, ?).  Should we also rename `$'?
-BYacc uses `$end'.  `$eof' is attracting, but after all we may be
-parsing a string, a stream etc.
 
 ** History/Bibliography
 Some history of Bison and some bibliography would be most welcome.
Index: doc/bison.texinfo
--- doc/bison.texinfo Thu, 25 Jul 2002 23:44:04 +0200 akim
+++ doc/bison.texinfo Sun, 28 Jul 2002 16:18:04 +0200 akim
@@ -3553,9 +3553,9 @@ directives:
 Generate an array of token names in the parser file.  The name of the
 array is @code{yytname}; @address@hidden is the name of the
 token whose internal Bison token code number is @var{i}.  The first
-three elements of @code{yytname} are always @code{"$"}, @code{"error"},
-and @code{"$undefined."}; after these come the symbols defined in the
-grammar file.
+three elements of @code{yytname} are always @code{"$end"},
address@hidden"error"}, and @code{"$undefined"}; after these come the symbols
+defined in the grammar file.
 
 For single-character literal tokens and literal string tokens, the name
 in the table includes the single-quote or double-quote characters: for
@@ -5276,12 +5276,19 @@ useless: STR;
 %%
 @end example
 
address@hidden reports that @samp{calc.y contains 1 useless nonterminal
-and 1 useless rule} and that @samp{calc.y contains 7 shift/reduce
-conflicts}.  When given @option{--report=state}, in addition to
address@hidden, it creates a file @file{calc.output} with contents
-detailed below.  The order of the output and the exact presentation
-might vary, but the interpretation is the same.
address@hidden reports:
+
address@hidden
+calc.y: warning: 1 useless nonterminal and 1 useless rule
+calc.y:11.1-7: warning: useless nonterminal: useless
+calc.y:11.8-12: warning: useless rule: useless: STR
+calc.y contains 7 shift/reduce conflicts.
address@hidden example
+
+When given @option{--report=state}, in addition to @file{calc.tab.c}, it
+creates a file @file{calc.output} with contents detailed below.  The
+order of the output and the exact presentation might vary, but the
+interpretation is the same.
 
 The first section includes details on conflicts that were solved thanks
 to precedence and/or associativity:
@@ -5334,7 +5341,7 @@ useless: STR;
 Grammar
 
   Number, Line, Rule
-    0   5 $axiom -> exp $
+    0   5 $accept -> exp $end
     1   5 exp -> exp '+' exp
     2   6 exp -> exp '-' exp
     3   7 exp -> exp '*' exp
@@ -5348,7 +5355,7 @@ useless: STR;
 @example
 Terminals, with rules where they appear
 
-$ (0) 0
+$end (0) 0
 '*' (42) 3
 '+' (43) 1
 '-' (45) 2
@@ -5358,7 +5365,7 @@ useless: STR;
 
 Nonterminals, with rules where they appear
 
-$axiom (8)
+$accept (8)
     on left: 0
 exp (9)
     on left: 1 2 3 4 5, on right: 0 1 2 3 4
@@ -5376,7 +5383,7 @@ useless: STR;
 @example
 state 0
 
-    $axiom  ->  . exp $   (rule 0)
+    $accept  ->  . exp $   (rule 0)
 
     NUM        shift, and go to state 1
 
@@ -5407,7 +5414,7 @@ useless: STR;
 @example
 state 0
 
-    $axiom  ->  . exp $   (rule 0)
+    $accept  ->  . exp $   (rule 0)
     exp  ->  . exp '+' exp   (rule 1)
     exp  ->  . exp '-' exp   (rule 2)
     exp  ->  . exp '*' exp   (rule 3)
@@ -5439,7 +5446,7 @@ useless: STR;
 @example
 state 2
 
-    $axiom  ->  exp . $   (rule 0)
+    $accept  ->  exp . $   (rule 0)
     exp  ->  exp . '+' exp   (rule 1)
     exp  ->  exp . '-' exp   (rule 2)
     exp  ->  exp . '*' exp   (rule 3)
@@ -5466,7 +5473,7 @@ useless: STR;
 @example
 state 3
 
-    $axiom  ->  exp $ .   (rule 0)
+    $accept  ->  exp $ .   (rule 0)
 
     $default   accept
 @end example
@@ -6006,7 +6013,7 @@ @node Table of Symbols
 @table @code
 @item @@$
 In an action, the location of the left-hand side of the rule.
-  @xref{Locations, , Locations Overview}.
address@hidden, , Locations Overview}.
 
 @item @@@var{n}
 In an action, the location of the @var{n}-th symbol of the right-hand
@@ -6019,6 +6026,20 @@ @node Table of Symbols
 @item address@hidden
 In an action, the semantic value of the @var{n}-th symbol of the
 right-hand side of the rule.  @xref{Actions}.
+
address@hidden $accept
+The predefined nonterminal whose only rule is @samp{$accept: @var{start}
+$end}, where @var{start} is the start symbol.  @xref{Start Decl, , The
+Start-Symbol}.  It cannot be used in the grammar.
+
address@hidden $end
+The predefined token marking the end of the token stream.  It cannot be
+used in the grammar.
+
address@hidden $undefined
+The predefined token onto which all undefined values returned by
address@hidden are mapped.  It cannot be used in the grammar, rather, use
address@hidden
 
 @item error
 A token name reserved for error recovery.  This token may be used in
Index: src/LR0.c
--- src/LR0.c Thu, 25 Jul 2002 23:18:58 +0200 akim
+++ src/LR0.c Sun, 28 Jul 2002 14:09:48 +0200 akim
@@ -63,7 +63,7 @@
     fprintf (stderr, "state_list_append (state = %d, symbol = %d (%s))\n",
             nstates, symbol, symbols[symbol]->tag);
 
-  /* If this is the eoftoken, and this is not the initial state, then
+  /* If this is the endtoken, and this is not the initial state, then
      this is the final state.  */
   if (symbol == 0 && first_state)
     final_state = state;
@@ -283,7 +283,7 @@
   int i;
 
   /* If this is the final state, we want it to have no reductions at
-     all, although it has one for `START_SYMBOL EOF .'.  */
+     all, although it has one for `START_SYMBOL $end .'.  */
   if (final_state && state->number == final_state->number)
     return;
 
Index: src/gram.h
--- src/gram.h Thu, 25 Jul 2002 23:18:58 +0200 akim
+++ src/gram.h Sun, 28 Jul 2002 14:09:09 +0200 akim
@@ -36,16 +36,16 @@
 
    The rules receive rule numbers 1 to NRULES in the order they are
    written.  More precisely Bison augments the grammar with the
-   initial rule, `$axiom: START-SYMBOL EOF', which is numbered 1, all
-   the user rules are 2, 3 etc.  Each time a rule number is presented
-   to the user, we subtract 1, so *displayed* rule numbers are 0, 1,
-   2...
+   initial rule, `$accept: START-SYMBOL $end', which is numbered 1,
+   all the user rules are 2, 3 etc.  Each time a rule number is
+   presented to the user, we subtract 1, so *displayed* rule numbers
+   are 0, 1, 2...
 
    Internally, we cannot use the number 0 for a rule because for
    instance RITEM stores both symbol (the RHS) and rule numbers: the
    symbols are shorts >= 0, and rule number are stored negative.
    Therefore 0 cannot be used, since it would be both the rule number
-   0, and the token EOF).
+   0, and the token $end).
 
    Actions are accessed via the rule number.
 
@@ -68,9 +68,11 @@
 
    RULES[R].assoc -- the associativity of R.
 
-   RULES[R].dprec -- the dynamic precedence level of R (for GLR parsing).
+   RULES[R].dprec -- the dynamic precedence level of R (for GLR
+   parsing).
 
-   RULES[R].merger -- index of merging function for R (for GLR parsing).
+   RULES[R].merger -- index of merging function for R (for GLR
+   parsing).
 
    RULES[R].line -- the line where R was defined.
 
Index: src/reader.c
--- src/reader.c Thu, 25 Jul 2002 23:18:58 +0200 akim
+++ src/reader.c Sun, 28 Jul 2002 16:12:31 +0200 akim
@@ -475,10 +475,10 @@
   /* Initialize the symbol table.  */
   symbols_new ();
 
-  /* Construct the axiom symbol. */
-  axiom = symbol_get ("$axiom", empty_location);
-  axiom->class = nterm_sym;
-  axiom->number = nvars++;
+  /* Construct the accept symbol. */
+  accept = symbol_get ("$accept", empty_location);
+  accept->class = nterm_sym;
+  accept->number = nvars++;
 
   /* Construct the error token */
   errtoken = symbol_get ("error", empty_location);
@@ -487,7 +487,7 @@
 
   /* Construct a token that represents all undefined literal tokens.
      It is always token number 2.  */
-  undeftoken = symbol_get ("$undefined.", empty_location);
+  undeftoken = symbol_get ("$undefined", empty_location);
   undeftoken->class = token_sym;
   undeftoken->number = ntokens++;
 
@@ -515,25 +515,25 @@
   /* Report any undefined symbols and consider them nonterminals.  */
   symbols_check_defined ();
 
-  /* If the user did not define her EOFTOKEN, do it now. */
-  if (!eoftoken)
+  /* If the user did not define her ENDTOKEN, do it now. */
+  if (!endtoken)
     {
-      eoftoken = symbol_get ("$", empty_location);
-      eoftoken->class = token_sym;
-      eoftoken->number = 0;
+      endtoken = symbol_get ("$end", empty_location);
+      endtoken->class = token_sym;
+      endtoken->number = 0;
       /* Value specified by POSIX.  */
-      eoftoken->user_token_number = 0;
+      endtoken->user_token_number = 0;
     }
 
   /* Insert the initial rule, which line is that of the first rule
      (not that of the start symbol):
 
-     axiom: %start EOF.  */
+     accept: %start EOF.  */
   {
-    symbol_list_t *p = symbol_list_new (axiom, empty_location);
+    symbol_list_t *p = symbol_list_new (accept, empty_location);
     p->location = grammar->location;
     p->next = symbol_list_new (startsymbol, empty_location);
-    p->next->next = symbol_list_new (eoftoken, empty_location);
+    p->next->next = symbol_list_new (endtoken, empty_location);
     p->next->next->next = symbol_list_new (NULL, empty_location);
     p->next->next->next->next = grammar;
     nrules += 1;
Index: src/reduce.c
--- src/reduce.c Sun, 28 Jul 2002 13:57:13 +0200 akim
+++ src/reduce.c Sun, 28 Jul 2002 14:09:09 +0200 akim
@@ -161,9 +161,9 @@
   Pp = bitset_create (nrules, BITSET_FIXED);
 
   /* If the start symbol isn't useful, then nothing will be useful. */
-  if (bitset_test (N, axiom->number - ntokens))
+  if (bitset_test (N, accept->number - ntokens))
     {
-      bitset_set (V, axiom->number);
+      bitset_set (V, accept->number);
 
       while (1)
        {
@@ -194,7 +194,7 @@
   V = Vp;
 
   /* Tokens 0, 1, and 2 are internal to Bison.  Consider them useful. */
-  bitset_set (V, eoftoken->number);            /* end-of-input token */
+  bitset_set (V, endtoken->number);            /* end-of-input token */
   bitset_set (V, errtoken->number);            /* error token */
   bitset_set (V, undeftoken->number);          /* some undefined token */
 
@@ -333,7 +333,7 @@
          if (ISVAR (*rhsp))
            *rhsp =  symbol_number_as_item_number (nontermmap[*rhsp]);
       }
-    axiom->number = nontermmap[axiom->number];
+    accept->number = nontermmap[accept->number];
   }
 
   nsyms -= nuseless_nonterminals;
@@ -438,7 +438,7 @@
 
   reduce_print ();
 
-  if (!bitset_test (N, axiom->number - ntokens))
+  if (!bitset_test (N, accept->number - ntokens))
     fatal_at (startsymbol_location,
              _("start symbol %s does not derive any sentence"),
              startsymbol->tag);
Index: src/state.c
--- src/state.c Mon, 08 Jul 2002 22:49:58 +0200 akim
+++ src/state.c Sun, 28 Jul 2002 14:10:15 +0200 akim
@@ -122,7 +122,7 @@
 
 state_number_t nstates = 0;
 /* FINAL_STATE is properly set by new_state when it recognizes its
-   accessing symbol: EOF.  */
+   accessing symbol: $end.  */
 state_t *final_state = NULL;
 
 #define STATE_ALLOC(Nitems)                                            \
Index: src/symtab.c
--- src/symtab.c Tue, 23 Jul 2002 20:15:05 +0200 akim
+++ src/symtab.c Sun, 28 Jul 2002 16:13:10 +0200 akim
@@ -32,8 +32,8 @@
 
 symbol_t *errtoken = NULL;
 symbol_t *undeftoken = NULL;
-symbol_t *eoftoken = NULL;
-symbol_t *axiom = NULL;
+symbol_t *endtoken = NULL;
+symbol_t *accept = NULL;
 symbol_t *startsymbol = NULL;
 location_t startsymbol_location;
 
@@ -181,11 +181,11 @@
                 symbol->tag);
 
   symbol->user_token_number = user_token_number;
-  /* User defined EOF token? */
+  /* User defined $end token? */
   if (user_token_number == 0)
     {
-      eoftoken = symbol;
-      eoftoken->number = 0;
+      endtoken = symbol;
+      endtoken->number = 0;
       /* It is always mapped to 0, so it was already counted in
         NTOKENS.  */
       --ntokens;
@@ -322,7 +322,7 @@
         prec and assoc fields and make both the same */
       if (this->number == NUMBER_UNDEFINED)
        {
-         if (this == eoftoken || this->alias == eoftoken)
+         if (this == endtoken || this->alias == endtoken)
            this->number = this->alias->number = 0;
          else
            {
@@ -540,8 +540,8 @@
   token_translations = XCALLOC (symbol_number_t, max_user_token_number + 1);
 
   /* Initialize all entries for literal tokens to 2, the internal
-     token number for $undefined., which represents all invalid
-     inputs.  */
+     token number for $undefined, which represents all invalid inputs.
+     */
   for (i = 0; i < max_user_token_number + 1; i++)
     token_translations[i] = undeftoken->number;
   symbols_do (symbol_translation, NULL);
Index: src/symtab.h
--- src/symtab.h Tue, 23 Jul 2002 20:15:05 +0200 akim
+++ src/symtab.h Sun, 28 Jul 2002 14:09:09 +0200 akim
@@ -127,8 +127,8 @@
    */
 extern symbol_t *errtoken;
 extern symbol_t *undeftoken;
-extern symbol_t *eoftoken;
-extern symbol_t *axiom;
+extern symbol_t *endtoken;
+extern symbol_t *accept;
 extern symbol_t *startsymbol;
 extern location_t startsymbol_location;
 
Index: tests/actions.at
--- tests/actions.at Sun, 30 Jun 2002 19:19:55 +0200 akim
+++ tests/actions.at Sun, 28 Jul 2002 16:13:47 +0200 akim
@@ -327,7 +327,7 @@ sending: 'x' (value = 10, line 100)
 sending: ';' (value = 11, line 110)
 line(10): thing(10) ';'
 sending: 'y' (value = 12, line 120)
-120: parse error, unexpected $undefined., expecting $ or error or 'x'
+120: parse error, unexpected $undefined, expecting $end or error or 'x'
 sending: EOF
 Freeing nterm line (10 from 100)
 Freeing nterm line (7 from 70)
Index: tests/calc.at
--- tests/calc.at Sun, 30 Jun 2002 19:19:55 +0200 akim
+++ tests/calc.at Sun, 28 Jul 2002 16:13:57 +0200 akim
@@ -396,7 +396,7 @@ m4_define([AT_CHECK_CALC],
 _AT_CHECK_CALC_ERROR([$1], [1//2], [15],
                      [1.3-1.4: parse error, unexpected '/', expecting "number" 
or '-' or '('])
 _AT_CHECK_CALC_ERROR([$1], [error], [4],
-                     [1.1-1.2: parse error, unexpected $undefined., expecting 
"number" or '-' or '\n' or '('])
+                     [1.1-1.2: parse error, unexpected $undefined, expecting 
"number" or '-' or '\n' or '('])
 _AT_CHECK_CALC_ERROR([$1], [1 = 2 = 3], [22],
                      [1.7-1.8: parse error, unexpected '='])
 _AT_CHECK_CALC_ERROR([$1],
Index: tests/conflicts.at
--- tests/conflicts.at Thu, 25 Jul 2002 23:18:58 +0200 akim
+++ tests/conflicts.at Sun, 28 Jul 2002 16:11:15 +0200 akim
@@ -150,7 +150,7 @@ exp: exp OP exp | NUM;
 
 Grammar
 
-    0 $axiom: exp $
+    0 $accept: exp $end
 
     1 exp: exp OP exp
     2    | NUM
@@ -158,7 +158,7 @@ exp: exp OP exp | NUM;
 
 Terminals, with rules where they appear
 
-$ (0) 0
+$end (0) 0
 error (256)
 NUM (258) 2
 OP (259) 1
@@ -166,7 +166,7 @@ exp: exp OP exp | NUM;
 
 Nonterminals, with rules where they appear
 
-$axiom (5)
+$accept (5)
     on left: 0
 exp (6)
     on left: 1 2, on right: 0 1
@@ -174,7 +174,7 @@ exp: exp OP exp | NUM;
 
 state 0
 
-    0 $axiom: . exp $
+    0 $accept: . exp $end
     1 exp: . exp OP exp
     2    | . NUM
 
@@ -192,16 +192,16 @@ exp: exp OP exp | NUM;
 
 state 2
 
-    0 $axiom: exp . $
+    0 $accept: exp . $end
     1 exp: exp . OP exp
 
-    $   shift, and go to state 3
-    OP  shift, and go to state 4
+    $end  shift, and go to state 3
+    OP    shift, and go to state 4
 
 
 state 3
 
-    0 $axiom: exp $ .
+    0 $accept: exp $end .
 
     $default   accept
 
@@ -219,8 +219,8 @@ exp: exp OP exp | NUM;
 
 state 5
 
-    1 exp: exp . OP exp  [$, OP]
-    1    | exp OP exp .  [$, OP]
+    1 exp: exp . OP exp  [$end, OP]
+    1    | exp OP exp .  [$end, OP]
 
     OP  shift, and go to state 4
 
@@ -253,7 +253,7 @@ exp: exp OP exp | NUM;
 AT_CHECK([cat input.output], [],
 [[Grammar
 
-    0 $axiom: exp $
+    0 $accept: exp $end
 
     1 exp: exp OP exp
     2    | NUM
@@ -261,7 +261,7 @@ exp: exp OP exp | NUM;
 
 Terminals, with rules where they appear
 
-$ (0) 0
+$end (0) 0
 error (256)
 NUM (258) 2
 OP (259) 1
@@ -269,7 +269,7 @@ exp: exp OP exp | NUM;
 
 Nonterminals, with rules where they appear
 
-$axiom (5)
+$accept (5)
     on left: 0
 exp (6)
     on left: 1 2, on right: 0 1
@@ -277,7 +277,7 @@ exp: exp OP exp | NUM;
 
 state 0
 
-    0 $axiom: . exp $
+    0 $accept: . exp $end
     1 exp: . exp OP exp
     2    | . NUM
 
@@ -295,16 +295,16 @@ exp: exp OP exp | NUM;
 
 state 2
 
-    0 $axiom: exp . $
+    0 $accept: exp . $end
     1 exp: exp . OP exp
 
-    $   shift, and go to state 3
-    OP  shift, and go to state 4
+    $end  shift, and go to state 3
+    OP    shift, and go to state 4
 
 
 state 3
 
-    0 $axiom: exp $ .
+    0 $accept: exp $end .
 
     $default   accept
 
@@ -322,8 +322,8 @@ exp: exp OP exp | NUM;
 
 state 5
 
-    1 exp: exp . OP exp  [$, OP]
-    1    | exp OP exp .  [$, OP]
+    1 exp: exp . OP exp  [$end, OP]
+    1    | exp OP exp .  [$end, OP]
 
     $default  reduce using rule 1 (exp)
     Conflict between rule 1 and token OP resolved as reduce (%left OP).
@@ -339,19 +339,19 @@ exp: exp OP exp | NUM;
 # When there are RR conflicts, some rules are disabled.  Usually it is
 # simply displayed as:
 #
-#    $           reduce using rule 3 (num)
-#    $           [reduce using rule 4 (id)]
+#    $end           reduce using rule 3 (num)
+#    $end           [reduce using rule 4 (id)]
 #
 # But when `reduce 3' is the default action, we'd produce:
 #
-#    $           [reduce using rule 4 (id)]
+#    $end           [reduce using rule 4 (id)]
 #    $default    reduce using rule 3 (num)
 #
 # In this precise case (a reduction is masked by the default
 # reduction), we make the `reduce 3' explicit:
 #
-#    $           reduce using rule 3 (num)
-#    $           [reduce using rule 4 (id)]
+#    $end           reduce using rule 3 (num)
+#    $end           [reduce using rule 4 (id)]
 #    $default    reduce using rule 3 (num)
 #
 # Maybe that's not the best display, but then, please propose something
@@ -379,7 +379,7 @@ num: '0';
 
 Grammar
 
-    0 $axiom: exp $
+    0 $accept: exp $end
 
     1 exp: num
     2    | id
@@ -391,14 +391,14 @@ num: '0';
 
 Terminals, with rules where they appear
 
-$ (0) 0
+$end (0) 0
 '0' (48) 3 4
 error (256)
 
 
 Nonterminals, with rules where they appear
 
-$axiom (4)
+$accept (4)
     on left: 0
 exp (5)
     on left: 1 2, on right: 0
@@ -410,7 +410,7 @@ num: '0';
 
 state 0
 
-    0 $axiom: . exp $
+    0 $accept: . exp $end
     1 exp: . num
     2    | . id
     3 num: . '0'
@@ -425,19 +425,19 @@ num: '0';
 
 state 1
 
-    3 num: '0' .  [$]
-    4 id: '0' .  [$]
+    3 num: '0' .  [$end]
+    4 id: '0' .  [$end]
 
-    $         reduce using rule 3 (num)
-    $         [reduce using rule 4 (id)]
+    $end      reduce using rule 3 (num)
+    $end      [reduce using rule 4 (id)]
     $default  reduce using rule 3 (num)
 
 
 state 2
 
-    0 $axiom: exp . $
+    0 $accept: exp . $end
 
-    $  shift, and go to state 5
+    $end  shift, and go to state 5
 
 
 state 3
@@ -456,7 +456,7 @@ num: '0';
 
 state 5
 
-    0 $axiom: exp $ .
+    0 $accept: exp $end .
 
     $default   accept
 ]])
Index: tests/regression.at
--- tests/regression.at Thu, 25 Jul 2002 23:44:04 +0200 akim
+++ tests/regression.at Sun, 28 Jul 2002 16:14:05 +0200 akim
@@ -150,7 +150,7 @@ expr:
 AT_CHECK([cat input.output], [],
 [[Grammar
 
-    0 $axiom: expr $
+    0 $accept: expr $end
 
     1 @1: /* empty */
 
@@ -163,7 +163,7 @@ expr:
 
 Terminals, with rules where they appear
 
-$ (0) 0
+$end (0) 0
 'a' (97) 2
 'b' (98) 2
 'c' (99) 4
@@ -172,7 +172,7 @@ expr:
 
 Nonterminals, with rules where they appear
 
-$axiom (6)
+$accept (6)
     on left: 0
 expr (7)
     on left: 2 4, on right: 0
@@ -184,7 +184,7 @@ expr:
 
 state 0
 
-    0 $axiom: . expr $
+    0 $accept: . expr $end
 
     'a'  shift, and go to state 1
 
@@ -205,9 +205,9 @@ expr:
 
 state 2
 
-    0 $axiom: expr . $
+    0 $accept: expr . $end
 
-    $  shift, and go to state 5
+    $end  shift, and go to state 5
 
 
 state 3
@@ -226,7 +226,7 @@ expr:
 
 state 5
 
-    0 $axiom: expr $ .
+    0 $accept: expr $end .
 
     $default   accept
 
@@ -371,7 +371,7 @@ exp: "a";
 AT_CHECK([cat input.output], 0,
 [[Grammar
 
-    0 $axiom: CONST_DEC_PART $
+    0 $accept: CONST_DEC_PART $end
 
     1 CONST_DEC_PART: CONST_DEC_LIST
 
@@ -385,7 +385,7 @@ exp: "a";
 
 Terminals, with rules where they appear
 
-$ (0) 0
+$end (0) 0
 ';' (59) 5
 '=' (61) 5
 error (256)
@@ -395,7 +395,7 @@ exp: "a";
 
 Nonterminals, with rules where they appear
 
-$axiom (7)
+$accept (7)
     on left: 0
 CONST_DEC_PART (8)
     on left: 1, on right: 0
@@ -409,7 +409,7 @@ exp: "a";
 
 state 0
 
-    0 $axiom: . CONST_DEC_PART $
+    0 $accept: . CONST_DEC_PART $end
 
     $default  reduce using rule 4 (@1)
 
@@ -421,9 +421,9 @@ exp: "a";
 
 state 1
 
-    0 $axiom: CONST_DEC_PART . $
+    0 $accept: CONST_DEC_PART . $end
 
-    $  shift, and go to state 5
+    $end  shift, and go to state 5
 
 
 state 2
@@ -454,7 +454,7 @@ exp: "a";
 
 state 5
 
-    0 $axiom: CONST_DEC_PART $ .
+    0 $accept: CONST_DEC_PART $end .
 
     $default   accept
 
@@ -584,8 +584,8 @@ else: "else" statement;
 };
 static const char *const yytname[] =
 {
-  "$", "error", "$undefined.", "\"if\"", "\"const\"", "\"then\"",
-  "\"else\"", "$axiom", "statement", "struct_stat", "if", "else", 0
+  "$end", "error", "$undefined", "\"if\"", "\"const\"", "\"then\"",
+  "\"else\"", "$accept", "statement", "struct_stat", "if", "else", 0
 };
 static const unsigned short yytoknum[] =
 {
Index: tests/sets.at
--- tests/sets.at Thu, 25 Jul 2002 23:18:58 +0200 akim
+++ tests/sets.at Sun, 28 Jul 2002 16:09:51 +0200 akim
@@ -82,23 +82,23 @@ e: 'e' | /* Nothing */;
 AT_EXTRACT_SETS([stderr], [sets])
 AT_CHECK([[cat sets]], [],
 [[DERIVES
-       $axiom derives
-                 0  e $
+       $accept derives
+                 0  e $end
        e derives
                  1  'e'
                  2  /* empty */
 NULLABLE
-       $axiom: no
+       $accept: no
        e: yes
 FIRSTS
-       $axiom firsts
-               $axiom
+       $accept firsts
+               $accept
                e
        e firsts
                e
 FDERIVES
-       $axiom derives
-                 0  e $
+       $accept derives
+                 0  e $end
                  1  'e'
                  2  /* empty */
        e derives
@@ -212,8 +212,8 @@ exp:
 AT_EXTRACT_SETS([stderr], [sets])
 AT_CHECK([[cat sets]], [],
 [[DERIVES
-       $axiom derives
-                 0  exp $
+       $accept derives
+                 0  exp $end
        exp derives
                  1  exp '<' exp
                  2  exp '>' exp
@@ -223,17 +223,17 @@ exp:
                  6  exp '=' exp
                  7  "exp"
 NULLABLE
-       $axiom: no
+       $accept: no
        exp: no
 FIRSTS
-       $axiom firsts
-               $axiom
+       $accept firsts
+               $accept
                exp
        exp firsts
                exp
 FDERIVES
-       $axiom derives
-                 0  exp $
+       $accept derives
+                 0  exp $end
                  1  exp '<' exp
                  2  exp '>' exp
                  3  exp '+' exp



reply via email to

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