java.lang.Object
java.lang.Record
com.darkcollective.relix.lang.LangToken
- Record Components:
type- the token categoryvalue- the raw lexeme text as it appeared in the source (forLangTokenType.STRING_LITthis is the content without the surrounding quotes, with escape sequences resolved)line- 1-based source line number of the first charactercolumn- 1-based source column number of the first character
A single token produced by the
LangLexer.-
Constructor Summary
ConstructorsConstructorDescriptionLangToken(LangTokenType type, String value, int line, int column) Creates an instance of aLangTokenrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcolumn()Returns the value of thecolumnrecord component.describe()Returns a human-readable description of this token suitable for use in error messages (e.g.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intline()Returns the value of thelinerecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
Method Details
-
describe
Returns a human-readable description of this token suitable for use in error messages (e.g."'import' at line 3, col 1"). -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
line
public int line()Returns the value of thelinerecord component.- Returns:
- the value of the
linerecord component
-
column
public int column()Returns the value of thecolumnrecord component.- Returns:
- the value of the
columnrecord component
-