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)
 
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
 
void operator= (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
 
uint32_t column
 

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/2]

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

◆ Token() [2/2]

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

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=()

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

◆ 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
private

◆ line

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

◆ value

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

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