s1mple

Crates.ios1mple
lib.rss1mple
version0.0.1
sourcesrc
created_at2022-03-13 19:04:21.852734
updated_at2022-03-13 19:04:21.852734
descriptionA toy language/compiler for learning compiler design.
homepage
repository
max_upload_size
id549341
size23,270
Adam Jeniski (Ajetski)

documentation

README

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

Commit count: 0

cargo fmt