Error handling in the new C++ parser

Andi Kleen ak@muc.de
Sun Dec 29 11:59:00 GMT 2002


Hi,

I looked at the new C++ parser in mainline and noticed there are lots 
of unchecked cp_parser_require() in parser.c. Sometimes it checks 
later using cp_parser_error_occurred(), but in many other cases
it doesn't.

There seems to be no effort to skip to a sychronizing token
(like ';' or ')') after a normal syntax error, like the old bison
parser did.  I expect it will just become hopelessly confused in this 
case then.

Can someone please expand a bit on how the syntax error recovery 
is supposed to work ? 

Thanks,

-Andi



More information about the Gcc mailing list