package p.studio.compiler.backend.irvm;

public class IRVMLoweringException extends RuntimeException {
    private final IRVMLoweringErrorCode code;
    private final Integer fileId;
    private final Integer start;
    private final Integer end;

    public IRVMLoweringException(
            final IRVMLoweringErrorCode code,
            final String message) {
        this(code, message, null, null, null);
    }

    public IRVMLoweringException(
            final IRVMLoweringErrorCode code,
            final String message,
            final Integer fileId,
            final Integer start,
            final Integer end) {
        super(message);
        this.code = code;
        this.fileId = fileId;
        this.start = start;
        this.end = end;
    }

    public IRVMLoweringErrorCode code() {
        return code;
    }

    public Integer fileId() {
        return fileId;
    }

    public Integer start() {
        return start;
    }

    public Integer end() {
        return end;
    }
}
