@@ -44,14 +44,22 @@ var AnnotationRules = On(jdt.CompilationUnit).Roles(File).Descendants(
4444
4545 // Method declarations
4646 On (jdt .MethodDeclaration ).Roles (FunctionDeclaration ).Children (
47- //TODO: On(jdt.PropertyTypeParameters).Roles(FunctionDeclarationTypeParameter),
48- //TODO: On(jdt.PropertyReturnType2).Roles(FunctionDeclarationReturnType)
4947 On (jdt .PropertyName ).Roles (FunctionDeclarationName ),
5048 On (jdt .PropertyBody ).Roles (FunctionDeclarationBody ),
5149 On (jdt .PropertyParameters ).Roles (FunctionDeclarationArgument ).Self (
5250 On (HasProperty ("varargs" , "true" )).Roles (FunctionDeclarationVarArgsList ),
5351 ).Children (
54- //TODO: On(jdt.PropertyType).Roles(FunctionDeclarationArgumentType),
52+ On (jdt .PropertyName ).Roles (FunctionDeclarationArgumentName ),
53+ ),
54+ ),
55+ // FIXME: A lambda expression is not really a function declaration
56+ // but current UAST doesn't provide anything else for function definitions
57+ // so I'm considering a lambda expression a function declaration for now
58+ On (jdt .LambdaExpression ).Roles (FunctionDeclaration , Incomplete ).Children (
59+ On (jdt .PropertyBody ).Roles (FunctionDeclarationBody ),
60+ On (jdt .PropertyParameters ).Roles (FunctionDeclarationArgument ).Self (
61+ On (HasProperty ("varargs" , "true" )).Roles (FunctionDeclarationVarArgsList ),
62+ ).Children (
5563 On (jdt .PropertyName ).Roles (FunctionDeclarationArgumentName ),
5664 ),
5765 ),
@@ -60,6 +68,7 @@ var AnnotationRules = On(jdt.CompilationUnit).Roles(File).Descendants(
6068 On (jdt .AnnotationTypeMemberDeclaration ).Roles (Incomplete ),
6169 On (jdt .EnumConstantDeclaration ).Roles (Incomplete ),
6270 On (jdt .FieldDeclaration ).Roles (Incomplete ),
71+ On (jdt .Initializer ).Roles (Incomplete ),
6372 On (jdt .SingleVariableDeclaration ).Roles (Incomplete ),
6473 On (jdt .VariableDeclarationExpression ).Roles (Expression , Incomplete ),
6574 On (jdt .VariableDeclarationFragment ).Roles (Incomplete ),
@@ -74,11 +83,28 @@ var AnnotationRules = On(jdt.CompilationUnit).Roles(File).Descendants(
7483 On (jdt .TypeLiteral ).Roles (TypeLiteral , Expression ),
7584
7685 // Calls
86+ On (jdt .ClassInstanceCreation ).Roles (Call , Expression , Incomplete ).Children (
87+ On (jdt .PropertyType ).Roles (CallCallee ),
88+ On (jdt .PropertyArguments ).Roles (CallPositionalArgument ),
89+ ),
90+ On (jdt .ConstructorInvocation ).Roles (Call , Statement , Incomplete ).Children (
91+ On (jdt .PropertyType ).Roles (CallCallee ),
92+ On (jdt .PropertyArguments ).Roles (CallPositionalArgument ),
93+ ),
7794 On (jdt .MethodInvocation ).Roles (Call , Expression ).Children (
7895 On (jdt .PropertyExpression ).Roles (CallReceiver ),
7996 On (jdt .PropertyName ).Roles (CallCallee ),
8097 On (jdt .PropertyArguments ).Roles (CallPositionalArgument ),
8198 ),
99+ On (jdt .SuperConstructorInvocation ).Roles (Call , Statement , Incomplete ).Children (
100+ On (jdt .PropertyExpression ).Roles (CallReceiver ),
101+ On (jdt .PropertyArguments ).Roles (CallPositionalArgument ),
102+ ),
103+ On (jdt .SuperMethodInvocation ).Roles (Call , Expression , Incomplete ).Children (
104+ On (jdt .PropertyQualifier ).Roles (CallCallee ),
105+ On (jdt .PropertyName ).Roles (CallCallee ),
106+ On (jdt .PropertyArguments ).Roles (CallPositionalArgument ),
107+ ),
82108
83109 // Conditionals
84110 On (jdt .IfStatement ).Roles (If , Statement ).Children (
@@ -226,15 +252,32 @@ var AnnotationRules = On(jdt.CompilationUnit).Roles(File).Descendants(
226252 // Other expressions
227253 On (jdt .ArrayAccess ).Roles (Expression , Incomplete ),
228254 On (jdt .ArrayCreation ).Roles (Expression , Incomplete ),
255+ On (jdt .CastExpression ).Roles (Expression , Incomplete ),
256+ On (jdt .CreationReference ).Roles (Expression , Incomplete ),
257+ On (jdt .ExpressionMethodReference ).Roles (Expression , Incomplete ),
258+ On (jdt .ParenthesizedExpression ).Roles (Expression , Incomplete ),
259+ On (jdt .SuperMethodReference ).Roles (Expression , Incomplete ),
229260 On (jdt .ThisExpression ).Roles (This , Expression ),
230261
231262 // Other statements
232263 On (jdt .Block ).Roles (BlockScope , Block , Statement ),
264+ On (jdt .BreakStatement ).Roles (Break , Statement ),
233265 On (jdt .EmptyStatement ).Roles (Statement ),
234266 On (jdt .ExpressionStatement ).Roles (Statement ),
267+ On (jdt .LabeledStatement ).Roles (Statement , Incomplete ),
235268 On (jdt .ReturnStatement ).Roles (Return , Statement ),
236- On (jdt .BreakStatement ).Roles (Break , Statement ),
269+ On (jdt .SynchronizedStatement ).Roles (Statement , Incomplete ),
237270
238- //TODO: synchronized
271+ // Others
272+ On (jdt .ArrayInitializer ).Roles (Incomplete ),
273+ On (jdt .Dimension ).Roles (Incomplete ),
239274 On (jdt .Javadoc ).Roles (Documentation , Comment ),
275+ On (jdt .NormalAnnotation ).Roles (Incomplete ),
276+ On (jdt .MemberRef ).Roles (Incomplete ),
277+ On (jdt .MemberValuePair ).Roles (Incomplete ),
278+ On (jdt .MethodRef ).Roles (Incomplete ),
279+ On (jdt .MethodRefParameter ).Roles (Incomplete ),
280+ On (jdt .TagElement ).Roles (Incomplete ),
281+ On (jdt .TextElement ).Roles (Incomplete ),
282+ On (jdt .TypeParameter ).Roles (Incomplete ),
240283)
0 commit comments