|
|
Examples
The table below contains links to several example grammars.
A typical mistake in C++ is to write '>>' instead of
'> >' to terminate a nested template-id. basil
can recover very easily from such a mistake. For example, let's run
basilsim with the log file log-08 and give it the input
# A <B <C>>
IDENT LT IDENT LT IDENT RSHIFT
The recover strategy 'r:[GT,GT]:RSHIFT' will replace
'>>' with '> >'. The recover
message is
error.txt:3:1: Syntax error before '{end of file}'
error.txt:2:25: Replacing 'RSHIFT' with 'GT GT'
This would be just one of several recover strategies in a C++ parser.
|
|