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 |
{ |
{ |
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 |
|
|