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

Lexer. More...

#include <Lexer.hpp>

Collaboration diagram for Phasor::Lexer:
[legend]

Classes

struct  Error

Public Member Functions

 Lexer (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 ( std::string source)

Definition at line 11 of file Lexer.cpp.

Member Function Documentation

◆ advance()

char pulsar::Lexer::advance ( )
private

Definition at line 53 of file Lexer.cpp.

Here is the caller graph for this function:

◆ complexString()

Definition at line 342 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
inlinenodiscard

Definition at line 24 of file Lexer.hpp.

Here is the caller graph for this function:

◆ identifier()

Definition at line 181 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 65 of file Lexer.cpp.

Here is the caller graph for this function:

◆ number()

Definition at line 205 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 44 of file Lexer.cpp.

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

◆ scanToken()

Definition at line 94 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 16 of file Lexer.cpp.

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

◆ skipWhitespace()

Definition at line 70 of file Lexer.cpp.

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

◆ string()

Definition at line 241 of file Lexer.cpp.

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

◆ tokenize()

Definition at line 27 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: