Class DefaultValueTranslator
- java.lang.Object
-
- net.ssehub.easy.reasoning.sseReasoner.functions.DefaultValueTranslator
-
public class DefaultValueTranslator extends java.lang.ObjectTurns partial compound default values into complete values as EASy allows only one default assignment per variable.- Author:
- Holger Eichelberger
-
-
Constructor Summary
Constructors Constructor Description DefaultValueTranslator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static CompoundInitializercreateTranslatedCompoundInitializer(Compound type, java.util.Map<java.lang.String,ConstraintSyntaxTree> values, java.util.Map<java.lang.String,AbstractVariable> decls)Creates a translated compound initializer.static ConstraintSyntaxTreetranslateDefaultValue(ConstraintSyntaxTree cst)Translates a default value into its complete one-time default assignment value by including nested default values of the defining compound/container types.private static voidtranslateDefaultValues(Compound type, java.util.Map<java.lang.String,ConstraintSyntaxTree> values, java.util.Map<java.lang.String,AbstractVariable> decls)Recursively translates the default values of type intovaluesanddecls, but only if the slots are not already allocated.static ConstraintSyntaxTreetranslateDefaultValueSafe(ConstraintSyntaxTree cst)CallstranslateDefaultValue(ConstraintSyntaxTree)catching/logging exceptions.
-
-
-
Method Detail
-
translateDefaultValueSafe
public static ConstraintSyntaxTree translateDefaultValueSafe(ConstraintSyntaxTree cst)
CallstranslateDefaultValue(ConstraintSyntaxTree)catching/logging exceptions.- Parameters:
cst- the constraint to be translated- Returns:
- the translated constraint or
cst
-
translateDefaultValue
public static ConstraintSyntaxTree translateDefaultValue(ConstraintSyntaxTree cst) throws CSTSemanticException
Translates a default value into its complete one-time default assignment value by including nested default values of the defining compound/container types.- Parameters:
cst- the constraint to be translated- Returns:
- the translated constraint or
cst - Throws:
CSTSemanticException- if constraint expressions cannot correctly be built
-
translateDefaultValues
private static void translateDefaultValues(Compound type, java.util.Map<java.lang.String,ConstraintSyntaxTree> values, java.util.Map<java.lang.String,AbstractVariable> decls) throws CSTSemanticException
Recursively translates the default values of type intovaluesanddecls, but only if the slots are not already allocated.- Parameters:
type- the type to be translatedvalues- the values, i.e., slot name to value expression mappingsdecls- the declarations, i.e., slot name to declaration mappings- Throws:
CSTSemanticException- if constraint expressions cannot correctly be built
-
createTranslatedCompoundInitializer
private static CompoundInitializer createTranslatedCompoundInitializer(Compound type, java.util.Map<java.lang.String,ConstraintSyntaxTree> values, java.util.Map<java.lang.String,AbstractVariable> decls) throws CSTSemanticException
Creates a translated compound initializer.- Parameters:
type- the type initializer representsvalues- the values, i.e., slot name to value expression mappingsdecls- the declarations, i.e., slot name to declaration mappings- Returns:
- the created initializer
- Throws:
CSTSemanticException- if constraint expressions cannot correctly be built
-
-