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);
}
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;
}
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;
}
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;
}
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;
}
Aggregations