hoshi-lang dev
Yet another programming language
Loading...
Searching...
No Matches
lexer Class Reference

#include <lexer.hpp>

Collaboration diagram for lexer:

Classes

struct  Comment
 
struct  lexerState
 
struct  token
 

Public Member Functions

void getCh ()
 
 lexer (std::wstringstream ss)
 
void saveState ()
 
void returnState ()
 
void dropState ()
 
token scan ()
 
token alphaStart ()
 
token operatorStart ()
 
token strStart ()
 
token digitStart ()
 
token minusStart ()
 
token plusStart ()
 
token asteriskStart ()
 
token slashStart ()
 
token percentSignStart ()
 
token equalStart ()
 
token notStart ()
 
token lessStart ()
 
token greaterStart ()
 
token semicolonStart ()
 
token colonStart ()
 
token commaStart ()
 
token dotStart ()
 
token sharpStart ()
 
token leftParenthesesStart ()
 
token rightParenthesesStart ()
 
token leftBracketStart ()
 
token rightBracketStart ()
 
token leftBracesStart ()
 
token rightBracesStart ()
 
token andStart ()
 
token orStart ()
 
token xorStart ()
 
token binaryNotStart ()
 

Public Attributes

vec< Commentcomments
 
vec< lexerStatestates
 
token curToken
 
wchar curCh
 
int64_t line
 
int64_t col
 

Private Attributes

std::wstringstream stream
 

Detailed Description

Definition at line 14 of file lexer.hpp.

Constructor & Destructor Documentation

◆ lexer()

lexer ( std::wstringstream  ss)
explicit

Definition at line 8 of file lexer.cpp.

References lexer::getCh().

Here is the call graph for this function:

Member Function Documentation

◆ alphaStart()

◆ andStart()

lexer::token andStart ( )

Definition at line 562 of file lexer.cpp.

References lexer::token::binaryAnd, lexer::col, lexer::curCh, lexer::getCh(), lexer::line, and lexer::token::logicAnd.

Referenced by lexer::scan().

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

◆ asteriskStart()

lexer::token asteriskStart ( )

Definition at line 372 of file lexer.cpp.

References lexer::token::asterisk, lexer::col, lexer::curCh, lexer::getCh(), lexer::line, and lexer::token::multiplicationAssignment.

Referenced by lexer::scan().

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

◆ binaryNotStart()

lexer::token binaryNotStart ( )

Definition at line 594 of file lexer.cpp.

References lexer::token::binaryNot, lexer::col, lexer::getCh(), and lexer::line.

Here is the call graph for this function:

◆ colonStart()

lexer::token colonStart ( )

Definition at line 482 of file lexer.cpp.

References lexer::col, lexer::token::colon, lexer::curCh, lexer::token::directAssignSign, lexer::getCh(), and lexer::line.

Referenced by lexer::scan().

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

◆ commaStart()

lexer::token commaStart ( )

Definition at line 492 of file lexer.cpp.

References lexer::col, lexer::token::comma, lexer::getCh(), and lexer::line.

Referenced by lexer::scan().

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

◆ digitStart()

lexer::token digitStart ( )

Definition at line 235 of file lexer.cpp.

References lexer::col, lexer::curCh, lexer::token::decimal, lexer::getCh(), lexer::token::integer, lexer::line, lexer::token::shortInt, lexer::token::unsignedInt, and yoi::yoi_assert().

Referenced by lexer::scan().

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

◆ dotStart()

lexer::token dotStart ( )

Definition at line 498 of file lexer.cpp.

References lexer::col, lexer::curCh, lexer::token::dot, lexer::getCh(), lexer::token::kThreeDots, lexer::line, and lexer::stream.

Referenced by lexer::scan().

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

◆ dropState()

void dropState ( )

Definition at line 557 of file lexer.cpp.

References lexer::states.

Referenced by yoi::parse(), yoi::parse(), yoi::parse(), yoi::parse(), yoi::parse(), and lexer::returnState().

Here is the caller graph for this function:

◆ equalStart()

lexer::token equalStart ( )

Definition at line 430 of file lexer.cpp.

References lexer::token::assignSign, lexer::col, lexer::curCh, lexer::token::equal, lexer::getCh(), and lexer::line.

Referenced by lexer::scan().

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

◆ getCh()

◆ greaterStart()

lexer::token greaterStart ( )

Definition at line 463 of file lexer.cpp.

References lexer::token::binaryShiftRight, lexer::col, lexer::curCh, lexer::getCh(), lexer::token::greaterEqual, lexer::token::greaterThan, and lexer::line.

Referenced by lexer::scan().

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

◆ leftBracesStart()

lexer::token leftBracesStart ( )

Definition at line 533 of file lexer.cpp.

References lexer::col, lexer::getCh(), lexer::token::leftBraces, and lexer::line.

Referenced by lexer::scan().

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

◆ leftBracketStart()

lexer::token leftBracketStart ( )

Definition at line 521 of file lexer.cpp.

References lexer::col, lexer::getCh(), lexer::token::leftBracket, and lexer::line.

Referenced by lexer::scan().

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

◆ leftParenthesesStart()

