GNU Octave  3.8.0
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

 octave_push_lexer (const std::string &input=std::string(), bool eof=false)
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 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)
charflex_yytext (void)
octave_comment_listget_comment (void)
void gripe_matlab_incompatible (const std::string &msg)
void gripe_matlab_incompatible_continuation (void)
void gripe_matlab_incompatible_operator (const std::string &op)
void gripe_single_quote_string (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_identifier (void)
int handle_incompatible_assign_op (const char *pattern, int tok)
int handle_incompatible_op (const char *pattern, int tok, bool bos=false)
int handle_incompatible_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)
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_gripe_matlab_incompatible_comment (char c)
void maybe_mark_previous_token_as_variable (void)
bool maybe_unput_comma_before_unary_op (int tok)
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)
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
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
bool maybe_classdef_get_set_method
bbp_nesting_level nesting_level
std::stack< boolparsed_function_name
bool parsing_class_method
bool parsing_classdef
std::set< std::string > pending_local_variables
bool quote_is_transpose
bool reading_classdef_file
bool reading_fcn_file
bool reading_script_file
voidscanner
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

 octave_push_lexer (const octave_push_lexer &)
octave_push_lexeroperator= (const octave_push_lexer &)

Protected Attributes

int pflag
std::stack< intstart_state_stack

Detailed Description

Definition at line 751 of file lex.h.

Constructor & Destructor Documentation

octave_push_lexer::octave_push_lexer ( const std::string &  input = std::string (),
bool  eof = false 
)
inline

Definition at line 756 of file lex.h.

References input().

octave_push_lexer::octave_push_lexer ( const octave_push_lexer )
protected

Member Function Documentation

void octave_push_lexer::append_input ( const std::string &  input,
bool  eof 
)
inline

Definition at line 772 of file lex.h.

bool octave_base_lexer::at_end_of_buffer ( void  ) const
inlineinherited

Definition at line 548 of file lex.h.

bool octave_base_lexer::at_end_of_file ( void  ) const
inlineinherited

Definition at line 550 of file lex.h.

void octave_base_lexer::begin_string ( int  state)
inherited
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
void octave_push_lexer::decrement_promptflag ( void  )
inlinevirtual

Implements octave_base_lexer.

Definition at line 779 of file lex.h.

void octave_base_lexer::display_start_state ( void  ) const
inherited
void octave_base_lexer::display_token ( int  tok)
inherited
void octave_base_lexer::fatal_error ( const char msg)
inherited
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
octave_comment_list* octave_base_lexer::get_comment ( void  )
inlineinherited

Definition at line 580 of file lex.h.

void octave_base_lexer::gripe_matlab_incompatible ( const std::string &  msg)
inherited
void octave_base_lexer::gripe_matlab_incompatible_continuation ( void  )
inherited
void octave_base_lexer::gripe_matlab_incompatible_operator ( const std::string &  op)
inherited
void octave_base_lexer::gripe_single_quote_string ( void  )
inherited
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
int octave_base_lexer::handle_end_of_input ( void  )
inherited
int octave_base_lexer::handle_identifier ( void  )
inherited
int octave_base_lexer::handle_incompatible_assign_op ( const char pattern,
int  tok 
)
inherited
int octave_base_lexer::handle_incompatible_op ( const char pattern,
int  tok,
bool  bos = false 
)
inherited
int octave_base_lexer::handle_incompatible_unary_op ( int  tok,
bool  bos = false 
)
inherited
int octave_base_lexer::handle_meta_identifier ( void  )
inherited
void octave_base_lexer::handle_number ( void  )
inherited
int octave_base_lexer::handle_op ( const char pattern,
int  tok,
bool  bos = false 
)
inherited
int octave_base_lexer::handle_op_internal ( int  tok,
bool  bos,
bool  compat 
)
inherited
int octave_base_lexer::handle_superclass_identifier ( void  )
inherited
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
int octave_base_lexer::handle_unary_op ( int  tok,
bool  bos = false 
)
inherited
void octave_push_lexer::increment_promptflag ( void  )
inlinevirtual

