Search in sources :

Example 1 with Safe_allow_expContext

use of org.beetl.core.parser.BeetlParser.Safe_allow_expContext in project beetl2.0 by javamonkey.

the class AntlrProgramBuilder method parseSafeOutput.

protected Expression parseSafeOutput(Safe_outputContext soctx) {
    Expression safeExp = null;
    List list = soctx.children;
    if (list.size() == 1) {
        safeExp = null;
    } else {
        // just xxx!exp
        Safe_allow_expContext allowExp = (Safe_allow_expContext) list.get(1);
        if (allowExp.literal() != null) {
            safeExp = this.parseLiteralExpress(allowExp.literal());
        } else if (allowExp.nativeCall() != null) {
            safeExp = this.parseNativeCallExpression(allowExp.nativeCall());
        } else if (allowExp.functionCall() != null) {
            safeExp = this.parseFunExp(allowExp.functionCall());
        } else if (allowExp.expression() != null) {
            safeExp = this.parseExpress(allowExp.expression());
        } else if (allowExp.varRef() != null) {
            safeExp = this.parseVarRefExpression(allowExp.varRef());
        }
    }
    return safeExp;
}
Also used : Safe_allow_expContext(org.beetl.core.parser.BeetlParser.Safe_allow_expContext) ContentBodyExpression(org.beetl.core.statement.ContentBodyExpression) ArthExpression(org.beetl.core.statement.ArthExpression) JsonMapExpression(org.beetl.core.statement.JsonMapExpression) CompareExpression(org.beetl.core.statement.CompareExpression) FunctionExpression(org.beetl.core.statement.FunctionExpression) IncDecExpression(org.beetl.core.statement.IncDecExpression) Expression(org.beetl.core.statement.Expression) AndExpression(org.beetl.core.statement.AndExpression) StatementExpression(org.beetl.core.statement.StatementExpression) NativeCallExpression(org.beetl.core.statement.NativeCallExpression) NegExpression(org.beetl.core.statement.NegExpression) FormatExpression(org.beetl.core.statement.FormatExpression) TernaryExpression(org.beetl.core.statement.TernaryExpression) OrExpression(org.beetl.core.statement.OrExpression) JsonArrayExpression(org.beetl.core.statement.JsonArrayExpression) NotBooleanExpression(org.beetl.core.statement.NotBooleanExpression) ArrayList(java.util.ArrayList) List(java.util.List) LinkedList(java.util.LinkedList)

Aggregations

ArrayList (java.util.ArrayList)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 Safe_allow_expContext (org.beetl.core.parser.BeetlParser.Safe_allow_expContext)1 AndExpression (org.beetl.core.statement.AndExpression)1 ArthExpression (org.beetl.core.statement.ArthExpression)1 CompareExpression (org.beetl.core.statement.CompareExpression)1 ContentBodyExpression (org.beetl.core.statement.ContentBodyExpression)1 Expression (org.beetl.core.statement.Expression)1 FormatExpression (org.beetl.core.statement.FormatExpression)1 FunctionExpression (org.beetl.core.statement.FunctionExpression)1 IncDecExpression (org.beetl.core.statement.IncDecExpression)1 JsonArrayExpression (org.beetl.core.statement.JsonArrayExpression)1 JsonMapExpression (org.beetl.core.statement.JsonMapExpression)1 NativeCallExpression (org.beetl.core.statement.NativeCallExpression)1 NegExpression (org.beetl.core.statement.NegExpression)1 NotBooleanExpression (org.beetl.core.statement.NotBooleanExpression)1 OrExpression (org.beetl.core.statement.OrExpression)1 StatementExpression (org.beetl.core.statement.StatementExpression)1 TernaryExpression (org.beetl.core.statement.TernaryExpression)1