public abstract class AstNode {
/** Starting and ending position of the node in the sources. */
- public int sourceStart, sourceEnd;
+ private int sourceStart, sourceEnd;
/**
* Create a node giving starting and ending offset
* @param sourceEnd ending offset
*/
public AstNode(final int sourceStart, final int sourceEnd) {
- this.sourceStart = sourceStart;
- this.sourceEnd = sourceEnd;
+ this.setSourceStart(sourceStart);
+ this.setSourceEnd(sourceEnd);
}
/**
* @return the variables used
*/
public abstract List getUsedVariable();
+
+ public int getSourceStart() {
+ return sourceStart;
+ }
+
+ public int getSourceEnd() {
+ return sourceEnd;
+ }
+
+ public void setSourceStart(int sourceStart) {
+ this.sourceStart = sourceStart;
+ }
+
+ public void setSourceEnd(int sourceEnd) {
+ this.sourceEnd = sourceEnd;
+ }
}