Bash++
Bash++ compiler internal documentation
Public Member Functions | Private Attributes | Friends | List of all members
AST::Token< T > Class Template Reference

A class representing a token in the Bash++ AST. Tokens store their value along with line and column information. More...

#include <Token.h>

Public Member Functions

 Token ()=default
 
 Token (const T &value, uint32_t line, uint32_t column)
 
 ~Token ()=default
 
 Token (const Token &other)=default
 
Tokenoperator= (const Token &other)=default
 
 Token (Token &&other) noexcept=default
 
Tokenoperator= (Token &&other) noexcept=default
 
const T & getValue () const
 
uint32_t getLine () const
 
uint32_t getCharPositionInLine () const
 
void setValue (const T &new_value)
 
void setLine (uint32_t new_line)
 
void setCharPositionInLine (uint32_t new_column)
 
 operator T () const
 
Tokenoperator= (const T &new_value)
 
void operator+= (const T &append_value)
 
bool operator== (const T &other) const
 
bool operator!= (const T &other) const
 

Private Attributes

value
 
uint32_t line = 0
 
uint32_t column = 0
 

Friends

std::ostream & operator<< (std::ostream &os, const Token< T > &token)
 

Detailed Description

template<class T>
class AST::Token< T >

A class representing a token in the Bash++ AST. Tokens store their value along with line and column information.

Template Parameters
TThe type of the token's value.

Constructor & Destructor Documentation

◆ Token() [1/4]

template<class T >
AST::Token< T >::Token ( )
default

◆ Token() [2/4]

template<class T >
AST::Token< T >::Token ( const T &  value,
uint32_t  line,
uint32_t  column 
)
inline

◆ ~Token()

template<class T >
AST::Token< T >::~Token ( )
default

◆ Token() [3/4]

template<class T >
AST::Token< T >::Token ( const Token< T > &  other)
default

◆ Token() [4/4]

template<class T >
AST::Token< T >::Token ( Token< T > &&  other)
defaultnoexcept

Member Function Documentation

◆ getCharPositionInLine()

template<class T >
uint32_t AST::Token< T >::getCharPositionInLine ( ) const
inline

◆ getLine()

template<class T >
uint32_t AST::Token< T >::getLine ( ) const
inline

◆ getValue()

template<class T >
const T & AST::Token< T >::getValue ( ) const
inline

◆ operator T()

template<class T >
AST::Token< T >::operator T ( ) const
inline

◆ operator!=()

template<class T >
bool AST::Token< T >::operator!= ( const T &  other) const
inline

◆ operator+=()

template<class T >
void AST::Token< T >::operator+= ( const T &  append_value)
inline

◆ operator=() [1/3]

template<class T >
Token & AST::Token< T >::operator= ( const T &  new_value)
inline

◆ operator=() [2/3]

template<class T >
Token & AST::Token< T >::operator= ( const Token< T > &  other)
default

◆ operator=() [3/3]

template<class T >
Token & AST::Token< T >::operator= ( Token< T > &&  other)
defaultnoexcept

◆ operator==()

template<class T >
bool AST::Token< T >::operator== ( const T &  other) const
inline

◆ setCharPositionInLine()

template<class T >
void AST::Token< T >::setCharPositionInLine ( uint32_t  new_column)
inline

◆ setLine()

template<class T >
void AST::Token< T >::setLine ( uint32_t  new_line)
inline

◆ setValue()

template<class T >
void AST::Token< T >::setValue ( const T &  new_value)
inline

Friends And Related Symbol Documentation

◆ operator<<

template<class T >
std::ostream & operator<< ( std::ostream &  os,
const Token< T > &  token 
)
friend

Member Data Documentation

◆ column

template<class T >
uint32_t AST::Token< T >::column = 0
private

◆ line

template<class T >
uint32_t AST::Token< T >::line = 0
private

◆ value

template<class T >
T AST::Token< T >::value
private

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