Implements octave_base_lexer.

Definition at line 777 of file lex.h.

void octave_base_lexer::init ( void  )
inherited
virtual bool octave_base_lexer::input_from_eval_string ( void  ) const
inlinevirtualinherited

Reimplemented in octave_lexer.

Definition at line 637 of file lex.h.

Referenced by octave_base_lexer::reset().

virtual bool octave_base_lexer::input_from_file ( void  ) const
inlinevirtualinherited

Reimplemented in octave_lexer.

Definition at line 635 of file lex.h.

Referenced by octave_base_lexer::is_keyword_token().

virtual bool octave_base_lexer::input_from_terminal ( void  ) const
inlinevirtualinherited

Reimplemented in octave_lexer.

Definition at line 633 of file lex.h.

std::string octave_push_lexer::input_source ( void  ) const
inlinevirtual

Reimplemented from octave_base_lexer.

Definition at line 790 of file lex.h.

bool octave_base_lexer::inside_any_object_index ( void  )
inherited

Definition at line 4898 of file lex.cc.

References lexical_feedback::looking_at_object_index.

Referenced by octave_base_lexer::is_keyword_token().

int octave_base_lexer::is_keyword_token ( const std::string &  s)
inherited

Definition at line 4926 of file lex.cc.

References lexical_feedback::at_beginning_of_statement, break_kw, case_kw, catch_kw, token::classdef_end, classdef_kw, continue_kw, lexical_feedback::current_input_column, octave_base_lexer::decrement_promptflag(), lexical_feedback::defining_func, do_kw, else_kw, elseif_kw, end_kw, end_try_catch_kw, end_unwind_protect_kw, endclassdef_kw, endenumeration_kw, endevents_kw, endfor_kw, endfunction_kw, endif_kw, endmethods_kw, endparfor_kw, endproperties_kw, endswitch_kw, endwhile_kw, token::enumeration_end, enumeration_kw, token::events_end, events_kw, lexical_feedback::fcn_file_full_name, token::for_end, for_kw, lexical_feedback::force_script, token::function_end, function_kw, get_kw, global_kw, token::if_end, if_kw, octave_kw_hash::in_word_set(), octave_base_lexer::input_from_file(), lexical_feedback::input_line_number, octave_base_lexer::inside_any_object_index(), octave_kw::kw_id, lexical_feedback::looking_at_decl_list, lexical_feedback::looking_at_return_list, lexical_feedback::looping, magic_file_kw, magic_line_kw, lexical_feedback::maybe_classdef_get_set_method, token::methods_end, methods_kw, otherwise_kw, panic_impossible, token::parfor_end, parfor_kw, lexical_feedback::parsed_function_name, lexical_feedback::parsing_classdef, persistent_kw, token::properties_end, properties_kw, octave_base_lexer::push_token(), lexical_feedback::reading_classdef_file, lexical_feedback::reading_fcn_file, lexical_feedback::reading_script_file, return_kw, set_kw, token::simple_end, static_kw, token::switch_end, switch_kw, octave_kw::tok, lexical_feedback::token_count, token::try_catch_end, try_kw, until_kw, unwind_protect_cleanup_kw, token::unwind_protect_end, unwind_protect_kw, warning_with_id(), token::while_end, and while_kw.

Referenced by octave_base_lexer::handle_identifier(), octave_base_lexer::handle_meta_identifier(), and octave_base_lexer::handle_superclass_identifier().

bool octave_push_lexer::is_push_lexer ( void  ) const
inlinevirtual

Reimplemented from octave_base_lexer.

Definition at line 763 of file lex.h.

bool octave_base_lexer::is_variable ( const std::string &  name)
inherited
void octave_base_lexer::lexer_debug ( const char pattern)
inherited
bool octave_base_lexer::looking_at_space ( void  )
inherited
bool octave_base_lexer::looks_like_command_arg ( void  )
inherited
void lexical_feedback::mark_as_variable ( const std::string &  nm)
inherited
void lexical_feedback::mark_as_variables ( const std::list< std::string > &  lst)
inherited

