BLINK. A simple interpreter based on Javascript.
Syntax to work with Blink.
- Proper spacing is required between keywords.
- Each statement should be terminated with semicolon.
- Last statement should not be terminated with semicolon.
use
: The use keyword is used to declare a variable before using it. The variable name follows the identifier rules for Javascript.set
: The set keyword is used to set the value of the variable. It is followed by variable name and the value to be assigned.print
: The print keyword followed by variable name prints out in the output area.if/end
: The conditional statements. If condition is true, the lines under it tillend
keyword is found are executed. If condition is false, the statements untilend
are skipped.
Usage until v0.0
use my_Var;
set my_Var 10
This sets the value for my_Var
as 10.
use age;
set age 20;
print age
It prints the value of the age variable.
use a;
set a 100;
if true;
set a 50;
end;
print a;
The if condition requires either a true
or false
value. If it is true, it evaluates the statements below it. Otherwise skips them.
Don't forget to put end;
to get out of the if block.