- Atom
- Resolved - single byte value
- Unresolved
- Constant - reference to named constant
- Function Invocation - function name with arguments (that are by themself atoms)
Hexo compiler is split in multiple steps:
-
CLI utility : Responsible for user interaction, configuration, source loading and command dispatching.
-
AST parser : Pest base parser / lexer, build abstract syntax tree. Produced AST structure might be have correct syntax, but might be semantically incorrect.
-
CST parser : Builds high level representation. Build CST is guaranteed to be semantically correct.
-
Cst resolver : Performs transformation on CST, resolves all values, functions and variables.
-
Renderer : Transforms CST into final binary output.
graph LR
CLI -- source code --> AST("AST Parser")
AST -- AST tree --> CST("CST Parser")
CST -- raw CST tree --> Resolver
Resolver -- resolved CST --> Renderer
Renderer -- binary output --> CLI
- Remove double CST states, probably should be split in resolved and unresolved trees
- Move function execution out of resolver
- Centralize atom resolution, currently it is all over the place
- Add support for constants and functions inside functions