1) Read a character from the file.
Call step 2 with the pointer to the root of the trie, the
character read and a pointer to the begining of the key word
save buffer.
2) Search for the input character in the current node of the trie.
If the input character is found in the trie then
Save the input character in the key word save buffer.
Attempt to read a character from the file.
If End of File then
Return End of File.
If the character found has a child trie pointer then
Call Step 2 with the child trie pointer, the character
read from the file and a pointer to the next byte in the
key word save buffer.
If the return value from the call to step 2 is NOT FOUND then
Unread the character read from the file
Return the token value stored with the input character
of this call.
else
Return the return value of the recursive call.
else If the character is not found then
Save a NUL in the key word save buffer.
Return the value NOT_FOUND.