GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
lex.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1993-2017 John W. Eaton
4 
5 This file is part of Octave.
6 
7 Octave is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if ! defined (octave_lex_h)
24 #define octave_lex_h 1
25 
26 #include "octave-config.h"
27 
28 #include <deque>
29 #include <limits>
30 #include <list>
31 #include <set>
32 #include <stack>
33 
34 #include "comment-list.h"
35 #include "input.h"
36 #include "token.h"
37 
38 namespace octave
39 {
40  class interpreter;
41 
42  // Is the given string a keyword?
43  extern bool is_keyword (const std::string& s);
44 
45  // For communication between the lexer and parser.
46 
47  class
49  {
50  public:
51 
52  // Track symbol table information when parsing functions.
53 
55  {
56  public:
57 
58  symbol_table_context (void) : frame_stack () { }
59 
60  void clear (void)
61  {
62  while (! frame_stack.empty ())
63  frame_stack.pop ();
64  }
65 
66  bool empty (void) const { return frame_stack.empty (); }
67 
68  void pop (void)
69  {
70  if (empty ())
72 
73  frame_stack.pop ();
74  }
75 
77  {
78  frame_stack.push (scope);
79  }
80 
82  {
83  return empty () ? symbol_table::current_scope () : frame_stack.top ();
84  }
85 
86  private:
87 
88  std::stack<symbol_table::scope_id> frame_stack;
89  };
90 
91  // Track nesting of square brackets, curly braces, and parentheses.
92 
94  {
95  private:
96 
98  {
99  BRACKET = 1,
100  BRACE = 2,
101  PAREN = 3,
102  ANON_FCN_BODY = 4
103  };
104 
105  public:
106 
107  bbp_nesting_level (void) : context () { }
108 
110 
111  bbp_nesting_level& operator = (const bbp_nesting_level& nl)
112  {
113  if (&nl != this)
114  context = nl.context;
115 
116  return *this;
117  }
118 
120 
121  void reset (void)
122  {
123  while (! context.empty ())
124  context.pop ();
125  }
126 
127  void bracket (void) { context.push (BRACKET); }
128 
129  bool is_bracket (void)
130  {
131  return ! context.empty () && context.top () == BRACKET;
132  }
133 
134  void brace (void) { context.push (BRACE); }
135 
136  bool is_brace (void)
137  {
138  return ! context.empty () && context.top () == BRACE;
139  }
140 
141  void paren (void) { context.push (PAREN); }
142 
143  bool is_paren (void)
144  {
145  return ! context.empty () && context.top () == PAREN;
146  }
147 
148  void anon_fcn_body (void) { context.push (ANON_FCN_BODY); }
149 
150  bool is_anon_fcn_body (void)
151  {
152  return ! context.empty () && context.top () == ANON_FCN_BODY;
153  }
154 
156  {
157  return (! context.empty ()
158  && (context.top () == BRACKET || context.top () == BRACE));
159  }
160 
161  bool none (void) { return context.empty (); }
162 
163  void remove (void)
164  {
165  if (! context.empty ())
166  context.pop ();
167  }
168 
169  void clear (void)
170  {
171  while (! context.empty ())
172  context.pop ();
173  }
174 
175  private:
176 
177  std::stack<int> context;
178  };
179 
181  {
182  public:
183 
184  // Store an "unlimited" number of tokens.
186  : buffer (), sz (sz_arg)
187  { }
188 
189  void push (token *tok)
190  {
191  if (buffer.size () == sz)
192  pop ();
193 
194  buffer.push_front (tok);
195  }
196 
197  void pop (void)
198  {
199  if (! empty ())
200  {
201  delete buffer.back ();
202  buffer.pop_back ();
203  }
204  }
205 
206  // Direct access.
207  token *at (size_t n)
208  {
209  return empty () ? 0 : buffer.at (n);
210  }
211 
212  const token *at (size_t n) const
213  {
214  return empty () ? 0 : buffer.at (n);
215  }
216 
217  // Most recently pushed.
218  token *front (void)
219  {
220  return empty () ? 0 : buffer.front ();
221  }
222 
223  const token *front (void) const
224  {
225  return empty () ? 0 : buffer.front ();
226  }
227 
228  token *back (void)
229  {
230  return empty () ? 0 : buffer.back ();
231  }
232 
233  const token *back (void) const
234  {
235  return empty () ? 0 : buffer.back ();
236  }
237 
238  // Number of elements currently in the buffer, max of sz.
239  size_t size (void) const { return buffer.size (); }
240 
241  bool empty (void) const { return buffer.empty (); }
242 
243  void clear (void)
244  {
245  while (! empty ())
246  pop ();
247  }
248 
249  private:
250 
251  std::deque<token *> buffer;
252 
253  size_t sz;
254 
255  // No copying!
256 
257  token_cache (const token_cache&);
258 
259  token_cache& operator = (const token_cache&);
260  };
261 
263  : end_of_input (false), at_beginning_of_statement (true),
264  looking_at_anon_fcn_args (false), looking_at_return_list (false),
265  looking_at_parameter_list (false), looking_at_decl_list (false),
266  looking_at_initializer_expression (false),
267  looking_at_matrix_or_assign_lhs (false),
268  looking_for_object_index (false),
269  looking_at_indirect_ref (false), parsing_class_method (false),
270  parsing_classdef (false), maybe_classdef_get_set_method (false),
271  parsing_classdef_get_method (false),
272  parsing_classdef_set_method (false),
273  quote_is_transpose (false), force_script (false),
274  reading_fcn_file (false), reading_script_file (false),
275  reading_classdef_file (false),
276  input_line_number (1), current_input_column (1),
277  bracketflag (0), braceflag (0),
278  looping (0), defining_func (0), looking_at_function_handle (0),
279  block_comment_nesting_level (0), command_arg_paren_count (0),
280  token_count (0), current_input_line (), comment_text (),
281  help_text (), string_text (), string_line (0), string_column (0),
282  fcn_file_name (), fcn_file_full_name (), looking_at_object_index (),
283  parsed_function_name (), pending_local_variables (),
284  symtab_context (), nesting_level (), tokens ()
285  {
286  init ();
287  }
288 
289  ~lexical_feedback (void);
290 
291  void init (void);
292 
293  void reset (void);
294 
295  int previous_token_value (void) const;
296 
297  bool previous_token_value_is (int tok_val) const;
298 
299  void mark_previous_token_trailing_space (void);
300 
301  bool space_follows_previous_token (void) const;
302 
303  bool previous_token_is_binop (void) const;
304 
305  bool previous_token_is_keyword (void) const;
306 
307  bool previous_token_may_be_command (void) const;
308 
309  void maybe_mark_previous_token_as_variable (void);
310 
311  void mark_as_variable (const std::string& nm);
312  void mark_as_variables (const std::list<std::string>& lst);
313 
314  // true means that we have encountered eof on the input stream.
316 
317  // true means we are at the beginning of a statement, where a
318  // command name is possible.
320 
321  // true means we are parsing an anonymous function argument list.
323 
324  // true means we're parsing the return list for a function.
326 
327  // true means we're parsing the parameter list for a function.
329 
330  // true means we're parsing a declaration list (global or
331  // persistent).
333 
334  // true means we are looking at the initializer expression for a
335  // parameter list element.
337 
338  // true means we're parsing a matrix or the left hand side of
339  // multi-value assignment statement.
341 
342  // object index not possible until we've seen something.
344 
345  // true means we're looking at an indirect reference to a
346  // structure element.
348 
349  // true means we are parsing a class method in function or classdef file.
351 
352  // true means we are parsing a classdef file
354 
355  // true means we are parsing a class method declaration line in a
356  // classdef file and can accept a property get or set method name.
357  // for example, "get.propertyname" is recognized as a function name.
359 
360  // TRUE means we are parsing a classdef get.method.
362 
363  // TRUE means we are parsing a classdef set.method.
365 
366  // return transpose or start a string?
368 
369  // TRUE means treat the current file as a script even if the first
370  // token is "function" or "classdef".
372 
373  // TRUE means we're parsing a function file.
375 
376  // TRUE means we're parsing a script file.
378 
379  // TRUE means we're parsing a classdef file.
381 
382  // the current input line number.
384 
385  // the column of the current token.
387 
388  // square bracket level count.
390 
391  // curly brace level count.
393 
394  // true means we're in the middle of defining a loop.
395  int looping;
396 
397  // nonzero means we're in the middle of defining a function.
399 
400  // nonzero means we are parsing a function handle.
402 
403  // nestng level for blcok comments.
405 
406  // Parenthesis count for command argument parsing.
408 
409  // Count of tokens recognized by this lexer since initialized or
410  // since the last reset.
411  size_t token_count;
412 
413  // The current line of input.
415 
416  // The current comment text.
418 
419  // The current help text.
421 
422  // The current character string text.
424 
425  // The position of the beginning of the current character string.
428 
429  // Simple name of function file we are reading.
431 
432  // Full name of file we are reading.
434 
435  // if the front of the list is true, the closest paren, brace, or
436  // bracket nesting is an index for an object.
437  std::list<bool> looking_at_object_index;
438 
439  // if the top of the stack is true, then we've already seen the name
440  // of the current function. should only matter if
441  // current_function_level > 0
442  std::stack<bool> parsed_function_name;
443 
444  // set of identifiers that might be local variable names.
445  std::set<std::string> pending_local_variables;
446 
447  // Track current symbol table scope and context.
449 
450  // is the closest nesting level a square bracket, squiggly brace,
451  // a paren, or an anonymous function body?
453 
454  // Tokens generated by the lexer.
456 
457  private:
458 
459  // No copying!
460 
462 
463  lexical_feedback& operator = (const lexical_feedback&);
464  };
465 
466  // base_lexer inherits from lexical_feedback because we will
467  // eventually have several different constructors and it is easier to
468  // intialize if everything is grouped in a parent class rather than
469  // listing all the members in the base_lexer class.
470 
471  class
473  {
474  public:
475 
476  // Handle buffering of input for lexer.
477 
479  {
480  public:
481 
483  : buffer (), pos (0), chars_left (0), eof (false)
484  { }
485 
486  void fill (const std::string& input, bool eof_arg);
487 
488  // Copy at most max_size characters to buf.
489  int copy_chunk (char *buf, size_t max_size);
490 
491  bool empty (void) const { return chars_left == 0; }
492 
493  bool at_eof (void) const { return eof; }
494 
495  private:
496 
498  const char *pos;
499  size_t chars_left;
500  bool eof;
501  };
502 
503  // Collect comment text.
504 
505  class
507  {
508  public:
509 
510  comment_buffer (void) : comment_list (0) { }
511 
512  ~comment_buffer (void) { delete comment_list; }
513 
515  {
516  if (! comment_list)
517  comment_list = new octave_comment_list ();
518 
519  comment_list->append (s, t);
520  }
521 
522  // Caller is expected to delete the returned value.
523 
525  {
526  octave_comment_list *retval = comment_list;
527 
528  comment_list = 0;
529 
530  return retval;
531  }
532 
533  void reset (void)
534  {
535  delete comment_list;
536 
537  comment_list = 0;
538  }
539 
540  private:
541 
543  };
544 
545  base_lexer (interpreter *interp_context = 0)
546  : lexical_feedback (), scanner (0), input_buf (), comment_buf (),
547  m_interp_context (interp_context)
548  {
549  init ();
550  }
551 
552  virtual ~base_lexer (void);
553 
554  void init (void);
555 
556  virtual bool is_push_lexer (void) const { return false; }
557 
558  virtual void reset (void);
559 
560  void prep_for_file (void);
561 
562  void begin_string (int state);
563 
564  virtual int fill_flex_buffer (char *buf, unsigned int max_size) = 0;
565 
566  bool at_end_of_buffer (void) const { return input_buf.empty (); }
567 
568  bool at_end_of_file (void) const { return input_buf.at_eof (); }
569 
570  int handle_end_of_input (void);
571 
572  char *flex_yytext (void);
573 
574  int flex_yyleng (void);
575 
576  int text_yyinput (void);
577 
578  void xunput (char c, char *buf);
579 
580  void xunput (char c);
581 
582  bool looking_at_space (void);
583 
584  bool inside_any_object_index (void);
585 
586  bool is_variable (const std::string& name, symbol_table::scope_id scope);
587 
588  int is_keyword_token (const std::string& s);
589 
590  bool fq_identifier_contains_keyword (const std::string& s);
591 
592  bool whitespace_is_significant (void);
593 
594  void handle_number (void);
595 
596  void handle_continuation (void);
597 
598  void finish_comment (octave_comment_elt::comment_type typ);
599 
600  octave_comment_list *get_comment (void) { return comment_buf.get_comment (); }
601 
602  int handle_close_bracket (int bracket_type);
603 
604  bool looks_like_command_arg (void);
605 
606  int handle_superclass_identifier (void);
607 
608  int handle_meta_identifier (void);
609 
610  int handle_fq_identifier (void);
611 
612  int handle_identifier (void);
613 
614  void maybe_warn_separator_insert (char sep);
615 
616  void warn_single_quote_string (void);
617 
618  void warn_language_extension (const std::string& msg);
619 
620  void maybe_warn_language_extension_comment (char c);
621 
622  void warn_language_extension_continuation (void);
623 
624  void warn_language_extension_operator (const std::string& op);
625 
626  void push_token (token *);
627 
628  token *current_token (void);
629 
630  void display_token (int tok);
631 
632  void fatal_error (const char *msg);
633 
634  void lexer_debug (const char *pattern);
635 
636  // Internal state of the flex-generated lexer.
637  void *scanner;
638 
639  // Object that reads and buffers input.
641 
642  // Object that collects comment text.
644 
645  // Interpreter that contains us, if any.
647 
648  virtual void increment_promptflag (void) = 0;
649 
650  virtual void decrement_promptflag (void) = 0;
651 
652  virtual int promptflag (void) const = 0;
653 
654  virtual int promptflag (int) = 0;
655 
656  virtual std::string input_source (void) const { return "unknown"; }
657 
658  virtual bool input_from_terminal (void) const { return false; }
659 
660  virtual bool input_from_file (void) const { return false; }
661 
662  virtual bool input_from_eval_string (void) const { return false; }
663 
664  void push_start_state (int state);
665 
666  void pop_start_state (void);
667 
668  void clear_start_state (void);
669 
670  int start_state (void) const { return start_state_stack.top (); }
671 
672  void display_start_state (void) const;
673 
674  int handle_op (const char *pattern, int tok, bool bos = false);
675 
676  int handle_language_extension_op (const char *pattern, int tok,
677  bool bos = false);
678 
679  bool maybe_unput_comma_before_unary_op (int tok);
680 
681  int handle_unary_op (int tok, bool bos = false);
682 
683  int handle_language_extension_unary_op (int tok, bool bos = false);
684 
685  int handle_assign_op (const char *pattern, int tok);
686 
687  int handle_language_extension_assign_op (const char *pattern, int tok);
688 
689  int handle_op_internal (int tok, bool bos, bool compat);
690 
691  int handle_token (const std::string& name, int tok);
692 
693  int handle_token (int tok, token *tok_val = 0);
694 
695  int count_token (int tok);
696 
697  int count_token_internal (int tok);
698 
699  int show_token (int tok);
700 
701  void enable_fq_identifier (void);
702 
703  protected:
704 
705  std::stack<int> start_state_stack;
706 
707  // No copying!
708 
709  base_lexer (const base_lexer&);
710 
711  base_lexer& operator = (const base_lexer&);
712  };
713 
714  class
715  lexer : public base_lexer
716  {
717  public:
718 
719  lexer (interpreter *interp_context = 0)
720  : base_lexer (interp_context), input_reader (this)
721  { }
722 
723  lexer (FILE *file, interpreter *interp_context = 0)
724  : base_lexer (interp_context), input_reader (file, this)
725  { }
726 
728  interpreter *interp_context = 0)
729  : base_lexer (interp_context), input_reader (eval_string, this)
730  { }
731 
732  void reset (void)
733  {
734  input_reader.reset ();
735 
737  }
738 
739  void increment_promptflag (void) { input_reader.increment_promptflag (); }
740 
741  void decrement_promptflag (void) { input_reader.decrement_promptflag (); }
742 
743  int promptflag (void) const { return input_reader.promptflag (); }
744 
745  int promptflag (int n) { return input_reader.promptflag (n); }
746 
748  {
749  return input_reader.input_source ();
750  }
751 
752  bool input_from_terminal (void) const
753  {
754  return input_reader.input_from_terminal ();
755  }
756 
757  bool input_from_file (void) const
758  {
759  return input_reader.input_from_file ();
760  }
761 
762  bool input_from_eval_string (void) const
763  {
764  return input_reader.input_from_eval_string ();
765  }
766 
767  int fill_flex_buffer (char *buf, unsigned int max_size);
768 
770 
771  protected:
772 
773  // No copying!
774 
775  lexer (const lexer&);
776 
777  lexer& operator = (const lexer&);
778  };
779 
780  class
781  push_lexer : public base_lexer
782  {
783  public:
784 
785  push_lexer (interpreter *interp_context = 0)
786  : base_lexer (interp_context), pflag (1)
787  {
788  append_input ("", false);
789  }
790 
792  interpreter *interp_context = 0)
793  : base_lexer (interp_context), pflag (1)
794  {
795  append_input (input, false);
796  }
797 
798  push_lexer (bool eof, interpreter *interp_context = 0)
799  : base_lexer (interp_context), pflag (1)
800  {
801  append_input ("", eof);
802  }
803 
804  push_lexer (const std::string& input, bool eof,
805  interpreter *interp_context = 0)
806  : base_lexer (interp_context), pflag (1)
807  {
808  append_input (input, eof);
809  }
810 
811  bool is_push_lexer (void) const { return true; }
812 
813  void reset (void)
814  {
815  promptflag (1);
816 
818  }
819 
820  void append_input (const std::string& input, bool eof)
821  {
822  input_buf.fill (input, eof);
823  }
824 
825  void increment_promptflag (void) { pflag++; }
826 
827  void decrement_promptflag (void) { pflag--; }
828 
829  int promptflag (void) const { return pflag; }
830 
831  int promptflag (int n)
832  {
833  int retval = pflag;
834  pflag = n;
835  return retval;
836  }
837 
838  std::string input_source (void) const { return "push buffer"; }
839 
840  int fill_flex_buffer (char *buf, unsigned int max_size);
841 
842  protected:
843 
844  int pflag;
845 
846  // No copying!
847 
848  push_lexer (const push_lexer&);
849 
850  push_lexer& operator = (const push_lexer&);
851  };
852 }
853 
854 #endif
bool parsing_classdef_get_method
Definition: lex.h:361
push_lexer(interpreter *interp_context=0)
Definition: lex.h:785
Octave interface to the compression and uncompression libraries.
Definition: aepbalance.cc:47
virtual void reset(void)
Definition: lex.cc:4862
For example cd octave end example noindent changes the current working directory to file
Definition: dirfns.cc:120
interpreter * m_interp_context
Definition: lex.h:646
void decrement_promptflag(void)
Definition: lex.h:827
const token * back(void) const
Definition: lex.h:233
bool maybe_classdef_get_set_method
Definition: lex.h:358
bool at_eof(void) const
Definition: lex.h:493
virtual std::string input_source(void) const
Definition: lex.h:656
int looking_at_function_handle
Definition: lex.h:401
bool looking_at_decl_list
Definition: lex.h:332
bool looking_at_anon_fcn_args
Definition: lex.h:322
input_buffer input_buf
Definition: lex.h:640
bool input_from_terminal(void) const
Definition: lex.h:752
std::string fcn_file_full_name
Definition: lex.h:433
bool input_from_file(void) const
Definition: lex.h:757
symbol_table::scope_id curr_scope(void) const
Definition: lex.h:81
token_cache(size_t sz_arg=std::numeric_limits< size_t >::max())
Definition: lex.h:185
comment_buffer comment_buf
Definition: lex.h:643
bool input_from_eval_string(void) const
Definition: lex.h:762
void * scanner
Definition: lex.h:637
size_t size(void) const
Definition: lex.h:239
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function t
Definition: ov-usr-fcn.cc:935
static bool is_variable(const std::string &name)
Definition: variables.cc:221
std::string input_source(void) const
Definition: lex.h:838
OCTAVE_EXPORT octave_value_list return the value of the option it must match the dimension of the state and the relative tolerance must also be a vector of the same length tem it must match the dimension of the state and the absolute tolerance must also be a vector of the same length The local error test applied at each integration step is xample roup calculate Y_a and Y _d item Given calculate Y nd enumerate In either initial values for the given components are input
Definition: DASPK-opts.cc:739
s
Definition: file-io.cc:2682
void push(symbol_table::scope_id scope=symbol_table::current_scope())
Definition: lex.h:76
bool reading_script_file
Definition: lex.h:377
bool looking_at_parameter_list
Definition: lex.h:328
std::set< std::string > pending_local_variables
Definition: lex.h:445
bool looking_at_return_list
Definition: lex.h:325
lexer(FILE *file, interpreter *interp_context=0)
Definition: lex.h:723
std::string string_text
Definition: lex.h:423
virtual bool input_from_terminal(void) const
Definition: lex.h:658
bool at_beginning_of_statement
Definition: lex.h:319
create a structure array and initialize its values The dimensions of each cell array of values must match Singleton cells and non cell values are repeated so that they fill the entire array If the cells are empty
Definition: ov-struct.cc:1688
OCTAVE_EXPORT octave_value_list any number nd example oindent prints the prompt xample Pick a any number!nd example oindent and waits for the user to enter a value The string entered by the user is evaluated as an so it may be a literal a variable name
Definition: input.cc:871
static std::string fcn_file_name(const octave_value &fcn)
Definition: symtab.cc:1168
OCTAVE_EXPORT octave_value_list isdir nd deftypefn *std::string nm
Definition: utils.cc:941
const token * at(size_t n) const
Definition: lex.h:212
#define lexer
Definition: oct-parse.cc:152
token_cache tokens
Definition: lex.h:455
static llvm::LLVMContext & context
Definition: jit-typeinfo.cc:76
bool is_push_lexer(void) const
Definition: lex.h:811
bool parsing_class_method
Definition: lex.h:350
bool looking_at_matrix_or_assign_lhs
Definition: lex.h:340
std::string input_source(void) const
Definition: lex.h:747
std::deque< token * > buffer
Definition: lex.h:251
int block_comment_nesting_level
Definition: lex.h:404
bool parsing_classdef_set_method
Definition: lex.h:364
void increment_promptflag(void)
Definition: lex.h:739
is false
Definition: cellfun.cc:398
bbp_nesting_level(const bbp_nesting_level &nl)
Definition: lex.h:109
octave_value retval
Definition: data.cc:6294
#define panic_impossible()
Definition: error.h:40
bool looking_at_indirect_ref
Definition: lex.h:347
std::string comment_text
Definition: lex.h:417
bool looking_for_object_index
Definition: lex.h:343
bool empty(void) const
Definition: lex.h:491
returns the type of the matrix and caches it for future use Called with more than one the function will not attempt to guess the type if it is still unknown This is useful for debugging purposes The possible matrix types depend on whether the matrix is full or and can be one of the following able sis tem and mark type as unknown tem as the structure of the matrix explicitly gives this(Sparse matrices only) tem code
Definition: matrix_type.cc:120
push_lexer(bool eof, interpreter *interp_context=0)
Definition: lex.h:798
octave_comment_list * comment_list
Definition: lex.h:542
sz
Definition: data.cc:5342
std::string help_text
Definition: lex.h:420
bool is_keyword(const std::string &s)
Definition: lex.cc:4529
int promptflag(void) const
Definition: lex.h:829
the sparsity preserving column transformation such that that defines the pivoting threshold can be given in which case it defines the c
Definition: lu.cc:138
bool looking_at_initializer_expression
Definition: lex.h:336
void append(const std::string &s, octave_comment_elt::comment_type t)
Definition: lex.h:514
lexical_feedback(void)
Definition: lex.h:262
bool at_end_of_file(void) const
Definition: lex.h:568
static uint32_t state[624]
Definition: randmtzig.cc:184
octave_comment_list * get_comment(void)
Definition: lex.h:600
lexer(interpreter *interp_context=0)
Definition: lex.h:719
void increment_promptflag(void)
Definition: lex.h:825
bbp_nesting_level nesting_level
Definition: lex.h:452
lexer(const std::string &eval_string, interpreter *interp_context=0)
Definition: lex.h:727
charNDArray max(char d, const charNDArray &m)
Definition: chNDArray.cc:228
bool at_end_of_buffer(void) const
Definition: lex.h:566
void decrement_promptflag(void)
Definition: lex.h:741
symbol_table_context symtab_context
Definition: lex.h:448
std::stack< symbol_table::scope_id > frame_stack
Definition: lex.h:88
std::stack< bool > parsed_function_name
Definition: lex.h:442
octave_comment_list * get_comment(void)
Definition: lex.h:524
virtual bool input_from_eval_string(void) const
Definition: lex.h:662
is longer than or if then or only for unique occurrences of the complete pattern(false).The default is true.If a cell array of strings ar
Definition: strfind.cc:192
std::string fcn_file_name
Definition: lex.h:430
int promptflag(int n)
Definition: lex.h:745
bool reading_classdef_file
Definition: lex.h:380
#define scanner
std::string current_input_line
Definition: lex.h:414
octave_input_reader input_reader
Definition: lex.h:769
virtual bool input_from_file(void) const
Definition: lex.h:660
int promptflag(void) const
Definition: lex.h:743
int command_arg_paren_count
Definition: lex.h:407
virtual bool is_push_lexer(void) const
Definition: lex.h:556
void reset(void)
Definition: lex.h:732
std::stack< int > start_state_stack
Definition: lex.h:705
OCTINTERP_API octave_value_list eval_string(const std::string &, bool silent, int &parse_status, int nargout)
base_lexer(interpreter *interp_context=0)
Definition: lex.h:545
std::list< bool > looking_at_object_index
Definition: lex.h:437
int promptflag(int n)
Definition: lex.h:831
void append_input(const std::string &input, bool eof)
Definition: lex.h:820
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
Definition: utils.cc:854
int start_state(void) const
Definition: lex.h:670
push_lexer(const std::string &input, interpreter *interp_context=0)
Definition: lex.h:791
Definition: token.h:32
void reset(void)
Definition: lex.h:813
push_lexer(const std::string &input, bool eof, interpreter *interp_context=0)
Definition: lex.h:804
static scope_id current_scope(void)
Definition: symtab.h:1163
const token * front(void) const
Definition: lex.h:223