use of org.osate.ba.parser.AadlBaParser.Value_constant_or_variableContext in project osate2 by osate.
the class AadlBaParserVisitor method visitFactor.
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override
public T visitFactor(@NotNull AadlBaParser.FactorContext ctx) {
visitChildren(ctx);
ctx.result = _baFact.createFactor();
Iterator<Value_constant_or_variableContext> it = ctx.value_constant_or_variable().iterator();
Value tmpValue = it.next().result;
ctx.result.setFirstValue(tmpValue);
ctx.result.setLocationReference(tmpValue.getLocationReference());
if (ctx.binary_numeric_operator() != null) {
ctx.result.setBinaryNumericOperator(ctx.binary_numeric_operator().result);
ctx.result.setSecondValue(it.next().result);
} else if (ctx.unary_numeric_operator() != null) {
ctx.result.setUnaryNumericOperator(ctx.unary_numeric_operator().result);
} else if (ctx.unary_boolean_operator() != null) {
ctx.result.setUnaryBooleanOperator(ctx.unary_boolean_operator().result);
}
return null;
}
Aggregations