package ga050426;

public class Exceptions extends Exception {
	public static final String USEDEF = " ~ USE/DEF directives should be used only in null segment";
	public static final String TXTONLY = " ~ instruction should be only used in txt segment!";
	public static final String ORGINSEG = " ~ instruction should be only used in null segment!";
	public static final String DSNOTINDATA = " ~ DS directive should be used only in BSS segment!";
	public static final String DCNOTINDATA = " ~ DC directive should be used only in DAT segment!";	
	public static final String WRONGCODE = " ~ Wrong code/instruction/directive in segment: ";
	public static final String ORGEQUDS = " ~ Supplying a non-numeric address field to ORG or EQU or DS. ";
	public static final String TOBIGDATA = " ~ Data in adresli line iz to big or to small";
}

class IllegalInstructionException extends Exceptions {
	private String errMsg = new String();

	public IllegalInstructionException(String errMsg) {
		this.errMsg += errMsg;
	}

	public String toString() {
		return errMsg;
	}
}

class UnknownSymbolException extends Exceptions {
}


class PrematureEndOfSource extends Exceptions {
	
	public String toString() {
		return "Premature end of source, insert END directive";
	}
}


class CorrectInstructionException extends Exceptions {
}

class SymbolDefinedException extends Exceptions {
	private String msg = "Duplicated symbol definition!";

	public String toString() {
		return msg;
	}
}

class SegmentDefinedException extends Exceptions {

	public String toString() {
		return "Segment already defined!";
	}
}

class SymbolLeavedUndefinedException extends Exceptions {

	public String toString() {
		return "There are symbols that are exported but never defined!";
	}

}
