Steps to add new syntax:
- Check if requires new keyword:
include/token.hpp
for token types
src/lexer.cpp
for token represesntations
src/reserved.inc
for reserved tokens
- Check if requires new AST:
include/ast.hpp
for new AST type
src/ast/ast.cpp
for method implementations, especially accept()
and ~T()
include/ast.hpp
for new AST visitor method
src/visitor.cpp
for implement AST visitor method
src/ast/serializer.cpp
for AST type serialize/deserialize
Steps:
- Create new token type (if not exists)
- Add lexer method to lex the token
- Check if reserved tokens were used and update
- Add lexer test
- Add new AST type
- Implement the parser
- Add parser test
- Add new visitor method for the AST type
- Implement interpreter
- Update examples for the new syntax
- Update integration test to include new syntax example file
- Implement serializer