GNU Octave  8.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-2023 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 
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 
148  bool is_anon_fcn_body (void)
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_fcn (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.
483  std::string m_current_input_line;
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.
498  std::string m_fcn_file_full_name;
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.
508  std::list<bool> m_looking_at_object_index;
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_language_extension (const std::string& msg);
685 
686  void maybe_warn_language_extension_comment (char c);
687 
688  void warn_language_extension_continuation (void);
689 
690  void warn_language_extension_operator (const std::string& op);
691 
692  void warn_deprecated_syntax (const std::string& msg);
693 
694  void warn_deprecated_operator (const std::string& deprecated_op,
695  const std::string& recommended_op,
696  const std::string& version);
697 
698  void push_token (token *);
699 
700  token * current_token (void);
701 
702  std::size_t pending_token_count (void) const;
703 
704  void display_token (int tok);
705 
706  void fatal_error (const char *msg);
707 
708  bool debug_flag (void) const;
709 
710  bool display_tokens (void) const;
711 
712  void increment_token_count (void);
713 
714  void lexer_debug (const char *pattern);
715 
716  // Internal state of the flex-generated lexer.
717  void *m_scanner;
718 
719  // Object that reads and buffers input.
721 
722  // Object that collects comment text.
724 
725  virtual std::string input_source (void) const { return "unknown"; }
726 
727  virtual bool input_from_terminal (void) const { return false; }
728 
729  virtual bool input_from_file (void) const { return false; }
730 
731  virtual bool input_from_eval_string (void) const { return false; }
732 
733  bool input_from_tmp_history_file (void);
734 
735  void push_start_state (int state);
736 
737  void pop_start_state (void);
738 
739  void clear_start_state (void);
740 
741  int start_state (void) const { return start_state_stack.top (); }
742 
743  void display_start_state (void) const;
744 
745  bool maybe_unput_comma_before_unary_op (int tok);
746 
747  int handle_op (int tok, bool bos = false, bool compat = true);
748 
749  int finish_command_arg (void);
750 
751  int handle_token (int tok, token *tok_val = nullptr);
752 
753  int count_token (int tok);
754 
755  int count_token_internal (int tok);
756 
757  int show_token (int tok);
758 
759 protected:
760 
761  std::stack<int> start_state_stack;
762 };
763 
764 class
765 lexer : public base_lexer
766 {
767 public:
768 
769  lexer (interpreter& interp)
770  : base_lexer (interp), m_reader (interp), m_initial_input (true)
771  { }
772 
773  lexer (FILE *file, interpreter& interp)
774  : base_lexer (interp), m_reader (interp, file), m_initial_input (true)
775  { }
776 
777  lexer (FILE *file, interpreter& interp, const std::string& encoding)
778  : base_lexer (interp), m_reader (interp, file, encoding),
779  m_initial_input (true)
780  { }
781 
782  lexer (const std::string& eval_string, interpreter& interp)
783  : base_lexer (interp), m_reader (interp, eval_string),
784  m_initial_input (true)
785  { }
786 
787  // No copying!
788 
789  lexer (const lexer&) = delete;
790 
791  lexer& operator = (const lexer&) = delete;
792 
793  void reset (void)
794  {
795  m_initial_input = true;
796 
798  }
799 
800  std::string input_source (void) const
801  {
802  return m_reader.input_source ();
803  }
804 
805  bool input_from_terminal (void) const
806  {
807  return m_reader.input_from_terminal ();
808  }
809 
810  bool input_from_file (void) const
811  {
812  return m_reader.input_from_file ();
813  }
814 
815  bool input_from_eval_string (void) const
816  {
817  return m_reader.input_from_eval_string ();
818  }
819 
820  int fill_flex_buffer (char *buf, unsigned int max_size);
821 
823 
824  // TRUE means we are filling the input buffer for the first time.
825  // Otherwise, we are requesting more input to complete the parse
826  // and, if printing a prompt, should use the secondary prompt
827  // string.
828 
830 };
831 
832 template <> int base_lexer::handle_number<2> ();
833 template <> int base_lexer::handle_number<10> ();
834 template <> int base_lexer::handle_number<16> ();
835 
836 class
837 push_lexer : public base_lexer
838 {
839 public:
840 
842  : base_lexer (interp)
843  {
844  append_input ("", false);
845  }
846 
847  push_lexer (const std::string& input, interpreter& interp)
848  : base_lexer (interp)
849  {
850  append_input (input, false);
851  }
852 
853  push_lexer (bool eof, interpreter& interp)
854  : base_lexer (interp)
855  {
856  append_input ("", eof);
857  }
858 
859  push_lexer (const std::string& input, bool eof, interpreter& interp)
860  : base_lexer (interp)
861  {
862  append_input (input, eof);
863  }
864 
865  // No copying!
866 
867  push_lexer (const push_lexer&) = delete;
868 
869  push_lexer& operator = (const push_lexer&) = delete;
870 
871  bool is_push_lexer (void) const { return true; }
872 
873  void append_input (const std::string& input, bool eof);
874 
875  std::string input_source (void) const { return "push buffer"; }
876 
877  int fill_flex_buffer (char *buf, unsigned int max_size);
878 };
879 
881 
882 #endif
OCTAVE_END_NAMESPACE(octave)
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
void reset(void)
Definition: lex.h:593
std::string m_buffer
Definition: lex.h:557
bool empty(void) const
Definition: lex.h:551
bool at_eof(void) const
Definition: lex.h:553
std::size_t m_offset
Definition: lex.h:558
std::size_t m_chars_left
Definition: lex.h:559
base_lexer(interpreter &interp)
Definition: lex.h:605
std::stack< int > start_state_stack
Definition: lex.h:761
comment_buffer m_comment_buf
Definition: lex.h:723
base_lexer(const base_lexer &)=delete
virtual int fill_flex_buffer(char *buf, unsigned int max_size)=0
virtual bool input_from_eval_string(void) const
Definition: lex.h:731
int handle_number(void)
int start_state(void) const
Definition: lex.h:741
virtual bool is_push_lexer(void) const
Definition: lex.h:622
bool at_end_of_file(void) const
Definition: lex.h:634
void * m_scanner
Definition: lex.h:717
virtual std::string input_source(void) const
Definition: lex.h:725
input_buffer m_input_buf
Definition: lex.h:720
virtual bool input_from_file(void) const
Definition: lex.h:729
bool at_end_of_buffer(void) const
Definition: lex.h:632
comment_list * get_comment(void)
Definition: lex.h:668
virtual bool input_from_terminal(void) const
Definition: lex.h:727
virtual void reset(void)
Definition: lex.cc:5380
Definition: lex.h:766
bool m_initial_input
Definition: lex.h:829
input_reader m_reader
Definition: lex.h:822
lexer(const lexer &)=delete
lexer(FILE *file, interpreter &interp)
Definition: lex.h:773
bool input_from_file(void) const
Definition: lex.h:810
lexer(interpreter &interp)
Definition: lex.h:769
bool input_from_eval_string(void) const
Definition: lex.h:815
lexer(FILE *file, interpreter &interp, const std::string &encoding)
Definition: lex.h:777
lexer(const std::string &eval_string, interpreter &interp)
Definition: lex.h:782
std::string input_source(void) const
Definition: lex.h:800
void reset(void)
Definition: lex.h:793
bool input_from_terminal(void) const
Definition: lex.h:805
std::stack< int > m_context
Definition: lex.h:175
bbp_nesting_level(const bbp_nesting_level &nl)
Definition: lex.h:108
std::size_t size(void) const
Definition: lex.h:71
symbol_table_context(interpreter &interp)
Definition: lex.h:62
void push(const symbol_scope &scope)
Definition: lex.h:75
std::deque< symbol_scope > m_frame_stack
Definition: lex.h:87
const token * front(void) const
Definition: lex.h:235
token_cache(const token_cache &)=delete
bool empty(void) const
Definition: lex.h:253
token * front(void)
Definition: lex.h:230
void push(token *tok)
Definition: lex.h:204
token * at(std::size_t n)
Definition: lex.h:219
const token * back(void) const
Definition: lex.h:245
const token * at(std::size_t n) const
Definition: lex.h:224
std::deque< token * > m_buffer
Definition: lex.h:263
token * back(void)
Definition: lex.h:240
std::size_t size(void) const
Definition: lex.h:251
bool m_looking_at_parameter_list
Definition: lex.h:371
bool m_reading_classdef_file
Definition: lex.h:438
bool m_looking_at_anon_fcn_args
Definition: lex.h:365
std::string m_help_text
Definition: lex.h:489
std::string m_package_name
Definition: lex.h:504
filepos m_filepos
Definition: lex.h:470
bool m_arguments_is_keyword
Definition: lex.h:389
std::string m_current_input_line
Definition: lex.h:483
bool m_end_of_input
Definition: lex.h:355
bool m_allow_command_syntax
Definition: lex.h:358
int m_looping
Definition: lex.h:451
bool m_parsing_classdef_set_method
Definition: lex.h:422
int m_bracketflag
Definition: lex.h:445
bool m_parsing_anon_fcn_body
Definition: lex.h:396
std::string m_comment_text
Definition: lex.h:486
lexical_feedback(const lexical_feedback &)=delete
token_cache m_tokens
Definition: lex.h:523
std::stack< bool > m_parsed_function_name
Definition: lex.h:513
bool m_at_beginning_of_statement
Definition: lex.h:362
int m_block_comment_nesting_level
Definition: lex.h:460
int m_command_arg_paren_count
Definition: lex.h:463
std::string m_fcn_file_full_name
Definition: lex.h:498
bool m_looking_at_return_list
Definition: lex.h:368
bool m_parsing_classdef_get_method
Definition: lex.h:419
std::string m_string_text
Definition: lex.h:480
std::list< bool > m_looking_at_object_index
Definition: lex.h:508
int m_braceflag
Definition: lex.h:448
bool m_parsing_classdef_decl
Definition: lex.h:407
bool m_looking_at_matrix_or_assign_lhs
Definition: lex.h:379
bool m_parsing_classdef_superclass
Definition: lex.h:411
lexical_feedback(interpreter &interp)
Definition: lex.h:266
bool m_looking_for_object_index
Definition: lex.h:382
interpreter & m_interpreter
Definition: lex.h:352
bbp_nesting_level m_nesting_level
Definition: lex.h:520
bool m_parsing_classdef
Definition: lex.h:402
bool m_reading_script_file
Definition: lex.h:435
bool m_classdef_element_names_are_keywords
Definition: lex.h:393
bool m_reading_fcn_file
Definition: lex.h:432
std::size_t m_token_count
Definition: lex.h:467
std::string m_function_text
Definition: lex.h:492
filepos m_tok_end
Definition: lex.h:477
std::string m_fcn_file_name
Definition: lex.h:495
bool m_looking_at_decl_list
Definition: lex.h:375
symbol_table_context m_symtab_context
Definition: lex.h:516
bool m_quote_is_transpose
Definition: lex.h:425
filepos m_tok_beg
Definition: lex.h:476
bool m_parsing_class_method
Definition: lex.h:399
bool m_buffer_function_text
Definition: lex.h:442
bool m_force_script
Definition: lex.h:429
std::string m_dir_name
Definition: lex.h:501
bool m_maybe_classdef_get_set_method
Definition: lex.h:416
bool m_looking_at_indirect_ref
Definition: lex.h:386
int m_looking_at_function_handle
Definition: lex.h:457
int m_defining_fcn
Definition: lex.h:454
push_lexer(const std::string &input, bool eof, interpreter &interp)
Definition: lex.h:859
std::string input_source(void) const
Definition: lex.h:875
push_lexer(const push_lexer &)=delete
push_lexer(interpreter &interp)
Definition: lex.h:841
push_lexer(bool eof, interpreter &interp)
Definition: lex.h:853
bool is_push_lexer(void) const
Definition: lex.h:871
push_lexer(const std::string &input, interpreter &interp)
Definition: lex.h:847
Definition: token.h:39
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
bool iskeyword(const std::string &s)
Definition: lex.cc:1359
octave_idx_type n
Definition: mx-inlines.cc:753
#define lexer
Definition: oct-parse.cc:146
static int input(yyscan_t yyscanner)
#define m_scanner
static uint32_t state[624]
Definition: randmtzig.cc:193