use of org.whole.lang.parsers.ParseException in project whole by wholeplatform.
the class WorkflowsInterpreterVisitor method visit.
@Override
public void visit(Parse entity) {
try {
entity.getText().accept(this);
CharSequence text = (CharSequence) getResultValue();
entity.getGrammar().accept(this);
IEntity grammarOrUri = getResult();
if (!EntityUtils.isData(grammarOrUri)) {
stagedVisit(grammarOrUri);
grammarOrUri = ((Grammar) grammarOrUri).getUri();
}
String grammarUri = grammarOrUri.wStringValue();
IEntity model;
if (EntityUtils.isNotResolver(entity.getNt())) {
entity.getNt().accept(this);
model = GrammarsUtils.parse(text, grammarUri, getResult().wStringValue());
} else
model = GrammarsUtils.parse(text, grammarUri);
setResult(entity.getModel(), model);
} catch (ParseException e) {
// FIXME ?
throw e;
} catch (Exception e) {
throw IWholeRuntimeException.asWholeException(e, entity, getBindings());
}
}
Aggregations