Module pattern_lexer::token
source · Expand description
Module containing the tokens
Structs
- A lexical token.
Enums
- Premade Token kinds for semantic (examples are not mandatory): |
rust TokenKind| Explanation | Examples | |————————|————————————|–––––––––––| |rust KEYWORD| Reserved words | if, return, … | |rust DELIMITER| Paired delimiter symbols | (), [], {}, … | |rust PUNCTUATION| Punctuation symbols | ;, ., … | |rust OPERATOR| Symbols that operates on arguments | +, -, =, … | |rust COMMENT| Line or block comments | //, /* … */, … | |rust WHITESPACE| Non-printable characters | - | |rust LITERAL| Numerical, logical, textual values | 1, true, “true”, … | |rust IDENTIFIER| Names assigned in a program | x, temp, PRINT | These token kinds (exceptrust IDENTIFIER) should be constructed with a name that can be used to differentiate tokens with same kind.