WCSim
Public Member Functions | Private Attributes | List of all members
CADMesh::File::Lexer Class Reference

#include <CADMesh.hh>

Collaboration diagram for CADMesh::File::Lexer:
Collaboration graph

Public Member Functions

 Lexer (std::string filepath, State *initial_state=nullptr)
 
std::string String ()
 
void Run (State *initial_state, size_t lines=0)
 
Items GetItems ()
 
void Backup ()
 
void BackupTo (int position)
 
std::string Next ()
 
std::string Peek ()
 
void Skip ()
 
ItemThisIsA (Token token, std::string error="")
 
ItemStartOfA (Token token, std::string error="")
 
ItemEndOfA (Token token, std::string error="")
 
ItemMaybeEndOfA (Token token, std::string error="")
 
bool OneOf (std::string possibles)
 
bool ManyOf (std::string possibles)
 
bool Until (std::string match)
 
bool MatchExactly (std::string match)
 
bool OneDigit ()
 
bool ManyDigits ()
 
bool OneLetter ()
 
bool ManyLetters ()
 
bool ManyCharacters ()
 
bool Integer ()
 
bool Float ()
 
bool Number ()
 
bool SkipWhiteSpace ()
 
bool SkipLineBreak ()
 
bool SkipLineBreaks ()
 
bool SkipLine ()
 
StateError (std::string message)
 
StateLastError ()
 
bool TestState (State *state)
 
bool IsDryRun ()
 
void PrintMessage (std::string name, std::string message)
 
void PrintItem (Item item)
 
size_t LineNumber ()
 

Private Attributes

Statestate_
 
Itemparent_item_ = nullptr
 
Items items_
 
std::string input_
 
size_t position_ = 0
 
size_t start_ = 0
 
size_t width_ = 1
 
size_t line_ = 1
 
size_t end_line_ = 0
 
bool dry_run_ = false
 
int depth_ = 0
 
std::string last_error_ = ""
 

Detailed Description

Definition at line 227 of file CADMesh.hh.

Constructor & Destructor Documentation

◆ Lexer()

CADMesh::File::Lexer::Lexer ( std::string  filepath,
State initial_state = nullptr 
)

Definition at line 711 of file CADMesh.hh.

Member Function Documentation

◆ Backup()

void CADMesh::File::Lexer::Backup ( )

Definition at line 743 of file CADMesh.hh.

◆ BackupTo()

void CADMesh::File::Lexer::BackupTo ( int  position)

Definition at line 753 of file CADMesh.hh.

◆ EndOfA()

Item * CADMesh::File::Lexer::EndOfA ( Token  token,
std::string  error = "" 
)

Definition at line 822 of file CADMesh.hh.

◆ Error()

State * CADMesh::File::Lexer::Error ( std::string  message)

Definition at line 1008 of file CADMesh.hh.

◆ Float()

bool CADMesh::File::Lexer::Float ( )

Definition at line 929 of file CADMesh.hh.

◆ GetItems()

Items CADMesh::File::Lexer::GetItems ( )

Definition at line 741 of file CADMesh.hh.

◆ Integer()

bool CADMesh::File::Lexer::Integer ( )

Definition at line 916 of file CADMesh.hh.

◆ IsDryRun()

bool CADMesh::File::Lexer::IsDryRun ( )

Definition at line 1059 of file CADMesh.hh.

◆ LastError()

State * CADMesh::File::Lexer::LastError ( )

Definition at line 1027 of file CADMesh.hh.

◆ LineNumber()

size_t CADMesh::File::Lexer::LineNumber ( )

Definition at line 1061 of file CADMesh.hh.

◆ ManyCharacters()

bool CADMesh::File::Lexer::ManyCharacters ( )

Definition at line 910 of file CADMesh.hh.

◆ ManyDigits()

bool CADMesh::File::Lexer::ManyDigits ( )

Definition at line 900 of file CADMesh.hh.

◆ ManyLetters()

bool CADMesh::File::Lexer::ManyLetters ( )

Definition at line 906 of file CADMesh.hh.

◆ ManyOf()

bool CADMesh::File::Lexer::ManyOf ( std::string  possibles)

Definition at line 866 of file CADMesh.hh.

◆ MatchExactly()

bool CADMesh::File::Lexer::MatchExactly ( std::string  match)

Definition at line 885 of file CADMesh.hh.

◆ MaybeEndOfA()

Item * CADMesh::File::Lexer::MaybeEndOfA ( Token  token,
std::string  error = "" 
)

