ipp Language Compiler. ipp is a cross-platform language that is compiled to c++.
"i made it, and it work"
~Michał 2021
Echo "hello"
Lub EchoLine "hello"
Displays string in console window. You can use ~
operator to concatenate two or more strings.
ReadKey
Halt program and wait for user input. Returns ASCII value of inputed char.
ReadString
Halt program and wait for user input. Returns inputed string. Since i++ is compiled to C++, this code is not legal in i++: string s = ReadString;
.
Wait 'int millisecond'
ex. Wait 2000
Halts program for 2 seconds.
return
Returns value from function. ex. return 4;
.
if
and else
work in the same way as in C++. ex. if x == 1;
. To end if
block, Use end
.
if x == 1;
EchoLine x;
end;
else;
EchoLine "else";
end;
for
ex. for int i = 1; i < 10; i++;
.
while
ex. while 1==1;
.
DoWhile
ex.
DoWhile 1==1;
EchoLine "Helo";
end;
File
To create file object. ex. File myFile;
.
File.Open
To open a file. ex. myFile.Open "file.txt";
.
File.Write
Write to file. ex. myFile.Write "text";
.
File.Close
Close file. ex. myFile.Close;
.
CreateFile 'FileName'
. ex. CreateFile file;
Will create file.txt
File.ReadByLine 'string output'
or File.ReadByLineEcho
To read file content. ex. myFile.ReadByLine str;
. File.ReadByLine
and File.ReadBylineEcho
are loops, so they need to be ended with end;
.
Read specific character from string:
string s = "text";
EchoLine s[0];
~
Concatenate operator. You can use it in Echo
or EchoLine
, to merge strings.
=
Use it to assign value to a variable. ex. int hello = 123;
. After using =
add one (
)/blank space after variable name.
+
Addition
-
subtraction
~
Concatenate. ex. EchoLine "Hello" ~ " World";
*
Multiplication
/
Division
%
Modulo
++
Increment
*
Multiplication
/
Division
int/int*
string
ex. string s;
or string s = "hello";
.
char
float
double
void
In function definitions. ex. def void test();
.
You can use the address of a variable like this:
int i = 10;
EchoLine i.Address;
Or assign it to a pointer like this:
int i = 10;
int* p = i.Address;
EchoLine p;
Use def
, in order to define a function. After def
keyword provide return type. ex. def int test();
. End function definition with end
keyword. ex.
def void test();
EchoLine "Function!";
end;
In order to add other, existing .ipp file Use use
keyword. ex.
use "code.ipp";
def int main();
FromDiffrentFile();
end;
Functions can take arguments. ex. def int test(int x, int y);
.
name=example
Change compiled .exe filename to 'example'.
run
Run program after compilation.
linux
Use this flag, if you are using ippCompiler in Linux.
force
Use this flag to force compile program regardless of errors detected by ippCompiler.
macros
Downloads additional files needed by ippCompiler.
nogencode
Compiler outputs only runable file whitout generated .cpp file.
noout
Produces no output. Used in compiling examples.
help
Shows list of all compiler flags.
ex: name=hello, run, force
You can use ippCompiler from command line too. ex. ippCompiler.exe code.ipp run
or ippCompiler.exe code.ipp -run
bool MacroContains(string s1, string s2)
Returns true, is s1 contains s2, otherwise false.
Every i++ program needs to have main function defined. Use def int main();
.
def int main();
EchoLine "Hello, World!";
end;
Function calling example:
def void test();
EchoLine "Function";
end;
def int main();
test();
end;