Class ThriftTokenizer

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.lang.Readable, net.morimekta.util.lexer.Tokenizer<ThriftTokenType,​ThriftToken>

    public class ThriftTokenizer
    extends net.morimekta.util.lexer.TokenizerBase<ThriftTokenType,​ThriftToken>
    Specialization of the 'pretty' tokenizer to make it handle some special cases only applicable when parsing thrift files, but not allowed in pretty format or config files.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String kConst  
      static java.lang.String kEnum  
      static java.lang.String kException  
      static java.lang.String kExtends  
      static java.lang.String kImplements  
      static java.lang.String kInclude  
      static java.lang.String kInterface  
      static java.lang.String kNamespace  
      static java.lang.String kNull  
      static java.lang.String kOf  
      static java.lang.String kOneway  
      static java.lang.String kOptional  
      static java.lang.String kRequired  
      static java.lang.String kService  
      static java.lang.String kStruct  
      static java.lang.String kThrows  
      static java.lang.String kTypedef  
      static java.lang.String kUnion  
      static java.lang.String kVoid  
      • Fields inherited from class net.morimekta.util.lexer.TokenizerBase

        DEFAULT_BUFFER_SIZE
      • Fields inherited from class net.morimekta.util.io.LineBufferedReader

        buffer, bufferLimit, bufferLineEnd, bufferOffset, lastChar, lineNo, linePos, preLoaded, reader
      • Fields inherited from class java.io.Reader

        lock
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected boolean allowIdentifier​(int last)  
      protected ThriftToken genericToken​(char[] buffer, int offset, int len, ThriftTokenType type, int lineNo, int linePos)  
      protected ThriftToken identifierToken​(char[] buffer, int offset, int len, int lineNo, int linePos)  
      protected ThriftToken nextSymbol()  
      protected ThriftToken numberToken​(char[] buffer, int offset, int len, int lineNo, int linePos)  
      ThriftToken parseNextToken()  
      protected boolean startString()  
      protected ThriftToken stringToken​(char[] buffer, int offset, int len, int lineNo, int linePos)  
      protected ThriftToken symbolToken​(char[] buffer, int offset, int len, int lineNo, int linePos)  
      • Methods inherited from class net.morimekta.util.lexer.TokenizerBase

        currentLine, currentLineNo, currentLinePos, eofFailure, failure, identifierSeparator, isWhitespace, readUntil, startIdentifier, startNumber, startSymbol, toString
      • Methods inherited from class net.morimekta.util.io.LineBufferedReader

        close, getLine, getLineNo, getLinePos, getRemainingLines, getRestOfLine, maybeConsolidateBuffer, read, read, readNextChar
      • Methods inherited from class java.io.Reader

        mark, markSupported, nullReader, read, read, ready, reset, skip, transferTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait