]> git.saurik.com Git - bison.git/commitdiff
* src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
authorAkim Demaille <akim@epita.fr>
Sun, 7 Apr 2002 17:42:49 +0000 (17:42 +0000)
committerAkim Demaille <akim@epita.fr>
Sun, 7 Apr 2002 17:42:49 +0000 (17:42 +0000)
(start_symbol, max_user_token_number, semantic_parser)
(error_token_number): Initialize.
* src/reader.c (grammar, start_flag, startval, typed, lastprec):
Initialize.
(reader): Don't.
(errtoken, eoftoken, undeftoken, axiom): Extern.

ChangeLog
src/gram.c
src/reader.c
src/reader.h

index 3dbfb57e46dffd635cdc85b6def35c7992a47675..69404a2962cd50fd7887627103a0b39ef1ebb2be 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2002-04-07  Akim Demaille  <akim@epita.fr>
+
+       * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
+       (start_symbol, max_user_token_number, semantic_parser)
+       (error_token_number): Initialize.
+       * src/reader.c (grammar, start_flag, startval, typed, lastprec):
+       Initialize.
+       (reader): Don't.
+       (errtoken, eoftoken, undeftoken, axiom): Extern.
+
 2002-04-07  Akim Demaille  <akim@epita.fr>
 
        * src/gram.h (rule_s): prec and precsym are now pointers
 2002-04-07  Akim Demaille  <akim@epita.fr>
 
        * src/gram.h (rule_s): prec and precsym are now pointers
index 9f5521ae5144bff5845299b0a7aee8890004248a..acb586931a451a67e5088d024ffa6cd0d7f79703 100644 (file)
 
 /* comments for these variables are in gram.h  */
 
 
 /* comments for these variables are in gram.h  */
 
-int nitems;
-int nrules;
-int nsyms;
-int ntokens;
-int nvars;
+int nitems = 0;
+int nrules = 0;
+int nsyms = 0;
+int ntokens = 0;
+int nvars = 0;
 
 short *ritem = NULL;
 
 short *ritem = NULL;
-int nritems;
+int nritems = 0;
 
 rule_t *rules = NULL;
 
 struct bucket **symbols = NULL;
 short *token_translations = NULL;
 
 
 rule_t *rules = NULL;
 
 struct bucket **symbols = NULL;
 short *token_translations = NULL;
 
-int start_symbol;
+int start_symbol = 0;
 
 
-int max_user_token_number;
+int max_user_token_number = 256;
 
 
-int semantic_parser;
+int semantic_parser = 0;
 
 
-int pure_parser;
+int pure_parser = 0;
 
 
-int error_token_number;
+int error_token_number = 0;
 
 
 /*--------------------------------------.
 
 
 /*--------------------------------------.
index 01b5940c608b320956663291d51b618e9fe9aca2..c53ab21238f46a7a89e98d9b1954aa5fcc5ab9a0 100644 (file)
@@ -52,24 +52,24 @@ typedef struct symbol_list
 } symbol_list;
 
 int lineno;
 } symbol_list;
 
 int lineno;
-static symbol_list *grammar;
-static int start_flag;
-static bucket *startval;
+static symbol_list *grammar = NULL;
+static int start_flag = 0;
+static bucket *startval = NULL;
 
 /* Nonzero if components of semantic values are used, implying
    they must be unions.  */
 static int value_components_used;
 
 /* Nonzero if %union has been seen.  */
 
 /* Nonzero if components of semantic values are used, implying
    they must be unions.  */
 static int value_components_used;
 
 /* Nonzero if %union has been seen.  */
-static int typed;
+static int typed = 0;
 
 /* Incremented for each %left, %right or %nonassoc seen */
 
 /* Incremented for each %left, %right or %nonassoc seen */
-static int lastprec;
+static int lastprec = 0;
 
 
-static bucket *errtoken = NULL;
-static bucket *undeftoken = NULL;
-static bucket *eoftoken = NULL;
-static bucket *axiom = NULL;
+bucket *errtoken = NULL;
+bucket *undeftoken = NULL;
+bucket *eoftoken = NULL;
+bucket *axiom = NULL;
 
 static symbol_list *
 symbol_list_new (bucket *sym)
 
 static symbol_list *
 symbol_list_new (bucket *sym)
@@ -1743,22 +1743,6 @@ packgram (void)
 void
 reader (void)
 {
 void
 reader (void)
 {
-  start_flag = 0;
-  startval = NULL;             /* start symbol not specified yet. */
-
-  nsyms = 0;
-  nvars = 0;
-  nrules = 0;
-  nitems = 0;
-
-  typed = 0;
-  lastprec = 0;
-
-  semantic_parser = 0;
-  pure_parser = 0;
-
-  grammar = NULL;
-
   lex_init ();
   lineno = 1;
 
   lex_init ();
   lineno = 1;
 
index 32f02e96ffc35f4d4f97f4ddfc34954caf426d34..abff0d3828eba3256352e2684e8b28df737ba991 100644 (file)
@@ -21,6 +21,8 @@
 #ifndef READER_H_
 # define READER_H_
 
 #ifndef READER_H_
 # define READER_H_
 
+#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
 /* 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
@@ -34,4 +36,9 @@ void grammar_free PARAMS ((void));
 
 extern int lineno;
 
 
 extern int lineno;
 
+extern bucket *errtoken;
+extern bucket *undeftoken;
+extern bucket *eoftoken;
+extern bucket *axiom;
+
 #endif /* !READER_H_ */
 #endif /* !READER_H_ */