Search in sources :

Example 1 with TypeTable

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

the class AgreeASTBuilder method getAgreeProgram.

public AgreeProgram getAgreeProgram(ComponentInstance compInst, boolean isMonolithic) {
    boolean containsRTPatterns = false;
    this.isMonolithic = isMonolithic;
    globalNodes = new ArrayList<>();
    uninterpretedFunc = new ArrayList<>();
    renamings = new HashMap<>();
    refMap = new HashMap<>();
    // EGM: array-backend
    symbolTable = new TypeTable();
    AgreeNode topNode = getAgreeNode(compInst, true);
    List<AgreeNode> agreeNodes = gatherNodes(topNode);
    // EGM: array-backend
    List<Type> lustreTypes = symbolTable.getLustreTypes();
    // have to convert the types. The reason we use Record types in the
    // first place rather than the more general types is so we can check set
    // containment easily
    AgreeProgram program = new AgreeProgram(agreeNodes, new ArrayList<>(globalNodes), new ArrayList<>(uninterpretedFunc), lustreTypes, topNode);
    // if there are any patterns in the AgreeProgram we need to inline them
    program = AgreePatternTranslator.translate(program);
    containsRTPatterns = program.containsRealTimePatterns;
    program = AgreeInlineLatchedConnections.translate(program);
    program = AgreeMakeClockedLustreNodes.translate(program);
    // go through the extension registries and transform the program
    AgreeAutomaterRegistry aAReg = (AgreeAutomaterRegistry) ExtensionRegistry.getRegistry(ExtensionRegistry.AGREE_AUTOMATER_EXT_ID);
    List<AgreeAutomater> automaters = aAReg.getAgreeAutomaters();
    for (AgreeAutomater aa : automaters) {
        program = aa.transform(program);
    }
    program.containsRealTimePatterns(containsRTPatterns);
    // EGM: DEBUG
    System.out.println("getAgreeProgram");
    com.rockwellcollins.atc.agree.analysis.ast.visitors.AgreeASTPrettyprinter pp = new com.rockwellcollins.atc.agree.analysis.ast.visitors.AgreeASTPrettyprinter();
    program.accept(pp);
    System.out.println(pp.toString());
    System.out.println(AgreeLogger.getLog());
    return program;
}
Also used : RealCast(com.rockwellcollins.atc.agree.agree.RealCast) FloorCast(com.rockwellcollins.atc.agree.agree.FloorCast) ConnectionType(com.rockwellcollins.atc.agree.analysis.ast.AgreeAADLConnection.ConnectionType) Type(jkind.lustre.Type) NamedType(jkind.lustre.NamedType) FeatureGroupType(org.osate.aadl2.FeatureGroupType) DataSubcomponentType(org.osate.aadl2.DataSubcomponentType) ComponentType(org.osate.aadl2.ComponentType) AgreeAutomaterRegistry(com.rockwellcollins.atc.agree.analysis.extentions.AgreeAutomaterRegistry) TypeTable(com.rockwellcollins.atc.agree.analysis.TypeTable) AgreeAutomater(com.rockwellcollins.atc.agree.analysis.extentions.AgreeAutomater)

Aggregations

FloorCast (com.rockwellcollins.atc.agree.agree.FloorCast)1 RealCast (com.rockwellcollins.atc.agree.agree.RealCast)1 TypeTable (com.rockwellcollins.atc.agree.analysis.TypeTable)1 ConnectionType (com.rockwellcollins.atc.agree.analysis.ast.AgreeAADLConnection.ConnectionType)1 AgreeAutomater (com.rockwellcollins.atc.agree.analysis.extentions.AgreeAutomater)1 AgreeAutomaterRegistry (com.rockwellcollins.atc.agree.analysis.extentions.AgreeAutomaterRegistry)1 NamedType (jkind.lustre.NamedType)1 Type (jkind.lustre.Type)1 ComponentType (org.osate.aadl2.ComponentType)1 DataSubcomponentType (org.osate.aadl2.DataSubcomponentType)1 FeatureGroupType (org.osate.aadl2.FeatureGroupType)1