use of com.googlecode.aviator.code.NoneCodeGenerator in project aviatorscript by killme2008.
the class AviatorEvaluatorInstance method validate.
/**
* Validate a script text whether is a legal aviatorscript text, throw exception if not.
*
* @since 5.0.2
* @param script the script text
*/
public void validate(final String script) {
if (script == null || script.trim().length() == 0) {
throw new CompileExpressionErrorException("Blank script");
}
ExpressionLexer lexer = new ExpressionLexer(this, script);
CodeGenerator codeGenerator = new NoneCodeGenerator();
ExpressionParser parser = new ExpressionParser(this, lexer, codeGenerator);
parser.parse();
}
Aggregations