https://github.com/bkopysc/genuinelang
Unique language made with ANTLR +Java + LLVM
https://github.com/bkopysc/genuinelang
antlr4 java llvm
Last synced: 5 months ago
JSON representation
Unique language made with ANTLR +Java + LLVM
- Host: GitHub
- URL: https://github.com/bkopysc/genuinelang
- Owner: BKopysc
- Created: 2023-05-30T16:31:11.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-06-16T10:51:06.000Z (almost 3 years ago)
- Last Synced: 2025-06-05T00:57:51.932Z (10 months ago)
- Topics: antlr4, java, llvm
- Language: Java
- Homepage:
- Size: 2.1 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GenuineLang [GLang]
Homemade language and compilator created from scratch for Computer Science project.
Tech stack: ANTLR, Java, LLVM
## Language progress:
- variables: int, real ✅
- read, print ✅
- basic arithmetic operations ✅
- pointing out errors during lexical and syntactic analysis ✅
- tests ✅
- if/else ✅
- loop ✅
- functions ✅
- local and global variables ✅
***
## Proof of Concept
### Simple program
```
int a;
read a;
int b;
read b;
int power;
read power;
function int loopIncresase(int a, int b) do
int c = a;
while c < b do
print c;
c = c + 1;
end
return 0;
end
function int loopDecrease(int a, int b) do
int c = a;
while c > b do
print c;
c = c - 1;
end
return 0;
end
function int simplePower(int a, int c) do
int res = 1;
int ctr = 1;
while ctr <= c do
res = res * a;
ctr = ctr + 1;
end
return res;
end
if a>b do
loopDecrease(a,b);
else
loopIncresase(a,b);
end
int pow = simplePower(a,power);
print pow;
```
### Console output

## Run yourself
1. You need:
- Java 17
- Linux environment
- Clang and lli tool
2. Create compiler: ```make generate compile```
3. Run .gl file: ```make run-ll INPUT="./poc.gl"```