Class Type1Lexer

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Token aheadToken  
      private java.nio.ByteBuffer buffer  
      private static org.apache.commons.logging.Log LOG
      Log instance.
      private int openParens  
    • Constructor Summary

      Constructors 
      Constructor Description
      Type1Lexer​(byte[] bytes)
      Constructs a new Type1Lexer given a header-less .pfb segment.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private char getChar()
      Reads an ASCII char from the buffer.
      Token nextToken()
      Returns the next token and consumes it.
      Token peekToken()
      Returns the next token without consuming it.
      private Token readCharString​(int length)
      Reads a binary CharString.
      private java.lang.String readComment()
      Reads a line comment.
      private java.lang.String readRegular()
      Reads a sequence of regular characters, i.e.
      private Token readString()
      Reads a (string).
      private Token readToken​(Token prevToken)
      Reads a single token.
      private Token tryReadNumber()
      Reads a number or returns null.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOG

        private static final org.apache.commons.logging.Log LOG
        Log instance.
      • buffer

        private final java.nio.ByteBuffer buffer
      • aheadToken

        private Token aheadToken
      • openParens

        private int openParens
    • Constructor Detail

      • Type1Lexer

        Type1Lexer​(byte[] bytes)
            throws java.io.IOException
        Constructs a new Type1Lexer given a header-less .pfb segment.
        Parameters:
        bytes - Header-less .pfb segment
        Throws:
        java.io.IOException
    • Method Detail

      • nextToken

        public Token nextToken()
                        throws java.io.IOException
        Returns the next token and consumes it.
        Returns:
        The next token.
        Throws:
        java.io.IOException
      • peekToken

        public Token peekToken()
        Returns the next token without consuming it.
        Returns:
        The next token
      • getChar

        private char getChar()
        Reads an ASCII char from the buffer.
      • readToken

        private Token readToken​(Token prevToken)
                         throws java.io.IOException
        Reads a single token.
        Parameters:
        prevToken - the previous token
        Throws:
        java.io.IOException
      • tryReadNumber

        private Token tryReadNumber()
        Reads a number or returns null.
      • readRegular

        private java.lang.String readRegular()
        Reads a sequence of regular characters, i.e. not delimiters or whitespace
      • readComment

        private java.lang.String readComment()
        Reads a line comment.
      • readString

        private Token readString()
                          throws java.io.IOException
        Reads a (string).
        Throws:
        java.io.IOException
      • readCharString

        private Token readCharString​(int length)
        Reads a binary CharString.