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

#include "token.h"

Collaboration diagram for octave::token:

Classes

union  tok_info
 

Public Types

enum  end_tok_type {
  simple_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, while_end
}
 
enum  token_type {
  generic_token, keyword_token, string_token, double_token,
  ettype_token, sym_rec_token, scls_name_token
}
 

Public Member Functions

 token (int tv, int l=-1, int c=-1)
 
 token (int tv, bool is_keyword, int l=-1, int c=-1)
 
 token (int tv, const char *s, int l=-1, int c=-1)
 
 token (int tv, const std::string &s, int l=-1, int c=-1)
 
 token (int tv, double d, const std::string &s="", int l=-1, int c=-1)
 
 token (int tv, end_tok_type t, int l=-1, int c=-1)
 
 token (int tv, const symbol_record &s, int l=-1, int c=-1)
 
 token (int tv, const std::string &mth, const std::string &cls, int l=-1, int c=-1)
 
 token (const token &)=delete
 
 ~token (void)
 
int column (void) const
 
end_tok_type ettype (void) const
 
bool is_keyword (void) const
 
bool is_symbol (void) const
 
int line (void) const
 
void mark_may_be_command (void)
 
void mark_trailing_space (void)
 
bool may_be_command (void) const
 
double 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
 
symbol_record sym_rec (void) const
 
std::string symbol_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

int m_column_num
 
int m_line_num
 
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 34 of file token.h.

Member Enumeration Documentation

◆ end_tok_type

Enumerator
simple_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 
while_end 

Definition at line 50 of file token.h.

◆ token_type

Enumerator
generic_token 
keyword_token 
string_token 
double_token 
ettype_token 
sym_rec_token 
scls_name_token 

Definition at line 39 of file token.h.

Constructor & Destructor Documentation

◆ token() [1/9]

octave::token::token ( int  tv,
int  l = -1,
int  c = -1 
)

Definition at line 34 of file token.cc.

◆ token() [2/9]

octave::token::token ( int  tv,
bool  is_keyword,
int  l = -1,
int  c = -1 
)

Definition at line 40 of file token.cc.

◆ token() [3/9]

octave::token::token ( int  tv,
const char *  s,
int  l = -1,
int  c = -1 
)

Definition at line 46 of file token.cc.

◆ token() [4/9]

octave::token::token ( int  tv,
const std::string s,
int  l = -1,
int  c = -1 
)

Definition at line 52 of file token.cc.

◆ token() [5/9]

octave::token::token ( int  tv,
double  d,
const std::string s = "",
int  l = -1,
int  c = -1 
)

Definition at line 58 of file token.cc.

◆ token() [6/9]

octave::token::token ( int  tv,
end_tok_type  t,
int  l = -1,
int  c = -1 
)

Definition at line 64 of file token.cc.

◆ token() [7/9]

octave::token::token ( int  tv,
const symbol_record s,
int  l = -1,
int  c = -1 
)

Definition at line 70 of file token.cc.

◆ token() [8/9]

octave::token::token ( int  tv,
const std::string mth,
const std::string cls,
int  l = -1,
int  c = -1 
)

Definition at line 76 of file token.cc.

◆ token() [9/9]

octave::token::token ( const token )
delete

◆ ~token()

Member Function Documentation

◆ column()

int octave::token::column ( void  ) const
inline

Definition at line 98 of file token.h.

◆ ettype()

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

Definition at line 123 of file token.cc.

References ettype_token, octave::token::tok_info::m_et, m_tok_info, and m_type_tag.

◆ is_keyword()

bool octave::token::is_keyword ( void  ) const
inline

Definition at line 100 of file token.h.

◆ is_symbol()

bool octave::token::is_symbol ( void  ) const
inline

Definition at line 105 of file token.h.

◆ line()

int octave::token::line ( void  ) const
inline

Definition at line 97 of file token.h.

◆ mark_may_be_command()

void octave::token::mark_may_be_command ( void  )
inline

Definition at line 88 of file token.h.

◆ mark_trailing_space()

void octave::token::mark_trailing_space ( void  )
inline

Definition at line 91 of file token.h.

◆ may_be_command()

bool octave::token::may_be_command ( void  ) const
inline

Definition at line 89 of file token.h.

◆ number()

double octave::token::number ( void  ) const

Definition at line 110 of file token.cc.

References double_token, octave::token::tok_info::m_num, m_tok_info, and m_type_tag.

◆ operator=()

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

◆ space_follows_token()

bool octave::token::space_follows_token ( void  ) const
inline

Definition at line 92 of file token.h.

◆ superclass_class_name()

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

◆ superclass_method_name()

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

◆ sym_rec()

symbol_record octave::token::sym_rec ( void  ) const

Definition at line 130 of file token.cc.

References octave::token::tok_info::m_sr, m_tok_info, m_type_tag, and sym_rec_token.

◆ symbol_name()

std::string octave::token::symbol_name ( void  ) const

◆ text()

std::string octave::token::text ( void  ) const

Definition at line 96 of file token.cc.

References octave::token::tok_info::m_str, m_tok_info, m_type_tag, and string_token.

◆ text_rep()

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

Definition at line 151 of file token.cc.

References m_orig_text.

◆ token_value()

int octave::token::token_value ( void  ) const
inline

Definition at line 94 of file token.h.

◆ token_value_is()

bool octave::token::token_value_is ( int  tv) const
inline

Definition at line 95 of file token.h.

◆ ttype()

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

Definition at line 117 of file token.cc.

References m_type_tag.

Member Data Documentation

◆ m_column_num

int octave::token::m_column_num
private

Definition at line 130 of file token.h.

◆ m_line_num

int octave::token::m_line_num
private

Definition at line 128 of file token.h.

◆ m_maybe_cmd

bool octave::token::m_maybe_cmd
private

Definition at line 124 of file token.h.

◆ m_orig_text

std::string octave::token::m_orig_text
private

Definition at line 194 of file token.h.

Referenced by text_rep().

◆ m_tok_info

tok_info octave::token::m_tok_info
private

◆ m_tok_val

int octave::token::m_tok_val
private

Definition at line 132 of file token.h.

◆ m_tspc

bool octave::token::m_tspc
private

Definition at line 126 of file token.h.

◆ m_type_tag

token_type octave::token::m_type_tag
private

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