Phasor 3.1.1
Stack VM based Programming Language
Loading...
Searching...
No Matches
Phasor::Lexer Class Reference

Lexer. More...

#include <Lexer.hpp>

Classes

struct  Error

Public Member Functions

 Lexer (const std::string &source)
std::vector< Tokentokenize ()
std::optional< ErrorgetError () const

Private Member Functions

char peek ()
char advance ()
bool isAtEnd ()
void skipWhitespace ()
void skipShebang ()
Token scanToken ()
Token identifier ()
Token number ()
Token string ()
Token complexString ()

Private Attributes

std::string source
size_t position = 0
size_t line = 1
size_t column = 1
std::optional< ErrorlastError

Detailed Description

Lexer.

Definition at line 12 of file Lexer.hpp.

Constructor & Destructor Documentation

◆ Lexer()

pulsar::Lexer::Lexer ( const std::string & source)

Definition at line 10 of file Lexer.cpp.

Member Function Documentation

◆ advance()

char pulsar::Lexer::advance ( )
private

Definition at line 48 of file Lexer.cpp.

Here is the caller graph for this function:

◆ complexString()

Definition at line 310 of file Lexer.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getError()

std::optional< Error > Phasor::Lexer::getError ( ) const
inline

Definition at line 25 of file Lexer.hpp.

Here is the caller graph for this function:

◆ identifier()

Definition at line 168 of file Lexer.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isAtEnd()

bool pulsar::Lexer::isAtEnd ( )
private

Definition at line 60 of file Lexer.cpp.

Here is the caller graph for this function:

◆ number()

Definition at line 190 of file Lexer.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ peek()

char pulsar::Lexer::peek ( )
private

Definition at line 41 of file Lexer.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scanToken()

Definition at line 89 of file Lexer.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ skipShebang()

void pulsar::Lexer::skipShebang ( )
private

Definition at line 15 of file Lexer.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ skipWhitespace()

Definition at line 65 of file Lexer.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ string()

Definition at line 216 of file Lexer.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tokenize()

Definition at line 26 of file Lexer.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ column

size_t Phasor::Lexer::column = 1
private

Definition at line 33 of file Lexer.hpp.

◆ lastError

std::optional<Error> Phasor::Lexer::lastError
private

Definition at line 35 of file Lexer.hpp.

◆ line

size_t Phasor::Lexer::line = 1
private

Definition at line 32 of file Lexer.hpp.

◆ position

size_t Phasor::Lexer::position = 0
private

Definition at line 31 of file Lexer.hpp.

◆ source

std::string Phasor::Lexer::source
private

Definition at line 30 of file Lexer.hpp.


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