java.lang.Object
java.lang.Record
org.aya.cli.parse.ModifierParser
Generalized modifier parser. There are two assumptions in this parser:
1. Availability. Whether a modifier is usable (can occur) in a declaration.
2. Presence. Whether a modifier is present (is specified) in a declaration.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordFor different declarations we have different modifiers that are available.static enumstatic enumstatic interfaceAll parsed modifiers -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ModifierParser.FilterOnly "open" is available to (data/struct) declsstatic final ModifierParser.Filter"opaque", "inline" and "overlap" is available to functions.static final ModifierParser.Filternothing is available to sub-level decls (ctor/field). -
Constructor Summary
ConstructorsConstructorDescriptionModifierParser(@NotNull org.aya.util.reporter.Reporter reporter) Creates an instance of aModifierParserrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull ModifierParser.Modifiersparse(@NotNull kala.collection.immutable.ImmutableSeq<org.aya.util.error.WithPos<ModifierParser.Modifier>> modifiers, @NotNull ModifierParser.Filter filter) voidreportContradictModifier(@NotNull org.aya.util.error.WithPos<ModifierParser.Modifier> current, @NotNull org.aya.util.error.WithPos<ModifierParser.Modifier> that) voidreportDuplicatedModifier(@NotNull org.aya.util.error.WithPos<ModifierParser.Modifier> data) @NotNull org.aya.util.reporter.Reporterreporter()Returns the value of thereporterrecord component.voidreportUnsuitableModifier(@NotNull org.aya.util.error.WithPos<ModifierParser.Modifier> data) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DECL_FILTER
Only "open" is available to (data/struct) decls -
FN_FILTER
"opaque", "inline" and "overlap" is available to functions. -
SUBDECL_FILTER
nothing is available to sub-level decls (ctor/field).
-
-
Constructor Details
-
ModifierParser
public ModifierParser(@NotNull @NotNull org.aya.util.reporter.Reporter reporter) Creates an instance of aModifierParserrecord class.- Parameters:
reporter- the value for thereporterrecord component
-
-
Method Details
-
parse
@NotNull public @NotNull ModifierParser.Modifiers parse(@NotNull @NotNull kala.collection.immutable.ImmutableSeq<org.aya.util.error.WithPos<ModifierParser.Modifier>> modifiers, @NotNull @NotNull ModifierParser.Filter filter) - Parameters:
filter- The filter also performs on the modifiers that expanded from input.
-
reportUnsuitableModifier
public void reportUnsuitableModifier(@NotNull @NotNull org.aya.util.error.WithPos<ModifierParser.Modifier> data) -
reportDuplicatedModifier
public void reportDuplicatedModifier(@NotNull @NotNull org.aya.util.error.WithPos<ModifierParser.Modifier> data) -
reportContradictModifier
public void reportContradictModifier(@NotNull @NotNull org.aya.util.error.WithPos<ModifierParser.Modifier> current, @NotNull @NotNull org.aya.util.error.WithPos<ModifierParser.Modifier> that) -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
reporter
@NotNull public @NotNull org.aya.util.reporter.Reporter reporter()Returns the value of thereporterrecord component.- Returns:
- the value of the
reporterrecord component
-