Search in sources :

Example 1 with BTSType

use of org.sireum.hamr.ir.BTSType in project osate-plugin by sireum.

the class BAVisitor method caseBehaviorVariable.

@Override
public Boolean caseBehaviorVariable(BehaviorVariable object) {
    Option<BTSVariableCategory.Type> category = toNone();
    List<BTSVariableDeclaration> names = new ArrayList<>();
    DataClassifier dc = object.getDataClassifier();
    this.v.processDataType(dc);
    Classifier c = Classifier$.MODULE$.apply(dc.getQualifiedName());
    BTSType varType = BTSClassifier$.MODULE$.apply(c);
    Name name = toSimpleName(object.getName());
    Option<BTSExp> assignExpression = toNone();
    assert object.getOwnedValueConstant() == null : "Need to handle ba variable const init " + object;
    Option<BLESSIntConst> arraySize = toNone();
    // NA for BA
    Option<BTSAssertion> variableAssertion = toNone();
    BTSVariableDeclaration vd = BTSVariableDeclaration$.MODULE$.apply(name, category, varType, assignExpression, arraySize, variableAssertion);
    names.add(vd);
    push(names);
    return false;
}
Also used : ArrayList(java.util.ArrayList) DataClassifier(org.osate.aadl2.DataClassifier) Classifier(org.sireum.hamr.ir.Classifier) DataClassifier(org.osate.aadl2.DataClassifier) BLESSIntConst(org.sireum.hamr.ir.BLESSIntConst) Name(org.sireum.hamr.ir.Name) BTSType(org.sireum.hamr.ir.BTSType) BTSAssertion(org.sireum.hamr.ir.BTSAssertion) BTSType(org.sireum.hamr.ir.BTSType) BTSLiteralType(org.sireum.hamr.ir.BTSLiteralType) BTSVariableDeclaration(org.sireum.hamr.ir.BTSVariableDeclaration) BTSExp(org.sireum.hamr.ir.BTSExp)

Aggregations

ArrayList (java.util.ArrayList)1 DataClassifier (org.osate.aadl2.DataClassifier)1 BLESSIntConst (org.sireum.hamr.ir.BLESSIntConst)1 BTSAssertion (org.sireum.hamr.ir.BTSAssertion)1 BTSExp (org.sireum.hamr.ir.BTSExp)1 BTSLiteralType (org.sireum.hamr.ir.BTSLiteralType)1 BTSType (org.sireum.hamr.ir.BTSType)1 BTSVariableDeclaration (org.sireum.hamr.ir.BTSVariableDeclaration)1 Classifier (org.sireum.hamr.ir.Classifier)1 Name (org.sireum.hamr.ir.Name)1