Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering
Represents a field access expression (read access and write access).
#id: id
the unique ID of this field access.
#parent: id
ID of the parent node.
#encl: methodT, constructorT, classInitializerT, fieldT, annotationMemberT
ID of the fact that represents the enclosing element.
#receiver: expression, typeRefT, 'null'
ID of the expression on which the field is accessed
or 'null' for the implicit field access.
In case of an access to a static field #expr is a typeRefT.
'name': atom
name of the accessed field.
#field: fieldT, null
ID of the accessed field.
null
is only valid in case of the “length” field of array types.
int field = 1; public void getField() { int j = field; }
fieldT(#field, ..., type(basic, int, 0), 'field', ...). methodT(#encl, ..., 'getField', [], type(basic, void, 0), [], ...). localT(#parent, ..., #encl, type(basic, int, 0), 'j', #id). getFieldT(#id, #parent, #encl, 'null', 'i', #field).
ast_node_def('Java',getFieldT,[ ast_arg(id, mult(1,1,no ), id, [getFieldT]), ast_arg(parent, mult(1,1,no ), id, [id]), ast_arg(encl, mult(1,1,no ), id, [methodT, constructorT, classInitializerT, fieldT, annotationMemberT]), ast_arg(expr, mult(0,1,no ), id, [nullType,expressionType,typeRefT]), ast_arg(name, mult(0,1,no ), attr, [atom]), ast_arg(ref, mult(1,1,no ), id, [fieldT,nullType]) ]).