Skip to content

An arithmetic interpreter + web service written in Micronaut and Angular.

Notifications You must be signed in to change notification settings

thilo-behnke/arithmetic-interpreter

Repository files navigation

About

An arithmetic interpreter that parses and evaluates arithmetic expressions.

Understands expressions of the following grammar:

  • expression := expression binary_operation expression | '-' expression | '(' expression ')' | variable_assignment | term | unary_function

  • term := number | variable

  • number := integer | decimal

  • integer := '0' | ('1' - '9') ('0' - '9')*

  • decimal := ( integer )? '.' ('0' - '9')*

  • variable := ('a' - 'z' | 'A' - 'Z') ('a' - 'z' | 'A' - 'Z' | '0' - '9')*

  • variable_assignment := variable '=' expression

  • binary_operation := '+' | '-' | '*' | '/'

  • unary_function := ('sqrt' | 'log' | 'sin' | 'cos') '(' expression ')'

How to run

Run: ./run-docker.sh
Access web-client: http://0.0.0.0:80

Demo