/1go

Primary LanguageGoMIT LicenseMIT

test

1go

Learn you go compiler for great good!

コマンドメモ

docker run --rm -it -v `pwd`:/go/1go golang:1.16.2

現在の文法

program    = stmt*
stmt       = expr ";" | "return" expr ";"
expr       = assign
assign     = equality ("=" assign)?
equality   = relational ("==" relational | "!=" relational)*
relational = add ("<" add | "<=" add | ">" add | ">=" add)*
add        = mul ("+" mul | "-" mul)*
mul        = unary ("*" unary | "/" unary)*
unary      = ("+" | "-")? primary
primary    = num | ident | "(" expr ")"