Default actions are useful because they save a lot of space in parsing tables, at the cost of missing expected tokens in the error messages...
printed by the command 'fcheck'. This is the relevant BNF rule for the example given at the end of this message:
So far, my approach has been that improved diagnostics shouldn't slow
down the processing of correct programs. Is it worthwhile to improve diagnostics by disabling default actions in a LALR parser?
...
Thanks,
Ev. Drikos
This is mainly a parsing question but it's also Fortran related as well.
When I make syntax checking with the command 'fcheck' in the code below,
the error message doesn't contain a '(' in the expected tokens. This
happens due to default actions, although the parser is basically LALR. A
pure LALR parser wouldn't make reductions without examine the lookahead.
This is an interesting case. Since the ( isn't required, it isn't so obvious that the message should mention it.
...
Seems to me that the question is more user experience, and less
parsing tables.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 159 |
Nodes: | 16 (0 / 16) |
Uptime: | 98:37:18 |
Calls: | 3,209 |
Files: | 10,563 |
Messages: | 3,009,579 |