Lexer module¶
-
class
Lexer.Lexer.Lexer¶ Bases:
object-
check_word(pattern: str, text: str) → Optional[Match[str]]¶ Check the word
-
error(text)¶ Raise a custom exception
-
find_longest_match()¶ Find the longest match
-
finish()¶ Finish the read
-
get_input(text)¶ Get the text input and set in current text variable
- Parameters
text – text to set in current_text
-
get_tokens() → List[Tokens.Token.Token]¶ return the list of all tokens
-
replace_word(pattern: str, replacement: str, target: str)¶ Replace the word
-
run_lexer(code: TextIO) → List[Any]¶ Run the lexer to get all tokens in .dtb file
-