lexer::token leftParenthesesStart ( )

Definition at line 509 of file lexer.cpp.

References lexer::col, lexer::getCh(), lexer::token::leftParentheses, and lexer::line.

Referenced by lexer::scan().

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

◆ lessStart()

lexer::token lessStart ( )

Definition at line 450 of file lexer.cpp.

References lexer::token::binaryShiftLeft, lexer::col, lexer::curCh, lexer::getCh(), lexer::token::lessEqual, lexer::token::lessThan, and lexer::line.

Referenced by lexer::scan().

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

◆ minusStart()

lexer::token minusStart ( )

Definition at line 343 of file lexer.cpp.

References lexer::col, lexer::curCh, lexer::token::decrementSign, lexer::getCh(), lexer::line, lexer::token::minus, lexer::token::subtractionAssignment, and lexer::token::toSign.

Referenced by lexer::scan().

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

◆ notStart()

lexer::token notStart ( )

Definition at line 440 of file lexer.cpp.

References lexer::col, lexer::curCh, lexer::getCh(), lexer::line, lexer::token::logicNot, and lexer::token::notEqual.

Referenced by lexer::scan().

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

◆ operatorStart()

◆ orStart()

lexer::token orStart ( )

Definition at line 572 of file lexer.cpp.

References lexer::token::binaryOr, lexer::col, lexer::curCh, lexer::getCh(), lexer::line, and lexer::token::logicOr.

Referenced by lexer::scan().

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

◆ percentSignStart()

lexer::token percentSignStart ( )

Definition at line 420 of file lexer.cpp.

References lexer::col, lexer::curCh, lexer::getCh(), lexer::line, lexer::token::percentSign, and lexer::token::reminderAssignment.

Referenced by lexer::scan().

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

◆ plusStart()

lexer::token plusStart ( )

Definition at line 359 of file lexer.cpp.

References lexer::token::additionAssignment, lexer::col, lexer::curCh, lexer::getCh(), lexer::token::incrementSign, lexer::line, and lexer::token::plus.

Referenced by lexer::scan().

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

◆ returnState()

void returnState ( )

◆ rightBracesStart()

lexer::token rightBracesStart ( )

Definition at line 539 of file lexer.cpp.

References lexer::col, lexer::getCh(), lexer::line, and lexer::token::rightBraces.

Referenced by lexer::scan().

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

◆ rightBracketStart()

lexer::token rightBracketStart ( )

Definition at line 527 of file lexer.cpp.

References lexer::col, lexer::getCh(), lexer::line, and lexer::token::rightBracket.

Referenced by lexer::scan().

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

◆ rightParenthesesStart()

lexer::token rightParenthesesStart ( )

Definition at line 515 of file lexer.cpp.

References lexer::col, lexer::getCh(), lexer::line, and lexer::token::rightParentheses.

Referenced by lexer::scan().

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

◆ saveState()

void saveState ( )

Definition at line 545 of file lexer.cpp.

References lexer::col, lexer::curCh, lexer::curToken, lexer::line, lexer::states, and lexer::stream.

Referenced by yoi::parse(), yoi::parse(), yoi::parse(), yoi::parse(), and yoi::parse().

Here is the caller graph for this function:

◆ scan()

◆ semicolonStart()

lexer::token semicolonStart ( )

Definition at line 476 of file lexer.cpp.

References lexer::col, lexer::getCh(), lexer::line, and lexer::token::semicolon.

Referenced by lexer::scan().

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

◆ sharpStart()

lexer::token sharpStart ( )

Definition at line 588 of file lexer.cpp.

References lexer::col, lexer::getCh(), lexer::line, and lexer::token::sharp.

Referenced by lexer::scan().

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

◆ slashStart()

lexer::token slashStart ( )

Definition at line 382 of file lexer.cpp.

References lexer::col, lexer::comments, lexer::curCh, lexer::token::divisionAssignment, lexer::getCh(), lexer::line, lexer::scan(), and lexer::token::slash.

Referenced by lexer::scan().

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

◆ strStart()

lexer::token strStart ( )

Definition at line 214 of file lexer.cpp.

References lexer::token::character, lexer::col, lexer::curCh, lexer::getCh(), lexer::line, yoi::panic(), yoi::parseString(), and lexer::token::string.

Referenced by lexer::scan().

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

◆ xorStart()

lexer::token xorStart ( )

Definition at line 582 of file lexer.cpp.

References lexer::token::binaryXor, lexer::col, lexer::getCh(), and lexer::line.

Referenced by lexer::scan().

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

Member Data Documentation

◆ col

◆ comments

vec<Comment> comments

Definition at line 23 of file lexer.hpp.

Referenced by lexer::slashStart().

◆ curCh

◆ curToken

◆ line

◆ states

vec<lexerState> states

Definition at line 171 of file lexer.hpp.

Referenced by lexer::dropState(), lexer::returnState(), and lexer::saveState().

◆ stream

std::wstringstream stream
private

Definition at line 15 of file lexer.hpp.

Referenced by lexer::dotStart(), lexer::getCh(), lexer::returnState(), and lexer::saveState().


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