@@ -56,56 +56,60 @@ public IncludeDecl(SpecFile file, Attribute... attributes) {
56
56
}
57
57
}
58
58
59
- public static class TermDecl extends SyntacticElement .Impl implements Decl {
59
+ public static class AnnotableDecl extends SyntacticElement .Impl implements Decl {
60
+ public final Map <String ,Object > annotations ;
61
+
62
+ public AnnotableDecl (Map <String ,Object > annotations , Attribute ... attributes ) {
63
+ super (attributes );
64
+ this .annotations = new HashMap <String ,Object >(annotations );
65
+ }
66
+ }
67
+
68
+ public static class TermDecl extends AnnotableDecl {
60
69
public Type .Term type ;
61
70
62
- public TermDecl (Type .Term data , Attribute ... attributes ) {
63
- super (attributes );
71
+ public TermDecl (Type .Term data , Map < String , Object > annotations , Attribute ... attributes ) {
72
+ super (annotations , attributes );
64
73
this .type = data ;
65
74
}
66
75
}
67
76
68
- public static class TypeDecl extends SyntacticElement . Impl implements Decl {
77
+ public static class TypeDecl extends AnnotableDecl {
69
78
public final String name ;
70
79
public final Type type ;
71
80
public final boolean isOpen ;
72
81
73
- public TypeDecl (String n , Type type , boolean isOpen , Attribute ... attributes ) {
74
- super (attributes );
82
+ public TypeDecl (String n , Type type , boolean isOpen , Map < String , Object > annotations , Attribute ... attributes ) {
83
+ super (annotations , attributes );
75
84
this .name = n ;
76
85
this .type = type ;
77
86
this .isOpen = isOpen ;
78
87
}
79
88
}
80
89
81
- public static abstract class RewriteDecl extends SyntacticElement .Impl implements
82
- Decl {
90
+ public static abstract class RewriteDecl extends AnnotableDecl {
83
91
public Pattern .Term pattern ;
84
92
public final ArrayList <RuleDecl > rules ;
85
- public final String name ;
86
- public final int rank ;
87
93
88
94
public RewriteDecl (Pattern .Term pattern , Collection <RuleDecl > rules ,
89
- String name , int rank , Attribute ... attributes ) {
90
- super (attributes );
95
+ Map < String , Object > annotations , Attribute ... attributes ) {
96
+ super (annotations , attributes );
91
97
this .pattern = pattern ;
92
- this .rules = new ArrayList <RuleDecl >(rules );
93
- this .name = name ;
94
- this .rank = rank ;
98
+ this .rules = new ArrayList <RuleDecl >(rules );
95
99
}
96
100
}
97
101
98
102
public static class ReduceDecl extends RewriteDecl {
99
103
public ReduceDecl (Pattern .Term pattern , Collection <RuleDecl > rules ,
100
- String name , int rank , Attribute ... attributes ) {
101
- super (pattern ,rules ,name , rank ,attributes );
104
+ Map < String , Object > annotations , Attribute ... attributes ) {
105
+ super (pattern ,rules ,annotations ,attributes );
102
106
}
103
107
}
104
108
105
109
public static class InferDecl extends RewriteDecl {
106
- public InferDecl (Pattern .Term pattern , Collection <RuleDecl > rules ,
107
- String name , int rank , Attribute ... attributes ) {
108
- super (pattern ,rules ,name , rank , attributes );
110
+ public InferDecl (Pattern .Term pattern , Collection <RuleDecl > rules , Map < String , Object > annotations ,
111
+ Attribute ... attributes ) {
112
+ super (pattern ,rules ,annotations , attributes );
109
113
}
110
114
}
111
115
0 commit comments