Lexer#
-
namespace stapl
-
namespace parsing#
Classes and types related to parsing.
Enums
-
enum class TokenKind#
Tokens of stapl.
Values:
-
enumerator Eof#
Token kind for EOF.
-
enumerator Def#
Token kind for “def” keyword.
-
enumerator Extern#
Token kind for “extern” keyword.
-
enumerator If#
Token kind for “if” keyword.
-
enumerator Else#
Token kind for “else” keyword.
-
enumerator While#
Token kind for “while” keyword.
-
enumerator Break#
Token kind for “break” keyword.
-
enumerator Continue#
Token kind for “continue” keyword.
-
enumerator Identifier#
Token kind for identifier.
-
enumerator Int#
Token kind for int literal.
-
enumerator Float#
Token kind for float literal.
-
enumerator Bool#
Token kind for boolean literal.
-
enumerator Let#
Token kind for “let” keyword.
-
enumerator Return#
Token kind for “return” keyword.
-
enumerator Module#
Token kind for “module” keyword.
-
enumerator Op#
Token kind for operator.
-
enumerator Misc#
Token kind for various punctuations.
-
enumerator Eof#
-
class Lexer#
- #include <lexer.h>
Lexer for stapl.
Public Functions
-
Lexer(std::string code)#
Constructor for lexer.
- Parameters:
code – Code string to be lexed.
Private Members
-
std::string code#
Code string that is currently lexed.
-
std::string identifier#
Identifier that is currently lexed.
-
std::string op#
Operator that is currently lexed.
-
std::string::iterator it#
Iterator of currently lexed code.
-
std::map<int, std::set<int>> operator_dfa#
DFA table for parsing operators.
-
int last_char#
Last character seen.
-
Lexer(std::string code)#
-
enum class TokenKind#
-
namespace parsing#