Search in sources :

Example 1 with AConstantsContextClause

use of de.be4.classicalb.core.parser.node.AConstantsContextClause in project prob2 by bendisposto.

the class ContextTranslator method processConstants.

private List<PContextClause> processConstants() {
    List<PContextClause> constants = new ArrayList<>();
    List<PExpression> concrete = new ArrayList<>();
    List<PExpression> abstractC = new ArrayList<>();
    for (EventBConstant eventBConstant : context.getConstants()) {
        if (eventBConstant.isAbstract()) {
            abstractC.add((PExpression) ((EventB) eventBConstant.getExpression()).getAst());
        } else {
            concrete.add((PExpression) ((EventB) eventBConstant.getExpression()).getAst());
        }
    }
    constants.add(new AConstantsContextClause(concrete));
    constants.add(new AAbstractConstantsContextClause(abstractC));
    return constants;
}
Also used : AConstantsContextClause(de.be4.classicalb.core.parser.node.AConstantsContextClause) EventB(de.prob.animator.domainobjects.EventB) ArrayList(java.util.ArrayList) EventBConstant(de.prob.model.eventb.EventBConstant) PExpression(de.be4.classicalb.core.parser.node.PExpression) PContextClause(de.be4.classicalb.core.parser.node.PContextClause) AAbstractConstantsContextClause(de.be4.classicalb.core.parser.node.AAbstractConstantsContextClause)

Aggregations

AAbstractConstantsContextClause (de.be4.classicalb.core.parser.node.AAbstractConstantsContextClause)1 AConstantsContextClause (de.be4.classicalb.core.parser.node.AConstantsContextClause)1 PContextClause (de.be4.classicalb.core.parser.node.PContextClause)1 PExpression (de.be4.classicalb.core.parser.node.PExpression)1 EventB (de.prob.animator.domainobjects.EventB)1 EventBConstant (de.prob.model.eventb.EventBConstant)1 ArrayList (java.util.ArrayList)1