Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tsarchghs/mt
MT is a high level programming language.
https://github.com/tsarchghs/mt
c compiler programming-language
Last synced: 9 days ago
JSON representation
MT is a high level programming language.
- Host: GitHub
- URL: https://github.com/tsarchghs/mt
- Owner: tsarchghs
- License: gpl-3.0
- Created: 2018-12-14T13:44:44.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-21T23:47:45.000Z (almost 6 years ago)
- Last Synced: 2024-10-12T06:49:31.970Z (26 days ago)
- Topics: c, compiler, programming-language
- Language: C
- Homepage:
- Size: 551 KB
- Stars: 10
- Watchers: 2
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MT
The compiler skips the AST phase and produces the output based on only the tokens given.
Currently it's in alpha stage.Usage: ```./compiler ```
For the compiler to work you must have C's GCC compiler.
Examples:
Print 1 to 10
```javascript
var b = 1;
while b < 11:
print(b);
b += 1;
end
```
output:
```
1
2
3
4
5
6
7
8
9
10
```
```javascript
var child1 = "John";
var child2 = "Johnson"; // creative.. I know :)
var child1_age = 16;
var child2_age = 16;if child1_age > child2_age:
print(child1_age);
end
elif child1_age == child2_age:
print("They are the same age");
end
else:
print(child2_age);
end
```
Output: ``` They are the same age ```
Dynamic typing:
```javascript
var b = "DSASDA";
print(b);
b = 31.321;
print(b);
b = 52;
print(b);
```
Output:
```
DSASDA
31.321
52
```
Functions: (alpha/buggy)
```javascript
function squareOfTwo():
print(4);
end
squareOfTwo();
```
- Because MT's compiler (ab)uses GCC's C extension that allows function definitions inside of main function .
Why is gcc required for the compiler to work?