Package eu.bandm.tools.ops
Enum Class EBNFModifier
- All Implemented Interfaces:
Serializable
,Comparable<EBNFModifier>
,java.lang.constant.Constable
Models the four regular-expression operators which are frequently used
in extended Bakus-Naur-forms.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionNeutral case, that no modifier is appended to a sub-expression.Operator which allows the decorated sub-expression to appear or not to appear.Operator which allows the decorated sub-expression to appear arbitrary many times, but at least onceOperator which allows the decorated sub-expression to appear zero to arbitrary many times. -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
addsEpsilon
(EBNFModifier arg) Whether the given modifier allows empty string.static boolean
Whether the given modifier allows using a sub-expression ore than once.static EBNFModifier
compose
(EBNFModifier... args) Calculate the effect of more than one modifier applied to the same sub-expression.static EBNFModifier
Returns the enum constant of this class with the specified name.static EBNFModifier[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
none
Neutral case, that no modifier is appended to a sub-expression. -
optional
Operator which allows the decorated sub-expression to appear or not to appear. -
star
Operator which allows the decorated sub-expression to appear zero to arbitrary many times. -
plus
Operator which allows the decorated sub-expression to appear arbitrary many times, but at least once
-
-
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
-
compose
Calculate the effect of more than one modifier applied to the same sub-expression. The table is- ? * + ----------------- - - ? * + ? ? ? * * * * * * * + + * * +
-
addsEpsilon
Whether the given modifier allows empty string. -
addsRepetitions
Whether the given modifier allows using a sub-expression ore than once.
-