Record Class Grammar.Chars
java.lang.Object
java.lang.Record
org.libxmq.imp.ixml.earley.Grammar.Chars
- Record Components:
set- the code points matched- true if the terminal is hiddentext- how the terminal is written in the grammar, eg 'a' or ['a'-'z'; #a]tokens- the tokens matched (see Tokens), one bit per token: the token of a literal, or for a charset the tokens of the code points in set that have been seen in the inputs so far. Shared by the terminals with the same set.
- All Implemented Interfaces:
Grammar.Symbol
- Enclosing class:
Grammar
public static record Grammar.Chars(BitSet set, boolean hidden, String text, BitSet tokens)
extends Record
implements Grammar.Symbol
A terminal: one code point from a set. A hidden terminal, -'x', is not output.
-
Constructor Summary
Constructors -
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.booleanhidden()Returns the value of thehiddenrecord component.booleanmatches(int codepoint) Returns true if the code point is in the set.booleanmatchesToken(int token) Returns true if the token is matched.set()Returns the value of thesetrecord component.text()Returns the value of thetextrecord component.tokens()Returns the value of thetokensrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface Grammar.Symbol
isZeroWidthModifier and TypeMethodDescriptiondefault booleanReturns true if the symbol matches nothing: the parser steps over it.
-
Constructor Details
-
Method Details
-
matches
public boolean matches(int codepoint) Returns true if the code point is in the set.- Parameters:
codepoint- the code point- Returns:
- true on a match
-
matchesToken
public boolean matchesToken(int token) Returns true if the token is matched.- Parameters:
token- the token- Returns:
- true on a match
-
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
set
-
text
-
tokens
-