Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hyeockjinkim/calc2
Calculator using ANTLR4 .g4 file
https://github.com/hyeockjinkim/calc2
antlr4 g4 java
Last synced: 1 day ago
JSON representation
Calculator using ANTLR4 .g4 file
- Host: GitHub
- URL: https://github.com/hyeockjinkim/calc2
- Owner: HyeockJinKim
- Created: 2019-11-08T08:38:12.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-11-14T06:16:36.000Z (about 5 years ago)
- Last Synced: 2024-05-28T23:51:26.716Z (8 months ago)
- Topics: antlr4, g4, java
- Language: Java
- Homepage:
- Size: 1.96 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Calculator using ANTLR
> only use .g4 fileThis 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
```python
a = 13;
a + 2;
1 + 3 * 2 - 3 * 7
``````python
15
-14
```### input code
![code](imgs/test_wh.png)### result
![result](imgs/result.png)It also guarantees operator precedence.