RU-Language is a programming language written in C. It uses bytecode and VM to execute the instructions. RU-Lang is dynamically-typed and object-oriented language. The keywords used in this language's grammar are taken from the Roman Urdu.
make
./main
./main <filename>.ru
chhaap "this is ru tutorial";
khaaka A {
method() {
chhaap "this is a class method";
}
}
tafaaul loop(number) {
chhaap "this is a function";
}
elaan dard <- "this is pain";
shoro (elaan i <- 0; i < number; i <- i + 1) {
chhaap i;
}
agr (glt) {
chhaap "hhaha";
}
warna {
chhaap "heheh";
}
tafaaul loop(number) {
shoro (elaan i <- 0; i < number; i <- i + 1) {
chhaap i;
}
lautana "Done";
}
elaan i <- 0;
jbtk (i < 5) {
chhaap i;
i <- i + 1;
}
khaaka A {
method() {
chhaap "A";
}
}
khaaka B -> A {
method() {
chhaap "showing inheritance";
}
}
khaaka A {
method() {
chhaap "A";
}
}
A.method();
A.name <- "ha ha ha";
khaaka A {
method() {
chhaap this.name;
}
}
elaan a = A();
a.name <- "ha ha ha";
a.method();
khaaka A {
method() {
chhaap "A";
}
}
khaaka B -> A {
method() {
elaan closure <- super.method;
closure();
}
}
elaan b <- B();
b.method();
durust
glt