RawToken
data class RawToken
Fields
Name | Description |
---|---|
val sequence: CharSequence
|
|
val context: ParseContext?
|
Location of where the token was found in the .wast file. |
Constructors
<init>
constructor(sequence: CharSequence, context: ParseContext?)
Special Token implementation, used by the actual tokens to build instances of themselves against.
Parameters
Name | Description |
---|---|
sequence: CharSequence
|
|
context: ParseContext?
|
Extensions
findFloatLiteral
fun RawToken.findFloatLiteral(): TokenMatchResult?
Receiver
Name | Description |
---|---|
RawToken
|
ReturnValue
Name | Description |
---|---|
TokenMatchResult?
|
isFloatLiteral
fun RawToken.isFloatLiteral(): Boolean
Receiver
Name | Description |
---|---|
RawToken
|
ReturnValue
Name | Description |
---|---|
Boolean
|
toFloatLiteral
fun RawToken.toFloatLiteral(): FloatLiteral
Receiver
Name | Description |
---|---|
RawToken
|
ReturnValue
Name | Description |
---|---|
FloatLiteral
|
findIdentifier
fun RawToken.findIdentifier(): TokenMatchResult?
Receiver
Name | Description |
---|---|
RawToken
|
ReturnValue
Name | Description |
---|---|
TokenMatchResult?
|
isIdentifier
fun RawToken.isIdentifier(): Boolean
Receiver
Name | Description |
---|---|
RawToken
|
ReturnValue
Name | Description |
---|---|
Boolean
|
toIdentifier
fun RawToken.toIdentifier(): Identifier
Receiver
Name | Description |
---|---|
RawToken
|
ReturnValue
Name | Description |
---|---|
Identifier
|
findIntegerLiteral
fun RawToken.findIntegerLiteral(): TokenMatchResult?
Receiver
Name | Description |
---|---|
RawToken
|
ReturnValue
Name | Description |
---|---|
TokenMatchResult?
|
isIntegerLiteral
fun RawToken.isIntegerLiteral(): Boolean
Receiver
Name | Description |
---|---|
RawToken
|
ReturnValue
Name | Description |
---|---|
Boolean
|
toIntegerLiteral
fun RawToken.toIntegerLiteral(): IntegerLiteral<*>
Receiver
Name | Description |
---|---|
RawToken
|
ReturnValue
Name | Description |
---|---|
IntegerLiteral<*>
|
findKeyword
fun RawToken.findKeyword(): TokenMatchResult?
Receiver
Name | Description |
---|---|
RawToken
|
ReturnValue
Name | Description |
---|---|
TokenMatchResult?
|
isKeyword
fun RawToken.isKeyword(): Boolean
Receiver
Name | Description |
---|---|
RawToken
|
ReturnValue
Name | Description |
---|---|
Boolean
|
toKeyword
fun RawToken.toKeyword(): Keyword
Receiver
Name | Description |
---|---|
RawToken
|
ReturnValue
Name | Description |
---|---|
Keyword
|
findParen
fun RawToken.findParen(): TokenMatchResult?
Receiver
Name | Description |
---|---|
RawToken
|
ReturnValue
Name | Description |
---|---|
TokenMatchResult?
|
isOpenParen
fun RawToken.isOpenParen(): Boolean
Receiver
Name | Description |
---|---|
RawToken
|
ReturnValue
Name | Description |
---|---|
Boolean
|
isClosedParen
fun RawToken.isClosedParen(): Boolean
Receiver
Name | Description |
---|---|
RawToken
|
ReturnValue
Name | Description |
---|---|
Boolean
|
findReserved
fun RawToken.findReserved(): TokenMatchResult?
Receiver
Name | Description |
---|---|
RawToken
|
ReturnValue
Name | Description |
---|---|
TokenMatchResult?
|
isReserved
fun RawToken.isReserved(): Boolean
Receiver
Name | Description |
---|---|
RawToken
|
ReturnValue
Name | Description |
---|---|
Boolean
|
toReserved
fun RawToken.toReserved(): Reserved
Receiver
Name | Description |
---|---|
RawToken
|
ReturnValue
Name | Description |
---|---|
Reserved
|
findStringLiteral
fun RawToken.findStringLiteral(): TokenMatchResult?
Receiver
Name | Description |
---|---|
RawToken
|
ReturnValue
Name | Description |
---|---|
TokenMatchResult?
|
isStringLiteral
fun RawToken.isStringLiteral(): Boolean
Receiver
Name | Description |
---|---|
RawToken
|
ReturnValue
Name | Description |
---|---|
Boolean
|
toStringLiteral
fun RawToken.toStringLiteral(): StringLiteral
Receiver
Name | Description |
---|---|
RawToken
|
ReturnValue
Name | Description |
---|---|
StringLiteral
|
isKeyword
fun Token.isKeyword(keywordValue: String): Boolean
Receiver
Name | Description |
---|---|
Token
|
Parameters
Name | Description |
---|---|
keywordValue: String
|
ReturnValue
Name | Description |
---|---|
Boolean
|
asKeywordMatching
fun Token.asKeywordMatching(value: String): Keyword?
Casts the Token into a Keyword and returns it if its Keyword.value is value.
Returns null
if either condition is unmet.
Receiver
Name | Description |
---|---|
Token
|
Parameters
Name | Description |
---|---|
value: String
|
ReturnValue
Name | Description |
---|---|
Keyword?
|
asKeywordMatching
fun Token.asKeywordMatching(regex: Regex): Pair
Casts the Token into a Keyword and returns it, along with the match, if its Keyword.value matches regexp.
Returns null
if neither condition is met.
Receiver
Name | Description |
---|---|
Token
|
Parameters
Name | Description |
---|---|
regex: Regex
|
ReturnValue
Name | Description |
---|---|
Pair
|
Special Token implementation, used by the actual tokens to build instances of themselves against.