Repository of Compilation Techniques (Learning) with Library SLY. You can read the manual book here
- Ahmad Fauza Aulia
- Fitri Amalia Langgundi
- Nia Zulia Saputri
- this language is created using the SLY library which is supported with PYTHON version 3.*
- this language has the extension .rhs
RHS-LANG | MEAN |
---|---|
FI | IF |
TNIRP | |
NEHT | THEN |
ESLE | ELSE |
ROF | FOR |
NUF | FUN |
OT | TO |
-> | ARROW |
Follow this steps
- Open CMD or TERMINAL with the directory this folder directory
cd .../Rhs-Lang/
- And then run file main.py in the Rhs-Lang folder
for ex: Copy paste this text to your cmd or terminal
python .main.py .bahasaku.rhs
NOW, YOU CAN DO IT
You can edit file code in the
Bahasaku.rhs
example:
TNIRP "Hello World"
result
Hello World
or:
a= "Hello World"
TNIRP a
result
"Hello World"
example:
3+2
4-1
3*3
4/2
result
5
3
6
2
or
a=6
b=2
TNIRP a+b
TNIRP a-b
TNIRP a*b
TNIRP a/b
result
8
4
12
3
IF expr THEN stmt1 ELSE stmt2
example:
a=6
y="true"
n="false"
FI a==6 NEHT TNIRP y ESLE TNIRP n
result
"true"
FOR expr TO stmt1 THEN stmt2
example:
ROF i=0 OT 5 NEHT TNIPR i
result
0
1
2
3
4
NUF functionName() -> Your Code Here...
example:
NUF ahsheup() -> TNIRP "Mantap Gan!!"
ahsheup()
result
Mantap Gan!!
or:
NUF loop() -> ROF i=0 OT 5 NEHT TNIPR i
loop()
result
Mantap Gan!!
You can use
'#'
symbol to make comment in your source code.
example:
I = "U" #but U not I
FI I == "U" NEHT TNIRP "PERFECT" ESLE TNIRP "I'm So Sorry"
#now you know how this works
result
"PERFECT"
Good luck, Thanks :)
This is a modified source code for the howCode programming language series.
You can watch the video accompanying this series here: https://www.youtube.com/playlist?list=PLBOh8f9FoHHgPEbiK-FSdSw3FiyP78fbk