org.icepdf.core.pobjects.functions.postscript
Class Lexer

java.lang.Object
  extended by org.icepdf.core.pobjects.functions.postscript.Lexer

public class Lexer
extends java.lang.Object

A state machine used to parse valid type 4 functions tokens in a input stream. As the tokens are parsed found operands are executed to mananipulate the stack.

Since:
4.2
Author:
ICEsoft Technologies Inc.

Constructor Summary
Lexer()
           
 
Method Summary
 java.util.Stack getStack()
          Gets the stack associated with this lexer.
 void parse(float[] input)
          Parse the input stream associated with this instance.
 void setInputStream(java.io.InputStream in)
          Type 4 function input stream to pars.e
protected  void setReader(java.io.Reader reader)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Lexer

public Lexer()
Method Detail

setInputStream

public void setInputStream(java.io.InputStream in)
Type 4 function input stream to pars.e

Parameters:
in - type 4 function input stream.

setReader

protected void setReader(java.io.Reader reader)

parse

public void parse(float[] input)
           throws java.io.IOException
Parse the input stream associated with this instance.

Parameters:
input - array of 1 or more numbers to be pushed onto the stack before the type 4 function is executed.
Throws:
java.io.IOException - if the input stream is null or incomplete.

getStack

public java.util.Stack getStack()
Gets the stack associated with this lexer. Once parse has successfully executed the stack will contain n numbers which represent the type 4 function output.

Returns:
stack containing the output of the type 4 function. If #parse() was not called the stack will be empty