A Top-Down Generation Parser To create it you must define a:
- Operator Precedence Table
- BNF grammar rule
- 3 Handler functions for parsing tokens.
AST_EXPR nud(*token)
expects nothing to the left of the token. Used for Unary operationsAST_EXPR led(*token)
expects a token to the left. Used for Binary Operations, Postfix
- Lookup tables
Binding Power
This is the degree to which an operator should be preferred. There is a table of operators and their precedence.