Factory methods for creating token definitions in the lexer DSL.
Attributes
- Companion
- class
- Source
- lexer.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Token.type
Members list
Value members
Concrete methods
Creates an ignored token that will be matched but not included in the output.
Creates an ignored token that will be matched but not included in the output.
This is compile-time only and should only be used inside lexer definitions.
Attributes
- Returns
-
a token that will be ignored
- Source
- lexer.scala
Creates a token whose lexemes carry no value (()). To carry the matched text or anything computed from it, bind the match and pass it: case n @ "[0-9]+" => Token["NUM"](n.toInt).
Creates a token whose lexemes carry no value (()). To carry the matched text or anything computed from it, bind the match and pass it: case n @ "[0-9]+" => Token["NUM"](n.toInt).
This is compile-time only and should only be used inside lexer definitions.
Type parameters
- Name
-
the token name
Attributes
- Returns
-
a token definition
- Source
- lexer.scala
Creates a token whose lexemes carry value, typically computed from the bound match.
Creates a token whose lexemes carry value, typically computed from the bound match.
This is compile-time only and should only be used inside lexer definitions.
Type parameters
- Name
-
the token name
Value parameters
- value
-
the value its lexemes carry
Attributes
- Returns
-
a token definition
- Source
- lexer.scala
