Search in sources :

Example 71 with Expression

use of lucee.transformer.expression.Expression in project Lucee by lucee.

the class AbstrCFMLExprTransformer method xorOp.

/**
 * Transfomiert eine  Xor (xor) Operation.
 * <br />
 * EBNF:<br />
 * <code>orOp {"xor" spaces  orOp};</code>
 * @return CFXD Element
 * @throws TemplateException
 */
private Expression xorOp(ExprData data) throws TemplateException {
    Expression expr = orOp(data);
    while (data.srcCode.forwardIfCurrentAndNoWordAfter("xor")) {
        comments(data);
        expr = data.factory.opBool(expr, orOp(data), Factory.OP_BOOL_XOR);
    }
    return expr;
}
Also used : FunctionAsExpression(lucee.transformer.bytecode.expression.FunctionAsExpression) Expression(lucee.transformer.expression.Expression)

Example 72 with Expression

use of lucee.transformer.expression.Expression in project Lucee by lucee.

the class AbstrCFMLExprTransformer method impOp.

/**
 * Transfomiert eine Implication (imp) Operation.
 * <br />
 * EBNF:<br />
 * <code>eqvOp {"imp" spaces eqvOp};</code>
 * @return CFXD Element
 * @throws TemplateException
 */
private Expression impOp(ExprData data) throws TemplateException {
    Expression expr = eqvOp(data);
    while (data.srcCode.forwardIfCurrentAndNoWordAfter("imp")) {
        comments(data);
        expr = data.factory.opBool(expr, eqvOp(data), Factory.OP_BOOL_IMP);
    }
    return expr;
}
Also used : FunctionAsExpression(lucee.transformer.bytecode.expression.FunctionAsExpression) Expression(lucee.transformer.expression.Expression)

Example 73 with Expression

use of lucee.transformer.expression.Expression in project Lucee by lucee.

the class AbstrCFMLExprTransformer method sharp.

/**
 * Sharps (#) die innerhalb von Expressions auftauchen haben in CFML keine weitere Beteutung
 * und werden durch diese Methode einfach entfernt.
 * <br />
 * Beispiel:<br />
 * <code>arrayLen(#arr#)</code> und <code>arrayLen(arr)</code> sind identisch.
 * EBNF:<br />
 * <code>"#" checker "#";</code>
 * @return CFXD Element
 * @throws TemplateException
 */
private Expression sharp(ExprData data) throws TemplateException {
    if (!data.srcCode.forwardIfCurrent('#'))
        return null;
    Expression expr;
    comments(data);
    boolean old = data.allowLowerThan;
    data.allowLowerThan = true;
    expr = assignOp(data);
    data.allowLowerThan = old;
    comments(data);
    if (!data.srcCode.forwardIfCurrent('#'))
        throw new TemplateException(data.srcCode, "Syntax Error, Invalid Construct " + (data.srcCode.length() < 30 ? data.srcCode.toString() : ""));
    comments(data);
    return expr;
}
Also used : FunctionAsExpression(lucee.transformer.bytecode.expression.FunctionAsExpression) Expression(lucee.transformer.expression.Expression) TemplateException(lucee.runtime.exp.TemplateException)

Example 74 with Expression

use of lucee.transformer.expression.Expression in project Lucee by lucee.

the class AbstrCFMLExprTransformer method expoOp.

/**
 * Transfomiert den Exponent Operator (^,exp). Im Gegensatz zu CFMX ,
 * werden die Zeichen " exp " auch als Exponent anerkannt.
 * <br />
 * EBNF:<br />
 * <code>clip {("exp"|"^") spaces clip};</code>
 * @return CFXD Element
 * @throws TemplateException
 */
private Expression expoOp(ExprData data) throws TemplateException {
    Expression expr = unaryOp(data);
    // Modulus Operation
    while (data.srcCode.forwardIfCurrent('^') || data.srcCode.forwardIfCurrentAndNoWordAfter("exp")) {
        comments(data);
        expr = OpDouble.toExprDouble(expr, unaryOp(data), OpDouble.EXP);
    }
    return expr;
}
Also used : FunctionAsExpression(lucee.transformer.bytecode.expression.FunctionAsExpression) Expression(lucee.transformer.expression.Expression)

Aggregations

Expression (lucee.transformer.expression.Expression)74 FunctionAsExpression (lucee.transformer.bytecode.expression.FunctionAsExpression)34 LitString (lucee.transformer.expression.literal.LitString)25 TemplateException (lucee.runtime.exp.TemplateException)19 Attribute (lucee.transformer.bytecode.statement.tag.Attribute)16 Variable (lucee.transformer.expression.var.Variable)16 Body (lucee.transformer.bytecode.Body)11 ExprString (lucee.transformer.expression.ExprString)11 GeneratorAdapter (org.objectweb.asm.commons.GeneratorAdapter)11 Position (lucee.transformer.Position)10 OpVariable (lucee.transformer.bytecode.op.OpVariable)10 LitBoolean (lucee.transformer.expression.literal.LitBoolean)8 Literal (lucee.transformer.expression.literal.Literal)8 ArrayList (java.util.ArrayList)7 TransformerException (lucee.transformer.TransformerException)7 BodyBase (lucee.transformer.bytecode.BodyBase)7 Statement (lucee.transformer.bytecode.Statement)7 Argument (lucee.transformer.bytecode.expression.var.Argument)7 PrintOut (lucee.transformer.bytecode.statement.PrintOut)6 FunctionBody (lucee.transformer.bytecode.FunctionBody)5