Changeset 13884


Ignore:
Timestamp:
Oct 29, 2019 8:20:15 AM (3 weeks ago)
Author:
molsson
Message:

Merged revision(s) 13743, 13842, 13852, 13863 from branches/dev-mo-2278:
#5843 Added new inherited attribute to check if component is in generated inner.
........
#5843 Extracted method connectorVariablePrefix() from myCausalityConnectorPrefix().
........
#5843 Removes CausalityConnectorPrefix from parameters when scalarizing records.
........
#5843 Added isParameter() and isDiscrete() to SrcComponentClause.
........

Location:
branches/dev-mo-2278-merge
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/dev-mo-2278-merge

  • branches/dev-mo-2278-merge/Compiler/ModelicaFrontEnd/src/jastadd/flattening/Flattening.jrag

    r13675 r13884  
    17341734        }
    17351735        if (isConnectorVariable()) {
    1736             if (isInput()) {
    1737                 return CausalityConnectorPrefix.INPUT;
    1738             } else if (isOutput()) {
    1739                 return CausalityConnectorPrefix.OUTPUT;
    1740             } else if (isFlow()) {
    1741                 return CausalityConnectorPrefix.FLOW;
    1742             } else if (isStream()) {
    1743                 return CausalityConnectorPrefix.STREAM;
    1744             } else if (!variability().parameterOrLess()) {
    1745                 return CausalityConnectorPrefix.POTENTIAL;
    1746             } else {
    1747                 return CausalityConnectorPrefix.NONE;
    1748             }
     1736            return connectorVariablePrefix();
    17491737        } else {
    17501738            if (isInput()) {
     
    17551743                return CausalityConnectorPrefix.NONE;
    17561744            }
     1745        }
     1746    }
     1747   
     1748    /**
     1749     * Computes the {@link CausalityConnectorPrefix} this variable would have if it
     1750     * was a connector variable in a top-level connector.
     1751     */
     1752    public CausalityConnectorPrefix InstAssignable.connectorVariablePrefix() {
     1753        if (isInput()) {
     1754            return CausalityConnectorPrefix.INPUT;
     1755        } else if (isOutput()) {
     1756            return CausalityConnectorPrefix.OUTPUT;
     1757        } else if (isFlow()) {
     1758            return CausalityConnectorPrefix.FLOW;
     1759        } else if (isStream()) {
     1760            return CausalityConnectorPrefix.STREAM;
     1761        } else if (!variability().parameterOrLess()) {
     1762            return CausalityConnectorPrefix.POTENTIAL;
     1763        } else {
     1764            return CausalityConnectorPrefix.NONE;
    17571765        }
    17581766    }
  • branches/dev-mo-2278-merge/Compiler/ModelicaFrontEnd/src/jastadd/instance/InnerOuter.jrag

    r10841 r13884  
    113113    eq BaseNode.getChild().isGeneratedInner()                       = false;
    114114
     115    inh boolean InstComponentDecl.isInGeneratedInner();
     116    eq InstGeneratedInner.getInstComponentDecl().isInGeneratedInner() = true;
     117    eq InstClassDecl.getChild().isInGeneratedInner()                  = false;
     118
    115119}
    116120
  • branches/dev-mo-2278-merge/Compiler/ModelicaFrontEnd/src/jastadd/util/Util.jrag

    r13793 r13884  
    13131313   
    13141314
    1315     /**
    1316      * Check if this component is declared parameter.
    1317      */
    1318     syn boolean SrcComponentDecl.isParameter() = hasSrcTypePrefixVariability() && getSrcTypePrefixVariability().parameterVariability();
    1319    
    1320     /**
    1321      * Check if this component is declared constant.
    1322      */
    1323     syn boolean SrcComponentDecl.isConstant() = hasSrcTypePrefixVariability() && getSrcTypePrefixVariability().constantVariability();
    1324    
    1325     /**
    1326      * Check if this component clause is declared constant.
    1327      */
    1328     syn boolean SrcComponentClause.isConstant() = hasSrcTypePrefixVariability() && getSrcTypePrefixVariability().constantVariability();
    1329    
    1330     /**
    1331      * Check if this component is declared discrete.
    1332      */
    1333     syn boolean SrcComponentDecl.isDiscrete() = hasSrcTypePrefixVariability() && getSrcTypePrefixVariability().discreteVariability();
     1315    syn boolean SrcComponentDecl.isParameter() = myComponentClause().isParameter();
     1316    syn boolean SrcComponentDecl.isConstant()  = myComponentClause().isConstant();
     1317    syn boolean SrcComponentDecl.isDiscrete()  = myComponentClause().isDiscrete();
     1318   
     1319    syn boolean SrcComponentClause.isParameter() = hasSrcTypePrefixVariability() && getSrcTypePrefixVariability().parameterVariability();
     1320    syn boolean SrcComponentClause.isConstant()  = hasSrcTypePrefixVariability() && getSrcTypePrefixVariability().constantVariability();
     1321    syn boolean SrcComponentClause.isDiscrete()  = hasSrcTypePrefixVariability() && getSrcTypePrefixVariability().discreteVariability();
    13341322
    13351323    /**
  • branches/dev-mo-2278-merge/Compiler/ModelicaMiddleEnd/src/jastadd/scalarization/Scalarization.jrag

    r13846 r13884  
    734734                fv.setBindingExpOpt(new Opt());
    735735            }
     736            if (variability.parameterOrLess()){
     737                inputOutput = CausalityConnectorPrefix.NONE;
     738            }
    736739            fv.setTypePrefixVariability(variability);
    737740            fv.setCausalityConnectorPrefix(inputOutput);
Note: See TracChangeset for help on using the changeset viewer.