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
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
octave::push_lexer Class Reference

#include "lex.h"

Inheritance diagram for octave::push_lexer:
Inheritance graph
[legend]
Collaboration diagram for octave::push_lexer:
Collaboration graph
[legend]

Public Member Functions

 push_lexer (interpreter *interp_context=0)
 
 push_lexer (const std::string &input, interpreter *interp_context=0)
 
 push_lexer (bool eof, interpreter *interp_context=0)
 
 push_lexer (const std::string &input, bool eof, interpreter *interp_context=0)
 
void append_input (const std::string &input, bool eof)
 
bool at_end_of_buffer (void) const
 
bool at_end_of_file (void) const
 
void begin_string (int state)
 
void clear_start_state (void)
 
int count_token (int tok)
 
int count_token_internal (int tok)
 
tokencurrent_token (void)
 
void decrement_promptflag (void)
 
void display_start_state (void) const
 
void display_token (int tok)
 
void enable_fq_identifier (void)
 
void fatal_error (const char *msg)
 
int fill_flex_buffer (char *buf, unsigned int max_size)
 
void finish_comment (octave_comment_elt::comment_type typ)
 
int flex_yyleng (void)
 
char * flex_yytext (void)
 
bool fq_identifier_contains_keyword (const std::string &s)
 
octave_comment_listget_comment (void)
 
int handle_assign_op (const char *pattern, int tok)
 
int handle_close_bracket (int bracket_type)
 
void handle_continuation (void)
 
int handle_end_of_input (void)
 
int handle_fq_identifier (void)
 
int handle_identifier (void)
 
int handle_language_extension_assign_op (const char *pattern, int tok)
 
int handle_language_extension_op (const char *pattern, int tok, bool bos=false)
 
int handle_language_extension_unary_op (int tok, bool bos=false)
 
int handle_meta_identifier (void)
 
void handle_number (void)
 
int handle_op (const char *pattern, int tok, bool bos=false)
 
int handle_op_internal (int tok, bool bos, bool compat)
 
int handle_superclass_identifier (void)
 
int handle_token (const std::string &name, int tok)
 
int handle_token (int tok, token *tok_val=0)
 
int handle_unary_op (int tok, bool bos=false)
 
void increment_promptflag (void)
 
void init (void)
 
virtual bool input_from_eval_string (void) const
 
virtual bool input_from_file (void) const
 
virtual bool input_from_terminal (void) const
 
std::string input_source (void) const
 
bool inside_any_object_index (void)
 
int is_keyword_token (const std::string &s)
 
bool is_push_lexer (void) const
 
bool is_variable (const std::string &name, symbol_table::scope_id scope)
 
void lexer_debug (const char *pattern)
 
bool looking_at_space (void)
 
bool looks_like_command_arg (void)
 
void mark_as_variable (const std::string &nm)
 
void mark_as_variables (const std::list< std::string > &lst)
 
void mark_previous_token_trailing_space (void)
 
void maybe_mark_previous_token_as_variable (void)
 
bool maybe_unput_comma_before_unary_op (int tok)
 
void maybe_warn_language_extension_comment (char c)
 
void maybe_warn_separator_insert (char sep)
 
void pop_start_state (void)
 
void prep_for_file (void)
 
bool previous_token_is_binop (void) const
 
bool previous_token_is_keyword (void) const
 
bool previous_token_may_be_command (void) const
 
int previous_token_value (void) const
 
bool previous_token_value_is (int tok_val) const
 
int promptflag (void) const
 
int promptflag (int n)
 
void push_start_state (int state)
 
void push_token (token *)
 
void reset (void)
 
int show_token (int tok)
 
bool space_follows_previous_token (void) const
 
int start_state (void) const
 
int text_yyinput (void)
 
void warn_language_extension (const std::string &msg)
 
void warn_language_extension_continuation (void)
 
void warn_language_extension_operator (const std::string &op)
 
void warn_single_quote_string (void)
 
bool whitespace_is_significant (void)
 
void xunput (char c, char *buf)
 
void xunput (char c)
 

Public Attributes

bool at_beginning_of_statement
 
int block_comment_nesting_level
 
int braceflag
 
int bracketflag
 
int command_arg_paren_count
 
comment_buffer comment_buf
 
std::string comment_text
 
int current_input_column
 
std::string current_input_line
 
int defining_func
 
bool end_of_input
 
std::string fcn_file_full_name
 
std::string fcn_file_name
 
