GNU Octave  6.2.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-2021 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 
42 namespace 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  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 (size_t n)
220  {
221  return empty () ? nullptr : m_buffer.at (n);
222  }
223 
224  const token * at (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  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_initializer_expression (false),
276  m_looking_at_matrix_or_assign_lhs (false),
277  m_looking_for_object_index (false),
278  m_looking_at_indirect_ref (false),
279  m_parsing_anon_fcn_body (false),
280  m_parsing_class_method (false),
281  m_parsing_classdef (false),
282  m_parsing_classdef_decl (false),
283  m_parsing_classdef_superclass (false),
284  m_maybe_classdef_get_set_method (false),
285  m_parsing_classdef_get_method (false),
286  m_parsing_classdef_set_method (false),
287  m_quote_is_transpose (false),
288  m_force_script (false),
289  m_reading_fcn_file (false),
290  m_reading_script_file (false),
291  m_reading_classdef_file (false),
292  m_buffer_function_text (false),
293  m_bracketflag (0),
294  m_braceflag (0),
295  m_looping (0),
296  m_defining_func (0),
297  m_looking_at_function_handle (0),
298  m_block_comment_nesting_level (0),
299  m_command_arg_paren_count (0),
300  m_token_count (0),
301  m_filepos (),
302  m_tok_beg (),
303  m_tok_end (),
304  m_string_text (),
305  m_current_input_line (),
306  m_comment_text (),
307  m_help_text (),
308  m_function_text (),
309  m_fcn_file_name (),
310  m_fcn_file_full_name (),
311  m_dir_name (),
312  m_package_name (),
313  m_looking_at_object_index (),
314  m_parsed_function_name (),
315  m_pending_local_variables (),
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 maybe_mark_previous_token_as_variable (void);
350 
351  void mark_as_variable (const std::string& nm);
352  void mark_as_variables (const std::list<std::string>& lst);
353 
355 
356  // true means that we have encountered eof on the input stream.
358 
359  // true means command syntax is allowed.
361 
362  // true means we are at the beginning of a statement, where a
363  // command name is possible.
365 
366  // true means we are parsing an anonymous function argument list.
368 
369  // true means we're parsing the return list for a function.
371 
372  // true means we're parsing the parameter list for a function.
374 
375  // true means we're parsing a declaration list (global or
376  // persistent).
378 
379  // true means we are looking at the initializer expression for a
380  // parameter list element.
382 
383  // true means we're parsing a matrix or the left hand side of
384  // multi-value assignment statement.
386 
387  // object index not possible until we've seen something.
389 
390  // true means we're looking at an indirect reference to a
391  // structure element.
393 
394  // true means we are parsing the body of an anonymous function.
396 
397  // true means we are parsing a class method in function or classdef file.
399 
400  // true means we are parsing a classdef file
402 
403  // true means we are parsing the initial classdef declaration
404  // portion of classdef file, from the "classdef" token through the
405  // optional list of superclasses.
407 
408  // true means we are parsing the superclass part of a classdef
409  // declaration.
411 
412  // true means we are parsing a class method declaration line in a
413  // classdef file and can accept a property get or set method name.
414  // for example, "get.propertyname" is recognized as a function name.
416 
417  // TRUE means we are parsing a classdef get.method.
419 
420  // TRUE means we are parsing a classdef set.method.
422 
423  // return transpose or start a string?
425 
426  // TRUE means treat the current file as a script even if the first
427  // token is "function" or "classdef".
429 
430  // TRUE means we're parsing a function file.
432 
433  // TRUE means we're parsing a script file.
435 
436  // TRUE means we're parsing a classdef file.
438 
439  // TRUE means we should store the text of the function we are
440  // parsing.
442 
443  // square bracket level count.
445 
446  // curly brace level count.
448 
449  // true means we're in the middle of defining a loop.
451 
452  // nonzero means we're in the middle of defining a function.
454 
455  // nonzero means we are parsing a function handle.
457 
458  // nestng level for block comments.
460 
461  // Parenthesis count for command argument parsing.
463 
464  // Count of tokens recognized by this lexer since initialized or
465  // since the last reset.
467 
468  // The current position in the file (line and column).
470 
471  // The positions of the beginning and end of the current token after
472  // calling update_token_positions. Also used apart from
473  // update_token_positions to handle the beginning and end of
474  // character strings.
477 
478  // The current character string text.
479  std::string m_string_text;
480 
481  // The current line of input.
482  std::string m_current_input_line;
483 
484  // The current comment text.
485  std::string m_comment_text;
486 
487  // The current help text.
488  std::string m_help_text;
489 
490  // The text of functions entered on the command line.
491  std::string m_function_text;
492 
493  // Simple name of function file we are reading.
494  std::string m_fcn_file_name;
495 
496  // Full name of file we are reading.
497  std::string m_fcn_file_full_name;
498 
499  // Directory name where this file was found. May be relative.
500  std::string m_dir_name;
501 
502  // Name of +package containing this file, if any.
503  std::string m_package_name;
504 
505  // if the front of the list is true, the closest paren, brace, or
506  // bracket nesting is an index for an object.
507  std::list<bool> m_looking_at_object_index;
508 
509  // if the top of the stack is true, then we've already seen the name
510  // of the current function. should only matter if
511  // current_function_level > 0
512  std::stack<bool> m_parsed_function_name;
513 
514  // set of identifiers that might be local variable names.
515  std::set<std::string> m_pending_local_variables;
516 
517  // Track current symbol table scope and context.
519 
520  // is the closest nesting level a square bracket, squiggly brace,
521  // a paren, or an anonymous function body?
523 
524  // Tokens generated by the lexer.
526  };
527 
528  // base_lexer inherits from lexical_feedback because we will
529  // eventually have several different constructors and it is easier to
530  // initialize if everything is grouped in a parent class rather than
531  // listing all the members in the base_lexer class.
532 
533  class
535  {
536  public:
537 
538  // Handle buffering of input for lexer.
539 
541  {
542  public:
543 
545  : m_buffer (), m_offset (0), m_chars_left (0), m_eof (false)
546  { }
547 
548  void fill (const std::string& input, bool eof_arg);
549 
550  // Copy at most max_size characters to buf.
551  int copy_chunk (char *buf, size_t max_size, bool by_lines = false);
552 
553  bool empty (void) const { return m_chars_left == 0; }
554 
555  bool at_eof (void) const { return m_eof; }
556 
557  private:
558 
559  std::string m_buffer;
560  size_t m_offset;
561  size_t m_chars_left;
562  bool m_eof;
563  };
564 
565  // Collect comment text.
566 
567  class
569  {
570  public:
571 
572  comment_buffer (void) : m_comment_list (nullptr) { }
573 
574  ~comment_buffer (void) { delete m_comment_list; }
575 
576  void append (const std::string& s, comment_elt::comment_type t)
577  {
578  if (! m_comment_list)
579  m_comment_list = new comment_list ();
580 
581  m_comment_list->append (s, t);
582  }
583 
584  // Caller is expected to delete the returned value.
585 
587  {
588  comment_list *retval = m_comment_list;
589 
590  m_comment_list = nullptr;
591 
592  return retval;
593  }
594 
595  void reset (void)
596  {
597  delete m_comment_list;
598 
599  m_comment_list = nullptr;
600  }
601 
602  private:
603 
605  };
606 
608  : lexical_feedback (interp), m_scanner (nullptr), m_input_buf (),
609  m_comment_buf ()
610  {
611  init ();
612  }
613 
614  // No copying!
615 
616  base_lexer (const base_lexer&) = delete;
617 
618  base_lexer& operator = (const base_lexer&) = delete;
619 
620  virtual ~base_lexer (void);
621 
622  void init (void);
623 
624  virtual bool is_push_lexer (void) const { return false; }
625 
626  virtual void reset (void);
627 
628  void prep_for_file (void);
629 
630  void begin_string (int state);
631 
632  virtual int fill_flex_buffer (char *buf, unsigned int max_size) = 0;
633 
634  bool at_end_of_buffer (void) const { return m_input_buf.empty (); }
635 
636  bool at_end_of_file (void) const { return m_input_buf.at_eof (); }
637 
638  int handle_end_of_input (void);
639 
640  char * flex_yytext (void);
641 
642  int flex_yyleng (void);
643 
644  int text_yyinput (void);
645 
646  void xunput (char c, char *buf);
647 
648  void xunput (char c);
649 
650  void update_token_positions (int tok_len);
651 
652  bool looking_at_space (void);
653 
654  bool inside_any_object_index (void);
655 
656  bool is_variable (const std::string& name, const symbol_scope& scope);
657 
658  int make_keyword_token (const std::string& s);
659 
660  bool fq_identifier_contains_keyword (const std::string& s);
661 
662  bool whitespace_is_significant (void);
663 
664  void handle_number (void);
665 
666  void handle_continuation (void);
667 
668  void finish_comment (comment_elt::comment_type typ);
669 
670  comment_list * get_comment (void) { return m_comment_buf.get_comment (); }
671 
672  int handle_close_bracket (int bracket_type);
673 
674  bool looks_like_command_arg (void);
675 
676  int handle_superclass_identifier (void);
677 
678  int handle_meta_identifier (void);
679 
680  int handle_fq_identifier (void);
681 
682  int handle_identifier (void);
683 
684  void maybe_warn_separator_insert (char sep);
685 
686  void warn_single_quote_string (void);
687 
688  void warn_language_extension (const std::string& msg);
689 
690  void maybe_warn_language_extension_comment (char c);
691 
692  void warn_language_extension_continuation (void);
693 
694  void warn_language_extension_operator (const std::string& op);
695 
696  void push_token (token *);
697 
698  token * current_token (void);
699 
700  size_t pending_token_count (void) const;
701 
702  void display_token (int tok);
703 
704  void fatal_error (const char *msg);
705 
706  bool debug_flag (void) const;
707 
708  bool display_tokens (void) const;
709 
710  void increment_token_count (void);
711 
712  void lexer_debug (const char *pattern);
713 
714  // Internal state of the flex-generated lexer.
715  void *m_scanner;
716 
717  // Object that reads and buffers input.
719 
720  // Object that collects comment text.
722 
723  virtual std::string input_source (void) const { return "unknown"; }
724 
725  virtual bool input_from_terminal (void) const { return false; }
726 
727  virtual bool input_from_file (void) const { return false; }
728 
729  virtual bool input_from_eval_string (void) const { return false; }
730 
731  bool input_from_tmp_history_file (void);
732 
733  void push_start_state (int state);
734 
735  void pop_start_state (void);
736 
737  void clear_start_state (void);
738 
739  int start_state (void) const { return start_state_stack.top (); }
740 
741  void display_start_state (void) const;
742 
743  bool maybe_unput_comma_before_unary_op (int tok);
744 
745  int handle_op (int tok, bool bos = false, bool compat = true);
746 
747  int finish_command_arg (void);
748 
749  int handle_token (int tok, token *tok_val = nullptr);
750 
751  int count_token (int tok);
752 
753  int count_token_internal (int tok);
754 
755  int show_token (int tok);
756 
757  protected:
758 
759  std::stack<int> start_state_stack;
760  };
761 
762  class
763  lexer : public base_lexer
764  {
765  public:
766 
767  lexer (interpreter& interp)
768  : base_lexer (interp), m_reader (interp), m_initial_input (true)
769  { }
770 
771  lexer (FILE *file, interpreter& interp)
772  : base_lexer (interp), m_reader (interp, file), m_initial_input (true)
773  { }
774 
775  lexer (const std::string& eval_string, interpreter& interp)
776  : base_lexer (interp), m_reader (interp, eval_string),
777  m_initial_input (true)
778  { }
779 
780  // No copying!
781 
782  lexer (const lexer&) = delete;
783 
784  lexer& operator = (const lexer&) = delete;
785 
786  void reset (void)
787  {
788  m_initial_input = true;
789 
791  }
792 
793  std::string input_source (void) const
794  {
795  return m_reader.input_source ();
796  }
797 
798  bool input_from_terminal (void) const
799  {
800  return m_reader.input_from_terminal ();
801  }
802 
803  bool input_from_file (void) const
804  {
805  return m_reader.input_from_file ();
806  }
807 
808  bool input_from_eval_string (void) const
809  {
810  return m_reader.input_from_eval_string ();
811  }
812 
813  int fill_flex_buffer (char *buf, unsigned int max_size);
814 
816 
817  // TRUE means we are filling the input buffer for the first time.
818  // Otherwise, we are requesting more input to complete the parse
819  // and, if printing a prompt, should use the secondary prompt
820  // string.
821 
823  };
824 
825  class
826  push_lexer : public base_lexer
827  {
828  public:
829 
831  : base_lexer (interp)
832  {
833  append_input ("", false);
834  }
835 
836  push_lexer (const std::string& input, interpreter& interp)
837  : base_lexer (interp)
838  {
839  append_input (input, false);
840  }
841 
842  push_lexer (bool eof, interpreter& interp)
843  : base_lexer (interp)
844  {
845  append_input ("", eof);
846  }
847 
848  push_lexer (const std::string& input, bool eof, interpreter& interp)
849  : base_lexer (interp)
850  {
851  append_input (input, eof);
852  }
853 
854  // No copying!
855 
856  push_lexer (const push_lexer&) = delete;
857 
858  push_lexer& operator = (const push_lexer&) = delete;
859 
860  bool is_push_lexer (void) const { return true; }
861 
862  void append_input (const std::string& input, bool eof);
863 
864  std::string input_source (void) const { return "push buffer"; }
865 
866  int fill_flex_buffer (char *buf, unsigned int max_size);
867  };
868 }
869 
870 #endif
void append(const std::string &s, comment_elt::comment_type t)
Definition: lex.h:576
comment_list * get_comment(void)
Definition: lex.h:586
comment_list * m_comment_list
Definition: lex.h:604
bool at_eof(void) const
Definition: lex.h:555
bool empty(void) const
Definition: lex.h:553
virtual bool input_from_eval_string(void) const
Definition: lex.h:729
virtual int fill_flex_buffer(char *buf, unsigned int max_size)=0
int start_state(void) const
Definition: lex.h:739
comment_buffer m_comment_buf
Definition: lex.h:721
std::stack< int > start_state_stack
Definition: lex.h:759
virtual bool input_from_terminal(void) const
Definition: lex.h:725
bool at_end_of_buffer(void) const
Definition: lex.h:634
base_lexer(const base_lexer &)=delete
bool at_end_of_file(void) const
Definition: lex.h:636
input_buffer m_input_buf
Definition: lex.h:718
virtual std::string input_source(void) const
Definition: lex.h:723
virtual bool is_push_lexer(void) const
Definition: lex.h:624
virtual void reset(void)
Definition: lex.cc:5334
virtual bool input_from_file(void) const
Definition: lex.h:727
base_lexer(interpreter &interp)
Definition: lex.h:607
void * m_scanner
Definition: lex.h:715
comment_list * get_comment(void)
Definition: lex.h:670
bool input_from_terminal(void) const
Definition: lex.h:798
bool input_from_eval_string(void) const
Definition: lex.h:808
lexer(FILE *file, interpreter &interp)
Definition: lex.h:771
bool m_initial_input
Definition: lex.h:822
std::string input_source(void) const
Definition: lex.h:793
void reset(void)
Definition: lex.h:786
input_reader m_reader
Definition: lex.h:815
bool input_from_file(void) const
Definition: lex.h:803
lexer(const std::string &eval_string, interpreter &interp)
Definition: lex.h:775
lexer(interpreter &interp)
Definition: lex.h:767
lexer(const lexer &)=delete
bbp_nesting_level(const bbp_nesting_level &nl)
Definition: lex.h:108
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_cache(const token_cache &)=delete
size_t size(void) const
Definition: lex.h:251
const token * at(size_t n) const
Definition: lex.h:224
const token * front(void) const
Definition: lex.h:235
const token * back(void) const
Definition: lex.h:245
std::deque< token * > m_buffer
Definition: lex.h:263
std::string m_comment_text
Definition: lex.h:485
void mark_as_variable(const std::string &nm)
bool m_looking_at_matrix_or_assign_lhs
Definition: lex.h:385
std::stack< bool > m_parsed_function_name
Definition: lex.h:512
int m_command_arg_paren_count
Definition: lex.h:462
std::string m_current_input_line
Definition: lex.h:482
bbp_nesting_level m_nesting_level
Definition: lex.h:522
lexical_feedback(const lexical_feedback &)=delete
bool m_looking_at_return_list
Definition: lex.h:370
int m_block_comment_nesting_level
Definition: lex.h:459
bool m_looking_at_decl_list
Definition: lex.h:377
bool m_looking_at_anon_fcn_args
Definition: lex.h:367
bool m_reading_classdef_file
Definition: lex.h:437
bool m_parsing_classdef_superclass
Definition: lex.h:410
bool m_parsing_classdef_decl
Definition: lex.h:406
interpreter & m_interpreter
Definition: lex.h:354
bool m_allow_command_syntax
Definition: lex.h:360
bool m_looking_at_parameter_list
Definition: lex.h:373
bool m_parsing_anon_fcn_body
Definition: lex.h:395
token_cache m_tokens
Definition: lex.h:525
bool m_parsing_classdef_get_method
Definition: lex.h:418
bool m_parsing_classdef_set_method
Definition: lex.h:421
bool m_reading_script_file
Definition: lex.h:434
symbol_table_context m_symtab_context
Definition: lex.h:518
std::string m_string_text
Definition: lex.h:479
bool m_buffer_function_text
Definition: lex.h:441
std::string m_help_text
Definition: lex.h:488
bool m_looking_at_initializer_expression
Definition: lex.h:381
std::string m_fcn_file_full_name
Definition: lex.h:497
bool m_maybe_classdef_get_set_method
Definition: lex.h:415
std::list< bool > m_looking_at_object_index
Definition: lex.h:507
std::string m_package_name
Definition: lex.h:503
bool m_quote_is_transpose
Definition: lex.h:424
int m_looking_at_function_handle
Definition: lex.h:456
bool m_parsing_class_method
Definition: lex.h:398
std::set< std::string > m_pending_local_variables
Definition: lex.h:515
bool m_looking_for_object_index
Definition: lex.h:388
bool m_looking_at_indirect_ref
Definition: lex.h:392
lexical_feedback(interpreter &interp)
Definition: lex.h:266
std::string m_dir_name
Definition: lex.h:500
bool m_at_beginning_of_statement
Definition: lex.h:364
std::string m_function_text
Definition: lex.h:491
std::string m_fcn_file_name
Definition: lex.h:494
size_t m_token_count
Definition: lex.h:466
push_lexer(const std::string &input, interpreter &interp)
Definition: lex.h:836
push_lexer(const std::string &input, bool eof, interpreter &interp)
Definition: lex.h:848
bool is_push_lexer(void) const
Definition: lex.h:860
push_lexer(interpreter &interp)
Definition: lex.h:830
std::string input_source(void) const
Definition: lex.h:864
push_lexer(bool eof, interpreter &interp)
Definition: lex.h:842
push_lexer(const push_lexer &)=delete
QString name
octave_idx_type n
Definition: mx-inlines.cc:753
static uint32_t state[624]
Definition: randmtzig.cc:190
octave_value_list eval_string(const std::string &eval_str, bool silent, int &parse_status, int nargout)
Definition: oct-parse.cc:9714
bool iskeyword(const std::string &s)
Definition: lex.cc:1283
#define lexer
Definition: oct-parse.cc:146
static int input(yyscan_t yyscanner)
octave_value::octave_value(const Array< char > &chm, char type) return retval
Definition: ov.cc:811