#design #toy #compiler #learning #language-compiler

bin+lib s1mple

A toy language/compiler for learning compiler design

1 unstable release

0.0.1 Mar 13, 2022

#90 in #toy

MIT license

17KB
440 lines

s1mple

A toy language/compiler for learning compiler design.

CI

Screenshot

image

Grammar

Symbol Symbol Defisnition
Function fn <Ident>? <FunctionParams> <FunctionReturn>? <FunctionBody>
FunctionParams ( )
FunctionReturn -> i64
FunctionBody { <Expression> }
Expression <Value> <Operator>? <Expression>?
Value <Ident> | <Literal>
Operator +
Ident [A-Za-z]*
Literal [0-9]*

Todo

  • Expand grammar to add modules that can contain mulitple functions
  • Implement symbol table
  • Expand grammar to include capturing arguments for a function
  • Add more operators and operator precedence

Tech Stack

Dependencies

~7.5MB
~167K SLoC