Use a simple DFA to parse operators.#28
Conversation
|
This adds 133 net lines of code, and IMHO makes the |
|
See #24 (comment) for related discussion. |
Store a copy of the starting node in ParseOperation.
cff73b0 to
09f01c5
Compare
|
FYI, I rebased this over the latest main branch. (No conflicts.) |
|
The majority of my operators are * = + and -. The existing code, which uses a loop through a list, has these near the end of a 50+ element list. So, every potential operator has to go through 40+ dead ends (even operators which are not implemented) before a hit is found. The dfa structure finds an operator very quickly and also rejects non operators very quickly. It seems it is worth the code complexity for the better performance. This link should show the dfa visually from a dot file. |
|
The graph code and some slight reformatting is in https://github.com/JaredDavis22/parsingtonFork/tree/matcherUsingThreadLocalguess |
Stores a copy of the starting node in ParseOperation.