/calc2

Calculator using ANTLR4 .g4 file

Primary LanguageJava

Calculator using ANTLR

only use .g4 file

This calculator saves the value to be stored in the variable in the Map.

In addition, each statement can be separated by ;, and the last statement does not have to be ;. (similar to Rust)

Supports multi-line calculations and storing result in variables.

input

a = 13;
a + 2;
1 + 3 * 2 - 3 * 7
15
-14

input code

code

result

result

It also guarantees operator precedence.