SNL Compiler frontend implemented in rust and c(with ffi).
- snl-lexer: Lexer written in Rust
- Tokenize
- Line & Column
- Comment
- snl-rdp: Recursive descent parser written in Rust
- snl-ll1: LL(1) parser written in Rust.
- snl-semantic: Semantic Analysis part written in Rust
- Construct symbol table
- Type
- Variable
- Procedure
- Semantic errors
- Duplicated identifier
- Undefined identifier
- Undefined type
- Uncompatable type
- Invalid variable represent
- Invalid array definition
- Array index outbound
- Unexpected array index
- Invalid field index type
- Undefined record field
- Assign type mismatch
- Invalid assignee
- Call parameter type mismatch
- Call parameter count mismatch
- Invalid bool expression
- Invalid read type
- Invalid write type
- Construct symbol table
- snl-utils: Some common parts
- snlc: Simple representation program, uses all the librarys above
BNF
: https://github.com/Yesterday17/SNLCompiler/blob/master/grammar/snl.bnfBNF(LL(1))
: https://github.com/Yesterday17/SNLCompiler/blob/master/grammar/snl_ll1.bnfFormat used to generate predict table
: https://github.com/Yesterday17/SNLCompiler/blob/6587ea8046c9727f1895a408f513d3072e5f46d0/grammar/snl_ll1
Predict table generation
: http://jsmachines.sourceforge.net/machines/ll1.htmlAST(JSON) to SVG
: https://vanya.jp.net/vtree/