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

#include "token.h"

Collaboration diagram for token:

Classes

union  tok_info
 

Public Types

enum  end_tok_type {
  simple_end , arguments_end , classdef_end , enumeration_end ,
  events_end , for_end , function_end , if_end ,
  methods_end , parfor_end , properties_end , switch_end ,
  try_catch_end , unwind_protect_end , spmd_end , while_end
}
 
enum  token_type {
  generic_token , keyword_token , string_token , numeric_token ,
  ettype_token , scls_name_token
}
 

Public Member Functions

 token (const token &)=delete
 
 token (int tv, bool is_keyword, const filepos &beg_pos, const filepos &end_pos)
 
 token (int tv, const char *s, const filepos &beg_pos, const filepos &end_pos)
 
 token (int tv, const filepos &beg_pos, const filepos &end_pos)
 
 token (int tv, const octave_value &val, const std::string &s, const filepos &beg_pos, const filepos &end_pos)
 
 token (int tv, const std::string &mth, const std::string &cls, const filepos &beg_pos, const filepos &end_pos)
 
 token (int tv, const std::string &s, const filepos &beg_pos, const filepos &end_pos)
 
 token (int tv, end_tok_type t, const filepos &beg_pos, const filepos &end_pos)
 
 ~token (void)
 
void beg_pos (const filepos &pos)
 
filepos beg_pos (void) const
 
int column (void) const
 
void end_pos (const filepos &pos)
 
filepos end_pos (void) const
 
end_tok_type ettype (void) const
 
bool iskeyword (void) const
 
bool isstring (void) const
 
int line (void) const
 
void mark_may_be_command (void)
 
void mark_trailing_space (void)
 
bool may_be_command (void) const
 
octave_value number (void) const
 
tokenoperator= (const token &)=delete
 
bool space_follows_token (void) const
 
std::string superclass_class_name (void) const
 
std::string superclass_method_name (void) const
 
std::string text (void) const
 
std::string text_rep (void) const
 
int token_value (void) const
 
bool token_value_is (int tv) const
 
token_type ttype (void) const
 

Private Attributes

filepos m_beg_pos
 
filepos m_end_pos
 
bool m_maybe_cmd
 
std::string m_orig_text
 
tok_info m_tok_info
 
int m_tok_val
 
bool m_tspc
 
token_type m_type_tag
 

Detailed Description

Definition at line 38 of file token.h.

Member Enumeration Documentation

◆ end_tok_type

Enumerator
simple_end 
arguments_end 
classdef_end 
enumeration_end 
events_end 
for_end 
function_end 
if_end 
methods_end 
parfor_end 
properties_end 
switch_end 
try_catch_end 
unwind_protect_end 
spmd_end 
while_end 

Definition at line 52 of file token.h.

◆ token_type

Enumerator
generic_token 
keyword_token 
string_token 
numeric_token 
ettype_token 
scls_name_token 

Definition at line 42 of file token.h.

Constructor & Destructor Documentation

◆ token() [1/8]

token::token ( int  tv,
const filepos beg_pos,
const filepos end_pos 
)

Definition at line 37 of file token.cc.

◆ token() [2/8]

token::token ( int  tv,
bool  is_keyword,
const filepos beg_pos,
const filepos end_pos 
)

Definition at line 43 of file token.cc.

◆ token() [3/8]

token::token ( int  tv,
const char *  s,
const filepos beg_pos,
const filepos end_pos 
)

Definition at line 51 of file token.cc.

◆ token() [4/8]

token::token ( int  tv,
const std::string &  s,
const filepos beg_pos,
const filepos end_pos 
)

Definition at line 58 of file token.cc.

◆ token() [5/8]

token::token ( int  tv,
const octave_value val,
const std::string &  s,
const filepos beg_pos,
const filepos end_pos 
)

Definition at line 65 of file token.cc.

◆ token() [6/8]

token::token ( int  tv,
end_tok_type  t,
const filepos beg_pos,
const filepos end_pos 
)

