GNU Octave 7.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
lex.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 1993-2022 The Octave Project Developers
4//
5// See the file COPYRIGHT.md in the top-level directory of this
6// distribution or <https://octave.org/copyright/>.
7//
8// This file is part of Octave.
9//
10// Octave is free software: you can redistribute it and/or modify it
11// under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// Octave is distributed in the hope that it will be useful, but
16// WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18// GNU General Public License for more details.
19//
20// You should have received a copy of the GNU General Public License
21// along with Octave; see the file COPYING. If not, see
22// <https://www.gnu.org/licenses/>.
23//
24////////////////////////////////////////////////////////////////////////
25
26#if ! defined (octave_lex_h)
27#define octave_lex_h 1
28
29#include "octave-config.h"
30
31#include <deque>
32#include <list>
33#include <set>
34#include <stack>
35
36#include "comment-list.h"
37#include "filepos.h"
38#include "input.h"
39#include "symscope.h"
40#include "token.h"
41
42namespace octave
43{
44 class interpreter;
45
46 // Is the given string a keyword?
47 extern bool iskeyword (const std::string& s);
48
49 // For communication between the lexer and parser.
50
51 class
53 {
54 public:
55
56 // Track symbol table information when parsing functions.
57
59 {
60 public:
61
63 : m_interpreter (interp), m_frame_stack () { }
64
65 ~symbol_table_context (void) { clear (); }
66
67 void clear (void);
68
69 bool empty (void) const { return m_frame_stack.empty (); }
70
71 std::size_t size (void) const { return m_frame_stack.size (); }
72
73 void pop (void);
74
75 void push (const symbol_scope& scope)
76 {
77 m_frame_stack.push_front (scope);
78 }
79
80 symbol_scope curr_scope (void) const;
81 symbol_scope parent_scope (void) const;
82
83 private:
84
86
87 std::deque<symbol_scope> m_frame_stack;
88 };
89
90 // Track nesting of square brackets, curly braces, and parentheses.
91
93 {
94 private:
95
97 {
98 BRACKET = 1,
99 BRACE = 2,
100 PAREN = 3,
101 ANON_FCN_BODY = 4
102 };
103
104 public:
105
106 bbp_nesting_level (void) : m_context () { }
107
109 : m_context (nl.m_context)
110 { }
111
112 bbp_nesting_level& operator = (const bbp_nesting_level& nl)
113 {
114 if (&nl != this)
115 m_context = nl.m_context;
116
117 return *this;
118 }
119
120 ~bbp_nesting_level (void) = default;
121
122 // Alias for clear function.
123 void reset (void) { clear (); }
124
125 void bracket (void) { m_context.push (BRACKET); }
126
127 bool is_bracket (void)
128 {
129 return ! m_context.empty () && m_context.top () == BRACKET;
130 }
131
132 void brace (void) { m_context.push (BRACE); }
133
134 bool is_brace (void)
135 {
136 return ! m_context.empty () && m_context.top () == BRACE;
137 }
138
139 void paren (void) { m_context.push (PAREN); }
140
141 bool is_paren (void)
142 {
143 return ! m_context.empty () && m_context.top () == PAREN;
144 }
145
146 void anon_fcn_body (void) { m_context.push (ANON_FCN_BODY); }
147
149 {
150 return ! m_context.empty () && m_context.top () == ANON_FCN_BODY;
151 }
152
154 {
155 return (! m_context.empty ()
156 && (m_context.top () == BRACKET || m_context.top () == BRACE));
157 }
158
159 bool none (void) { return m_context.empty (); }
160
161 void remove (void)
162 {
163 if (! m_context.empty ())
164 m_context.pop ();
165 }
166
167 void clear (void)
168 {
169 while (! m_context.empty ())
170 m_context.pop ();
171 }
172
173 private:
174
175 std::stack<int> m_context;
176 };
177
179 {
180 public:
181
182 // Store an "unlimited" number of tokens.
183
184 // Tokens are allocated with new. Delete them when they are
185 // removed from the cache.
186 //
187 // One of the reasons for using this class instead of std::deque
188 // directly is that we can ensure that memory is cleaned up
189 // properly. It's more tedious to do that with deque since the
190 // deque destructor and clear method don't call delete on the
191 // elements that it stores. Another reason is that it makes it
192 // easier to change the implementation later if needed.
193
194 token_cache (void) : m_buffer () { }
195
196 // No copying!
197
198 token_cache (const token_cache&) = delete;
199
200 token_cache& operator = (const token_cache&) = delete;
201
202 ~token_cache (void) { clear (); }
203
204 void push (token *tok)
205 {
206 m_buffer.push_front (tok);
207 }
208
209 void pop (void)
210 {
211 if (! empty ())
212 {
213 delete m_buffer.back ();
214 m_buffer.pop_back ();
215 }
216 }
217
218 // Direct access.
219 token * at (std::size_t n)
220 {
221 return empty () ? nullptr : m_buffer.at (n);
222 }
223
224 const token * at (std::size_t n) const
225 {
226 return empty () ? nullptr : m_buffer.at (n);
227 }
228
229 // Most recently pushed.
230 token * front (void)
231 {
232 return empty () ? nullptr : m_buffer.front ();
233 }
234
235 const token * front (void) const
236 {
237 return empty () ? nullptr : m_buffer.front ();
238 }
239
240 token * back (void)
241 {
242 return empty () ? nullptr : m_buffer.back ();
243 }
244
245 const token * back (void) const
246 {
247 return empty () ? nullptr : m_buffer.back ();
248 }
249
250 // Number of elements currently in the buffer.
251 std::size_t size (void) const { return m_buffer.size (); }
252
253 bool empty (void) const { return m_buffer.empty (); }
254
255 void clear (void)
256 {
257 while (! empty ())
258 pop ();
259 }
260
261 private:
262
263 std::deque<token *> m_buffer;
264 };
265
267 : m_interpreter (interp),
268 m_end_of_input (false),
269 m_allow_command_syntax (true),
270 m_at_beginning_of_statement (true),
271 m_looking_at_anon_fcn_args (false),
272 m_looking_at_return_list (false),
273 m_looking_at_parameter_list (false),
274 m_looking_at_decl_list (false),
275 m_looking_at_matrix_or_assign_lhs (false),
276 m_looking_for_object_index (false),
277 m_looking_at_indirect_ref (false),
278 m_arguments_is_keyword (false),
279 m_classdef_element_names_are_keywords (false),
280 m_parsing_anon_fcn_body (false),
281 m_parsing_class_method (false),
282 m_parsing_classdef (false),
283 m_parsing_classdef_decl (false),
284 m_parsing_classdef_superclass (false),
285 m_maybe_classdef_get_set_method (false),
286 m_parsing_classdef_get_method (false),
287 m_parsing_classdef_set_method (false),
288 m_quote_is_transpose (false),
289 m_force_script (false),
290 m_reading_fcn_file (false),
291 m_reading_script_file (false),
292 m_reading_classdef_file (false),
293 m_buffer_function_text (false),
294 m_bracketflag (0),
295 m_braceflag (0),
296 m_looping (0),
297 m_defining_func (0),
298 m_looking_at_function_handle (0),
299 m_block_comment_nesting_level (0),
300 m_command_arg_paren_count (0),
301 m_token_count (0),
302 m_filepos (1, 1),
303 m_tok_beg (),
304 m_tok_end (),
305 m_string_text (),
306 m_current_input_line (),
307 m_comment_text (),
308 m_help_text (),
309 m_function_text (),
310 m_fcn_file_name (),
311 m_fcn_file_full_name (),
312 m_dir_name (),
313 m_package_name (),
314 m_looking_at_object_index (),
315 m_parsed_function_name (),
316 m_symtab_context (interp),
317 m_nesting_level (),
318 m_tokens ()
319 {
320 init ();
321 }
322
323 // No copying!
324
326
327 lexical_feedback& operator = (const lexical_feedback&) = delete;
328
329 ~lexical_feedback (void);
330
331 void init (void);
332
333 void reset (void);
334
335 int previous_token_value (void) const;
336
337 bool previous_token_value_is (int tok_val) const;
338
339 void mark_previous_token_trailing_space (void);
340
341 bool space_follows_previous_token (void) const;
342
343 bool previous_token_is_binop (void) const;
344
345 bool previous_token_is_keyword (void) const;
346
347 bool previous_token_may_be_command (void) const;
348
349 void mark_as_variable (const std::string& nm);
350 void mark_as_variables (const std::list<std::string>& lst);
351
353
354 // true means that we have encountered eof on the input stream.
356
357 // true means command syntax is allowed.
359
360 // true means we are at the beginning of a statement, where a
361 // command name is possible.
363
364 // true means we are parsing an anonymous function argument list.
366
367 // true means we're parsing the return list for a function.
369
370 // true means we're parsing the parameter list for a function.
372
373 // true means we're parsing a declaration list (global or
374 // persistent).
376
377 // true means we're parsing a matrix or the left hand side of
378 // multi-value assignment statement.
380
381 // object index not possible until we've seen something.
383
384 // true means we're looking at an indirect reference to a
385 // structure element.
387
388 // true means arguments is handled as keyword.
390
391 // true means "properties", "methods", "events", and "enumeration"
392 // are treated like keywords.
394
395 // true means we are parsing the body of an anonymous function.
397
398 // true means we are parsing a class method in function or classdef file.
400
401 // true means we are parsing a classdef file
403
404 // true means we are parsing the initial classdef declaration
405 // portion of classdef file, from the "classdef" token through the
406 // optional list of superclasses.
408
409 // true means we are parsing the superclass part of a classdef
410 // declaration.
412
413 // true means we are parsing a class method declaration line in a
414 // classdef file and can accept a property get or set method name.
415 // for example, "get.propertyname" is recognized as a function name.
417
418 // TRUE means we are parsing a classdef get.method.
420
421 // TRUE means we are parsing a classdef set.method.
423
424 // return transpose or start a string?
426
427 // TRUE means treat the current file as a script even if the first
428 // token is "function" or "classdef".
430
431 // TRUE means we're parsing a function file.
433
434 // TRUE means we're parsing a script file.
436
437 // TRUE means we're parsing a classdef file.
439
440 // TRUE means we should store the text of the function we are
441 // parsing.
443
444 // square bracket level count.
446
447 // curly brace level count.
449
450 // true means we're in the middle of defining a loop.
452
453 // nonzero means we're in the middle of defining a function.
455
456 // nonzero means we are parsing a function handle.
458
459 // nestng level for block comments.
461
462 // Parenthesis count for command argument parsing.
464
465 // Count of tokens recognized by this lexer since initialized or
466 // since the last reset.
467 std::size_t m_token_count;
468
469 // The current position in the file (line and column).
471
472 // The positions of the beginning and end of the current token after
473 // calling update_token_positions. Also used apart from
474 // update_token_positions to handle the beginning and end of
475 // character strings.
478
479 // The current character string text.
480 std::string m_string_text;
481
482 // The current line of input.
484
485 // The current comment text.
486 std::string m_comment_text;
487
488 // The current help text.
489 std::string m_help_text;
490
491 // The text of functions entered on the command line.
492 std::string m_function_text;
493
494 // Simple name of function file we are reading.
495 std::string m_fcn_file_name;
496
497 // Full name of file we are reading.
499
500 // Directory name where this file was found. May be relative.
501 std::string m_dir_name;
502
503 // Name of +package containing this file, if any.
504 std::string m_package_name;
505
506 // if the front of the list is true, the closest paren, brace, or
507 // bracket nesting is an index for an object.
509
510 // if the top of the stack is true, then we've already seen the name
511 // of the current function. should only matter if
512 // current_function_level > 0
513 std::stack<bool> m_parsed_function_name;
514
515 // Track current symbol table scope and context.
517
518 // is the closest nesting level a square bracket, squiggly brace,
519 // a paren, or an anonymous function body?
521
522 // Tokens generated by the lexer.
524 };
525
526 // base_lexer inherits from lexical_feedback because we will
527 // eventually have several different constructors and it is easier to
528 // initialize if everything is grouped in a parent class rather than
529 // listing all the members in the base_lexer class.
530
531 class
533 {
534 public:
535
536 // Handle buffering of input for lexer.
537
539 {
540 public:
541
543 : m_buffer (), m_offset (0), m_chars_left (0), m_eof (false)
544 { }
545
546 void fill (const std::string& input, bool eof_arg);
547
548 // Copy at most max_size characters to buf.
549 int copy_chunk (char *buf, std::size_t max_size, bool by_lines = false);
550
551 bool empty (void) const { return m_chars_left == 0; }
552
553 bool at_eof (void) const { return m_eof; }
554
555 private:
556
557 std::string m_buffer;
558 std::size_t m_offset;
559 std::size_t m_chars_left;
560 bool m_eof;
561 };
562
563 // Collect comment text.
564
565 class
567 {
568 public:
569
570 comment_buffer (void) : m_comment_list (nullptr) { }
571
572 ~comment_buffer (void) { delete m_comment_list; }
573
574 void append (const std::string& s, comment_elt::comment_type t)
575 {
576 if (! m_comment_list)
577 m_comment_list = new comment_list ();
578
579 m_comment_list->append (s, t);
580 }
581
582 // Caller is expected to delete the returned value.
583
585 {
586 comment_list *retval = m_comment_list;
587
588 m_comment_list = nullptr;
589
590 return retval;
591 }
592
593 void reset (void)
594 {
595 delete m_comment_list;
596
597 m_comment_list = nullptr;
598 }
599
600 private:
601
603 };
604
606 : lexical_feedback (interp), m_scanner (nullptr), m_input_buf (),
607 m_comment_buf ()
608 {
609 init ();
610 }
611
612 // No copying!
613
614 base_lexer (const base_lexer&) = delete;
615
616 base_lexer& operator = (const base_lexer&) = delete;
617
618 virtual ~base_lexer (void);
619
620 void init (void);
621
622 virtual bool is_push_lexer (void) const { return false; }
623
624 virtual void reset (void);
625
626 void prep_for_file (void);
627
628 void begin_string (int state);
629
630 virtual int fill_flex_buffer (char *buf, unsigned int max_size) = 0;
631
632 bool at_end_of_buffer (void) const { return m_input_buf.empty (); }
633
634 bool at_end_of_file (void) const { return m_input_buf.at_eof (); }
635
636 int handle_end_of_input (void);
637
638 char * flex_yytext (void);
639
640 int flex_yyleng (void);
641
642 int text_yyinput (void);
643
644 void xunput (char c, char *buf);
645
646 void xunput (char c);
647
648 void update_token_positions (int tok_len);
649
650 bool looking_at_space (void);
651
652 bool inside_any_object_index (void);
653
654 int make_keyword_token (const std::string& s);
655
656 bool fq_identifier_contains_keyword (const std::string& s);
657
658 bool whitespace_is_significant (void);
659
660 // We only provide specializations with base equal to 2, 10, or 16.
661 template <int base>
662 int handle_number (void);
663
664 void handle_continuation (void);
665
666 void finish_comment (comment_elt::comment_type typ);
667
668 comment_list * get_comment (void) { return m_comment_buf.get_comment (); }
669
670 int handle_close_bracket (int bracket_type);
671
672 bool looks_like_command_arg (void);
673
674 int handle_superclass_identifier (void);
675
676 int handle_meta_identifier (void);
677
678 int handle_fq_identifier (void);
679
680 int handle_identifier (void);
681
682 void maybe_warn_separator_insert (char sep);
683
684 void warn_single_quote_string (void);
685
686 void warn_language_extension (const std::string& msg);
687
688 void maybe_warn_language_extension_comment (char c);
689
690 void warn_language_extension_continuation (void);
691
692 void warn_language_extension_operator (const std::string& op);
693
694 void warn_deprecated_syntax (const std::string& msg);
695
696 void warn_deprecated_operator (const std::string& deprecated_op,
697 const std::string& recommended_op,
698 const std::string& version);
699
700 void push_token (token *);
701
702 token * current_token (void);
703
704 std::size_t pending_token_count (void) const;
705
706 void display_token (int tok);
707
708 void fatal_error (const char *msg);
709
710 bool debug_flag (void) const;
711
712 bool display_tokens (void) const;
713
714 void increment_token_count (void);
715
716 void lexer_debug (const char *pattern);
717
718 // Internal state of the flex-generated lexer.
720
721 // Object that reads and buffers input.
723
724 // Object that collects comment text.
726
727 virtual std::string input_source (void) const { return "unknown"; }
728
729 virtual bool input_from_terminal (void) const { return false; }
730
731 virtual bool input_from_file (void) const { return false; }
732
733 virtual bool input_from_eval_string (void) const { return false; }
734
735 bool input_from_tmp_history_file (void);
736
737 void push_start_state (int state);
738
739 void pop_start_state (void);
740
741 void clear_start_state (void);
742
743 int start_state (void) const { return start_state_stack.top (); }
744
745 void display_start_state (void) const;
746
747 bool maybe_unput_comma_before_unary_op (int tok);
748
749 int handle_op (int tok, bool bos = false, bool compat = true);
750
751 int finish_command_arg (void);
752
753 int handle_token (int tok, token *tok_val = nullptr);
754
755 int count_token (int tok);
756
757 int count_token_internal (int tok);
758
759 int show_token (int tok);
760
761 protected:
762
763 std::stack<int> start_state_stack;
764 };
765
766 class
767 lexer : public base_lexer
768 {
769 public:
770
772 : base_lexer (interp), m_reader (interp), m_initial_input (true)
773 { }
774
775 lexer (FILE *file, interpreter& interp)
776 : base_lexer (interp), m_reader (interp, file), m_initial_input (true)
777 { }
778
779 lexer (FILE *file, interpreter& interp, const std::string& encoding)
780 : base_lexer (interp), m_reader (interp, file, encoding), m_initial_input (true)
781 { }
782
783 lexer (const std::string& eval_string, interpreter& interp)
784 : base_lexer (interp), m_reader (interp, eval_string),
785 m_initial_input (true)
786 { }
787
788 // No copying!
789
790 lexer (const lexer&) = delete;
791
792 lexer& operator = (const lexer&) = delete;
793
794 void reset (void)
795 {
796 m_initial_input = true;
797
799 }
800
801 std::string input_source (void) const
802 {
803 return m_reader.input_source ();
804 }
805
806 bool input_from_terminal (void) const
807 {
808 return m_reader.input_from_terminal ();
809 }
810
811 bool input_from_file (void) const
812 {
813 return m_reader.input_from_file ();
814 }
815
816 bool input_from_eval_string (void) const
817 {
818 return m_reader.input_from_eval_string ();
819 }
820
821 int fill_flex_buffer (char *buf, unsigned int max_size);
822
824
825 // TRUE means we are filling the input buffer for the first time.
826 // Otherwise, we are requesting more input to complete the parse
827 // and, if printing a prompt, should use the secondary prompt
828 // string.
829
831 };
832
833 template <> int base_lexer::handle_number<2> ();
834 template <> int base_lexer::handle_number<10> ();
835 template <> int base_lexer::handle_number<16> ();
836
837 class
838 push_lexer : public base_lexer
839 {
840 public:
841
843 : base_lexer (interp)
844 {
845 append_input ("", false);
846 }
847
848 push_lexer (const std::string& input, interpreter& interp)
849 : base_lexer (interp)
850 {
851 append_input (input, false);
852 }
853
854 push_lexer (bool eof, interpreter& interp)
855 : base_lexer (interp)
856 {
857 append_input ("", eof);
858 }
859
860 push_lexer (const std::string& input, bool eof, interpreter& interp)
861 : base_lexer (interp)
862 {
863 append_input (input, eof);
864 }
865
866 // No copying!
867
868 push_lexer (const push_lexer&) = delete;
869
870 push_lexer& operator = (const push_lexer&) = delete;
871
872 bool is_push_lexer (void) const { return true; }
873
874 void append_input (const std::string& input, bool eof);
875
876 std::string input_source (void) const { return "push buffer"; }
877
878 int fill_flex_buffer (char *buf, unsigned int max_size);
879 };
880}
881
882#endif
void append(const std::string &s, comment_elt::comment_type t)
Definition: lex.h:574
comment_list * get_comment(void)
Definition: lex.h:584
comment_list * m_comment_list
Definition: lex.h:602
bool at_eof(void) const
Definition: lex.h:553
bool empty(void) const
Definition: lex.h:551
virtual bool input_from_eval_string(void) const
Definition: lex.h:733
virtual int fill_flex_buffer(char *buf, unsigned int max_size)=0
comment_list * get_comment(void)
Definition: lex.h:668
int start_state(void) const
Definition: lex.h:743
comment_buffer m_comment_buf
Definition: lex.h:725
std::stack< int > start_state_stack
Definition: lex.h:763
virtual bool input_from_terminal(void) const
Definition: lex.h:729
bool at_end_of_buffer(void) const
Definition: lex.h:632
base_lexer(const base_lexer &)=delete
bool at_end_of_file(void) const
Definition: lex.h:634
input_buffer m_input_buf
Definition: lex.h:722
virtual std::string input_source(void) const
Definition: lex.h:727
virtual bool is_push_lexer(void) const
Definition: lex.h:622
virtual bool input_from_file(void) const
Definition: lex.h:731
base_lexer(interpreter &interp)
Definition: lex.h:605
void * m_scanner
Definition: lex.h:719
int handle_number(void)
virtual void reset(void)
Definition: lex.cc:5380
bool input_from_terminal(void) const
Definition: lex.h:806
bool input_from_eval_string(void) const
Definition: lex.h:816
lexer(FILE *file, interpreter &interp, const std::string &encoding)
Definition: lex.h:779
lexer(FILE *file, interpreter &interp)
Definition: lex.h:775
bool m_initial_input
Definition: lex.h:830
std::string input_source(void) const
Definition: lex.h:801
void reset(void)
Definition: lex.h:794
input_reader m_reader
Definition: lex.h:823
bool input_from_file(void) const
Definition: lex.h:811
lexer(const std::string &eval_string, interpreter &interp)
Definition: lex.h:783
lexer(interpreter &interp)
Definition: lex.h:771
lexer(const lexer &)=delete
bbp_nesting_level(const bbp_nesting_level &nl)
Definition: lex.h:108
std::size_t size(void) const
Definition: lex.h:71
void push(const symbol_scope &scope)
Definition: lex.h:75
std::deque< symbol_scope > m_frame_stack
Definition: lex.h:87
symbol_table_context(interpreter &interp)
Definition: lex.h:62
token * at(std::size_t n)
Definition: lex.h:219
token_cache(const token_cache &)=delete
const token * back(void) const
Definition: lex.h:245
std::size_t size(void) const
Definition: lex.h:251
const token * at(std::size_t n) const
Definition: lex.h:224
std::deque< token * > m_buffer
Definition: lex.h:263
const token * front(void) const
Definition: lex.h:235
std::string m_comment_text
Definition: lex.h:486
bool m_looking_at_matrix_or_assign_lhs
Definition: lex.h:379
std::stack< bool > m_parsed_function_name
Definition: lex.h:513
int m_command_arg_paren_count
Definition: lex.h:463
bool m_classdef_element_names_are_keywords
Definition: lex.h:393
std::string m_current_input_line
Definition: lex.h:483
bbp_nesting_level m_nesting_level
Definition: lex.h:520
lexical_feedback(const lexical_feedback &)=delete
bool m_looking_at_return_list
Definition: lex.h:368
int m_block_comment_nesting_level
Definition: lex.h:460
bool m_looking_at_decl_list
Definition: lex.h:375
bool m_looking_at_anon_fcn_args
Definition: lex.h:365
bool m_arguments_is_keyword
Definition: lex.h:389
bool m_reading_classdef_file
Definition: lex.h:438
bool m_parsing_classdef_superclass
Definition: lex.h:411
bool m_parsing_classdef_decl
Definition: lex.h:407
interpreter & m_interpreter
Definition: lex.h:352
bool m_allow_command_syntax
Definition: lex.h:358
bool m_looking_at_parameter_list
Definition: lex.h:371
bool m_parsing_anon_fcn_body
Definition: lex.h:396
token_cache m_tokens
Definition: lex.h:523
bool m_parsing_classdef_get_method
Definition: lex.h:419
bool m_parsing_classdef_set_method
Definition: lex.h:422
bool m_reading_script_file
Definition: lex.h:435
symbol_table_context m_symtab_context
Definition: lex.h:516
std::string m_string_text
Definition: lex.h:480
bool m_buffer_function_text
Definition: lex.h:442
std::string m_help_text
Definition: lex.h:489
std::string m_fcn_file_full_name
Definition: lex.h:498
std::size_t m_token_count
Definition: lex.h:467
bool m_maybe_classdef_get_set_method
Definition: lex.h:416
std::list< bool > m_looking_at_object_index
Definition: lex.h:508
std::string m_package_name
Definition: lex.h:504
bool m_quote_is_transpose
Definition: lex.h:425
int m_looking_at_function_handle
Definition: lex.h:457
bool m_parsing_class_method
Definition: lex.h:399
bool m_looking_for_object_index
Definition: lex.h:382
bool m_looking_at_indirect_ref
Definition: lex.h:386
lexical_feedback(interpreter &interp)
Definition: lex.h:266
std::string m_dir_name
Definition: lex.h:501
bool m_at_beginning_of_statement
Definition: lex.h:362
std::string m_function_text
Definition: lex.h:492
std::string m_fcn_file_name
Definition: lex.h:495
push_lexer(const std::string &input, interpreter &interp)
Definition: lex.h:848
push_lexer(const std::string &input, bool eof, interpreter &interp)
Definition: lex.h:860
bool is_push_lexer(void) const
Definition: lex.h:872
push_lexer(interpreter &interp)
Definition: lex.h:842
std::string input_source(void) const
Definition: lex.h:876
push_lexer(bool eof, interpreter &interp)
Definition: lex.h:854
push_lexer(const push_lexer &)=delete
static uint32_t state[624]
Definition: randmtzig.cc:192
bool iskeyword(const std::string &s)
#define lexer
Definition: oct-parse.cc:146
static int input(yyscan_t yyscanner)
#define m_scanner