@@ -41,18 +41,18 @@ var AnnotationRules = On(jdt.CompilationUnit).Roles(uast.File).Descendants(
4141 ),
4242
4343 // Type declarations
44- On (jdt .AnonymousClassDeclaration ).Roles (uast .Expression , uast .Declaration , uast .Type , uast .Incomplete ).Children (
44+ On (jdt .AnonymousClassDeclaration ).Roles (uast .Expression , uast .Declaration , uast .Type , uast .Anonymous ).Children (
4545 On (jdt .PropertyBodyDeclarations ).Roles (uast .Body ),
4646 ),
47- On (jdt .AnnotationTypeDeclaration ).Roles (uast .Declaration , uast .Type , uast .Incomplete ).Children (
47+ On (jdt .AnnotationTypeDeclaration ).Roles (uast .Declaration , uast .Type , uast .Annotation ).Children (
4848 On (jdt .PropertyBodyDeclarations ).Roles (uast .Body ),
4949 ),
50- On (jdt .EnumDeclaration ).Roles (uast .Declaration , uast .Type , uast .Incomplete ),
50+ On (jdt .EnumDeclaration ).Roles (uast .Declaration , uast .Type , uast .Enumeration ),
5151
5252 // ClassDeclaration | InterfaceDeclaration
5353 On (jdt .TypeDeclaration ).Roles (uast .Declaration , uast .Type ),
5454 // Local (TypeDeclaration | EnumDeclaration)
55- On (jdt .TypeDeclarationStatement ).Roles (uast .Statement , uast .Declaration , uast .Type , uast . Incomplete ),
55+ On (jdt .TypeDeclarationStatement ).Roles (uast .Statement , uast .Declaration , uast .Type ),
5656
5757 // Method declarations
5858 On (jdt .MethodDeclaration ).Roles (uast .Declaration , uast .Function ).Children (
@@ -64,10 +64,7 @@ var AnnotationRules = On(jdt.CompilationUnit).Roles(uast.File).Descendants(
6464 On (jdt .PropertyName ).Roles (uast .Function , uast .Name ),
6565 ),
6666 ),
67- // FIXME: A lambda expression is not really a function declaration
68- // but current UAST doesn't provide anything else for function definitions
69- // so I'm considering a lambda expression a function declaration for now
70- On (jdt .LambdaExpression ).Roles (uast .Declaration , uast .Function , uast .Incomplete ).Children (
67+ On (jdt .LambdaExpression ).Roles (uast .Declaration , uast .Function , uast .Anonymous ).Children (
7168 On (jdt .PropertyBody ).Roles (uast .Function , uast .Body ),
7269 On (jdt .PropertyParameters ).Roles (uast .Function , uast .Argument ).Self (
7370 On (HasProperty ("varargs" , "true" )).Roles (uast .Function , uast .ArgsList ),
@@ -82,15 +79,15 @@ var AnnotationRules = On(jdt.CompilationUnit).Roles(uast.File).Descendants(
8279 ),
8380
8481 // Other declarations
85- On (jdt .AnnotationTypeMemberDeclaration ).Roles (uast .Declaration , uast .Type , uast .Incomplete ),
86- On (jdt .EnumConstantDeclaration ).Roles (uast .Declaration , uast .Incomplete ),
87- On (jdt .FieldDeclaration ).Roles (uast .Declaration , uast .Incomplete ),
82+ On (jdt .AnnotationTypeMemberDeclaration ).Roles (uast .Declaration , uast .Type , uast .Annotation ),
83+ On (jdt .EnumConstantDeclaration ).Roles (uast .Declaration , uast .Enumeration ),
84+ On (jdt .FieldDeclaration ).Roles (uast .Declaration , uast .Variable ),
8885 // TODO: differentiate between static (class) and instance initialization
8986 On (jdt .Initializer ).Roles (uast .Initialization , uast .Block , uast .Incomplete ),
90- On (jdt .SingleVariableDeclaration ).Roles (uast .Declaration , uast .Incomplete ),
91- On (jdt .VariableDeclarationExpression ).Roles (uast .Expression , uast .Declaration , uast .Incomplete ),
92- On (jdt .VariableDeclarationFragment ).Roles (uast .Declaration , uast .Incomplete ),
93- On (jdt .VariableDeclarationStatement ).Roles (uast .Statement , uast .Declaration , uast .Incomplete ),
87+ On (jdt .SingleVariableDeclaration ).Roles (uast .Declaration , uast .Variable ),
88+ On (jdt .VariableDeclarationExpression ).Roles (uast .Expression , uast .Declaration , uast .Variable ),
89+ On (jdt .VariableDeclarationFragment ).Roles (uast .Declaration , uast .Variable ),
90+ On (jdt .VariableDeclarationStatement ).Roles (uast .Statement , uast .Declaration , uast .Variable ),
9491
9592 // Literals
9693 On (jdt .BooleanLiteral ).Roles (uast .Expression , uast .Literal , uast .Boolean ),
@@ -176,14 +173,20 @@ var AnnotationRules = On(jdt.CompilationUnit).Roles(uast.File).Descendants(
176173
177174 // Operators
178175 On (jdt .InfixExpression ).Roles (uast .Expression , uast .Binary , uast .Operator ).Self (
179- On (HasProperty ("operator" , "+" )).Roles (uast .Add ),
180- On (HasProperty ("operator" , "-" )).Roles (uast .Substract ),
181- On (HasProperty ("operator" , "*" )).Roles (uast .Multiply ),
182- On (HasProperty ("operator" , "/" )).Roles (uast .Divide ),
183- On (HasProperty ("operator" , "%" )).Roles (uast .Modulo ),
176+ On (HasProperty ("operator" , "+" )).Roles (uast .Add , uast . Arithmetic ),
177+ On (HasProperty ("operator" , "-" )).Roles (uast .Substract , uast . Arithmetic ),
178+ On (HasProperty ("operator" , "*" )).Roles (uast .Multiply , uast . Arithmetic ),
179+ On (HasProperty ("operator" , "/" )).Roles (uast .Divide , uast . Arithmetic ),
180+ On (HasProperty ("operator" , "%" )).Roles (uast .Modulo , uast . Arithmetic ),
184181 On (HasProperty ("operator" , "<<" )).Roles (uast .Bitwise , uast .LeftShift ),
185182 On (HasProperty ("operator" , ">>" )).Roles (uast .Bitwise , uast .RightShift ),
186183 On (HasProperty ("operator" , ">>>" )).Roles (uast .Bitwise , uast .RightShift , uast .Unsigned ),
184+ On (HasProperty ("operator" , "<" )).Roles (uast .LessThan , uast .Relational ),
185+ On (HasProperty ("operator" , ">" )).Roles (uast .GreaterThan , uast .Relational ),
186+ On (HasProperty ("operator" , "<=" )).Roles (uast .LessThanOrEqual , uast .Relational ),
187+ On (HasProperty ("operator" , ">=" )).Roles (uast .GreaterThanOrEqual , uast .Relational ),
188+ On (HasProperty ("operator" , "==" )).Roles (uast .Equal , uast .Relational ),
189+ On (HasProperty ("operator" , "==" )).Roles (uast .Equal , uast .Not , uast .Relational ),
187190 On (HasProperty ("operator" , "&" )).Roles (uast .Bitwise , uast .And ),
188191 On (HasProperty ("operator" , "|" )).Roles (uast .Bitwise , uast .Or ),
189192 On (HasProperty ("operator" , "&&" )).Roles (uast .Boolean , uast .And ),
@@ -195,8 +198,8 @@ var AnnotationRules = On(jdt.CompilationUnit).Roles(uast.File).Descendants(
195198 ),
196199
197200 On (jdt .PostfixExpression ).Roles (uast .Expression , uast .Operator , uast .Unary , uast .Postfix ).Self (
198- On (HasProperty ("operator" , "++" )).Roles (uast .Increment ),
199- On (HasProperty ("operator" , "--" )).Roles (uast .Increment ),
201+ On (HasProperty ("operator" , "++" )).Roles (uast .Increment , uast . Arithmetic ),
202+ On (HasProperty ("operator" , "--" )).Roles (uast .Increment , uast . Arithmetic ),
200203 ),
201204
202205 On (jdt .PrefixExpression ).Roles (uast .Expression , uast .Operator , uast .Unary ).Self (
@@ -260,7 +263,7 @@ var AnnotationRules = On(jdt.CompilationUnit).Roles(uast.File).Descendants(
260263
261264 // Exceptions
262265 On (jdt .TryStatement ).Roles (uast .Statement , uast .Try ).Children (
263- // TODO: TryWithResourcesStatement
266+ On ( jdt . PropertyResources ). Roles ( uast . Try ),
264267 On (jdt .PropertyBody ).Roles (uast .Try , uast .Body ),
265268 On (jdt .PropertyCatchClauses ).Roles (uast .Try , uast .Catch ),
266269 On (jdt .PropertyFinally ).Roles (uast .Try , uast .Finally ),
@@ -271,21 +274,23 @@ var AnnotationRules = On(jdt.CompilationUnit).Roles(uast.File).Descendants(
271274 On (jdt .AssertStatement ).Roles (uast .Statement , uast .Assert ),
272275
273276 // Annotations
274- On (jdt .MarkerAnnotation ).Roles (uast .Incomplete ),
275- On (jdt .MemberRef ).Roles (uast .Incomplete ),
276- On (jdt .MemberValuePair ).Roles (uast .Incomplete ),
277- On (jdt .MethodRef ).Roles (uast .Incomplete ),
278- On (jdt .MethodRefParameter ).Roles (uast .Incomplete ),
279- On (jdt .NormalAnnotation ).Roles (uast .Incomplete ),
280- On (jdt .SingleMemberAnnotation ).Roles (uast .Incomplete ),
281- On (jdt .TagElement ).Roles (uast .Incomplete ),
282- On (jdt .TextElement ).Roles (uast .Incomplete ),
277+ On (jdt .MarkerAnnotation ).Roles (uast .Annotation , uast .Incomplete ),
278+ On (jdt .NormalAnnotation ).Roles (uast .Annotation , uast .Incomplete ),
279+ On (jdt .SingleMemberAnnotation ).Roles (uast .Annotation , uast .Incomplete ),
280+ On (jdt .MemberValuePair ).Roles (uast .Annotation , uast .Incomplete ),
283281
284282 // Comments
285283 On (jdt .BlockComment ).Roles (uast .Comment ),
286284 On (jdt .Javadoc ).Roles (uast .Documentation , uast .Comment ),
287285 On (jdt .LineComment ).Roles (uast .Comment ),
288286
287+ // Javadoc tags
288+ On (jdt .MemberRef ).Roles (uast .Documentation , uast .Variable , uast .Incomplete ),
289+ On (jdt .MethodRef ).Roles (uast .Documentation , uast .Function , uast .Incomplete ),
290+ On (jdt .MethodRefParameter ).Roles (uast .Documentation , uast .Function , uast .Incomplete ),
291+ On (jdt .TagElement ).Roles (uast .Documentation , uast .Incomplete ),
292+ On (jdt .TextElement ).Roles (uast .Documentation , uast .Incomplete ),
293+
289294 // Other expressions
290295 On (jdt .ArrayAccess ).Roles (uast .Expression , uast .Incomplete ),
291296 On (jdt .ArrayCreation ).Roles (uast .Expression , uast .Incomplete ),
0 commit comments