1
2
3
4
5 package contraire
6
7 type prog struct{ decls []decl }
8
9
10
11 type decl interface{ decl() }
12
13 type constDecl struct {
14 name string
15 expr constExpr
16 }
17
18 type typeDecl struct {
19 name string
20 expr typeExpr
21 }
22
23 func (*constDecl) decl() {}
24 func (*typeDecl) decl() {}
25
26
27
28 type constExpr interface{ constExpr() }
29
30 type constName struct{ name string }
31 type constLtrl struct{}
32
33 func (*constName) constExpr() {}
34 func (*constLtrl) constExpr() {}
35
36
37
38 type typeExpr interface{ typeExpr() }
39
40 type typeName struct{ name string }
41 type typeBasic struct{}
42 type typePointer struct{ expr typeExpr }
43
44 func (*typeName) typeExpr() {}
45 func (*typeBasic) typeExpr() {}
46 func (*typePointer) typeExpr() {}
47
View as plain text