The PostScript language, of which Type 1 fonts are a subset, has a somewhat awkward lexical structure. It is neither regular nor context-free, and the execution of the program can modify the the behaviour of the lexer/parser. Nevertheless, this class represents an attempt to artificially separate the PostScript parsing process into separate lexing and parsing phases in order to reduce the complexity of the parsing phase. , PostScript Language Reference 3rd ed, Adobe Systems (1999)
| Modifier and Type | Field and Description |
|---|---|
| private Token | |
| private final ByteBuffer | |
| private static final Log | LOG
Log instance. |
| private int |
| Access | Constructor and Description |
|---|---|
| pack-priv | Type1Lexer(byte[]
Header-less .pfb segment bytes)Constructs a new Type1Lexer given a header-less .pfb segment. |
| Modifier and Type | Method and Description |
|---|---|
| private char | |
| public Token | |
| public boolean | |
| public Token | |
| private Token | |
| private String | |
| private String | |
| private Token | |
| private Token | |
| private Token |
| aheadToken | back to summary |
|---|---|
| private Token aheadToken | |
| buffer | back to summary |
|---|---|
| private final ByteBuffer buffer | |
| LOG | back to summary |
|---|---|
| private static final Log LOG Log instance. | |
| openParens | back to summary |
|---|---|
| private int openParens | |
| Type1Lexer | back to summary |
|---|---|
| pack-priv Type1Lexer(byte[] bytes) throws IOException Constructs a new Type1Lexer given a header-less .pfb segment.
| |
| getChar | back to summary |
|---|---|
| private char getChar() throws IOException Reads an ASCII char from the buffer. | |
| nextToken | back to summary |
|---|---|
| public Token nextToken() throws IOException Returns the next token and consumes it.
| |
| peekKind | back to summary |
|---|---|
| public boolean peekKind(Token. Checks if the kind of the next token equals the given one without consuming it.
| |
| peekToken | back to summary |
|---|---|
| public Token peekToken() Returns the next token without consuming it.
| |
| readCharString | back to summary |
|---|---|
| private Token readCharString(int length) throws IOException Reads a binary CharString. | |
| readComment | back to summary |
|---|---|
| private String readComment() throws IOException Reads a line comment. | |
| readRegular | back to summary |
|---|---|
| private String readRegular() throws IOException Reads a sequence of regular characters, i.e. not delimiters or whitespace | |
| readString | back to summary |
|---|---|
| private Token readString() throws IOException Reads a (string). | |
| readToken | back to summary |
|---|---|
| private Token readToken(Token prevToken) throws IOException Reads a single token.
| |
| tryReadNumber | back to summary |
|---|---|
| private Token tryReadNumber() throws IOException Reads a number or returns null. | |