Definition at line 4662 of file lex.cc.

References lexical_feedback::pending_local_variables.

void lexical_feedback::mark_previous_token_trailing_space ( void  )
inherited
void octave_base_lexer::maybe_gripe_matlab_incompatible_comment ( char  c)
inherited

Definition at line 5550 of file lex.cc.

References octave_base_lexer::gripe_matlab_incompatible().

void lexical_feedback::maybe_mark_previous_token_as_variable ( void  )
inherited
bool octave_base_lexer::maybe_unput_comma_before_unary_op ( int  tok)
inherited
void octave_base_lexer::maybe_warn_separator_insert ( char  sep)
inherited
octave_push_lexer& octave_push_lexer::operator= ( const octave_push_lexer )
protected
void octave_base_lexer::pop_start_state ( void  )
inherited
void octave_base_lexer::prep_for_file ( void  )
inherited
bool lexical_feedback::previous_token_is_binop ( void  ) const
inherited
bool lexical_feedback::previous_token_is_keyword ( void  ) const
inherited
bool lexical_feedback::previous_token_may_be_command ( void  ) const
inherited
int lexical_feedback::previous_token_value ( void  ) const
inherited
bool lexical_feedback::previous_token_value_is ( int  tok_val) const
inherited
int octave_push_lexer::promptflag ( void  ) const
inlinevirtual

Implements octave_base_lexer.

Definition at line 781 of file lex.h.

int octave_push_lexer::promptflag ( int  n)
inlinevirtual

Implements octave_base_lexer.

Definition at line 783 of file lex.h.

void octave_base_lexer::push_start_state ( int  state)
inherited
void octave_base_lexer::push_token ( token tok)
inherited
void octave_push_lexer::reset ( void  )
inlinevirtual

Reimplemented from octave_base_lexer.

Definition at line 765 of file lex.h.

References octave_base_lexer::reset().

int octave_base_lexer::show_token ( int  tok)
inherited
bool 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
bool octave_base_lexer::whitespace_is_significant ( void  )
inherited
void octave_base_lexer::xunput ( char  c,
char buf 
)
inherited
void octave_base_lexer::xunput ( char  c)
inherited

Definition at line 4882 of file lex.cc.

References octave_base_lexer::flex_yytext(), and octave_base_lexer::xunput().

Member Data Documentation

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

Definition at line 390 of file lex.h.

Referenced by octave_base_lexer::handle_end_of_input(), and lexical_feedback::reset().

int lexical_feedback::braceflag
inherited

Definition at line 378 of file lex.h.

Referenced by octave_base_lexer::handle_close_bracket(), and lexical_feedback::reset().

int lexical_feedback::bracketflag
inherited

Definition at line 375 of file lex.h.

Referenced by octave_base_lexer::handle_close_bracket(), and lexical_feedback::reset().

comment_buffer octave_base_lexer::comment_buf
inherited

Definition at line 621 of file lex.h.

Referenced by octave_base_lexer::finish_comment(), and octave_base_lexer::reset().

std::string lexical_feedback::comment_text
inherited
int lexical_feedback::current_input_column
inherited
std::string lexical_feedback::current_input_line
inherited

Definition at line 397 of file lex.h.

Referenced by octave_lexer::fill_flex_buffer(), and lexical_feedback::reset().

int lexical_feedback::defining_func
inherited

Definition at line 384 of file lex.h.

Referenced by octave_base_lexer::is_keyword_token(), and lexical_feedback::reset().

bool lexical_feedback::end_of_input
inherited

Definition at line 307 of file lex.h.

Referenced by main_loop(), and lexical_feedback::reset().

std::string lexical_feedback::fcn_file_full_name
inherited
std::string lexical_feedback::fcn_file_name
inherited

Definition at line 413 of file lex.h.