Definition at line 72 of file token.cc.

◆ token() [7/8]

token::token ( int  tv,
const std::string &  mth,
const std::string &  cls,
const filepos beg_pos,
const filepos end_pos 
)

Definition at line 79 of file token.cc.

◆ token() [8/8]

token::token ( const token )
delete

◆ ~token()

Member Function Documentation

◆ beg_pos() [1/2]

void token::beg_pos ( const filepos pos)
inline

Definition at line 112 of file token.h.

◆ beg_pos() [2/2]

filepos token::beg_pos ( void  ) const
inline

◆ column()

◆ end_pos() [1/2]

void token::end_pos ( const filepos pos)
inline

Definition at line 113 of file token.h.

◆ end_pos() [2/2]

filepos token::end_pos ( void  ) const
inline

Definition at line 110 of file token.h.

◆ ettype()

token::end_tok_type token::ettype ( void  ) const

◆ iskeyword()

bool token::iskeyword ( void  ) const
inline

Definition at line 119 of file token.h.

Referenced by lexical_feedback::previous_token_is_keyword().

◆ isstring()

bool token::isstring ( void  ) const
inline

Definition at line 124 of file token.h.

◆ line()

◆ mark_may_be_command()

void token::mark_may_be_command ( void  )
inline

Definition at line 100 of file token.h.

Referenced by base_lexer::handle_identifier().

◆ mark_trailing_space()

void token::mark_trailing_space ( void  )
inline

Definition at line 103 of file token.h.

Referenced by lexical_feedback::mark_previous_token_trailing_space().

◆ may_be_command()

bool token::may_be_command ( void  ) const
inline

Definition at line 101 of file token.h.

Referenced by lexical_feedback::previous_token_may_be_command().

◆ number()

octave_value token::number ( void  ) const

◆ operator=()

token& token::operator= ( const token )
delete

◆ space_follows_token()

bool token::space_follows_token ( void  ) const
inline

Definition at line 104 of file token.h.

Referenced by lexical_feedback::space_follows_previous_token().

◆ superclass_class_name()

std::string token::superclass_class_name ( void  ) const

◆ superclass_method_name()

std::string token::superclass_method_name ( void  ) const

◆ text()

◆ text_rep()

std::string token::text_rep ( void  ) const

Definition at line 138 of file token.cc.

References m_orig_text.

Referenced by base_parser::make_constant().

◆ token_value()

int token::token_value ( void  ) const
inline

Definition at line 106 of file token.h.

Referenced by base_parser::make_constant(), and lexical_feedback::previous_token_value().

◆ token_value_is()

bool token::token_value_is ( int  tv) const
inline

Definition at line 107 of file token.h.

Referenced by lexical_feedback::previous_token_value_is().

◆ ttype()

token::token_type token::ttype ( void  ) const

Definition at line 111 of file token.cc.

References m_type_tag.

Member Data Documentation

◆ m_beg_pos

filepos token::m_beg_pos
private

Definition at line 142 of file token.h.

◆ m_end_pos

filepos token::m_end_pos
private

Definition at line 143 of file token.h.

◆ m_maybe_cmd

bool token::m_maybe_cmd
private

Definition at line 138 of file token.h.

◆ m_orig_text

std::string token::m_orig_text
private

Definition at line 208 of file token.h.

Referenced by text_rep().

◆ m_tok_info

tok_info token::m_tok_info
private

Definition at line 206 of file token.h.

Referenced by ~token(), ettype(), number(), superclass_class_name(), superclass_method_name(), and text().

◆ m_tok_val

int token::m_tok_val
private

Definition at line 145 of file token.h.

◆ m_tspc

bool token::m_tspc
private

Definition at line 140 of file token.h.

◆ m_type_tag

token_type token::m_type_tag
private

Definition at line 147 of file token.h.

Referenced by ~token(), ettype(), number(), superclass_class_name(), superclass_method_name(), text(), and ttype().


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