slcom/slangc/parser/Location.sauce

57 lines
1.2 KiB
Plaintext

package slangc.parser;
public class Location {
private final Source source;
private final LocationType type;
private final int indexBegin, lineBegin, characterBegin, indexEnd, lineEnd, characterEnd;
public Location(Source source, LocationType type, int indexBegin, int lineBegin, int characterBegin, int indexEnd, int lineEnd, int characterEnd) {
this.source = source;
this.type = type;
this.indexBegin = indexBegin;
this.lineBegin = lineBegin;
this.characterBegin = characterBegin;
this.indexEnd = indexEnd;
this.lineEnd = lineEnd;
this.characterEnd = characterEnd;
}
public Location(Source source) {
this(source, LocationType.WITHIN, -1, -1, -1, -1, -1, -1);
}
public Source getSource() {
return source;
}
public LocationType getType() {
return type;
}
public int getIndexBegin() {
return indexBegin;
}
public int getLineBegin() {
return lineBegin;
}
public int getCharacterBegin() {
return characterBegin;
}
public int getIndexEnd() {
return indexEnd;
}
public int getLineEnd() {
return lineEnd;
}
public int getCharacterEnd() {
return characterEnd;
}
}