Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Friends
cli::Lexer Class Reference

#include <Lexer.h>

Data Structures

struct  Token
 

Public Types

enum class  Hint { NONE , TYPE , FILE }
 
enum class  TokenType : unsigned {
  IDENTIFIER , UNSIGNED , DOUBLE , STRING ,
  LESS_THAN , LESS_THAN_OR_EQUAL , MORE_THAN , MORE_THAN_OR_EQUAL ,
  EQUAL , NOT_EQUAL , LEFT_PAREN , RIGHT_PAREN ,
  LEFT_BRACE , RIGHT_BRACE , LEFT_BRACKET , RIGHT_BRACKET ,
  DOLLAR_SIGN , AT_SIGN , AMPERSAND_SIGN , PIPE_SIGN ,
  CARET_SIGN , COLON_SIGN , SEMICOLON_SIGN , MINUS_SIGN ,
  PLUS_SIGN , SLASH_SIGN , ASTERISK_SIGN , TILDE_SIGN ,
  EXCLAMATION_SIGN , PERCENTAGE_SIGN , HASH_SIGN , AND ,
  OR , DEC , INC , ASSIGN ,
  COMMA , DOT , FILE , TYPE ,
  ERROR , EOT , EOS
}
 

Public Member Functions

 Lexer (CharSequence source)
 
Token nextToken (bool readNextLine=false)
 
void putback (Token &&token)
 
void setHint (Hint hint)
 

Static Public Member Functions

static std::string tokenTypeToString (TokenType type)
 
static TokenType is_kw (const std::string &)
 

Friends

bool operator< (TokenType first, TokenType second)
 

Member Enumeration Documentation

◆ Hint

enum class cli::Lexer::Hint
strong
Enumerator
NONE 
TYPE 
FILE 

◆ TokenType

enum class cli::Lexer::TokenType : unsigned
strong
Enumerator
IDENTIFIER 
UNSIGNED 
DOUBLE 
STRING 
LESS_THAN 
LESS_THAN_OR_EQUAL 
MORE_THAN 
MORE_THAN_OR_EQUAL 
EQUAL 
NOT_EQUAL 
LEFT_PAREN 
RIGHT_PAREN 
LEFT_BRACE 
RIGHT_BRACE 
LEFT_BRACKET 
RIGHT_BRACKET 
DOLLAR_SIGN 
AT_SIGN 
AMPERSAND_SIGN 
PIPE_SIGN 
CARET_SIGN 
COLON_SIGN 
SEMICOLON_SIGN 
MINUS_SIGN 
PLUS_SIGN 
SLASH_SIGN 
ASTERISK_SIGN 
TILDE_SIGN 
EXCLAMATION_SIGN 
PERCENTAGE_SIGN 
HASH_SIGN 
AND 
OR 
DEC 
INC 
ASSIGN 
COMMA 
DOT 
FILE 
TYPE 
ERROR 
EOT 
EOS 

Constructor & Destructor Documentation

◆ Lexer()

cli::Lexer::Lexer ( CharSequence  source)
inlineexplicit
Here is the call graph for this function:

Member Function Documentation

◆ is_kw()

static TokenType cli::Lexer::is_kw ( const std::string &  )
inlinestatic
Here is the caller graph for this function:

◆ nextToken()

Lexer::Token cli::Lexer::nextToken ( bool  readNextLine = false)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putback()

void cli::Lexer::putback ( Token &&  token)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setHint()

void cli::Lexer::setHint ( Hint  hint)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tokenTypeToString()

static std::string cli::Lexer::tokenTypeToString ( TokenType  type)
inlinestatic
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<

bool operator< ( TokenType  first,
TokenType  second 
)
friend

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