mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 04:13:03 +00:00
Currently autocompletion on a line with errors leaks the error messages. It can be useful to let the user know, but GNU Readline does not provide us with an nice way to display the error. So we actually break into the current line of the user. So instead, do not show these errors. * examples/c/bistromathic/parse.y (user_context): New. Use %param to pass it to the parser and scanner. Keep quiet when in computing autocompletion.
bistromathic - all the bells and whistles
This example demonstrates best practices when using Bison.
- Its hand-written scanner tracks locations.
- Its interface is pure.
- It uses the
errortoken to get error recovery. - Its interface is "incremental", well suited for interaction: it uses the push-parser API to feed the parser with the incoming tokens.
- It features an interactive command line with completion based on the
parser state, based on
yyexpected_tokens. - It uses Bison's standard catalogue for internationalization of generated messages.
- It uses a custom syntax error with location, lookahead correction and token internationalization.
- It supports debug traces with semantic values.
- It uses named references instead of the traditional $1, $2, etc.
To customize the interaction with bistromathic, see the GNU Readline user
manual (see info rluserman).