https://github.com/josethz00/math_interpreter
Repo destinated to studies about languages, compilers, interpreters, grammars and lexical and sintax analysis
https://github.com/josethz00/math_interpreter
c lex yacc
Last synced: 9 days ago
JSON representation
Repo destinated to studies about languages, compilers, interpreters, grammars and lexical and sintax analysis
- Host: GitHub
- URL: https://github.com/josethz00/math_interpreter
- Owner: josethz00
- Created: 2021-06-08T22:51:34.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-11T01:52:12.000Z (almost 5 years ago)
- Last Synced: 2025-03-05T01:32:15.592Z (over 1 year ago)
- Topics: c, lex, yacc
- Language: C
- Homepage:
- Size: 60.5 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Basic Math Interpreter
=============
This is a simple math expression interpreter written with C, Lex and Yacc
1. Use ``` make ``` command in your terminal to compile ```.y```, ```.l``` and ```.c``` files and then run
### Limitations:
- For now, the language only supports variables with integer variables, not floats neither strings
- The supported operators are: ```=``` (assignment), ```-``` (subtraction), ```+``` (sum), ```*``` (multiplication), ```/``` (division), ```sqrtof``` (square root of) and ```powerof``` (power of)
- Operators precedence is not supported yet
### Language grammar examples:
```
a = 10;
print a;
```
```
a = 10 + 191;
print a;
```
```
a = 90;
print a;
a = a + 22;
print a;
```
```
a = 10;
b = 30;
c = a + b;
print c;
```