/[bison]/bison/src/reader.c
ViewVC logotype

Diff of /bison/src/reader.c

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

revision 1.172 by akim, Thu May 2 15:06:46 2002 UTC revision 1.173 by akim, Thu May 2 16:16:11 2002 UTC
# Line 1264  read_declarations (void) Line 1264  read_declarations (void)
1264    
1265  /*------------------------------------------------------------------.  /*------------------------------------------------------------------.
1266  | Assuming that a `{' has just been seen, copy everything up to the |  | Assuming that a `{' has just been seen, copy everything up to the |
1267  | matching `}' into the actions file.  RULE_LENGTH is the number of |  | matching `}' into ACTION_OBSTACK.                                 |
1268  | values in the current rule so far, which says where to find `$0'  |  |                                                                   |
1269  | with respect to the top of the stack.                             |  | RULE_LENGTH is the number of values in the current rule so far,   |
1270    | which says where to find `$0' with respect to the top of the      |
1271    | stack.  It is not the same as the rule->length in the case of mid |
1272    | rule actions.                                                     |
1273  |                                                                   |  |                                                                   |
1274  | This routine is used for actions.                                 |  | This routine is used for actions.                                 |
1275  `------------------------------------------------------------------*/  `------------------------------------------------------------------*/
1276    
1277  static void  static void
1278  parse_braces (symbol_list *rule, int rule_length)  parse_action (symbol_list *rule, int rule_length)
1279  {  {
1280    int c;    int count = 1;
1281    int count;    rule->action_line = lineno;
   
   count = 1;  
1282    while (count > 0)    while (count > 0)
1283      {      {
1284          int c;
1285        while ((c = getc (finput)) != '}')        while ((c = getc (finput)) != '}')
1286          switch (c)          switch (c)
1287            {            {
# Line 1323  parse_braces (symbol_list *rule, int rul Line 1325  parse_braces (symbol_list *rule, int rul
1325      }      }
1326    
1327    obstack_1grow (&action_obstack, '\0');    obstack_1grow (&action_obstack, '\0');
 }  
   
   
 static void  
 parse_action (symbol_list *rule, int rule_length)  
 {  
   rule->action_line = lineno;  
   parse_braces (rule, rule_length);  
1328    rule->action = obstack_finish (&action_obstack);    rule->action = obstack_finish (&action_obstack);
1329  }  }
1330    

Legend:
Removed from v.1.172  
changed lines
  Added in v.1.173

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