Mercurial > octave
comparison libinterp/parse-tree/parse.h @ 21073:f7cc48f601d2
additional reworking of error handling in the parser (bug #46877)
* oct-parse.in.yy (ABORT_PARSE): Delete. Replace all uses with
YYABORT. Ensure that all uses of octave_base_parser::bison_error are
followed by YYABORT.
(octave_base_parser::make_for_command): Always delete unused parse
tree elements if an error is detected.
octave_base_parser::make_index_expression): Likewise.
(octave_base_parser::parse_error_msg): New data member.
(octave_base_parser::bison_error): Store error message for later use
instead of calling parse_error.
(octave_parser::run, octave_push_parser::run): Check return status of
Bison-generated parser and call parse_error here with stored message.
Handle exceptions generated while parsing.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 14 Jan 2016 16:40:12 -0500 |
parents | f25c14056b7c |
children | 538b57866b90 |
comparison
equal
deleted
inserted
replaced
21072:a9ed4104ecfd | 21073:f7cc48f601d2 |
---|---|
389 tree_statement *stmt, bool warn_missing_semi); | 389 tree_statement *stmt, bool warn_missing_semi); |
390 | 390 |
391 // Generic error messages. | 391 // Generic error messages. |
392 void bison_error (const std::string& s, int l = -1, int c = -1); | 392 void bison_error (const std::string& s, int l = -1, int c = -1); |
393 | 393 |
394 // Contains error message if Bison-generated parser returns non-zero | |
395 // status. | |
396 std::string parse_error_msg; | |
397 | |
394 // Have we found an explicit end to a function? | 398 // Have we found an explicit end to a function? |
395 bool endfunction_found; | 399 bool endfunction_found; |
396 | 400 |
397 // TRUE means we are in the process of autoloading a function. | 401 // TRUE means we are in the process of autoloading a function. |
398 bool autoloading; | 402 bool autoloading; |