Matches all accesses to fields.
This pattern only matches nodes of type expression.
Properties
fieldAccess produces a record that contains the following properties:
| Name | Type | Description |
|---|---|---|
field |
symbol |
The symbol of the field being accessed |
objectExpression |
expression |
The object that owns the field being accessed |
Inherits properties from:
Example
For a Java class like this:
Example {
public int myPublicInt;
};
... and an access like this:
Example e;
int i = e.myPublicInt;
... the following CodeXM pattern finds the access:
pattern accessToExamplePublicInt {
fieldAccess {
.objectExpression == expression {
.type == classType { .simpleName == "Example" }
};
.field == symbol { .simpleName == "myPublicInt" }
}
};