picceler
Loading...
Searching...
No Matches
picceler::Token Struct Reference

Represents a token produced by the lexer. More...

#include <lexer.h>

Public Types

enum class  Type : size_t {
  IDENTIFIER , NUMBER , STRING , SYMBOL ,
  EOF_TOKEN , UNKNOWN
}
 The type of the token. More...

Public Member Functions

std::string typeToString () const
 Converts the token type to a string representation.
std::string toString () const
 Converts the token to a string representation.

Public Attributes

Type _type
std::string _value
size_t _line
size_t _column

Detailed Description

Represents a token produced by the lexer.

Member Enumeration Documentation

◆ Type

enum class picceler::Token::Type : size_t
strong

The type of the token.

Enumerator
IDENTIFIER 
NUMBER 
STRING 
SYMBOL 
EOF_TOKEN 
UNKNOWN 

Member Function Documentation

◆ toString()

std::string picceler::Token::toString ( ) const
inline

Converts the token to a string representation.

Returns
The string representation of the token.

◆ typeToString()

std::string picceler::Token::typeToString ( ) const

Converts the token type to a string representation.

Returns
The string representation of the token type.

Member Data Documentation

◆ _column

size_t picceler::Token::_column

◆ _line

size_t picceler::Token::_line

◆ _type

Type picceler::Token::_type

◆ _value

std::string picceler::Token::_value

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