https://github.com/maxchehab/compiler
This is a WIP weekend project.
https://github.com/maxchehab/compiler
Last synced: about 1 month ago
JSON representation
This is a WIP weekend project.
- Host: GitHub
- URL: https://github.com/maxchehab/compiler
- Owner: maxchehab
- Created: 2017-09-01T01:30:33.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-09-05T06:28:53.000Z (over 7 years ago)
- Last Synced: 2025-01-30T21:57:27.152Z (3 months ago)
- Language: C++
- Homepage: http://104.236.141.69/compiler
- Size: 99.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# compiler
This is a WIP weekend project. There is no error handling and very minimal functionality.
This is simply an exercise exploring how a compiler works. View an online demonstration of this project [here](http://104.236.141.69/compiler).## commands
### `var` :: static variables
All variables are considered static. If one wants to update a variable's property they must create a new variable and assign the old variable plus whatever operation they desire.
A variable must be a positive integer.### `+` :: operator
The only mathematical operation available is addition of positive numbers. One can add saved variables and integers.### `print()` :: stdout
The print command is the only way to output variables. The print method only takes variables.### `;` :: semicolons
All commands must end with a semicolon.## examples
### creating a variable
```
var a = 10;
```### adding to a variable
```
var a = 10;
var b = a + 30;
```### printing a variable
```
var a = 10;
var b = a + 30;
print(b);
```### semicolons
```
var a = 10;var b = a + 30;print(b);
```