Math operation + - * / \ % & | ^ ~ ! >> << Bool operation AND OR XOR Compare operation = > < <> >= <= Object operation . IS Set value X := Y += -= = /= ... Value collection IN (a,b) String operation LEN Condition expr IF( condition, value1, value2) IFELSE( condition1, value1, condition2, value2, ... valueElse) Case expr CASE( v, value1, expr1, value2, expr2, ... , exprElse) Loop expr FOR, WHILE, REPEAT, TIMES Sentence end tag ; Variable with " "My Var" Array access AB[ C+2 ,10 ] Print output Print(Msg) Eval a string Eval('A+=20; B:=A/10;') Funcion/Var define public function Max(A,B):=IF(A>B,A,B);
Parse Example:
2 + X / Sin(Y) => {op:"+",p1:2,p2:{op:"/",p1:"X",p2:{op:"SIN",p1:"Y"}}} Z/(X.Max+0.5) => {op:"/",p1:"Z",p2:{op:"+",p1:{op:".",p1:"X",p2:"Max"},p2:0.5}}
Eval Example:
IF( Y.Name IS not NULL, PI, 3 + (9<<2) ) X:=3; Y:=X-5; IF(2>X+Y, 2, X*Y) X1:=1; Y:=IF(X IS NULL,0,X1|5); Z:=9/IF(X1+2<=(3+Y),X2:=X1<<3,(Y:=X1*10; X2:=Y|100)); P1.X:=10; P1.Y:=9-P1.X/2; S:=P1.((X+2)/Y)
Aim Language Convert Example:
Convert expression to Pascal:
X:=1+IF(A<B,IF(B,100,0.5)*1.5,IF(A<>C,2,4+5))
=>
if A<B then begin if B then begin tv_4_2:=100; end else begin tv_4_2:=0.5; end; tv_2_1:=tv_4_2*1.5; end else begin if A<>C then begin tv_3_3:=2; end else begin tv_3_3:=4+5; end; tv_2_1:=tv_3_3; end; X:=1+tv_2_1