Enum Class Multiplicity

java.lang.Object
java.lang.Enum<Multiplicity>
de.monticore.grammar.Multiplicity
All Implemented Interfaces:
Serializable, Comparable<Multiplicity>, Constable

public enum Multiplicity extends Enum<Multiplicity>
Denotes the multiplicity of nonterminals in a MC grammar such as '*', '+', or '?'.
  • Enum Constant Details

    • STANDARD

      public static final Multiplicity STANDARD
      No quantifier present
    • OPTIONAL

      public static final Multiplicity OPTIONAL
      '?' quantifier present
    • LIST

      public static final Multiplicity LIST
      '*' or '+' quantifier present
  • Method Details

    • values

      public static Multiplicity[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Multiplicity valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • determineMultiplicity

      public static Multiplicity determineMultiplicity(ASTAdditionalAttribute attributeInAST)
    • getMaxCardinality

      protected static int getMaxCardinality(ASTCard cardinality)
    • getMinCardinality

      protected static int getMinCardinality(ASTCard cardinality)
    • determineMultiplicity

      public static Multiplicity determineMultiplicity(ASTRuleComponent astNode)
      Performs the multiplicity calculation for inherited attributes.
      Parameters:
      astNode - The ast node.
      Returns:
      The multiplicity of the ast in the defining grammar.
    • determineMultiplicity

      public static Multiplicity determineMultiplicity(de.monticore.ast.ASTNode astNode)
    • determineMultiplicity

      public static Multiplicity determineMultiplicity(ASTMCGrammar rootNode, ASTRuleComponent astNode)
    • multiplicityByAlternative

      protected static Multiplicity multiplicityByAlternative(ASTMCGrammar rootNode, ASTRuleComponent astNode, List<ASTGrammarNode> intermediates)
    • multiplicityByDuplicates

      protected static Multiplicity multiplicityByDuplicates(ASTMCGrammar rootNode, ASTRuleComponent astNode, List<ASTGrammarNode> intermediates)
    • getUsageName

      public static Optional<String> getUsageName(de.monticore.ast.ASTNode ancestor)
    • areDuplicates

      protected static boolean areDuplicates(ASTMCGrammar rootNode, ASTRuleComponent firstNode, ASTRuleComponent secondNode)
    • getAllNodesInRelatedRuleComponents

      protected static Stream<ASTRuleComponent> getAllNodesInRelatedRuleComponents(ASTMCGrammar rootNode, ASTRuleComponent astNode, List<ASTGrammarNode> intermediates)
    • multiplicityByIteration

      public static Multiplicity multiplicityByIteration(ASTMCGrammar rootNode, ASTRuleComponent astNode, List<ASTGrammarNode> intermediates)
    • getIterationInt

      protected static int getIterationInt(de.monticore.ast.ASTNode ancestor)