Package de.monticore.grammar
Enum Class Multiplicity
- All Implemented Interfaces:
Serializable,Comparable<Multiplicity>,Constable
Denotes the multiplicity of nonterminals in a MC grammar such as '*', '+', or '?'.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionprotected static booleanareDuplicates(ASTMCGrammar rootNode, ASTRuleComponent firstNode, ASTRuleComponent secondNode) static MultiplicitydetermineMultiplicity(de.monticore.ast.ASTNode astNode) static MultiplicitydetermineMultiplicity(ASTAdditionalAttribute attributeInAST) static MultiplicitydetermineMultiplicity(ASTMCGrammar rootNode, ASTRuleComponent astNode) static MultiplicitydetermineMultiplicity(ASTRuleComponent astNode) Performs the multiplicity calculation for inherited attributes.protected static Stream<ASTRuleComponent> getAllNodesInRelatedRuleComponents(ASTMCGrammar rootNode, ASTRuleComponent astNode, List<ASTGrammarNode> intermediates) protected static intgetIterationInt(de.monticore.ast.ASTNode ancestor) protected static intgetMaxCardinality(ASTCard cardinality) protected static intgetMinCardinality(ASTCard cardinality) getUsageName(de.monticore.ast.ASTNode ancestor) protected static MultiplicitymultiplicityByAlternative(ASTMCGrammar rootNode, ASTRuleComponent astNode, List<ASTGrammarNode> intermediates) protected static MultiplicitymultiplicityByDuplicates(ASTMCGrammar rootNode, ASTRuleComponent astNode, List<ASTGrammarNode> intermediates) static MultiplicitymultiplicityByIteration(ASTMCGrammar rootNode, ASTRuleComponent astNode, List<ASTGrammarNode> intermediates) static MultiplicityReturns the enum constant of this class with the specified name.static Multiplicity[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
STANDARD
No quantifier present -
OPTIONAL
'?' quantifier present -
LIST
'*' or '+' quantifier present
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
determineMultiplicity
-
getMaxCardinality
-
getMinCardinality
-
determineMultiplicity
Performs the multiplicity calculation for inherited attributes.- Parameters:
astNode- The ast node.- Returns:
- The multiplicity of the ast in the defining grammar.
-
determineMultiplicity
-
determineMultiplicity
-
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
-
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)
-