comparison libinterp/parse-tree/oct-parse.in.yy @ 17629:1e8f8900a041

clean up partially constructed parse tree objects on parse errors (bug #40231) * oct-parse.in.yy (%destructor): New declaration of cleanup actions to take for items on the parser stack when a parse error occurs.
author John W. Eaton <jwe@octave.org>
date Fri, 11 Oct 2013 09:05:54 -0400
parents fd712a12fe53
children bd0a84de3375
comparison
equal deleted inserted replaced
17628:99ffa521ecec 17629:1e8f8900a041
296 %right UNARY EXPR_NOT 296 %right UNARY EXPR_NOT
297 %left POW EPOW HERMITIAN TRANSPOSE 297 %left POW EPOW HERMITIAN TRANSPOSE
298 %right PLUS_PLUS MINUS_MINUS 298 %right PLUS_PLUS MINUS_MINUS
299 %left '(' '.' '{' 299 %left '(' '.' '{'
300 300
301 // How to clean up if there is a parse error. We handle deleting tokens
302 // and comments seperately and separators are just characters. The
303 // remaining items are dynamically allocated parse tree objects that
304 // must be deleted.
305 %destructor { } <sep_type> <tok_val> <comment_type> <dummy_type> <>
306 %destructor { delete $$; } <*>
307
301 // Where to start. 308 // Where to start.
302 %start input 309 %start input
303 310
304 %% 311 %%
305 312