sapphirec
The Sapphire documentation
Token Struct Reference

#include <Token.h>

Public Member Functions

 Token (const TokenType &type)
 
 Token (const TokenType &type, const Location &location)
 
 Token (const TokenType &type, const int &val, const Location &location)
 
 Token (const TokenType &type, const std::string &val, const Location &location)
 
 Token (const TokenType &type, const std::string &val)
 
 Token (const TokenType &type, const float &val, const Location &location)
 
 ~Token ()
 
std::string to_string () const
 
std::string line () const
 
void operator= (const Token &other)
 
Token copy_with_new_type (const TokenType &type)
 

Static Public Member Functions

static Token make_with_line (const Token &origin, const std::string &line_text)
 
static void erase (Token &tk)
 
static bool match_token_types (const std::vector< Token > &a, const std::vector< Token > &b, int count)
 

Public Attributes

TokenType tk_type
 
int int_value
 
std::string string_value
 
float float_value
 
Location loc
 

Constructor & Destructor Documentation

◆ Token() [1/6]

Token::Token ( const TokenType type)

◆ Token() [2/6]

Token::Token ( const TokenType type,
const Location location 
)

◆ Token() [3/6]

Token::Token ( const TokenType type,
const int &  val,
const Location location 
)

◆ Token() [4/6]

Token::Token ( const TokenType type,
const std::string &  val,
const Location location 
)

◆ Token() [5/6]

Token::Token ( const TokenType type,
const std::string &  val 
)

◆ Token() [6/6]

Token::Token ( const TokenType type,
const float &  val,
const Location location 
)

◆ ~Token()

Token::~Token ( )

Member Function Documentation

◆ copy_with_new_type()

Token Token::copy_with_new_type ( const TokenType type)

◆ erase()

void Token::erase ( Token tk)
static

◆ line()

std::string Token::line ( ) const

◆ make_with_line()

Token Token::make_with_line ( const Token origin,
const std::string &  line_text 
)
static

◆ match_token_types()

bool Token::match_token_types ( const std::vector< Token > &  a,
const std::vector< Token > &  b,
int  count 
)
static

◆ operator=()

void Token::operator= ( const Token other)

◆ to_string()

std::string Token::to_string ( ) const

Member Data Documentation

◆ float_value

float Token::float_value

◆ int_value

int Token::int_value

◆ loc

Location Token::loc

◆ string_value

std::string Token::string_value

◆ tk_type

TokenType Token::tk_type

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