bool force_script
 
std::string help_text
 
input_buffer input_buf
 
int input_line_number
 
bool looking_at_anon_fcn_args
 
bool looking_at_decl_list
 
int looking_at_function_handle
 
bool looking_at_indirect_ref
 
bool looking_at_initializer_expression
 
bool looking_at_matrix_or_assign_lhs
 
std::list< boollooking_at_object_index
 
bool looking_at_parameter_list
 
bool looking_at_return_list
 
bool looking_for_object_index
 
int looping
 
interpreterm_interp_context
 
bool maybe_classdef_get_set_method
 
bbp_nesting_level nesting_level
 
std::stack< boolparsed_function_name
 
bool parsing_class_method
 
bool parsing_classdef
 
bool parsing_classdef_get_method
 
bool parsing_classdef_set_method
 
std::set< std::stringpending_local_variables
 
bool quote_is_transpose
 
bool reading_classdef_file
 
bool reading_fcn_file
 
bool reading_script_file
 
void * scanner
 
int string_column
 
int string_line
 
std::string string_text
 
symbol_table_context symtab_context
 
size_t token_count
 
token_cache tokens
 

Protected Member Functions

 push_lexer (const push_lexer &)
 
push_lexeroperator= (const push_lexer &)
 

Protected Attributes

int pflag
 
std::stack< intstart_state_stack
 

Detailed Description

Definition at line 780 of file lex.h.

Constructor & Destructor Documentation

octave::push_lexer::push_lexer ( interpreter interp_context = 0)
inline

Definition at line 785 of file lex.h.

octave::push_lexer::push_lexer ( const std::string input,
interpreter interp_context = 0 
)
inline

Definition at line 791 of file lex.h.

octave::push_lexer::push_lexer ( bool  eof,
interpreter interp_context = 0 
)
inline

Definition at line 798 of file lex.h.

octave::push_lexer::push_lexer ( const std::string input,
bool  eof,
interpreter interp_context = 0 
)
inline

Definition at line 804 of file lex.h.

octave::push_lexer::push_lexer ( const push_lexer )
protected

Member Function Documentation

void octave::push_lexer::append_input ( const std::string input,
bool  eof 
)
inline

Definition at line 820 of file lex.h.

bool octave::base_lexer::at_end_of_buffer ( void  ) const
inlineinherited

Definition at line 566 of file lex.h.

Referenced by octave::push_parser::run().

bool octave::base_lexer::at_end_of_file ( void  ) const
inlineinherited

Definition at line 568 of file lex.h.

void octave::base_lexer::begin_string ( int  state)
inherited

Definition at line 4896 of file lex.cc.

void octave::base_lexer::clear_start_state ( void  )
inherited
int octave::base_lexer::count_token ( int  tok)
inherited
int octave::base_lexer::count_token_internal ( int  tok)
inherited
token * octave::base_lexer::current_token ( void  )
inherited

Definition at line 5761 of file lex.cc.

void octave::push_lexer::decrement_promptflag ( void  )
inlinevirtual

Implements octave::base_lexer.

Definition at line 827 of file lex.h.

void octave::base_lexer::display_start_state ( void  ) const
inherited
void octave::base_lexer::display_token ( int  tok)
inherited

Definition at line 5768 of file lex.cc.

Referenced by octave::lexer::fill_flex_buffer().

void octave::base_lexer::enable_fq_identifier ( void  )
inherited

Definition at line 6123 of file lex.cc.

void octave::base_lexer::fatal_error ( const char *  msg)
inherited

Definition at line 5900 of file lex.cc.

int octave::push_lexer::fill_flex_buffer ( char *  buf,
unsigned int  max_size 
)
virtual
void octave::base_lexer::finish_comment ( octave_comment_elt::comment_type  typ)
inherited
int octave::base_lexer::flex_yyleng ( void  )
inherited
char * octave::base_lexer::flex_yytext ( void  )
inherited

Definition at line 4923 of file lex.cc.

Referenced by octave::base_lexer::pop_start_state().

bool octave::base_lexer::fq_identifier_contains_keyword ( const std::string s)
inherited

Definition at line 5260 of file lex.cc.

octave_comment_list* octave::base_lexer::get_comment ( void  )
inlineinherited

Definition at line 600 of file lex.h.

Referenced by octave::base_parser::make_statement().

