23 #if ! defined (octave_lex_h)
24 #define octave_lex_h 1
26 #include "octave-config.h"
62 while (! frame_stack.empty ())
66 bool empty (
void)
const {
return frame_stack.empty (); }
78 frame_stack.push (scope);
186 : buffer (),
sz (sz_arg)
191 if (buffer.size () ==
sz)
194 buffer.push_front (tok);
201 delete buffer.back ();
209 return empty () ? 0 : buffer.at (n);
214 return empty () ? 0 : buffer.at (n);
220 return empty () ? 0 : buffer.front ();
225 return empty () ? 0 : buffer.front ();
230 return empty () ? 0 : buffer.back ();
235 return empty () ? 0 : buffer.back ();
239 size_t size (
void)
const {
return buffer.size (); }
241 bool empty (
void)
const {
return buffer.empty (); }
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 ()
295 int previous_token_value (
void)
const;
297 bool previous_token_value_is (
int tok_val)
const;
299 void mark_previous_token_trailing_space (
void);
301 bool space_follows_previous_token (
void)
const;
303 bool previous_token_is_binop (
void)
const;
305 bool previous_token_is_keyword (
void)
const;
307 bool previous_token_may_be_command (
void)
const;
309 void maybe_mark_previous_token_as_variable (
void);
312 void mark_as_variables (
const std::list<std::string>& lst);
483 : buffer (), pos (0), chars_left (0), eof (
false)
489 int copy_chunk (
char *buf,
size_t max_size);
491 bool empty (
void)
const {
return chars_left == 0; }
519 comment_list->append (s, t);
547 m_interp_context (interp_context)
558 virtual void reset (
void);
560 void prep_for_file (
void);
562 void begin_string (
int state);
564 virtual int fill_flex_buffer (
char *buf,
unsigned int max_size) = 0;
570 int handle_end_of_input (
void);
572 char *flex_yytext (
void);
574 int flex_yyleng (
void);
576 int text_yyinput (
void);
578 void xunput (
char c,
char *buf);
580 void xunput (
char c);
582 bool looking_at_space (
void);
584 bool inside_any_object_index (
void);
590 bool fq_identifier_contains_keyword (
const std::string&
s);
592 bool whitespace_is_significant (
void);
594 void handle_number (
void);
596 void handle_continuation (
void);
602 int handle_close_bracket (
int bracket_type);
604 bool looks_like_command_arg (
void);
606 int handle_superclass_identifier (
void);
608 int handle_meta_identifier (
void);
610 int handle_fq_identifier (
void);
612 int handle_identifier (
void);
614 void maybe_warn_separator_insert (
char sep);
616 void warn_single_quote_string (
void);
618 void warn_language_extension (
const std::string& msg);
620 void maybe_warn_language_extension_comment (
char c);
622 void warn_language_extension_continuation (
void);
624 void warn_language_extension_operator (
const std::string& op);
626 void push_token (
token *);
628 token *current_token (
void);
630 void display_token (
int tok);
632 void fatal_error (
const char *msg);
634 void lexer_debug (
const char *
pattern);
648 virtual void increment_promptflag (
void) = 0;
650 virtual void decrement_promptflag (
void) = 0;
652 virtual int promptflag (
void)
const = 0;
654 virtual int promptflag (
int) = 0;
664 void push_start_state (
int state);
666 void pop_start_state (
void);
668 void clear_start_state (
void);
672 void display_start_state (
void)
const;
674 int handle_op (
const char *
pattern,
int tok,
bool bos =
false);
676 int handle_language_extension_op (
const char *
pattern,
int tok,
679 bool maybe_unput_comma_before_unary_op (
int tok);
681 int handle_unary_op (
int tok,
bool bos =
false);
683 int handle_language_extension_unary_op (
int tok,
bool bos =
false);
685 int handle_assign_op (
const char *
pattern,
int tok);
687 int handle_language_extension_assign_op (
const char *
pattern,
int tok);
689 int handle_op_internal (
int tok,
bool bos,
bool compat);
693 int handle_token (
int tok,
token *tok_val = 0);
695 int count_token (
int tok);
697 int count_token_internal (
int tok);
699 int show_token (
int tok);
701 void enable_fq_identifier (
void);
734 input_reader.reset ();
743 int promptflag (
void)
const {
return input_reader.promptflag (); }
745 int promptflag (
int n) {
return input_reader.promptflag (n); }
749 return input_reader.input_source ();
754 return input_reader.input_from_terminal ();
759 return input_reader.input_from_file ();
764 return input_reader.input_from_eval_string ();
767 int fill_flex_buffer (
char *buf,
unsigned int max_size);
788 append_input (
"",
false);
795 append_input (input,
false);
801 append_input (
"", eof);
808 append_input (input, eof);
822 input_buf.fill (input, eof);
840 int fill_flex_buffer (
char *buf,
unsigned int max_size);
bool parsing_classdef_get_method
push_lexer(interpreter *interp_context=0)
Octave interface to the compression and uncompression libraries.
For example cd octave end example noindent changes the current working directory to file
interpreter * m_interp_context
void decrement_promptflag(void)
const token * back(void) const
bool maybe_classdef_get_set_method
virtual std::string input_source(void) const
int looking_at_function_handle
bool looking_at_decl_list
bool is_anon_fcn_body(void)
bool looking_at_anon_fcn_args
bool input_from_terminal(void) const
std::string fcn_file_full_name
bool input_from_file(void) const
symbol_table::scope_id curr_scope(void) const
token_cache(size_t sz_arg=std::numeric_limits< size_t >::max())
comment_buffer comment_buf
bool input_from_eval_string(void) const
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function t
static bool is_variable(const std::string &name)
std::string input_source(void) const
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
void push(symbol_table::scope_id scope=symbol_table::current_scope())
bool looking_at_parameter_list
symbol_table_context(void)
std::set< std::string > pending_local_variables
bool looking_at_return_list
lexer(FILE *file, interpreter *interp_context=0)
virtual bool input_from_terminal(void) const
bool at_beginning_of_statement
std::stack< int > context
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
static std::string fcn_file_name(const octave_value &fcn)
OCTAVE_EXPORT octave_value_list isdir nd deftypefn *std::string nm
const token * at(size_t n) const
bool is_bracket_or_brace(void)
static llvm::LLVMContext & context
bool is_push_lexer(void) const
bool parsing_class_method
bool looking_at_matrix_or_assign_lhs
std::string input_source(void) const
std::deque< token * > buffer
int block_comment_nesting_level
bool parsing_classdef_set_method
void increment_promptflag(void)
bbp_nesting_level(const bbp_nesting_level &nl)
#define panic_impossible()
bool looking_at_indirect_ref
bool looking_for_object_index
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
push_lexer(bool eof, interpreter *interp_context=0)
bool is_keyword(const std::string &s)
int promptflag(void) const
the sparsity preserving column transformation such that that defines the pivoting threshold can be given in which case it defines the c
bool looking_at_initializer_expression
bool at_end_of_file(void) const
static uint32_t state[624]
octave_comment_list * get_comment(void)
lexer(interpreter *interp_context=0)
void increment_promptflag(void)
bbp_nesting_level nesting_level
lexer(const std::string &eval_string, interpreter *interp_context=0)
charNDArray max(char d, const charNDArray &m)
bool at_end_of_buffer(void) const
void decrement_promptflag(void)
symbol_table_context symtab_context
std::stack< symbol_table::scope_id > frame_stack
std::stack< bool > parsed_function_name
virtual bool input_from_eval_string(void) const
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
std::string fcn_file_name
bool reading_classdef_file
std::string current_input_line
octave_input_reader input_reader
virtual bool input_from_file(void) const
int promptflag(void) const
int command_arg_paren_count
virtual bool is_push_lexer(void) const
std::stack< int > start_state_stack
OCTINTERP_API octave_value_list eval_string(const std::string &, bool silent, int &parse_status, int nargout)
base_lexer(interpreter *interp_context=0)
std::list< bool > looking_at_object_index
void append_input(const std::string &input, bool eof)
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
int start_state(void) const
push_lexer(const std::string &input, interpreter *interp_context=0)
push_lexer(const std::string &input, bool eof, interpreter *interp_context=0)
static scope_id current_scope(void)
const token * front(void) const