]> git.saurik.com Git - bison.git/blobdiff - src/gram.h
* src/print.c, src/print_graph.c (escape): New.
[bison.git] / src / gram.h
index c12698b6fe5ae321c2b1db098c12f69329b1268a..021061d21e2860d8caab3e993ebc18c62bb70cd3 100644 (file)
    RULE_TABLE[R].precsym -- the symbol-number of the symbol in %prec
    for R (if any).
 
-   RULE_TABLE[R].assoc -- the associativity of the rule.
+   RULE_TABLE[R].assoc -- the associativity of R.
+
+   RULE_TABLE[R].line -- the line where R was defined.
+
+   RULE_TABLE[R].useful -- TRUE iff the rule is used.
 
    The right hand side is stored as symbol numbers in a portion of
    RITEM.
@@ -97,7 +101,6 @@ extern short *ritem;
 
 extern short *sprec;
 extern short *sassoc;
-extern short *rline;           /* Source line number of each rule */
 
 extern int start_symbol;
 
@@ -117,6 +120,14 @@ typedef struct rule_s
   short prec;
   short precsym;
   short assoc;
+  short line;
+  bool useful;
+
+  const char *action;
+  short action_line;
+
+  const char *guard;
+  short guard_line;
 } rule_t;
 
 extern struct rule_s *rule_table;
@@ -142,4 +153,12 @@ extern int pure_parser;
 /* ERROR_TOKEN_NUMBER is the token number of the error token.  */
 
 extern int error_token_number;
+
+
+/* Dump RITEM for traces. */
+void ritem_print PARAMS ((FILE *out));
+
+/* Return the size of the longest rule RHS.  */
+size_t ritem_longest_rhs PARAMS ((void));
+
 #endif /* !GRAM_H_ */