int octave::base_lexer::handle_assign_op ( const char *  pattern,
int  tok 
)
inherited
int octave::base_lexer::handle_close_bracket ( int  bracket_type)
inherited
void octave::base_lexer::handle_continuation ( void  )
inherited

Definition at line 5382 of file lex.cc.

int octave::base_lexer::handle_end_of_input ( void  )
inherited

Definition at line 4905 of file lex.cc.

int octave::base_lexer::handle_fq_identifier ( void  )
inherited
int octave::base_lexer::handle_identifier ( void  )
inherited

Definition at line 5578 of file lex.cc.

int octave::base_lexer::handle_language_extension_assign_op ( const char *  pattern,
int  tok 
)
inherited
int octave::base_lexer::handle_language_extension_op ( const char *  pattern,
int  tok,
bool  bos = false 
)
inherited

Definition at line 6002 of file lex.cc.

int octave::base_lexer::handle_language_extension_unary_op ( int  tok,
bool  bos = false 
)
inherited

Definition at line 6041 of file lex.cc.

int octave::base_lexer::handle_meta_identifier ( void  )
inherited
void octave::base_lexer::handle_number ( void  )
inherited

Definition at line 5311 of file lex.cc.

int octave::base_lexer::handle_op ( const char *  pattern,
int  tok,
bool  bos = false 
)
inherited

Definition at line 5994 of file lex.cc.

int octave::base_lexer::handle_op_internal ( int  tok,
bool  bos,
bool  compat 
)
inherited

Definition at line 6048 of file lex.cc.

Referenced by octave::base_lexer::handle_token().

int octave::base_lexer::handle_superclass_identifier ( void  )
inherited

Definition at line 5494 of file lex.cc.

int octave::base_lexer::handle_token ( const std::string name,
int  tok 
)
inherited
int octave::base_lexer::handle_token ( int  tok,
token tok_val = 0 
)
inherited

Definition at line 6072 of file lex.cc.

int octave::base_lexer::handle_unary_op ( int  tok,
bool  bos = false 
)
inherited

Definition at line 6034 of file lex.cc.

void octave::push_lexer::increment_promptflag ( void  )
inlinevirtual

Implements octave::base_lexer.

Definition at line 825 of file lex.h.

void octave::base_lexer::init ( void  )
inherited

Definition at line 4841 of file lex.cc.

virtual bool octave::base_lexer::input_from_eval_string ( void  ) const
inlinevirtualinherited

Reimplemented in octave::lexer.

Definition at line 662 of file lex.h.

virtual bool octave::base_lexer::input_from_file ( void  ) const
inlinevirtualinherited

Reimplemented in octave::lexer.

Definition at line 660 of file lex.h.

virtual bool octave::base_lexer::input_from_terminal ( void  ) const
inlinevirtualinherited

Reimplemented in octave::lexer.

Definition at line 658 of file lex.h.

std::string octave::push_lexer::input_source ( void  ) const
inlinevirtual

Reimplemented from octave::base_lexer.

Definition at line 838 of file lex.h.

bool octave::base_lexer::inside_any_object_index ( void  )
inherited

Definition at line 5002 of file lex.cc.

int octave::base_lexer::is_keyword_token ( const std::string s)
inherited

Definition at line 5031 of file lex.cc.

bool octave::push_lexer::is_push_lexer ( void  ) const
inlinevirtual

Reimplemented from octave::base_lexer.

Definition at line 811 of file lex.h.

bool octave::base_lexer::is_variable ( const std::string name,
symbol_table::scope_id  scope 
)
inherited

Definition at line 5020 of file lex.cc.

void octave::base_lexer::lexer_debug ( const char *  pattern)
inherited

Definition at line 5906 of file lex.cc.

bool octave::base_lexer::looking_at_space ( void  )
inherited

Definition at line 4994 of file lex.cc.

References display_character().

bool octave::base_lexer::looks_like_command_arg ( void  )
inherited
void octave::lexical_feedback::mark_as_variable ( const std::string nm)
inherited
void octave::lexical_feedback::mark_as_variables ( const std::list< std::string > &  lst)
inherited

Definition at line 4764 of file lex.cc.

Referenced by octave::base_parser::validate_matrix_for_assignment().

void octave::lexical_feedback::mark_previous_token_trailing_space ( void  )
inherited

Definition at line 4706 of file lex.cc.

void octave::lexical_feedback::maybe_mark_previous_token_as_variable ( void  )
inherited

Definition at line 4755 of file lex.cc.

