Record Class Token
java.lang.Object
java.lang.Record
org.applecommander.bastools.api.model.Token
public record Token(int line, Token.Type type, ApplesoftKeyword keyword, Double number, String text)
extends Record
A Token in the classic compiler sense, in that this represents a component of the application.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionToken(int line, Token.Type type, ApplesoftKeyword keyword, Double number, String text) Creates an instance of aTokenrecord class. -
Method Summary
Modifier and TypeMethodDescriptionasString()static Tokenstatic Tokenstatic Tokenstatic Tokeneol(int line) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static Tokenkeyword()Returns the value of thekeywordrecord component.static Tokenkeyword(int line, ApplesoftKeyword keyword) intline()Returns the value of thelinerecord component.number()Returns the value of thenumberrecord component.static Tokenstatic Tokenstatic Tokenstatic Tokensyntax(int line, int ch) text()Returns the value of thetextrecord component.toString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
Token
Creates an instance of aTokenrecord class.- Parameters:
line- the value for thelinerecord componenttype- the value for thetyperecord componentkeyword- the value for thekeywordrecord componentnumber- the value for thenumberrecord componenttext- the value for thetextrecord component
-
-
Method Details
-
accept
-
toString
-
asString
-
eol
-
number
-
number
-
ident
-
comment
-
data
-
string
-
keyword
-
syntax
-
directive
-
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. -
line
public int line()Returns the value of thelinerecord component.- Returns:
- the value of the
linerecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
keyword
Returns the value of thekeywordrecord component.- Returns:
- the value of the
keywordrecord component
-
number
Returns the value of thenumberrecord component.- Returns:
- the value of the
numberrecord component
-
text
Returns the value of thetextrecord component.- Returns:
- the value of the
textrecord component
-