Search in sources :

Example 21 with Ref

use of lucee.runtime.interpreter.ref.Ref in project Lucee by lucee.

the class CFMLExpressionInterpreter method _unaryOp.

private Ref _unaryOp(Ref ref, boolean isPlus) throws PageException {
    cfml.removeSpace();
    Ref res = preciseMath ? new BigPlus(ref, isPlus ? PLUS_ONE : MINUS_ONE, limited) : new Plus(ref, isPlus ? PLUS_ONE : MINUS_ONE, limited);
    ref = new Assign(ref, res, limited);
    return preciseMath ? new BigPlus(ref, isPlus ? MINUS_ONE : PLUS_ONE, limited) : new Plus(ref, isPlus ? MINUS_ONE : PLUS_ONE, limited);
}
Also used : Ref(lucee.runtime.interpreter.ref.Ref) BigPlus(lucee.runtime.interpreter.ref.op.BigPlus) Assign(lucee.runtime.interpreter.ref.var.Assign) DynAssign(lucee.runtime.interpreter.ref.var.DynAssign) Plus(lucee.runtime.interpreter.ref.op.Plus) BigPlus(lucee.runtime.interpreter.ref.op.BigPlus)

Example 22 with Ref

use of lucee.runtime.interpreter.ref.Ref in project Lucee by lucee.

the class CFMLExpressionInterpreter 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 PageException
 */
private Ref expoOp() throws PageException {
    Ref ref = unaryOp();
    while (cfml.isValidIndex() && (cfml.forwardIfCurrent('^') || cfml.forwardIfCurrent("exp"))) {
        cfml.removeSpace();
        ref = new Exp(ref, unaryOp(), limited);
    }
    return ref;
}
Also used : Ref(lucee.runtime.interpreter.ref.Ref) Exp(lucee.runtime.interpreter.ref.op.Exp)

Example 23 with Ref

use of lucee.runtime.interpreter.ref.Ref in project Lucee by lucee.

the class CFMLExpressionInterpreter method _intdiv.

private Ref _intdiv(Ref ref) throws PageException {
    // \=
    if (cfml.forwardIfCurrent('=')) {
        cfml.removeSpace();
        Ref right = assignOp();
        Ref res = preciseMath ? new BigIntDiv(ref, right, limited) : new IntDiv(ref, right, limited);
        ref = new Assign(ref, res, limited);
    } else {
        cfml.removeSpace();
        ref = preciseMath ? new BigIntDiv(ref, expoOp(), limited) : new IntDiv(ref, expoOp(), limited);
    }
    return ref;
}
Also used : Ref(lucee.runtime.interpreter.ref.Ref) BigIntDiv(lucee.runtime.interpreter.ref.op.BigIntDiv) IntDiv(lucee.runtime.interpreter.ref.op.IntDiv) BigIntDiv(lucee.runtime.interpreter.ref.op.BigIntDiv) Assign(lucee.runtime.interpreter.ref.var.Assign) DynAssign(lucee.runtime.interpreter.ref.var.DynAssign)

Example 24 with Ref

use of lucee.runtime.interpreter.ref.Ref in project Lucee by lucee.

the class CFMLExpressionInterpreter method concatOp.

/**
 * Transfomiert eine  Konkatinations-Operator (&) Operation. Im Gegensatz zu CFMX ,
 * wird das "!" Zeichen auch als Not Operator anerkannt.
 * <br />
 * EBNF:<br />
 * <code>plusMinusOp {"&" spaces concatOp};</code>
 * @return CFXD Element
 * @throws PageException
 */
private Ref concatOp() throws PageException {
    Ref ref = plusMinusOp();
    while (cfml.isCurrent('&') && !cfml.isNext('&')) {
        cfml.next();
        ref = _concat(ref);
    }
    return ref;
}
Also used : Ref(lucee.runtime.interpreter.ref.Ref)

Example 25 with Ref

use of lucee.runtime.interpreter.ref.Ref in project Lucee by lucee.

the class CFMLExpressionInterpreter 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 PageException
 */
private Ref sharp() throws PageException {
    if (!cfml.forwardIfCurrent('#'))
        return null;
    Ref ref;
    cfml.removeSpace();
    ref = assignOp();
    cfml.removeSpace();
    if (!cfml.forwardIfCurrent('#'))
        throw new InterpreterException("Syntax Error, Invalid Construct");
    cfml.removeSpace();
    return ref;
}
Also used : Ref(lucee.runtime.interpreter.ref.Ref)

Aggregations

Ref (lucee.runtime.interpreter.ref.Ref)34 Assign (lucee.runtime.interpreter.ref.var.Assign)9 DynAssign (lucee.runtime.interpreter.ref.var.DynAssign)9 ArrayList (java.util.ArrayList)6 Casting (lucee.runtime.interpreter.ref.cast.Casting)6 BIFCall (lucee.runtime.interpreter.ref.func.BIFCall)6 LString (lucee.runtime.interpreter.ref.literal.LString)6 FunctionLibFunctionArg (lucee.transformer.library.function.FunctionLibFunctionArg)5 ParserString (lucee.commons.lang.ParserString)4 FunctionLibFunction (lucee.transformer.library.function.FunctionLibFunction)4 ExpressionException (lucee.runtime.exp.ExpressionException)3 LFunctionValue (lucee.runtime.interpreter.ref.literal.LFunctionValue)3 BigPlus (lucee.runtime.interpreter.ref.op.BigPlus)3 Plus (lucee.runtime.interpreter.ref.op.Plus)3 BigIntDiv (lucee.runtime.interpreter.ref.op.BigIntDiv)2 BigMinus (lucee.runtime.interpreter.ref.op.BigMinus)2 Concat (lucee.runtime.interpreter.ref.op.Concat)2 IntDiv (lucee.runtime.interpreter.ref.op.IntDiv)2 Minus (lucee.runtime.interpreter.ref.op.Minus)2 Key (lucee.runtime.type.Collection.Key)2