Parser
Parser is an applet that can interpret and run simple scripts. After a script
is run, the defined variables are shown within brackets in the bottom text area,
together with any printed output. If Parser has encountered an error, it will
also be reported there, but unfortunately the error report is not
neither precise, nor easy to understand...
Language Summary
Parser understands a language similar to C and Pascal. It is probably most easily understood by reading the example code, but you can also read the language "specification" below.Operators
arithmetic operators: + - * / %Flow control statements
parentheses: ( )
comparison operators: < > <= >= == !=
assignment operator: =
variable decraration: int flag string
end of line: ;
boolean constants: true false
logical operators: and or not !
commments (can nest): { }
functions: name[param1,param2]
Loop statements
if flag1 then
;
elseif flag2 then
;
else
;
endif;
repeatFunctions
if flag3 then
break;
endif;
if flag4 then
continue;
endif;
while flag5;
string print[...]Operator precedence (same as Java)
string substring[any, int, int]
int getLength[string]
int stringToInt[string]
int random[int, int]
= int string flag while
or
and
== !=
<= >= < >
+ -
* / %
not !
) ]
By Björn Carlin, 2001
