Thea
Classes | Public Member Functions | List of all members
Token Class Reference

A token read from a TextInputStream. More...

#include <TextInputStream.hpp>

Classes

struct  ExtendedType
 Detailed categorization of a token (enum class). More...
 
struct  Type
 Basic categorization of a token. More...
 

Public Member Functions

bool boolean () const
 Return the value of this token as a boolean. More...
 
uint64 bytePosition () const
 Number of bytes from the beginning of the buffer that this token was parsed from. More...
 
int character () const
 Starting character position in the input line from which this token was parsed. More...
 
ExtendedType extendedType () const
 Get the extended type of the token. More...
 
int line () const
 Starting line of the input from which this token was parsed. More...
 
double number () const
 Return the numeric value for a number token. More...
 
std::string const & string () const
 The value of a single- or double-quoted string (not including the quotes), the name of a symbol, or the exact textual representation of a number as parsed from the input. More...
 
 Token ()
 Default constructor. More...
 
Type type () const
 Get the type of the token. More...
 

Detailed Description

A token read from a TextInputStream.

Definition at line 47 of file TextInputStream.hpp.

Constructor & Destructor Documentation

Token ( )

Default constructor.

Definition at line 111 of file TextInputStream.hpp.

Member Function Documentation

bool boolean ( ) const

Return the value of this token as a boolean.

Undefined if the token is not, in fact, a boolean.

Definition at line 142 of file TextInputStream.hpp.

uint64 bytePosition ( ) const

Number of bytes from the beginning of the buffer that this token was parsed from.

Begins at 0

Definition at line 160 of file TextInputStream.hpp.

int character ( ) const

Starting character position in the input line from which this token was parsed.

Starts at 1.

Definition at line 154 of file TextInputStream.hpp.

ExtendedType extendedType ( ) const

Get the extended type of the token.

Definition at line 127 of file TextInputStream.hpp.

int line ( ) const

Starting line of the input from which this token was parsed.

Starts at 1.

Definition at line 148 of file TextInputStream.hpp.

double number ( ) const

Return the numeric value for a number token.

Undefined if the token is not, in fact, a number.

Definition at line 58 of file TextInputStream.cpp.

std::string const& string ( ) const

The value of a single- or double-quoted string (not including the quotes), the name of a symbol, or the exact textual representation of a number as parsed from the input.

Definition at line 136 of file TextInputStream.hpp.

Type type ( ) const

Get the type of the token.

Definition at line 121 of file TextInputStream.hpp.


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