-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain_tokens.txt
44 lines (44 loc) · 2.04 KB
/
main_tokens.txt
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
<VARDECL><ID, array><=><ID, newTable><(><)><SEPARATOR>
<VARDECL><ID, str><=><ID, scan><(><)><SEPARATOR>
<VARDECL><ID, len><=><ID, strlen><(><ID, str><)><SEPARATOR>
<VARDECL><ID, i><=><NUM, 0><SEPARATOR>
<WHILE><(><ID, i><<><ID, len><)><DO>
<VARDECL><ID, ch><=><ID, at><(><ID, str><,><ID, i><)><SEPARATOR>
<IF><(><ID, ch><>=><CHARACTER, 0><&&><ID, ch><<=><CHARACTER, 9><||><ID, ch><==><CHARACTER, -><)><DO>
<VARDECL><ID, start><=><ID, i><SEPARATOR>
<VARDECL><ID, end><=><ID, i><SEPARATOR>
<WHILE><(><ID, i><<><ID, len><&&><(><ID, ch><>=><CHARACTER, 0><&&><ID, ch><<=><CHARACTER, 9><||><ID, ch><==><CHARACTER, .><||><ID, ch><==><CHARACTER, -><)><)><DO>
<ID, end><=><ID, i><+><NUM, 1><SEPARATOR>
<ID, i><=><ID, i><+><NUM, 1><SEPARATOR>
<ID, ch><=><ID, at><(><ID, str><,><ID, i><)><SEPARATOR>
<END>
<ID, push><(><ID, array><,><ID, strtonum><(><ID, substr><(><ID, str><,><ID, start><,><ID, end><)><)><)><SEPARATOR>
<END>
<ID, i><=><ID, i><+><NUM, 1><SEPARATOR>
<END>
<ID, len><=><ID, count><(><ID, array><)><SEPARATOR>
<VARDECL><ID, min><=><ID, at><(><ID, array><,><NUM, 0><)><SEPARATOR>
<VARDECL><ID, max><=><ID, min><SEPARATOR>
<VARDECL><ID, sum><=><ID, min><SEPARATOR>
<ID, i><=><NUM, 1><SEPARATOR>
<WHILE><(><ID, i><<><ID, len><)><DO>
<VARDECL><ID, curr><=><ID, at><(><ID, array><,><ID, i><)><SEPARATOR>
<ID, sum><=><ID, sum><+><ID, curr><SEPARATOR>
<IF><(><ID, curr><>><ID, max><)><DO>
<ID, max><=><ID, curr><SEPARATOR>
<END>
<IF><(><ID, curr><<><ID, min><)><DO>
<ID, min><=><ID, curr><SEPARATOR>
<END>
<ID, i><=><ID, i><+><NUM, 1><SEPARATOR>
<END>
<ID, print><(><STRING, Length is: ><)><SEPARATOR>
<ID, print><(><ID, len><,><STRING, ><)><SEPARATOR>
<ID, print><(><STRING, Max value is: ><)><SEPARATOR>
<ID, print><(><ID, max><,><STRING, ><)><SEPARATOR>
<ID, print><(><STRING, Min value is: ><)><SEPARATOR>
<ID, print><(><ID, min><,><STRING, ><)><SEPARATOR>
<ID, print><(><STRING, Sum of all values is: ><)><SEPARATOR>
<ID, print><(><ID, sum><,><STRING, ><)><SEPARATOR>
<ID, print><(><STRING, Average value is: ><)><SEPARATOR>
<ID, print><(><ID, sum></><ID, len><,><STRING, ><)><SEPARATOR>