/[bison]/bison/src/symtab.h
ViewVC logotype

Diff of /bison/src/symtab.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.26 by akim, Sun May 26 18:39:05 2002 UTC revision 1.27 by akim, Mon Jun 10 08:35:39 2002 UTC
# Line 22  Line 22 
22  #ifndef SYMTAB_H_  #ifndef SYMTAB_H_
23  # define SYMTAB_H_  # define SYMTAB_H_
24    
25  #define TABSIZE 1009  /*----------.
26    | Symbols.  |
27    `----------*/
28    
29  /* Associativity values for tokens and rules.  */  /* Associativity values for tokens and rules.  */
30  typedef enum  typedef enum
# Line 79  struct symbol_s Line 81  struct symbol_s
81  #define NUMBER_UNDEFINED ((symbol_number_t) -1)  #define NUMBER_UNDEFINED ((symbol_number_t) -1)
82    
83    
84  /* A function to apply to each symbol. */  /* Fetch (or create) the symbol associated to KEY.  */
85  typedef bool (*symbol_processor) PARAMS ((symbol_t *));  symbol_t *getsym PARAMS ((const char *key));
86    
87    /* Declare the new SYMBOL.  Make it an alias of SYMVAL, and type */
88    /* them with TYPENAME.                                           */
89    void symbol_make_alias PARAMS ((symbol_t *symbol, symbol_t *symval,
90                                    char *typename));
91    
92    /* Distinguished symbols.  AXIOM is the real start symbol, that used
93       by the automaton.  STARTSYMBOL is the one specified by the user.
94       */
95    extern symbol_t *errtoken;
96    extern symbol_t *undeftoken;
97    extern symbol_t *eoftoken;
98    extern symbol_t *axiom;
99    extern symbol_t *startsymbol;
100    
101    
102    /*---------------.
103    | Symbol table.  |
104    `---------------*/
105    
 symbol_t *getsym PARAMS ((const char *));  
106    
107    /* Create the symbol table.  */
108  void symbols_new PARAMS ((void));  void symbols_new PARAMS ((void));
109    
110    /* A function to apply to each symbol. */
111    typedef bool (*symbol_processor) PARAMS ((symbol_t *));
112    
113    /* Apply PROCESSOR to all the symbols.  PROCESSOR must return TRUE: on
114       FALSE, the processing stops.  */
115  void symbols_do PARAMS ((symbol_processor processor, void *processor_data));  void symbols_do PARAMS ((symbol_processor processor, void *processor_data));
116    
117    /* Free all the memory allocated for symbols.  */
118  void symbols_free PARAMS ((void));  void symbols_free PARAMS ((void));
119    
120    /* Check that all the symbols are defined.  Report any undefined */
121    /* symbols and consider them nonterminals.                       */
122    void symbols_check_defined PARAMS ((void));
123    
124    /* Perform various sanity checks, assign symbol numbers, and set up
125       TOKEN_TRANSLATIONS.  */
126    void symbols_pack PARAMS ((void));
127    
128  #endif /* !SYMTAB_H_ */  #endif /* !SYMTAB_H_ */

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26