-
Notifications
You must be signed in to change notification settings - Fork 0
/
simple4.atg
39 lines (27 loc) · 884 Bytes
/
simple4.atg
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
$FI
COMPILER Coco
CHARACTERS
letter = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_".
digit = "0123456789".
cr = '\r'.
lf = '\n'.
tab = '\t'.
stringCh = ANY - '"' - '\\' - cr - lf.
charCh = ANY - '\'' - '\\' - cr - lf.
printable = '\u0020' .. '\u007e'.
hex = "0123456789abcdef".
TOKENS
ident = letter { letter | digit }.
number = digit { digit }.
string = '"' { stringCh | '\\' printable } '"'.
badString = '"' { stringCh | '\\' printable } (cr | lf).
char = '\'' ( charCh | '\\' printable { hex } ) '\''.
IGNORE cr + lf + tab
/*-------------------------------------------------------------------------*/
PRODUCTIONS
Coco = Tel.
Tel = number "/" number.
Test1<asdf:number, asdf2:string>=Tel.
Test2<out Symbol sym>=Tel.
Test3<out Symbol sym, asdf:number, asdf2:string>=Tel.
END Coco.