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