Search in sources :

Example 1 with Value_constant_or_variableContext

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;
}
Also used : Value_constant_or_variableContext(org.osate.ba.parser.AadlBaParser.Value_constant_or_variableContext) ListValue(org.osate.aadl2.ListValue) IntegerValue(org.osate.ba.aadlba.IntegerValue) NamedValue(org.osate.ba.declarative.NamedValue) ClassifierValue(org.osate.aadl2.ClassifierValue) RangeValue(org.osate.aadl2.RangeValue) RecordValue(org.osate.aadl2.RecordValue) DeclarativeReferenceValue(org.osate.ba.declarative.DeclarativeReferenceValue) DeclarativeClassifierValue(org.osate.ba.declarative.DeclarativeClassifierValue) ReferenceValue(org.osate.aadl2.ReferenceValue) ModalPropertyValue(org.osate.aadl2.ModalPropertyValue) Value(org.osate.ba.aadlba.Value)

Aggregations

ClassifierValue (org.osate.aadl2.ClassifierValue)1 ListValue (org.osate.aadl2.ListValue)1 ModalPropertyValue (org.osate.aadl2.ModalPropertyValue)1 RangeValue (org.osate.aadl2.RangeValue)1 RecordValue (org.osate.aadl2.RecordValue)1 ReferenceValue (org.osate.aadl2.ReferenceValue)1 IntegerValue (org.osate.ba.aadlba.IntegerValue)1 Value (org.osate.ba.aadlba.Value)1 DeclarativeClassifierValue (org.osate.ba.declarative.DeclarativeClassifierValue)1 DeclarativeReferenceValue (org.osate.ba.declarative.DeclarativeReferenceValue)1 NamedValue (org.osate.ba.declarative.NamedValue)1 Value_constant_or_variableContext (org.osate.ba.parser.AadlBaParser.Value_constant_or_variableContext)1