object Lexer
Companion object of class Lexer
which defines tokens and some utility concepts
used for tokens and lexers
- Source
- Lexer.scala
- Alphabetic
- By Inheritance
- Lexer
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- case class Delim(char: Char) extends Token with Product with Serializable
A subclass of
Token
representing single-character delimitersA subclass of
Token
representing single-character delimiters- char
the delimiter character making up this token
- case class FloatLit(str: String) extends Token with Product with Serializable
A subclass of token representing floating point literals
- case class IntLit(str: String) extends Token with Product with Serializable
A subclass of token representing integer literals
- class MalformedInput extends Exception
An exception raised if an input does not correspond to what's expected
- case class StringLit(str: String) extends Token with Product with Serializable
A subclass of token representing string literals
- class Token extends AnyRef
The class of tokens, i.e.
The class of tokens, i.e. descriptions of input words (or: lexemes).
Value Members
- val Colon: Delim
The '
:
' token - val Comma: Delim
The '
,
' token - val EOF: Token
The token representing end of input
- val FalseLit: Token
The
false
token - val LBrace: Delim
The '
{
' token - val LBracket: Delim
The '
[
' token - val LParen: Delim
The '
(
' token - val NullLit: Token
The
null
token - val RBrace: Delim
The '
}
' token - val RBracket: Delim
The '
]
' token - val RParen: Delim
The '
)
' token - val TrueLit: Token
The
true
token - def quoted(str: String): String
Returns given string enclosed in
"
-quotes with all string characters escaped so that they correspond to the JSON standard.Returns given string enclosed in
"
-quotes with all string characters escaped so that they correspond to the JSON standard. Characters that escaped are:"
,\b
,\f
,\n
,\r
,\t
,\
. Furthermore, every other character which is not in the ASCII range 32-127 is escaped as a four hex-digit unicode character of the form\ u x x x x
.- str
the string to be quoted
The Scala compiler and reflection APIs.