vkdb
A time series database engine in C++.
Loading...
Searching...
No Matches
vkdb::Token Class Reference

Represents a token. More...

#include <token.h>

Public Types

using size_type = uint64_t
 

Public Member Functions

 Token ()=delete
 Deleted default constructor.
 
 Token (TokenType type, const Lexeme &lexeme, size_type line, size_type column) noexcept
 Construct a Token object from the given type, lexeme, line, and column.
 
 Token (Token &&) noexcept=default
 Move-construct a Token object.
 
Tokenoperator= (Token &&) noexcept=default
 Move-assign a Token object.
 
 Token (const Token &) noexcept=default
 Copy-construct a Token object.
 
Tokenoperator= (const Token &) noexcept=default
 Copy-assign a Token object.
 
 ~Token () noexcept=default
 Destroy the Token object.
 
bool operator== (const Token &other) const noexcept
 Equality operator for Token objects.
 
TokenType type () const noexcept
 Get the type of the token.
 
Lexeme lexeme () const noexcept
 Get the lexeme of the token.
 
size_type line () const noexcept
 Get the line number of the token.
 
size_type column () const noexcept
 Get the column number of the token.
 
std::string str () const noexcept
 Get the string representation of the token.
 

Detailed Description

Represents a token.

Definition at line 81 of file token.h.

Member Typedef Documentation

◆ size_type

using vkdb::Token::size_type = uint64_t

Definition at line 83 of file token.h.

Constructor & Destructor Documentation

◆ Token()

vkdb::Token::Token ( TokenType type,
const Lexeme & lexeme,
Token::size_type line,
Token::size_type column )
explicitnoexcept

Construct a Token object from the given type, lexeme, line, and column.

Parameters
typeThe type of the token.
lexemeThe lexeme of the token.
lineThe line number of the token.
columnThe column number of the token.

Definition at line 4 of file token.cpp.

Member Function Documentation

◆ column()

Token::size_type vkdb::Token::column ( ) const
nodiscardnoexcept

Get the column number of the token.

Returns
size_type The column number of the token.

Definition at line 34 of file token.cpp.

◆ lexeme()

Lexeme vkdb::Token::lexeme ( ) const
nodiscardnoexcept

Get the lexeme of the token.

Returns
Lexeme The lexeme of the token.

Definition at line 26 of file token.cpp.

◆ line()

Token::size_type vkdb::Token::line ( ) const
nodiscardnoexcept

Get the line number of the token.

Returns
size_type The line number of the token.

Definition at line 30 of file token.cpp.

◆ operator==()

bool vkdb::Token::operator== ( const Token & other) const
nodiscardnoexcept

Equality operator for Token objects.

Parameters
otherThe other Token object.
Returns
true if the Token objects are equal.
false if the Token objects are not equal.

Definition at line 15 of file token.cpp.

◆ str()

std::string vkdb::Token::str ( ) const
nodiscardnoexcept

Get the string representation of the token.

Returns
std::string The string representation of the token.

Definition at line 38 of file token.cpp.

◆ type()

TokenType vkdb::Token::type ( ) const
nodiscardnoexcept

Get the type of the token.

Returns
TokenType The type of the token.

Definition at line 22 of file token.cpp.


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