Catalog · How the catalog works
GerCompiler
German ligthweight Compiler for Linux 64-Bit
- ★ 2 on GitHub
Anyone may press Interesting, signed in or not. It helps others find this project.
README
#GerCompiler - A simple, german, lightweigth Linux-Compiler --Made as extension to GerInterpreter (http://www.sites.google.com/site/gerinterpreterr </br> --GerInterpreter has more Functions, use it as long, as my Project isn't finished :)</br>
SETUP: To compile the sources, you will need Lazarus-Pascal (http://www.lazarus-ide.org))</br>
To directly use the executable, use the script, or run
sudo chmod +x /Compiler
sudo ./CompilerPlease give me some Feedback, but don't post direct Answers to my Questions, </br>as I prefer working alone at this school Project </br> </br> HAVE FUN USING IT!
Little explanantion:
to start, we need a main-function.
haupt
anfang
endeInside of this, we can use many commands...
Example: schreiben </br>
This command writes to the terminal.
We use it like this:
schreiben ("HELLO" + " " + "World" + nZeile)You can concatenate as many strings, escape-sequences (nZeile) or Variables as needed...
nZeileappends a new Line to the written Text.
To add a new Variable, we need to do so before the first function has been created.
neuevariable (Hallo = "HELLO") //Adds a new Variable //The compiler recognizes the type of Variable
//strings need to be encapsulated in Quotes
haupt //The main-function
anfang
schreiben (Hallo + nzeile)
Hallo =+1 //Is round about the same as the ++ operator in C++
schreiben (Hallo + nZeile)
endeIf we want the user to be able to input a value for the Variable, we can do this...
neuevariable (Hallo = 123) //This time, we create a Number-variable.
haupt
anfang
schreiben (Hallo + nZeile)
eingeben (Hallo)
schreiben (Hallo + nZeile)
endeThis inputs the variable; It also pays attention, the user didn't input anything wrong like
→Too long numbers (in case of Numbers) →Characters (in case of Numbers)
Now, by that, we can create a new Function.
prototyp (writeHello) //Creates the function-prototype
haupt
anfang //This is the same as the begin...end indentation-block in Pascal... In c++ it would be {...}
aufrufen (writeHello)
ende
leer writeHello
anfang
schreiben ("Hello World" + nZeile)
endeThis creates a function. To call the function, we use the command aufrufen
Inside of functions, we can also do comparisons...
prototyp (test)
neuevariable (var1 = "3") //comparisons with Numbers need to be tested...
leer test
anfang
wenn var1 == "3"
anfang
schreiben (Hello ;-))
ende
ende
haupt
anfang
aufrufen (test) //it should write 'Hello', because var 1 equals to "1"
endeYou can compare almost everytype of Variables, but can't concatenate... Theres also a goto() function.
haupt
anfang
punktsetzen (s1) //places the goto-point
schreiben ("HI" + nZeile)
gehezu (s1) //goes to s1... It will write infinitely HI
ende
