}
private XExpression parseScriptIntoXTextEObject(String scriptAsString) throws ScriptParsingException {
Resource resource = resourceSet.createResource(computeUnusedUri(resourceSet)); // IS-A XtextResource
try {
resource.load(new StringInputStream(scriptAsString), resourceSet.getLoadOptions());
} catch (IOException e) {
throw new ScriptParsingException("Unexpected IOException; from close() of a String-based ByteArrayInputStream, no real I/O; how is that possible???", scriptAsString, e);
}
List<Diagnostic> errors = resource.getErrors();