3 ms·
For my parsing pet project(s), the following structure seems to serve me best: - Recursive descent parser for statements - "Canned" configurable expression pa
by dukoid 9y ago
For my parsing pet project(s), the following structure seems to serve me best:
- Recursive descent parser for statements
- "Canned" configurable expression parser for expressions: https://github.com/stefanhaustein/expressionparser https://github.com/stefanhaustein/expressionparser
- Both use a simple regex based generic tokenizer
- In more complex cases, parse the expressions to an unresolved syntax tree first (constructed from the bottom), then resolve the tree in a secondary top-down step (potentially to a linear representation).