Search in sources :

Example 1 with AgreeCauseEffectPattern

use of com.rockwellcollins.atc.agree.analysis.realtime.AgreeCauseEffectPattern in project AGREE by loonwerks.

the class AgreeASTBuilder method gatherStatementIds.

private Set<String> gatherStatementIds(AgreeStatement statement) {
    IdGatherer visitor = new IdGatherer();
    Set<String> ids = new HashSet<>();
    if (statement instanceof AgreeCauseEffectPattern) {
        AgreeCauseEffectPattern pattern = (AgreeCauseEffectPattern) statement;
        ids.addAll(pattern.cause.accept(visitor));
        ids.addAll(pattern.effect.accept(visitor));
    } else if (statement instanceof AgreePeriodicPattern) {
        AgreePeriodicPattern pattern = (AgreePeriodicPattern) statement;
        ids.addAll(pattern.event.accept(visitor));
    } else if (statement instanceof AgreeSporadicPattern) {
        AgreeSporadicPattern pattern = (AgreeSporadicPattern) statement;
        ids.addAll(pattern.event.accept(visitor));
    } else {
        ids.addAll(statement.expr.accept(visitor));
    }
    return ids;
}
Also used : IdGatherer(com.rockwellcollins.atc.agree.analysis.lustre.visitors.IdGatherer) AgreeSporadicPattern(com.rockwellcollins.atc.agree.analysis.realtime.AgreeSporadicPattern) AgreeCauseEffectPattern(com.rockwellcollins.atc.agree.analysis.realtime.AgreeCauseEffectPattern) AgreePeriodicPattern(com.rockwellcollins.atc.agree.analysis.realtime.AgreePeriodicPattern) HashSet(java.util.HashSet)

Aggregations

IdGatherer (com.rockwellcollins.atc.agree.analysis.lustre.visitors.IdGatherer)1 AgreeCauseEffectPattern (com.rockwellcollins.atc.agree.analysis.realtime.AgreeCauseEffectPattern)1 AgreePeriodicPattern (com.rockwellcollins.atc.agree.analysis.realtime.AgreePeriodicPattern)1 AgreeSporadicPattern (com.rockwellcollins.atc.agree.analysis.realtime.AgreeSporadicPattern)1 HashSet (java.util.HashSet)1