scala.tools.nsc.io

Lexer

class Lexer extends AnyRef

A simple lexer for tokens as they are used in JSON, plus parens (, ) Tokens understood are:

(, ), [, ], {, }, :, ,, true, false, null, strings (syntax as in JSON), integer numbers (syntax as in JSON: -?(0|\d+) floating point numbers (syntax as in JSON: -?(0|\d+)(\.\d+)?((e|E)(+|-)?\d+)?) The end of input is represented as its own token, EOF. Lexers can keep one token lookahead

Source
Lexer.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. Lexer
  2. AnyRef
  3. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Lexer (rd: Reader)

    rd

    the reader from which characters are read.

Value Members

  1. def != (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  2. def != (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  3. def ## (): Int

    Attributes
    final
    Definition Classes
    AnyRef → Any
  4. def == (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  5. def == (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  6. def accept (ch: Char): Unit

    The current token is a delimiter consisting of given character, reads next token, otherwise raises an error.

  7. def accept (t: Token): Unit

    If current token equals given token, reads next token, otherwise raises an error.

    If current token equals given token, reads next token, otherwise raises an error.

    t

    the given token to compare current token with

  8. def acceptChar (c: Char): Unit

    If last-read character equals given character, reads next character, otherwise raises an error

    If last-read character equals given character, reads next character, otherwise raises an error

    c

    the given character to compare with last-read character

  9. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  10. var ch : Char

    The last-read character

  11. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  12. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  13. def equals (arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  14. def error (msg: String): Nothing

    Always throws a MalformedInput exception with given error message.

    Always throws a MalformedInput exception with given error message.

    msg

    the error message

  15. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  16. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef → Any
  17. def getNumber (): Unit

    Reads a numeric literal, and forms an IntLit or FloatLit token from it.

    Reads a numeric literal, and forms an IntLit or FloatLit token from it. Last-read input character ch must be either - or a digit.

  18. def getString (): Unit

    Reads a string literal, and forms a StringLit token from it.

    Reads a string literal, and forms a StringLit token from it. Last-read input character ch must be opening "-quote.

  19. def hashCode (): Int

    Definition Classes
    AnyRef → Any
  20. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  21. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  22. def nextChar (): Unit

    Reads next character into ch

  23. def nextToken (): Unit

    Skips whitespace and reads next lexeme into token

  24. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  25. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  26. var pos : Long

    The number of characters read so far

  27. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  28. def toString (): String

    Definition Classes
    AnyRef → Any
  29. var token : Token

    The last-read token

  30. var tokenPos : Long

    The number of characters read before the start of the last-read token

  31. def wait (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  32. def wait (arg0: Long, arg1: Int): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  33. def wait (arg0: Long): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from AnyRef

Inherited from Any