This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The following is public domain, go wild. | |
// If you could however, please at least keep the blog URL in it if you use it verbaitum | |
// https://bravotic.com/dev/stdscr/index.php/2022/11/13/making-a-parser-generator-doesnt-have-to-be-hard/ | |
// Step 1: Lets get a list of tokens | |
// Our list of tokens | |
var tokens = ["Hello", "Hi", "Goodbye", "Good", "World", "Wordlist"]; | |
// Step 2: Create the trees | |
// We need to create a 'state' which holds the possible next letters, and a state for those as well |