mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Data Fields | Private Member Functions | Friends
m::ast::Token Struct Reference

#include <Token.hpp>

Collaboration diagram for m::ast::Token:
[legend]

Public Member Functions

 Token (Position pos, ThreadSafePooledString text, TokenType type)
 
 operator bool () const
 
 operator TokenType () const
 
void dump (std::ostream &out) const
 
void dump () const
 

Static Public Member Functions

static Token CreateArtificial (TokenType type=TK_EOF)
 

Data Fields

Position pos
 
ThreadSafePooledOptionalString text
 declared as optional for dummy tokens
 
TokenType type
 

Private Member Functions

 Token (TokenType type)
 

Friends

M_LCOV_EXCL_START friend std::string to_string (const Token &tok)
 
std::ostream & operator<< (std::ostream &os, const Token &tok)
 

Detailed Description

Definition at line 13 of file Token.hpp.

Constructor & Destructor Documentation

◆ Token() [1/2]

m::ast::Token::Token ( TokenType  type)
inlineexplicitprivate

Definition at line 20 of file Token.hpp.

◆ Token() [2/2]

m::ast::Token::Token ( Position  pos,
ThreadSafePooledString  text,
TokenType  type 
)
inlineexplicit

Definition at line 23 of file Token.hpp.

Member Function Documentation

◆ CreateArtificial()

static Token m::ast::Token::CreateArtificial ( TokenType  type = TK_EOF)
inlinestatic

◆ dump() [1/2]

M_LCOV_EXCL_START void Token::dump ( ) const

Definition at line 9 of file Token.cpp.

References dump().

Referenced by dump().

◆ dump() [2/2]

void m::ast::Token::dump ( std::ostream &  out) const
inline

Definition at line 45 of file Token.hpp.

◆ operator bool()

m::ast::Token::operator bool ( ) const
inline

Definition at line 31 of file Token.hpp.

References type.

◆ operator TokenType()

m::ast::Token::operator TokenType ( ) const
inline

Definition at line 32 of file Token.hpp.

References type.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const Token tok 
)
friend

Definition at line 41 of file Token.hpp.

◆ to_string

M_LCOV_EXCL_START friend std::string to_string ( const Token tok)
friend

Definition at line 35 of file Token.hpp.

Field Documentation

◆ pos

Position m::ast::Token::pos

◆ text

ThreadSafePooledOptionalString m::ast::Token::text

◆ type

TokenType m::ast::Token::type

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