luau/prototyping/Luau/Syntax.agda
Alan Jeffrey 5187e64f88
Implement a prototype interpreter (#353)
* First cut interpreter
2022-02-09 17:14:29 -06:00

28 lines
555 B
Agda

module Luau.Syntax where
open import Luau.Var using (Var)
open import Luau.Addr using (Addr)
infixr 5 _∙_
data Block : Set
data Stat : Set
data Expr : Set
data Block where
_∙_ : Stat Block Block
done : Block
data Stat where
function_⟨_⟩_end : Var Var Block Stat
local_←_ : Var Expr Stat
return : Expr Stat
data Expr where
nil : Expr
var : Var Expr
addr : Addr Expr
_$_ : Expr Expr Expr
function⟨_⟩_end : Var Block Expr
block_is_end : Var Block Expr