Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 493 Bytes

README.md

File metadata and controls

21 lines (15 loc) · 493 Bytes

mathematical expression interpreter

written in go

Grammar

declaration := statement #| fun_dec
statement   := expression

expression  := equality | var_dec
assignment  := IDENTIFIER '=' term

equalitycomparison ( '!='|'==' comparison )*
comparisonterm ( '>'|'>='|'<'|'<=' term )*

term        := factor ( '+'|'-' factor)*
factor      := unary ( '*'|'/' unary)*
unary       := '-' unary | primary
primary     := '(' expression ')' | NUMBER | IDENTIFIER