Referenced by octave_base_lexer::handle_end_of_input(), and lexical_feedback::reset().

bool lexical_feedback::force_script
inherited

Definition at line 357 of file lex.h.

Referenced by octave_base_lexer::is_keyword_token(), and lexical_feedback::reset().

std::string lexical_feedback::help_text
inherited

Definition at line 403 of file lex.h.

Referenced by octave_base_lexer::finish_comment(), and lexical_feedback::reset().

input_buffer octave_base_lexer::input_buf
inherited

Definition at line 618 of file lex.h.

Referenced by octave_lexer::fill_flex_buffer(), and fill_flex_buffer().

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

Definition at line 314 of file lex.h.

Referenced by lexical_feedback::reset().

bool lexical_feedback::looking_at_decl_list
inherited

Definition at line 324 of file lex.h.

Referenced by octave_base_lexer::is_keyword_token(), and lexical_feedback::reset().

int lexical_feedback::looking_at_function_handle
inherited

Definition at line 387 of file lex.h.

Referenced by octave_base_lexer::handle_identifier(), and lexical_feedback::reset().

bool lexical_feedback::looking_at_indirect_ref
inherited

Definition at line 339 of file lex.h.

Referenced by octave_base_lexer::handle_identifier(), and lexical_feedback::reset().

bool lexical_feedback::looking_at_initializer_expression
inherited

Definition at line 328 of file lex.h.

Referenced by lexical_feedback::reset().

bool lexical_feedback::looking_at_matrix_or_assign_lhs
inherited

Definition at line 332 of file lex.h.

Referenced by lexical_feedback::reset().

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

Definition at line 320 of file lex.h.

Referenced by lexical_feedback::reset().

bool lexical_feedback::looking_at_return_list
inherited

Definition at line 317 of file lex.h.

Referenced by octave_base_lexer::is_keyword_token(), and lexical_feedback::reset().

bool lexical_feedback::looking_for_object_index
inherited
int lexical_feedback::looping
inherited

Definition at line 381 of file lex.h.

Referenced by octave_base_lexer::is_keyword_token(), and lexical_feedback::reset().

bool lexical_feedback::maybe_classdef_get_set_method
inherited

Definition at line 347 of file lex.h.

Referenced by octave_base_lexer::is_keyword_token(), and lexical_feedback::reset().

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

Definition at line 425 of file lex.h.

Referenced by octave_base_lexer::is_keyword_token(), and lexical_feedback::reset().

bool lexical_feedback::parsing_class_method
inherited

Definition at line 342 of file lex.h.

Referenced by lexical_feedback::reset().

bool lexical_feedback::parsing_classdef
inherited

Definition at line 350 of file lex.h.

Referenced by octave_base_lexer::is_keyword_token(), and lexical_feedback::reset().

std::set<std::string> lexical_feedback::pending_local_variables
inherited
int octave_push_lexer::pflag
protected

Definition at line 796 of file lex.h.

bool lexical_feedback::quote_is_transpose
inherited

Definition at line 353 of file lex.h.

bool lexical_feedback::reading_classdef_file
inherited
bool lexical_feedback::reading_fcn_file
inherited
bool lexical_feedback::reading_script_file
inherited
void* octave_base_lexer::scanner
inherited
std::stack<int> octave_base_lexer::start_state_stack
protectedinherited
int lexical_feedback::string_column
inherited

Definition at line 410 of file lex.h.

Referenced by octave_base_lexer::begin_string(), and lexical_feedback::reset().

int lexical_feedback::string_line
inherited

Definition at line 409 of file lex.h.

Referenced by octave_base_lexer::begin_string(), and lexical_feedback::reset().

std::string lexical_feedback::string_text
inherited

Definition at line 406 of file lex.h.

Referenced by lexical_feedback::reset().

symbol_table_context lexical_feedback::symtab_context
inherited
size_t lexical_feedback::token_count
inherited
token_cache lexical_feedback::tokens
inherited

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