use of org.csstudio.autocomplete.parser.engine.expr.Expr in project yamcs-studio by yamcs.
the class ExprParser method parseValue.
private void parseValue(ExprToken e) throws ExprException {
Expr value = null;
switch(e.type) {
case Decimal:
value = new ExprDouble(e.doubleValue);
break;
case Integer:
value = new ExprInteger(e.integerValue);
break;
case String:
value = new ExprString(e.val);
break;
case Variable:
value = new ExprVariable(e.val);
break;
case QuotedVariable:
value = new ExprPV(e.val);
break;
default:
break;
}
setValue(value);
}
use of org.csstudio.autocomplete.parser.engine.expr.Expr in project yamcs-studio by yamcs.
the class ExprParser method parseExpression.
private void parseExpression(ExprLexer lexer) throws IOException, ExprException {
Expr c = current;
current = null;
ExprToken e = null;
while ((e = lexer.next()) != null) {
if (e.type.equals(ExprTokenType.CloseBracket)) {
Expr t = current;
current = c;
setValue(new ExprExpression(t));
break;
} else {
parseToken(lexer, e);
}
}
}
use of org.csstudio.autocomplete.parser.engine.expr.Expr in project yamcs-studio by yamcs.
the class FormulaContentParser method handleFunction.
private void handleFunction(ExprFunction f) {
if (f.isComplete())
return;
currentToken = new FunctionDescriptor();
currentToken.setValue(f.toString());
currentToken.setFunctionName(f.getName());
currentToken.setContentType(ContentType.FormulaFunction);
currentToken.setOpenBracket(true);
if (f.size() == 0) {
currentToken.setCurrentArgIndex(0);
return;
}
currentToken.setCurrentArgIndex(f.size() - 1);
Expr lastArg = f.getArg(f.size() - 1);
if (lastArg == null)
return;
handleExpr(lastArg);
}
use of org.csstudio.autocomplete.parser.engine.expr.Expr in project yamcs-studio by yamcs.
the class FormulaContentParser method handleConditionalOperation.
private void handleConditionalOperation(ExprConditionalOperator co) {
Expr value = co.getValueIfFalse();
if (value == null)
value = co.getValueIfTrue();
if (value == null)
return;
handleExpr(value);
}
use of org.csstudio.autocomplete.parser.engine.expr.Expr in project yamcs-studio by yamcs.
the class FormulaContentParser method handleBinaryOperation.
private void handleBinaryOperation(ExprBinaryOperator bo) {
Expr rhs = bo.getRHS();
if (rhs == null)
return;
handleExpr(rhs);
}
Aggregations