Skip to content

Yesterday17/SNLCompiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SNL Compiler

SNL Compiler frontend implemented in rust and c(with ffi).

Structure

  • 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
  • snl-utils: Some common parts
  • snlc: Simple representation program, uses all the librarys above

Grammar information

Tools used

About

SNL Compiler written in pure Rust.

Topics

Resources

License

Stars

Watchers

Forks

Languages