1415 |
void |
void |
1416 |
yyerror (char const *s) |
yyerror (char const *s) |
1417 |
@{ |
@{ |
1418 |
printf ("%s\n", s); |
fprintf (stderr, "%s\n", s); |
1419 |
@} |
@} |
1420 |
@end group |
@end group |
1421 |
@end example |
@end example |
3082 |
functional parser, it can be useful to process some additional information, |
functional parser, it can be useful to process some additional information, |
3083 |
especially symbol locations. |
especially symbol locations. |
3084 |
|
|
|
@c (terminal or not) ? |
|
|
|
|
3085 |
The way locations are handled is defined by providing a data type, and |
The way locations are handled is defined by providing a data type, and |
3086 |
actions to take when rules are matched. |
actions to take when rules are matched. |
3087 |
|
|
3146 |
else |
else |
3147 |
@{ |
@{ |
3148 |
$$ = 1; |
$$ = 1; |
3149 |
printf("Division by zero, l%d,c%d-l%d,c%d", |
fprintf (stderr, |
3150 |
@@3.first_line, @@3.first_column, |
"Division by zero, l%d,c%d-l%d,c%d", |
3151 |
@@3.last_line, @@3.last_column); |
@@3.first_line, @@3.first_column, |
3152 |
|
@@3.last_line, @@3.last_column); |
3153 |
@} |
@} |
3154 |
@} |
@} |
3155 |
@end group |
@end group |
3173 |
else |
else |
3174 |
@{ |
@{ |
3175 |
$$ = 1; |
$$ = 1; |
3176 |
printf("Division by zero, l%d,c%d-l%d,c%d", |
fprintf (stderr, |
3177 |
@@3.first_line, @@3.first_column, |
"Division by zero, l%d,c%d-l%d,c%d", |
3178 |
@@3.last_line, @@3.last_column); |
@@3.first_line, @@3.first_column, |
3179 |
|
@@3.last_line, @@3.last_column); |
3180 |
@} |
@} |
3181 |
@} |
@} |
3182 |
@end group |
@end group |