GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
token Class Reference

#include "token.h"

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 {
  invalid_token , generic_token , keyword_token , string_token ,
  numeric_token , ettype_token , scls_name_token
}
 

Public Member Functions

 token ()
 
 token (int id, bool is_kw, const filepos &beg_pos, const filepos &end_pos, const comment_list &lst=comment_list())
 
 token (int id, const char *s, const filepos &beg_pos, const filepos &end_pos, const comment_list &lst=comment_list())
 
 token (int id, const filepos &beg_pos, const filepos &end_pos, const comment_list &lst=comment_list())
 
 token (int id, const octave_value &val, const std::string &s, const filepos &beg_pos, const filepos &end_pos, const comment_list &lst=comment_list())
 
 token (int id, const std::string &meth, const std::string &cls, const filepos &beg_pos, const filepos &end_pos, const comment_list &lst=comment_list())
 
 token (int id, const std::string &s, const filepos &beg_pos, const filepos &end_pos, const comment_list &lst=comment_list())
 
 token (int id, end_tok_type t, const filepos &beg_pos, const filepos &end_pos, const comment_list &lst=comment_list())
 
filepos beg_pos () const
 
void beg_pos (const filepos &pos)
 
int column () const
 
filepos end_pos () const
 
void end_pos (const filepos &pos)
 
end_tok_type ettype () const
 
bool iskeyword () const
 
bool isstring () const
 
comment_list leading_comments () const
 
void leading_comments (const comment_list &lst)
 
int line () const
 
void mark_may_be_command ()
 
void mark_trailing_space ()
 
bool may_be_command () const
 
octave_value number () const
 
 operator bool () const
 
bool space_follows_token () const
 
std::string superclass_class_name () const
 
std::string superclass_method_name () const
 
std::string text () const
 
std::string text_rep () const
 
int token_id () const
 
bool token_is (const token *tok) const
 
bool token_is (int id) const
 
comment_list trailing_comments () const
 
void trailing_comments (const comment_list &lst)
 
token_type ttype () const
 

Detailed Description

Definition at line 41 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 56 of file token.h.

◆ token_type

Enumerator
invalid_token 
generic_token 
keyword_token 
string_token 
numeric_token 
ettype_token 
scls_name_token 

Definition at line 45 of file token.h.

Constructor & Destructor Documentation

◆ token() [1/8]

token::token ( )
inline

Definition at line 78 of file token.h.

◆ token() [2/8]

token::token ( int  id,
const filepos beg_pos,
const filepos end_pos,
const comment_list lst = comment_list () 
)
inline

Definition at line 82 of file token.h.

◆ token() [3/8]

token::token ( int  id,
bool  is_kw,
const filepos beg_pos,
const filepos end_pos,
const comment_list lst = comment_list () 
)
inline

Definition at line 86 of file token.h.

◆ token() [4/8]

token::token ( int  id,
const char *  s,
const filepos beg_pos,
const filepos end_pos,
const comment_list lst = comment_list () 
)
inline

Definition at line 90 of file token.h.

◆ token() [5/8]

token::token ( int  id,
const std::string &  s,
const filepos beg_pos,
const filepos end_pos,
const comment_list lst = comment_list () 
)
inline

Definition at line 94 of file token.h.

◆ token() [6/8]

token::token ( int  id,
const octave_value val,
const std::string &  s,
const filepos beg_pos,
const filepos end_pos,
const comment_list lst = comment_list () 
)
inline

Definition at line 98 of file token.h.

◆ token() [7/8]

token::token ( int  id,
end_tok_type  t,
const filepos beg_pos,
const filepos end_pos,
const comment_list lst = comment_list () 
)
inline

Definition at line 102 of file token.h.

◆ token() [8/8]

token::token ( int  id,
const std::string &  meth,
const std::string &  cls,
const filepos beg_pos,
const filepos end_pos,
const comment_list lst = comment_list () 
)
inline

Definition at line 106 of file token.h.

Member Function Documentation

◆ beg_pos() [1/2]

◆ beg_pos() [2/2]

void token::beg_pos ( const filepos pos)
inline

Definition at line 131 of file token.h.

◆ column()

int token::column ( ) const
inline

Definition at line 142 of file token.h.

◆ end_pos() [1/2]

◆ end_pos() [2/2]

void token::end_pos ( const filepos pos)
inline

Definition at line 132 of file token.h.

◆ ettype()

end_tok_type token::ettype ( ) const
inline

Definition at line 154 of file token.h.

Referenced by base_parser::end_token_error(), and base_parser::end_token_ok().

◆ iskeyword()

bool token::iskeyword ( ) const
inline

Definition at line 144 of file token.h.

Referenced by lexical_feedback::previous_token_is_keyword().

◆ isstring()

bool token::isstring ( ) const
inline

Definition at line 149 of file token.h.

◆ leading_comments() [1/2]

◆ leading_comments() [2/2]

void token::leading_comments ( const comment_list lst)
inline

Definition at line 137 of file token.h.

◆ line()

int token::line ( ) const
inline

Definition at line 141 of file token.h.

◆ mark_may_be_command()

void token::mark_may_be_command ( )
inline

Definition at line 112 of file token.h.

Referenced by base_lexer::handle_identifier().

◆ mark_trailing_space()

void token::mark_trailing_space ( )
inline

Definition at line 115 of file token.h.

Referenced by lexical_feedback::mark_previous_token_trailing_space().

◆ may_be_command()

bool token::may_be_command ( ) const
inline

Definition at line 113 of file token.h.

Referenced by lexical_feedback::previous_token_may_be_command().

◆ number()

octave_value token::number ( ) const
inline

Definition at line 152 of file token.h.

Referenced by base_lexer::display_token(), and base_parser::make_constant().

◆ operator bool()

token::operator bool ( ) const
inline

Definition at line 118 of file token.h.

◆ space_follows_token()

bool token::space_follows_token ( ) const
inline

Definition at line 116 of file token.h.

Referenced by lexical_feedback::space_follows_previous_token().

◆ superclass_class_name()

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

Definition at line 157 of file token.h.

Referenced by base_parser::make_superclass_ref().

◆ superclass_method_name()

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

Definition at line 156 of file token.h.

Referenced by base_parser::make_superclass_ref().

◆ text()

◆ text_rep()

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

Definition at line 159 of file token.h.

Referenced by base_parser::make_constant().

◆ token_id()

◆ token_is() [1/2]

bool token::token_is ( const token tok) const
inline

Definition at line 123 of file token.h.

References token_id().

◆ token_is() [2/2]

bool token::token_is ( int  id) const
inline

◆ trailing_comments() [1/2]

comment_list token::trailing_comments ( ) const
inline

◆ trailing_comments() [2/2]

void token::trailing_comments ( const comment_list lst)
inline

Definition at line 138 of file token.h.

◆ ttype()

token_type token::ttype ( ) const
inline

Definition at line 153 of file token.h.


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