top | up | prev | next

TrivialLexer Class

Definition at line 10 of TrivialLexer.hpp

Constructors

TrivialLexer(const char32_t* start_, const char32_t* end_, const std::string& fileName_, int fileIndex_)
TrivialLexer(const std::u32string& content_, const std::string& fileName_, int fileIndex_)

Member Functions

int NextState(int state, char32_t c) override

Constructor Details

TrivialLexer Constructor

TrivialLexer::TrivialLexer(const char32_t * start_, const char32_t * end_, const std::string& fileName_, int fileIndex_)

Definition at line 12 of TrivialLexer.cpp :
12 : Lexer(start_end_fileName_fileIndex_)
13 {
14 }


Declaration at line 14 of TrivialLexer.hpp


TrivialLexer Constructor

TrivialLexer::TrivialLexer(const std::u32string& content_, const std::string& fileName_, int fileIndex_)

Definition at line 8 of TrivialLexer.cpp :
 8 : Lexer(content_fileName_fileIndex_)
 9 {
10 }


Declaration at line 13 of TrivialLexer.hpp


Member Function Details

NextState Member Function

int TrivialLexer::NextState(int state, char32_t c) override

Definition at line 16 of TrivialLexer.cpp :
17 {
18     token.id = static_cast<int>(c);
19     token.match = lexeme;
20     if (c == '\n')
21     {
22         ++line;
23     }
24     return -1;
25 }


Declaration at line 15 of TrivialLexer.hpp

Base class overridden functions: soulng::lexer::Lexer::NextState


top | up | prev | next