Mercurial > hg > octave-lyh
comparison libinterp/parse-tree/lex.h @ 16115:4f6c37cfbdce
cleanup lexical_feedback objects
* lex.h (lexical_feedback::cleanup): New static member function.
* oct-parse.yy (eval_string, parse_fcn_file): Put new clenup function
on unwind-protect stack to delete lexer object.
* input.cc (get_debug_input): Likewise.
* toplev.cc (main_loop): Likewise.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 26 Feb 2013 10:58:33 -0500 |
parents | 7c5e5e97a3bc |
children | f8e463523229 |
comparison
equal
deleted
inserted
replaced
16114:73a21ade0b6b | 16115:4f6c37cfbdce |
---|---|
375 // Stack to hold tokens so that we can delete them when the parser is | 375 // Stack to hold tokens so that we can delete them when the parser is |
376 // reset and avoid growing forever just because we are stashing some | 376 // reset and avoid growing forever just because we are stashing some |
377 // information. | 377 // information. |
378 std::stack <token*> token_stack; | 378 std::stack <token*> token_stack; |
379 | 379 |
380 // For unwind protect. | |
381 static void cleanup (lexical_feedback *lexer) { delete lexer; } | |
382 | |
380 private: | 383 private: |
381 | 384 |
382 // No copying! | 385 // No copying! |
383 | 386 |
384 lexical_feedback (const lexical_feedback&); | 387 lexical_feedback (const lexical_feedback&); |