Class CharStream

java.lang.Object
com.google.googlejavaformat.java.javadoc.CharStream

final class CharStream extends Object
String reader designed for use from the lexer. Callers invoke the tryConsume* methods to specify what characters they expect and then readAndResetRecorded() to retrieve and consume the matched characters. This is a slightly odd API -- why not just return the matched characters from tryConsume? -- but it is convenient for the lexer.
  • Field Details

    • remaining

      String remaining
    • toConsume

      int toConsume
  • Constructor Details

    • CharStream

      CharStream(String input)
  • Method Details

    • tryConsume

      boolean tryConsume(String expected)
    • tryConsumeRegex

      boolean tryConsumeRegex(Pattern pattern)
    • readAndResetRecorded

      String readAndResetRecorded()
    • isExhausted

      boolean isExhausted()