Mercurial > octave-nkf
comparison libinterp/parse-tree/lex.ll @ 16122:6884401b2fbb
move reset_parser lexer helper function to lexical_feedback class
* lex.h, lex.ll (reset_parser): Declare as member function of
lexical_feedback class. Change all uses.
(cleanup_parser): Don't call reset parser.
* parse.h (reset_parser): Delete decl.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 26 Feb 2013 12:43:15 -0500 |
parents | bdf365c5c9bf |
children | a484e39d1f22 |
comparison
equal
deleted
inserted
replaced
16121:bdf365c5c9bf | 16122:6884401b2fbb |
---|---|
974 TOK_RETURN (END_OF_INPUT); | 974 TOK_RETURN (END_OF_INPUT); |
975 } | 975 } |
976 | 976 |
977 %% | 977 %% |
978 | 978 |
979 // Fix things up for errors or interrupts. The parser is never called | |
980 // recursively, so it is always safe to reinitialize its state before | |
981 // doing any parsing. | |
982 | |
983 void | 979 void |
984 reset_parser (void) | 980 lexical_feedback::reset_parser (void) |
985 { | 981 { |
986 // Start off on the right foot. | 982 // Start off on the right foot. |
987 BEGIN (INITIAL); | 983 BEGIN (INITIAL); |
988 | 984 |
989 parser_symtab_context.clear (); | 985 parser_symtab_context.clear (); |
1207 } | 1203 } |
1208 | 1204 |
1209 void | 1205 void |
1210 cleanup_parser (void) | 1206 cleanup_parser (void) |
1211 { | 1207 { |
1212 reset_parser (); | |
1213 | |
1214 clear_all_buffers (); | 1208 clear_all_buffers (); |
1215 } | 1209 } |
1216 | 1210 |
1217 // Restore a buffer (for unwind-prot). | 1211 // Restore a buffer (for unwind-prot). |
1218 | 1212 |