Class DefaultValueTranslator

java.lang.Object
net.ssehub.easy.reasoning.sseReasoner.functions.DefaultValueTranslator

public class DefaultValueTranslator extends Object
Turns partial compound default values into complete values as EASy allows only one default assignment per variable.
Author:
Holger Eichelberger
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private static net.ssehub.easy.varModel.cst.CompoundInitializer
    createTranslatedCompoundInitializer(net.ssehub.easy.varModel.model.datatypes.Compound type, Map<String,net.ssehub.easy.varModel.cst.ConstraintSyntaxTree> values, Map<String,net.ssehub.easy.varModel.model.AbstractVariable> decls)
    Creates a translated compound initializer.
    static net.ssehub.easy.varModel.cst.ConstraintSyntaxTree
    translateDefaultValue(net.ssehub.easy.varModel.cst.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 void
    translateDefaultValues(net.ssehub.easy.varModel.model.datatypes.Compound type, Map<String,net.ssehub.easy.varModel.cst.ConstraintSyntaxTree> values, Map<String,net.ssehub.easy.varModel.model.AbstractVariable> decls)
    Recursively translates the default values of type into values and decls, but only if the slots are not already allocated.
    static net.ssehub.easy.varModel.cst.ConstraintSyntaxTree
    translateDefaultValueSafe(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree cst)
    Calls translateDefaultValue(ConstraintSyntaxTree) catching/logging exceptions.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DefaultValueTranslator

      public DefaultValueTranslator()
  • Method Details

    • translateDefaultValueSafe

      public static net.ssehub.easy.varModel.cst.ConstraintSyntaxTree translateDefaultValueSafe(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree cst)
      Calls translateDefaultValue(ConstraintSyntaxTree) catching/logging exceptions.
      Parameters:
      cst - the constraint to be translated
      Returns:
      the translated constraint or cst
    • translateDefaultValue

      public static net.ssehub.easy.varModel.cst.ConstraintSyntaxTree translateDefaultValue(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree cst) throws net.ssehub.easy.varModel.cst.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:
      net.ssehub.easy.varModel.cst.CSTSemanticException - if constraint expressions cannot correctly be built
    • translateDefaultValues

      private static void translateDefaultValues(net.ssehub.easy.varModel.model.datatypes.Compound type, Map<String,net.ssehub.easy.varModel.cst.ConstraintSyntaxTree> values, Map<String,net.ssehub.easy.varModel.model.AbstractVariable> decls) throws net.ssehub.easy.varModel.cst.CSTSemanticException
      Recursively translates the default values of type into values and decls, but only if the slots are not already allocated.
      Parameters:
      type - the type to be translated
      values - the values, i.e., slot name to value expression mappings
      decls - the declarations, i.e., slot name to declaration mappings
      Throws:
      net.ssehub.easy.varModel.cst.CSTSemanticException - if constraint expressions cannot correctly be built
    • createTranslatedCompoundInitializer

      private static net.ssehub.easy.varModel.cst.CompoundInitializer createTranslatedCompoundInitializer(net.ssehub.easy.varModel.model.datatypes.Compound type, Map<String,net.ssehub.easy.varModel.cst.ConstraintSyntaxTree> values, Map<String,net.ssehub.easy.varModel.model.AbstractVariable> decls) throws net.ssehub.easy.varModel.cst.CSTSemanticException
      Creates a translated compound initializer.
      Parameters:
      type - the type initializer represents
      values - the values, i.e., slot name to value expression mappings
      decls - the declarations, i.e., slot name to declaration mappings
      Returns:
      the created initializer
      Throws:
      net.ssehub.easy.varModel.cst.CSTSemanticException - if constraint expressions cannot correctly be built