Definition at line 843 of file CADMesh.hh.

◆ Next()

std::string CADMesh::File::Lexer::Next ( )

Definition at line 760 of file CADMesh.hh.

◆ Number()

bool CADMesh::File::Lexer::Number ( )

Definition at line 951 of file CADMesh.hh.

◆ OneDigit()

bool CADMesh::File::Lexer::OneDigit ( )

Definition at line 898 of file CADMesh.hh.

◆ OneLetter()

bool CADMesh::File::Lexer::OneLetter ( )

Definition at line 902 of file CADMesh.hh.

◆ OneOf()

bool CADMesh::File::Lexer::OneOf ( std::string  possibles)

Definition at line 853 of file CADMesh.hh.

◆ Peek()

std::string CADMesh::File::Lexer::Peek ( )

Definition at line 776 of file CADMesh.hh.

◆ PrintItem()

void CADMesh::File::Lexer::PrintItem ( Item  item)

Definition at line 1078 of file CADMesh.hh.

◆ PrintMessage()

void CADMesh::File::Lexer::PrintMessage ( std::string  name,
std::string  message 
)

Definition at line 1068 of file CADMesh.hh.

◆ Run()

void CADMesh::File::Lexer::Run ( State initial_state,
size_t  lines = 0 
)

Definition at line 725 of file CADMesh.hh.

◆ Skip()

void CADMesh::File::Lexer::Skip ( )

Definition at line 785 of file CADMesh.hh.

◆ SkipLine()

bool CADMesh::File::Lexer::SkipLine ( )

Definition at line 999 of file CADMesh.hh.

◆ SkipLineBreak()

bool CADMesh::File::Lexer::SkipLineBreak ( )

Definition at line 981 of file CADMesh.hh.

◆ SkipLineBreaks()

bool CADMesh::File::Lexer::SkipLineBreaks ( )

Definition at line 990 of file CADMesh.hh.

◆ SkipWhiteSpace()

bool CADMesh::File::Lexer::SkipWhiteSpace ( )

Definition at line 971 of file CADMesh.hh.

◆ StartOfA()

Item * CADMesh::File::Lexer::StartOfA ( Token  token,
std::string  error = "" 
)

Definition at line 811 of file CADMesh.hh.

◆ String()

std::string CADMesh::File::Lexer::String ( )

Definition at line 721 of file CADMesh.hh.

◆ TestState()

bool CADMesh::File::Lexer::TestState ( State state)

Definition at line 1039 of file CADMesh.hh.

◆ ThisIsA()

Item * CADMesh::File::Lexer::ThisIsA ( Token  token,
std::string  error = "" 
)

Definition at line 787 of file CADMesh.hh.

◆ Until()

bool CADMesh::File::Lexer::Until ( std::string  match)

Definition at line 876 of file CADMesh.hh.

Member Data Documentation

◆ depth_

int CADMesh::File::Lexer::depth_ = 0
private

Definition at line 300 of file CADMesh.hh.

◆ dry_run_

bool CADMesh::File::Lexer::dry_run_ = false
private

Definition at line 298 of file CADMesh.hh.

◆ end_line_

size_t CADMesh::File::Lexer::end_line_ = 0
private

Definition at line 296 of file CADMesh.hh.

◆ input_

std::string CADMesh::File::Lexer::input_
private

Definition at line 290 of file CADMesh.hh.

◆ items_

Items CADMesh::File::Lexer::items_
private

Definition at line 288 of file CADMesh.hh.

◆ last_error_

std::string CADMesh::File::Lexer::last_error_ = ""
private

Definition at line 302 of file CADMesh.hh.

◆ line_

size_t CADMesh::File::Lexer::line_ = 1
private

Definition at line 295 of file CADMesh.hh.

◆ parent_item_

Item* CADMesh::File::Lexer::parent_item_ = nullptr
private

Definition at line 287 of file CADMesh.hh.

◆ position_

size_t CADMesh::File::Lexer::position_ = 0
private

Definition at line 292 of file CADMesh.hh.

◆ start_

size_t CADMesh::File::Lexer::start_ = 0
private

Definition at line 293 of file CADMesh.hh.

◆ state_

State* CADMesh::File::Lexer::state_
private

Definition at line 285 of file CADMesh.hh.

◆ width_

size_t CADMesh::File::Lexer::width_ = 1
private

Definition at line 294 of file CADMesh.hh.


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