public <O> O evaluate(@NonNull Resource resource, @NonNull Evaluator<? extends O> evaluator) throws ParseException {
      ExpressionIterator iterator = parse(resource);
      Expression expression = iterator.next();
      if (iterator.hasNext()) {
         throw new ParseException("Did not fully parse token stream");
      }
      try {
         return evaluator.eval(expression);
      } catch (Exception e) {
         throw new ParseException(e);
      }
   }
public < O > O evaluate ( @ NonNull Resource resource , @ NonNull Evaluator < ? extends O > evaluator ) throws ParseException { ExpressionIterator iterator = parse ( resource ) ; Expression expression = iterator . next ( ) ; if ( iterator . hasNext ( ) ) { throw new ParseException ( "Did not fully parse token stream" ) ; } try { return evaluator . eval ( expression ) ; } catch ( Exception e ) { throw new ParseException ( e ) ; } }
<p>Parses the given resource and evaluates it with the given evaluator. Requires that the parse result in a single
expression.</p>

@param <O>       the return type of the evaluator
@param resource  the resource to evaluate
@param evaluator the evaluator to use for transforming expressions
@return the single return values from the evaluator
@throws ParseException Something went wrong parsing