bool octave::base_lexer::maybe_unput_comma_before_unary_op ( int  tok)
inherited

Definition at line 6011 of file lex.cc.

Referenced by octave::base_lexer::handle_token().

void octave::base_lexer::maybe_warn_language_extension_comment ( char  c)
inherited

Definition at line 5730 of file lex.cc.

void octave::base_lexer::maybe_warn_separator_insert ( char  sep)
inherited

Definition at line 5685 of file lex.cc.

push_lexer& octave::push_lexer::operator= ( const push_lexer )
protected
void octave::base_lexer::pop_start_state ( void  )
inherited
void octave::base_lexer::prep_for_file ( void  )
inherited

Definition at line 4888 of file lex.cc.

Referenced by parse_fcn_file().

bool octave::lexical_feedback::previous_token_is_binop ( void  ) const
inherited
bool octave::lexical_feedback::previous_token_is_keyword ( void  ) const
inherited

Definition at line 4741 of file lex.cc.

References octave::lexical_feedback::previous_token_value().

bool octave::lexical_feedback::previous_token_may_be_command ( void  ) const
inherited

Definition at line 4748 of file lex.cc.

int octave::lexical_feedback::previous_token_value ( void  ) const
inherited

Definition at line 4692 of file lex.cc.

Referenced by octave::lexical_feedback::previous_token_is_keyword().

bool octave::lexical_feedback::previous_token_value_is ( int  tok_val) const
inherited

Definition at line 4699 of file lex.cc.

int octave::push_lexer::promptflag ( void  ) const
inlinevirtual

Implements octave::base_lexer.

Definition at line 829 of file lex.h.

int octave::push_lexer::promptflag ( int  n)
inlinevirtual

Implements octave::base_lexer.

Definition at line 831 of file lex.h.

References retval.

void octave::base_lexer::push_start_state ( int  state)
inherited

Definition at line 5920 of file lex.cc.

References error().

void octave::base_lexer::push_token ( token tok)
inherited
void octave::push_lexer::reset ( void  )
inlinevirtual

Reimplemented from octave::base_lexer.

Definition at line 813 of file lex.h.

References octave::base_lexer::reset().

int octave::base_lexer::show_token ( int  tok)
inherited
bool octave::lexical_feedback::space_follows_previous_token ( void  ) const
inherited
int octave::base_lexer::start_state ( void  ) const
inlineinherited
int octave::base_lexer::text_yyinput ( void  )
inherited

Definition at line 4935 of file lex.cc.

void octave::base_lexer::warn_language_extension ( const std::string msg)
inherited

Definition at line 5715 of file lex.cc.

void octave::base_lexer::warn_language_extension_continuation ( void  )
inherited

Definition at line 5737 of file lex.cc.

References octave::lexical_feedback::fcn_file_full_name, string, and warning_with_id().

void octave::base_lexer::warn_language_extension_operator ( const std::string op)
inherited

Definition at line 5743 of file lex.cc.

void octave::base_lexer::warn_single_quote_string ( void  )
inherited

Definition at line 5700 of file lex.cc.

bool octave::base_lexer::whitespace_is_significant ( void  )
inherited

Definition at line 5288 of file lex.cc.

void octave::base_lexer::xunput ( char  c,
char *  buf 
)
inherited

Definition at line 4970 of file lex.cc.

References display_character(), and octave::base_lexer::scanner.

void octave::base_lexer::xunput ( char  c)
inherited

Definition at line 4986 of file lex.cc.

Member Data Documentation

bool octave::lexical_feedback::at_beginning_of_statement
inherited
int octave::lexical_feedback::block_comment_nesting_level
inherited

Definition at line 404 of file lex.h.

int octave::lexical_feedback::braceflag
inherited

Definition at line 392 of file lex.h.

int octave::lexical_feedback::bracketflag
inherited

Definition at line 389 of file lex.h.

Referenced by octave::base_lexer::looks_like_command_arg().

int octave::lexical_feedback::command_arg_paren_count
inherited

Definition at line 407 of file lex.h.

comment_buffer octave::base_lexer::comment_buf
inherited
std::string octave::lexical_feedback::comment_text
inherited
int octave::lexical_feedback::current_input_column
inherited
std::string octave::lexical_feedback::current_input_line
inherited

Definition at line 414 of file lex.h.

Referenced by octave::base_parser::bison_error(), and fill_flex_buffer().

int octave::lexical_feedback::defining_func
inherited

