Useless translator for useless language. This is course project. Language use for system of manage robot in cell maze. Maze is a square. Robot can move to neighbor, cell if it is empty.
N- is variable number without repetition.I- index of array (int)ID->.N | ,N | $N?! maybe arrays- one line - one statement
- Literals
- Integer
[0-9]{1,} - Boolean
T|F
- Variables
- Integer
,N - Bool
.N - Procedures
$N - Labels
~N - Interer array
,N:->int aN[0];,N:I1->int aN[I1];,N:I1-I2->int aN[I1][I2];
- Bool array
.N:->bool aN[0];.N:I1->bool aN[I1];.N:I1-I2->bool aN[I1][I2];
- Procedures array
$N:->func aN[0];$N:I1->func aN[I1];$N:I1-I2->func aN[I1][I2];
- Operators
- Arithmetical (int)
- increment
,#N->aN += 1 - decrement
,*N->aN -= 1
- increment
- Logic (bool)
- logical nor:
.#(logic exp)!?
- logical nor:
- Assigment
<- - Comparison
<exp> eq <const>. Three types: logic, int, proc - Cycles
(<logic exp>)<cycle operator>{statements}?! Note: I dont know what should I use how a cycle operator - Conditions
[<logic exp>] please ~N?! need to know, can I do so?
if logic exp is true go to label - pass operator
np. This is pythonpass - binding operator
ID @ $N. bind ID to procedure with the following features:- binding many id to many procedure
- recursive binding is forbidden (return
F) - on handling binded ID: at first call proc, after that return ID value
- unbinding operator
ID % $N(returnT)
- Operators for manage robot
- move robot to one cell on selected direction
mf | mb | mr | ml, returnTif robot can do it, elseF - teleport robot to another random cell
tp, robot has limited quantity try usetp, after use this command robot dont know his position.