-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.src
More file actions
42 lines (35 loc) · 925 Bytes
/
test.src
File metadata and controls
42 lines (35 loc) · 925 Bytes
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
pattern Comment = Comment '//' Anything_EOL;
pattern Anything_EOL = EOL '$'
| Anything * Anything_EOL;
bind (Comment '//' anything) = ;
pattern CompSegment = CompSegment 'comptime' '{' UntilRun;
pattern UntilRun = Run '}'
| MidRun '{' UntilRun UntilRun
| Until * UntilRun;
bind 'BlockRun' (Until text next) = text BlockRun next;
bind 'BlockRun' (Run '}') = ;
bind 'BlockRun' (MidRun '{' next after) = BlockRun next BlockRun after;
bind (CompSegment 'comptime' '{' rest) =
comp
BlockRun rest
mov r0 !1
int
run
;
pattern UntilIn = In 'in'
| Untilin * UntilIn;
bind 'let' (* name) '=' (UntilIn value) '{' (UntilRun body) =
comptime {
BlockRun Body
}
bind name = BlockIn value
where
bind 'BlockIn' (Untilin text next) = text BlockIn next;
bind 'BlockIn' (In 'in') = ;
;
let syscall = r1 in {
mov r1 !1
}
mov r0 !syscall
// mov r0 !2
int