/[bison]/bison/src/parse-gram.y
ViewVC logotype

Diff of /bison/src/parse-gram.y

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

revision 1.13 by akim, Thu Jun 20 09:08:37 2002 UTC revision 1.14 by akim, Thu Jun 20 11:10:56 2002 UTC
# Line 69  do {                                                   \ Line 69  do {                                                   \
69  #define yyerror(Msg) \  #define yyerror(Msg) \
70          gram_error (yycontrol, &yylloc, Msg)          gram_error (yycontrol, &yylloc, Msg)
71    
 /* When debugging our pure parser, we want to see values and locations  
    of the tokens.  */  
72  #define YYPRINT(File, Type, Value) \  #define YYPRINT(File, Type, Value) \
73          yyprint (File, &yylloc, Type, &Value)          yyprint (File, Type, &Value)
74  static void yyprint (FILE *file, const location_t *loc,  static void yyprint (FILE *file, int type, const yystype *value);
                      int type, const yystype *value);  
75    
76  symbol_class current_class = unknown_sym;  symbol_class current_class = unknown_sym;
77  char *current_type = 0;  char *current_type = 0;
# Line 289  symbol_def: Line 286  symbol_def:
286       }       }
287  | ID  | ID
288       {       {
289         symbol_class_set ($1, current_class);         symbol_class_set ($1, current_class, @1);
290         symbol_type_set ($1, @1, current_type);         symbol_type_set ($1, @1, current_type);
291       }       }
292  | ID INT  | ID INT
293      {      {
294        symbol_class_set ($1, current_class);        symbol_class_set ($1, current_class, @1);
295        symbol_type_set ($1, @1, current_type);        symbol_type_set ($1, @1, current_type);
296        symbol_user_token_number_set ($1, $2);        symbol_user_token_number_set ($1, $2, @2);
297      }      }
298  | ID string_as_id  | ID string_as_id
299      {      {
300        symbol_class_set ($1, current_class);        symbol_class_set ($1, current_class, @1);
301        symbol_type_set ($1, @1, current_type);        symbol_type_set ($1, @1, current_type);
302        symbol_make_alias ($1, $2);        symbol_make_alias ($1, $2);
303      }      }
304  | ID INT string_as_id  | ID INT string_as_id
305      {      {
306        symbol_class_set ($1, current_class);        symbol_class_set ($1, current_class, @1);
307        symbol_type_set ($1, @1, current_type);        symbol_type_set ($1, @1, current_type);
308        symbol_user_token_number_set ($1, $2);        symbol_user_token_number_set ($1, $2, @2);
309        symbol_make_alias ($1, $3);        symbol_make_alias ($1, $3);
310      }      }
311  ;  ;
# Line 357  rhs: Line 354  rhs:
354  | rhs action  | rhs action
355      { grammar_current_rule_action_append ($2, @2); }      { grammar_current_rule_action_append ($2, @2); }
356  | rhs "%prec" symbol  | rhs "%prec" symbol
357      { grammar_current_rule_prec_set ($3); }      { grammar_current_rule_prec_set ($3, @3); }
358  ;  ;
359    
360  symbol:  symbol:
# Line 376  string_as_id: Line 373  string_as_id:
373    STRING    STRING
374      {      {
375        $$ = getsym ($1, @1);        $$ = getsym ($1, @1);
376        symbol_class_set ($$, token_sym);        symbol_class_set ($$, token_sym, @1);
377      }      }
378  ;  ;
379    
# Line 411  semi_colon.opt: Line 408  semi_colon.opt:
408    
409  static void  static void
410  yyprint (FILE *file,  yyprint (FILE *file,
411           const location_t *loc, int type, const yystype *value)           int type, const yystype *value)
412  {  {
413    fputs (" (", file);    fputc (' ', file);
   LOCATION_PRINT (file, *loc);  
   fputs (")", file);  
414    switch (type)    switch (type)
415      {      {
416      case CHARACTER:      case CHARACTER:

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

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