Definition at line 398 of file lex.h.

Referenced by octave::base_parser::recover_from_parsing_function().

bool octave::lexical_feedback::end_of_input
inherited

Definition at line 315 of file lex.h.

std::string octave::lexical_feedback::fcn_file_full_name
inherited
std::string octave::lexical_feedback::fcn_file_name
inherited
bool octave::lexical_feedback::force_script
inherited

Definition at line 371 of file lex.h.

Referenced by octave::base_parser::frob_function(), and parse_fcn_file().

std::string octave::lexical_feedback::help_text
inherited
input_buffer octave::base_lexer::input_buf
inherited

Definition at line 640 of file lex.h.

Referenced by fill_flex_buffer().

int octave::lexical_feedback::input_line_number
inherited
bool octave::lexical_feedback::looking_at_anon_fcn_args
inherited

Definition at line 322 of file lex.h.

bool octave::lexical_feedback::looking_at_decl_list
inherited

Definition at line 332 of file lex.h.

int octave::lexical_feedback::looking_at_function_handle
inherited

Definition at line 401 of file lex.h.

bool octave::lexical_feedback::looking_at_indirect_ref
inherited

Definition at line 347 of file lex.h.

Referenced by octave::base_parser::make_indirect_ref().

bool octave::lexical_feedback::looking_at_initializer_expression
inherited

Definition at line 336 of file lex.h.

bool octave::lexical_feedback::looking_at_matrix_or_assign_lhs
inherited

Definition at line 340 of file lex.h.

std::list<bool> octave::lexical_feedback::looking_at_object_index
inherited

Definition at line 437 of file lex.h.

bool octave::lexical_feedback::looking_at_parameter_list
inherited

Definition at line 328 of file lex.h.

Referenced by octave::base_parser::recover_from_parsing_function().

bool octave::lexical_feedback::looking_at_return_list
inherited

Definition at line 325 of file lex.h.

Referenced by octave::base_parser::recover_from_parsing_function().

bool octave::lexical_feedback::looking_for_object_index
inherited

Definition at line 343 of file lex.h.

int octave::lexical_feedback::looping
inherited
interpreter* octave::base_lexer::m_interp_context
inherited

Definition at line 646 of file lex.h.

bool octave::lexical_feedback::maybe_classdef_get_set_method
inherited

Definition at line 358 of file lex.h.

bbp_nesting_level octave::lexical_feedback::nesting_level
inherited
std::stack<bool> octave::lexical_feedback::parsed_function_name
inherited

Definition at line 442 of file lex.h.

Referenced by octave::base_parser::recover_from_parsing_function().

bool octave::lexical_feedback::parsing_class_method
inherited

Definition at line 350 of file lex.h.

Referenced by octave::base_parser::frob_function(), and parse_fcn_file().

bool octave::lexical_feedback::parsing_classdef
inherited

Definition at line 353 of file lex.h.

bool octave::lexical_feedback::parsing_classdef_get_method
inherited

Definition at line 361 of file lex.h.

bool octave::lexical_feedback::parsing_classdef_set_method
inherited

Definition at line 364 of file lex.h.

std::set<std::string> octave::lexical_feedback::pending_local_variables
inherited

Definition at line 445 of file lex.h.

Referenced by looks_like_copyright().

int octave::push_lexer::pflag
protected

Definition at line 844 of file lex.h.

bool octave::lexical_feedback::quote_is_transpose
inherited

Definition at line 367 of file lex.h.

bool octave::lexical_feedback::reading_classdef_file
inherited
bool octave::lexical_feedback::reading_fcn_file
inherited
bool octave::lexical_feedback::reading_script_file
inherited
void* octave::base_lexer::scanner
inherited

Definition at line 637 of file lex.h.

Referenced by octave::base_lexer::reset(), and octave::base_lexer::xunput().

std::stack<int> octave::base_lexer::start_state_stack
protectedinherited
int octave::lexical_feedback::string_column
inherited

Definition at line 427 of file lex.h.

int octave::lexical_feedback::string_line
inherited

Definition at line 426 of file lex.h.

std::string octave::lexical_feedback::string_text
inherited

Definition at line 423 of file lex.h.

symbol_table_context octave::lexical_feedback::symtab_context
inherited
size_t octave::lexical_feedback::token_count
inherited

Definition at line 411 of file lex.h.

token_cache octave::lexical_feedback::tokens
inherited

The documentation for this class was generated from the following files: