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 Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
token Class Reference

#include "token.h"

Collaboration diagram for token:
Collaboration graph
[legend]

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, while_end,
  try_catch_end, unwind_protect_end
}
enum  token_type {
  generic_token, keyword_token, string_token, double_token,
  ettype_token, sym_rec_token, scls_rec_token, meta_rec_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 std::string &s, int l=-1, int c=-1)
 token (int tv, double d, const std::string &s=std::string(), int l=-1, int c=-1)
 token (int tv, end_tok_type t, int l=-1, int c=-1)
 token (int tv, symbol_table::symbol_record *s, int l=-1, int c=-1)
 token (int tv, symbol_table::symbol_record *cls, symbol_table::symbol_record *pkg, int l=-1, int c=-1)
 token (int tv, symbol_table::symbol_record *mth, symbol_table::symbol_record *cls, symbol_table::symbol_record *pkg, int l=-1, int c=-1)
 ~token (void)
symbol_table::symbol_recordclass_rec (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
symbol_table::symbol_recordmeta_class_rec (void)
symbol_table::symbol_recordmeta_package_rec (void)
symbol_table::symbol_recordmethod_rec (void)
double number (void) const
symbol_table::symbol_recordpackage_rec (void)
bool space_follows_token (void) const
symbol_table::symbol_recordsym_rec (void)
std::string symbol_name (void) const
std::string text (void) const
std::string text_rep (void)
int token_value (void) const
bool token_value_is (int tv) const
token_type ttype (void) const

Private Member Functions

 token (const token &tok)
tokenoperator= (const token &tok)

Private Attributes

union {
   end_tok_type   et
   struct {
      symbol_table::symbol_record *   cr
      symbol_table::symbol_record *   pr
   }   mc
   double   num
   struct {
      symbol_table::symbol_record *   cr
      symbol_table::symbol_record *   mr
      symbol_table::symbol_record *   pr
   }   sc
   symbol_table::symbol_record *   sr
   std::string *   str
}; 
int column_num
int line_num
bool maybe_cmd
std::string orig_text
int tok_val
bool tspc
token_type type_tag

Detailed Description

Definition at line 30 of file token.h.

Member Enumeration Documentation

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

Definition at line 47 of file token.h.

Enumerator:
generic_token 
keyword_token 
string_token 
double_token 
ettype_token 
sym_rec_token 
scls_rec_token 
meta_rec_token 

Definition at line 35 of file token.h.

Constructor & Destructor Documentation

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

Definition at line 35 of file token.cc.

References column_num, generic_token, line_num, maybe_cmd, tok_val, tspc, and type_tag.

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

Definition at line 45 of file token.cc.

References column_num, generic_token, keyword_token, line_num, maybe_cmd, tok_val, tspc, and type_tag.

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

Definition at line 55 of file token.cc.

References column_num, line_num, maybe_cmd, str, string_token, tok_val, tspc, and type_tag.

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

Definition at line 66 of file token.cc.

References column_num, d, double_token, line_num, maybe_cmd, num, orig_text, tok_val, tspc, and type_tag.

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

Definition at line 78 of file token.cc.

References column_num, et, ettype_token, line_num, maybe_cmd, tok_val, tspc, and type_tag.

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

Definition at line 89 of file token.cc.

References column_num, line_num, maybe_cmd, sr, sym_rec_token, tok_val, tspc, and type_tag.

token::token ( int  tv,
symbol_table::symbol_record cls,
symbol_table::symbol_record pkg,
int  l = -1,
int  c = -1 
)

Definition at line 100 of file token.cc.

References column_num, line_num, maybe_cmd, mc, meta_rec_token, tok_val, tspc, and type_tag.

token::token ( int  tv,
symbol_table::symbol_record mth,
symbol_table::symbol_record cls,
symbol_table::symbol_record pkg,
int  l = -1,
int  c = -1 
)

Definition at line 113 of file token.cc.

References column_num, line_num, maybe_cmd, sc, scls_rec_token, tok_val, tspc, and type_tag.

token::~token ( void  )

Definition at line 128 of file token.cc.

References str, string_token, and type_tag.

token::token ( const token tok)
private

Member Function Documentation

symbol_table::symbol_record * token::class_rec ( void  )

Definition at line 183 of file token.cc.

References sc, scls_rec_token, and type_tag.

int token::column ( void  ) const
inline

Definition at line 90 of file token.h.

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

Definition at line 162 of file token.cc.

References et, ettype_token, and type_tag.

bool token::is_keyword ( void  ) const
inline

Definition at line 92 of file token.h.

Referenced by lexical_feedback::previous_token_is_keyword().

bool token::is_symbol ( void  ) const
inline

Definition at line 97 of file token.h.

Referenced by lexical_feedback::maybe_mark_previous_token_as_variable().

int token::line ( void  ) const
inline

Definition at line 89 of file token.h.

void token::mark_may_be_command ( void  )
inline

Definition at line 80 of file token.h.

Referenced by octave_base_lexer::handle_identifier().

void token::mark_trailing_space ( void  )
inline

Definition at line 83 of file token.h.

Referenced by lexical_feedback::mark_previous_token_trailing_space().

bool token::may_be_command ( void  ) const
inline

Definition at line 81 of file token.h.

Referenced by lexical_feedback::previous_token_may_be_command().

symbol_table::symbol_record * token::meta_class_rec ( void  )

Definition at line 197 of file token.cc.

References mc, meta_rec_token, and type_tag.

symbol_table::symbol_record * token::meta_package_rec ( void  )

Definition at line 204 of file token.cc.

References mc, meta_rec_token, and type_tag.

symbol_table::symbol_record * token::method_rec ( void  )

Definition at line 176 of file token.cc.

References sc, scls_rec_token, and type_tag.

double token::number ( void  ) const

Definition at line 149 of file token.cc.

References double_token, num, and type_tag.

Referenced by octave_base_lexer::display_token().

token& token::operator= ( const token tok)
private
symbol_table::symbol_record * token::package_rec ( void  )

Definition at line 190 of file token.cc.

References sc, scls_rec_token, and type_tag.

bool token::space_follows_token ( void  ) const
inline

Definition at line 84 of file token.h.

Referenced by lexical_feedback::space_follows_previous_token().

symbol_table::symbol_record * token::sym_rec ( void  )

Definition at line 169 of file token.cc.

References sr, sym_rec_token, and type_tag.

Referenced by octave_base_lexer::display_token().

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

Definition at line 135 of file token.cc.

References str, string_token, and type_tag.

Referenced by octave_base_lexer::display_token().

std::string token::text_rep ( void  )

Definition at line 211 of file token.cc.

References orig_text.

int token::token_value ( void  ) const
inline

Definition at line 86 of file token.h.

Referenced by lexical_feedback::previous_token_value().

bool token::token_value_is ( int  tv) const
inline

Definition at line 87 of file token.h.

Referenced by lexical_feedback::previous_token_value_is().

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

Definition at line 156 of file token.cc.

References type_tag.

Member Data Documentation

union { ... }
int token::column_num
private

Definition at line 129 of file token.h.

Referenced by token().

Definition at line 141 of file token.h.

end_tok_type token::et

Definition at line 136 of file token.h.

Referenced by ettype(), and token().

int token::line_num
private

Definition at line 128 of file token.h.

Referenced by token().

bool token::maybe_cmd
private

Definition at line 126 of file token.h.

Referenced by token().

struct { ... } token::mc

Definition at line 140 of file token.h.

double token::num

Definition at line 135 of file token.h.

Referenced by number(), and token().

std::string token::orig_text
private

Definition at line 150 of file token.h.

Referenced by text_rep(), and token().

Definition at line 142 of file token.h.

struct { ... } token::sc

Definition at line 137 of file token.h.

Referenced by sym_rec(), symbol_name(), and token().

std::string* token::str

Definition at line 134 of file token.h.

Referenced by text(), token(), and ~token().

int token::tok_val
private

Definition at line 130 of file token.h.

Referenced by token().

bool token::tspc
private

Definition at line 127 of file token.h.

Referenced by token().

token_type token::type_tag
private

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