Mercurial > hg > octave-lyh
comparison libinterp/parse-tree/lex.h @ 16158:7eb614760ddb
rename lexical_feedback to octave_lexer
* lex.h (octave_lexer): Rename from lexical_feedback.
* lex.h, lex.ll, parse.h, oct-parse.yy: Change all uses.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 28 Feb 2013 11:24:38 -0500 |
parents | 49dfba4fd3c5 |
children | c5bfdc4c0963 |
comparison
equal
deleted
inserted
replaced
16157:335041cc657a | 16158:7eb614760ddb |
---|---|
48 // No copying! | 48 // No copying! |
49 stream_reader (const stream_reader&); | 49 stream_reader (const stream_reader&); |
50 stream_reader& operator = (const stream_reader&); | 50 stream_reader& operator = (const stream_reader&); |
51 }; | 51 }; |
52 | 52 |
53 // Forward decl for lexical_feedback::token_stack. | 53 // Forward decl for octave_lexer::token_stack. |
54 class token; | 54 class token; |
55 | 55 |
56 // For communication between the lexer and parser. | 56 // For communication between the lexer and parser. |
57 | 57 |
58 class | 58 class |
59 lexical_feedback | 59 octave_lexer |
60 { | 60 { |
61 public: | 61 public: |
62 | 62 |
63 // Did eat_whitespace or eat_continuation eat a space or tab, or a | 63 // Did eat_whitespace or eat_continuation eat a space or tab, or a |
64 // newline, or both? | 64 // newline, or both? |
151 private: | 151 private: |
152 | 152 |
153 std::stack<int> context; | 153 std::stack<int> context; |
154 }; | 154 }; |
155 | 155 |
156 lexical_feedback (void) | 156 octave_lexer (void) |
157 : scanner (0), convert_spaces_to_comma (true), | 157 : scanner (0), convert_spaces_to_comma (true), |
158 do_comma_insert (false), at_beginning_of_statement (true), | 158 do_comma_insert (false), at_beginning_of_statement (true), |
159 looking_at_anon_fcn_args (false), looking_at_return_list (false), | 159 looking_at_anon_fcn_args (false), looking_at_return_list (false), |
160 looking_at_parameter_list (false), looking_at_decl_list (false), | 160 looking_at_parameter_list (false), looking_at_decl_list (false), |
161 looking_at_initializer_expression (false), | 161 looking_at_initializer_expression (false), |
172 pending_local_variables (), nesting_level () | 172 pending_local_variables (), nesting_level () |
173 { | 173 { |
174 init (); | 174 init (); |
175 } | 175 } |
176 | 176 |
177 ~lexical_feedback (void); | 177 ~octave_lexer (void); |
178 | 178 |
179 void init (void); | 179 void init (void); |
180 | 180 |
181 void reset (void); | 181 void reset (void); |
182 | 182 |
368 // Is the closest nesting level a square bracket, squiggly brace or | 368 // Is the closest nesting level a square bracket, squiggly brace or |
369 // a paren? | 369 // a paren? |
370 bbp_nesting_level nesting_level; | 370 bbp_nesting_level nesting_level; |
371 | 371 |
372 // For unwind protect. | 372 // For unwind protect. |
373 static void cleanup (lexical_feedback *lexer) { delete lexer; } | 373 static void cleanup (octave_lexer *lexer) { delete lexer; } |
374 | 374 |
375 private: | 375 private: |
376 | 376 |
377 // Stack to hold tokens so that we can delete them when the parser is | 377 // Stack to hold tokens so that we can delete them when the parser is |
378 // reset and avoid growing forever just because we are stashing some | 378 // reset and avoid growing forever just because we are stashing some |
379 // information. | 379 // information. |
380 std::stack <token*> token_stack; | 380 std::stack <token*> token_stack; |
381 | 381 |
382 // No copying! | 382 // No copying! |
383 | 383 |
384 lexical_feedback (const lexical_feedback&); | 384 octave_lexer (const octave_lexer&); |
385 | 385 |
386 lexical_feedback& operator = (const lexical_feedback&); | 386 octave_lexer& operator = (const octave_lexer&); |
387 }; | 387 }; |
388 | 388 |
389 #endif | 389 #endif |