GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
lexer Class Reference

#include "lex.h"

Inheritance diagram for lexer:
base_lexer lexical_feedback

Public Member Functions

 lexer (const std::string &eval_string, interpreter &interp)
 
 lexer (FILE *file, interpreter &interp)
 
 lexer (FILE *file, interpreter &interp, const std::string &encoding)
 
 lexer (interpreter &interp)
 
 ~lexer ()=default
 
int fill_flex_buffer (char *buf, unsigned int max_size)
 
bool input_from_eval_string () const
 
bool input_from_file () const
 
bool input_from_terminal () const
 
std::string input_source () const
 
void reset ()
 
- Public Member Functions inherited from base_lexer
 base_lexer (interpreter &interp)
 
virtual ~base_lexer ()
 
bool at_end_of_buffer () const
 
bool at_end_of_file () const
 
void begin_string (int state)
 
void check_comment_for_hash_char (const char *txt, std::size_t len)
 
void clear_start_state ()
 
int count_token (int tok)
 
int count_token_internal (int tok)
 
tokencurrent_token ()
 
bool debug_flag () const
 
void display_start_state () const
 
void display_token (int tok)
 
bool display_tokens () const
 
void fatal_error (const char *msg)
 
int finish_command_arg ()
 
void finish_comment (comment_elt::comment_type typ)
 
int flex_yyleng ()
 
char * flex_yytext ()
 
bool fq_identifier_contains_keyword (const std::string &s)
 
comment_listget_comment ()
 
int handle_close_bracket (int bracket_type)
 
void handle_continuation ()
 
int handle_end_of_input ()
 
int handle_fq_identifier ()
 
int handle_identifier ()
 
int handle_meta_identifier ()
 
template<>
int handle_number ()
 
template<>
int handle_number ()
 
template<>
int handle_number ()
 
template<int base>
int handle_number ()
 
template<>
int handle_number ()
 
template<>
int handle_number ()
 
template<>
int handle_number ()
 
int handle_op (int tok, bool bos=false, bool compat=true)
 
int handle_superclass_identifier ()
 
int handle_token (int tok, token *tok_val=nullptr)
 
void increment_token_count ()
 
void init ()
 
bool input_from_tmp_history_file ()
 
bool inside_any_object_index ()
 
virtual bool is_push_lexer () const
 
void lexer_debug (const char *pattern)
 
bool looking_at_space ()
 
bool looks_like_command_arg ()
 
int make_keyword_token (const std::string &s)
 
bool maybe_unput_comma_before_unary_op (int tok)
 
void maybe_warn_language_extension_comment (char c)
 
void maybe_warn_separator_insert (char sep)
 
std::size_t pending_token_count () const
 
void pop_start_state ()
 
void prep_for_file ()
 
void push_start_state (int state)
 
void push_token (token *)
 
int show_token (int tok)
 
int start_state () const
 
int text_yyinput ()
 
void update_token_positions (int tok_len)
 
void warn_deprecated_syntax (const std::string &msg)
 
void warn_language_extension (const std::string &msg)
 
void warn_language_extension_continuation ()
 
void warn_language_extension_operator (const std::string &op)
 
bool whitespace_is_significant ()
 
void xunput (char c)
 
void xunput (char c, char *buf)
 

Public Attributes

bool m_initial_input
 
input_reader m_reader
 
- Public Attributes inherited from base_lexer
comment_buffer m_comment_buf
 
input_buffer m_input_buf
 
void * m_scanner
 

Additional Inherited Members

- Protected Attributes inherited from base_lexer
std::stack< int > start_state_stack
 

Detailed Description

Definition at line 758 of file lex.h.

Constructor & Destructor Documentation

◆ lexer() [1/4]

lexer::lexer ( interpreter interp)
inline

Definition at line 763 of file lex.h.

◆ lexer() [2/4]

lexer::lexer ( FILE *  file,
interpreter interp 
)
inline

Definition at line 767 of file lex.h.

◆ lexer() [3/4]

lexer::lexer ( FILE *  file,
interpreter interp,
const std::string &  encoding 
)
inline

Definition at line 771 of file lex.h.

◆ lexer() [4/4]

lexer::lexer ( const std::string &  eval_string,
interpreter interp 
)
inline

Definition at line 776 of file lex.h.

◆ ~lexer()

lexer::~lexer ( )
default

Member Function Documentation

◆ fill_flex_buffer()

◆ input_from_eval_string()

bool lexer::input_from_eval_string ( ) const
inlinevirtual

Reimplemented from base_lexer.

Definition at line 807 of file lex.h.

◆ input_from_file()

bool lexer::input_from_file ( ) const
inlinevirtual

Reimplemented from base_lexer.

Definition at line 802 of file lex.h.

◆ input_from_terminal()

bool lexer::input_from_terminal ( ) const
inlinevirtual

Reimplemented from base_lexer.

Definition at line 797 of file lex.h.

◆ input_source()

std::string lexer::input_source ( ) const
inlinevirtual

Reimplemented from base_lexer.

Definition at line 792 of file lex.h.

◆ reset()

void lexer::reset ( )
inlinevirtual

Reimplemented from base_lexer.

Definition at line 785 of file lex.h.

References base_lexer::reset().

Member Data Documentation

◆ m_initial_input

bool lexer::m_initial_input

Definition at line 821 of file lex.h.

◆ m_reader

input_reader lexer::m_reader

Definition at line 814 of file lex.h.


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