-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.md.backup
92 lines (69 loc) · 1.66 KB
/
README.md.backup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Robit Transpiler Local
## Syntax (What is valid to write)
### Keywords
(As a clarification an expression is anything that evaluates to a number -> meaning it can also be a constant.)
`TYPE = INTEGER, CHAR, REAL, STRING, BOOLEAN`
`STRING = something written as "Text here"`
`CHAR = something written as 't'`
Valid arithmetic operators: `+`, `-`, `*`, `/`, `mod`, `div`
Valid Logic Operators: `{B} AND {B}`, `{B} OR {B}`, `NOT {B}`
<ul>
<li>
`OUTPUT {EXPRESSION(s) / STRING(s)}`*
*these should be comma-separated
<li>
`{VARIABLE / ARRAY_INDEX} <- {EXPRESSION / STRING}`
<li>
`DECLARE {VARIABLE} : ARRAY [EXPRESSION : EXPRESSION] OF {TYPE}`
<li>
`INPUT {VARIABLE / ARRAY_INDEX}`
<li>
```
IF {CONDITION (BOOLEAN)}
THEN
{STATEMENTS}
ELSE
{STATEMENTS}
ENDIF
```
* Note that the `ELSE` statement is optional.
* `IF` statements can also be nested.
<li>
```
CASE OF {VARIABLE / ARRAY_INDEX}
{EXPRESSION} : {STATEMENT (singular)}
{EXPRESSION} : {STATEMENT (singular)}
...
OTHERWISE : {STATEMENT (singular)}
ENDCASE
```
* Note that the `OTHERWISE` clause is optional.
<li>
```
FOR {VARIABLE / ARRAY_INDEX} <- {EXPRESSION} TO {EXPRESSION}
{STATEMENTS}
NEXT
```
<li>
```
FOR {VARIABLE / ARRAY_INDEX} <- {EXPRESSION} TO {EXPRESSION} STEP {EXPRESSION}
{STATEMENTS}
NEXT
```
<li>
```
REPEAT
{STATEMENTS}
UNTIL {CONDITION (BOOLEAN)}
```
<li>
```
WHILE {CONDITION (BOOLEAN)} DO
{STATEMENTS}
ENDWHILE
```
</ul>
A condition can be constructed using the comparison and boolean operators `AND`, `OR`, `NOT`, `>`, `<`,`<=`,`>=`,`==`, variables and expressions. Use brackets to make more explicit.
## What is this?
## How to use
## The Works