use of cz.cuni.mff.d3s.trupple.language.runtime.exceptions.CantReadInputException in project TrufflePascal by Aspect26.
the class ReadBuiltinNode method readOneToReference.
private void readOneToReference(FileValue file, Reference reference) {
try {
switch(reference.getFrameSlot().getKind()) {
case Int:
int intValue = readInt(file);
this.setReferenceInt(reference, intValue);
break;
case Byte:
char charValue = readChar(file);
this.setReferenceChar(reference, charValue);
break;
case Double:
double doubleValue = readDouble(file);
this.setReferenceDouble(reference, doubleValue);
break;
case Long:
long longValue = readLong(file);
this.setReferenceLong(reference, longValue);
break;
case Object:
Object objectValue = readObject(file, reference);
this.setReferenceObject(reference, objectValue);
break;
default:
throw new PascalRuntimeException("Wrong value passed to read.");
}
} catch (IOException e) {
throw new CantReadInputException(e);
}
}
Aggregations