Empirical
Public Member Functions | Public Attributes | List of all members
emp::Token Struct Reference

Information about a token instance from an input stream. More...

#include <Lexer.h>

Public Member Functions

 Token (size_t id, const std::string &str="")
 
 Token (const Token &)=default
 
Tokenoperator= (const Token &)=default
 
 operator size_t ()
 Token will automatically convert to its ID if used as an unsigned int. More...
 
 operator const std::string & ()
 Token will automatically convert to its matched sequence (lexeme) is used as a string. More...
 

Public Attributes

size_t token_id
 Which type of token is this? More...
 
std::string lexeme
 The specific sequence matched by this token. More...
 

Detailed Description

Information about a token instance from an input stream.

Constructor & Destructor Documentation

emp::Token::Token ( size_t  id,
const std::string &  str = "" 
)
inline
emp::Token::Token ( const Token )
default

Member Function Documentation

emp::Token::operator const std::string & ( )
inline

Token will automatically convert to its matched sequence (lexeme) is used as a string.

emp::Token::operator size_t ( )
inline

Token will automatically convert to its ID if used as an unsigned int.

Token& emp::Token::operator= ( const Token )
default

Member Data Documentation

std::string emp::Token::lexeme

The specific sequence matched by this token.

size_t emp::Token::token_id

Which type of token is this?


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