blob: 7bb5137ad32f93963fdd7a6b8066ee320c4f3314 (
plain)
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
|
lex
literal `{ `}
literal `struct `type
token id /[A-Za-z_][A-Za-z_0-9]*/
ignore /[ \t\r\n]+/
end
def attribute
[`type id]
def _struct
[`struct id `{ attribute* `}]
def program
[_struct*]
int func( P: program )
{
print( P )
}
int main()
{
parse P: program[ stdin ]
func( P )
}
main()
##### IN #####
struct S
{
type T
}
##### EXP #####
struct S
{
type T
}
|