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

Diff of /bison/src/gram.h

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

revision 1.6.2.2 by akim, Mon Nov 19 09:12:25 2001 UTC revision 1.6.2.3 by akim, Mon Nov 19 09:12:49 2001 UTC
# Line 50  Line 50 
50     RULE_TABLE[R].rhs -- the index in RITEM of the beginning of the     RULE_TABLE[R].rhs -- the index in RITEM of the beginning of the
51     portion for rule R.     portion for rule R.
52    
53       RULE_TABLE[R].prec -- the precedence level of R.
54    
55       RULE_TABLE[R].precsym -- the symbol-number of the symbol in %prec
56       for R (if any).
57    
58       RULE_TABLE[R].assoc -- the associativity of the rule.
59    
60     The right hand side is stored as symbol numbers in a portion of     The right hand side is stored as symbol numbers in a portion of
61     RITEM.     RITEM.
62    
# Line 67  Line 74 
74     Item numbers are used in the finite state machine to represent     Item numbers are used in the finite state machine to represent
75     places that parsing can get to.     places that parsing can get to.
76    
77     Precedence levels are recorded in the vectors sprec and rprec.     SPREC records the precedence level of each symbol.
    sprec records the precedence level of each symbol, rprec the  
    precedence level of each rule.  rprecsym is the symbol-number of  
    the symbol in %prec for this rule (if any).  
78    
79     Precedence levels are assigned in increasing order starting with 1     Precedence levels are assigned in increasing order starting with 1
80     so that numerically higher precedence values mean tighter binding     so that numerically higher precedence values mean tighter binding
# Line 91  extern int nvars; Line 95  extern int nvars;
95    
96  extern short *ritem;  extern short *ritem;
97    
 extern short *rprec;  
 extern short *rprecsym;  
98  extern short *sprec;  extern short *sprec;
 extern short *rassoc;  
99  extern short *sassoc;  extern short *sassoc;
100  extern short *rline;            /* Source line number of each rule */  extern short *rline;            /* Source line number of each rule */
101    
102  extern int start_symbol;  extern int start_symbol;
103    
 typedef struct rule_s  
 {  
   short lhs;  
   short rhs;  
 } rule_t;  
   
 extern struct rule_s *rule_table;  
   
104  /* associativity values in elements of rassoc, sassoc.  */  /* associativity values in elements of rassoc, sassoc.  */
105  typedef enum  typedef enum
106  {  {
# Line 117  typedef enum Line 110  typedef enum
110  } associativity;  } associativity;
111    
112    
113    typedef struct rule_s
114    {
115      short lhs;
116      short rhs;
117      short prec;
118      short precsym;
119      short assoc;
120    } rule_t;
121    
122    extern struct rule_s *rule_table;
123    
124  /* token translation table: indexed by a token number as returned by  /* token translation table: indexed by a token number as returned by
125     the user's yylex routine, it yields the internal token number used     the user's yylex routine, it yields the internal token number used
126     by the parser and throughout bison.  */     by the parser and throughout bison.  */

Legend:
Removed from v.1.6.2.2  
changed lines
  Added in v.1.6.2.3

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