Skip to content

Commit

Permalink
Merge pull request #144 from UniVE-SSV/access-global-accessors
Browse files Browse the repository at this point in the history
Adding accessors to `AccessGlobal` and `AccessIntsanceGlobal`
  • Loading branch information
VincenzoArceri authored Oct 29, 2021
2 parents 0dd4d46 + 5033ab1 commit 19aa163
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,25 @@ public AccessGlobal(CFG cfg, CodeLocation location, Unit container, Global targe
this.target = target;
}

/**
* Yields the {@link Unit} where the global targeted by this access is
* defined.
*
* @return the container of the global
*/
public Unit getContainer() {
return container;
}

/**
* Yields the {@link Global} targeted by this expression.
*
* @return the global
*/
public Global getTarget() {
return target;
}

@Override
public int setOffset(int offset) {
return this.offset = offset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,25 @@ public AccessInstanceGlobal(CFG cfg, CodeLocation location, Expression receiver,
receiver.setParentStatement(this);
}

/**
* Yields the expression that determines the receiver of the global access
* defined by this expression.
*
* @return the receiver of the access
*/
public Expression getReceiver() {
return receiver;
}

/**
* Yields the instance {@link Global} targeted by this expression.
*
* @return the global
*/
public Global getTarget() {
return target;
}

@Override
public int setOffset(int offset) {
return this.offset = offset;
Expand Down

0 comments on commit 19aa163

Please sign in to comment.