Modification Prefix Replaceable and Redeclare

1 Replaceable

A declared element of a class must have the prefix replaceable in order to be redeclared, apart from redeclarations that only change the attribute value and/or restricts the variability and possibly the dimension sizes. The main motivation for this rule is that a class needs to be designed for inheritance that includes redeclaration. Otherwise unexpected errors may occur.



2 Connector Classes




3 Resistor and TempResistor




4 Redeclare

The redeclare prefix is used at the front of a modifier containing a new variable or type declaration that replaces the original variable or type declaration element in the modified class.The reason for requiring a special keyword like redeclare is to reduce the risk for accidental programming errors that otherwise might occur when whole declarations are replaced by declarations of different types.




In order to allow further redeclaration of a redeclared element the replaceable prefix should be present also in the modifier.




In the class
SuperTempMicroCircuit the keyword replaceable is left out, which means that no further redeclaration is possible.



4.1 Flattening of MicroCircuit, TempMicroCiruit2