]> git.saurik.com Git - bison.git/blobdiff - src/lalr.h
* data/push.c (yyparse): Remove the prototype and the #define when in
[bison.git] / src / lalr.h
index af875d101fb785e2c8d53b04fe8e2ff7de2db34a..fe148d035fdabd64a5672188d83404f697ed6463 100644 (file)
@@ -1,6 +1,6 @@
 /* Compute lookahead criteria for bison,
 
 /* Compute lookahead criteria for bison,
 
-   Copyright (C) 1984, 1986, 1989, 2000, 2002, 2004 Free Software
+   Copyright (C) 1984, 1986, 1989, 2000, 2002, 2004, 2006 Free Software
    Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
    Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
 /* Import the definition of CORE, TRANSITIONS and REDUCTIONS. */
 # include "state.h"
 
 /* Import the definition of CORE, TRANSITIONS and REDUCTIONS. */
 # include "state.h"
 
-/* Compute how to make the finite state machine deterministic; find
+
+/** Build the LALR(1) automaton.
+
+   Compute how to make the finite state machine deterministic; find
    which rules need lookahead in each state, and which lookahead
    which rules need lookahead in each state, and which lookahead
-   tokens they accept.  */
+   tokens they accept.
 
 
+   Builds:
+   - #goto_map
+   - #from_state
+   - #to_state
+*/
 void lalr (void);
 
 void lalr (void);
 
-/* Release the information related to lookahead tokens.  Can be performed
-   once the action tables are computed.  */
 
 
-void lalr_free (void);
+/** Release the information related to lookahead tokens.
 
 
+   Can be performed once the action tables are computed.  */
+void lalr_free (void);
 
 
-/* lalr() builds these data structures. */
 
 
-/* GOTO_MAP, FROM_STATE and TO_STATE -- record each shift transition
-   which accepts a variable (a nonterminal).
+typedef size_t goto_number;
+# define GOTO_NUMBER_MAXIMUM ((goto_number) -1)
 
 
-   FROM_STATE[T] -- state number which a transition leads from.
-   TO_STATE[T] -- state number it leads to.
+/** Index into #from_state and #to_state.
 
    All the transitions that accept a particular variable are grouped
    together and GOTO_MAP[I - NTOKENS] is the index in FROM_STATE and
    TO_STATE of the first of them.  */
 
    All the transitions that accept a particular variable are grouped
    together and GOTO_MAP[I - NTOKENS] is the index in FROM_STATE and
    TO_STATE of the first of them.  */
-
-typedef size_t goto_number;
-# define GOTO_NUMBER_MAXIMUM ((goto_number) -1)
-
 extern goto_number *goto_map;
 extern goto_number *goto_map;
+
+/** State number which a transition leads from. */
 extern state_number *from_state;
 extern state_number *from_state;
+
+/** State number it leads to.  */
 extern state_number *to_state;
 
 
 extern state_number *to_state;