Class InstructionSequenceBuilder
- java.lang.Object
-
- com.tom_roush.pdfbox.pdmodel.common.function.type4.Parser.AbstractSyntaxHandler
-
- com.tom_roush.pdfbox.pdmodel.common.function.type4.InstructionSequenceBuilder
-
- All Implemented Interfaces:
Parser.SyntaxHandler
public final class InstructionSequenceBuilder extends Parser.AbstractSyntaxHandler
Basic parser for Type 4 functions which is used to build up instruction sequences.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description InstructionSequencegetInstructionSequence()Returns the instruction sequence that has been build from the syntactic elements.static InstructionSequenceparse(CharSequence text)Parses the given text into an instruction sequence representing a Type 4 function that can be executed.static intparseInt(String token)Parses a value of type "int".static floatparseReal(String token)Parses a value of type "real".voidtoken(CharSequence text)Called when a token is encountered.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from class com.tom_roush.pdfbox.pdmodel.common.function.type4.Parser.AbstractSyntaxHandler
comment, newLine, whitespace
-
-
-
-
Method Detail
-
getInstructionSequence
public InstructionSequence getInstructionSequence()
Returns the instruction sequence that has been build from the syntactic elements.- Returns:
- the instruction sequence
-
parse
public static InstructionSequence parse(CharSequence text)
Parses the given text into an instruction sequence representing a Type 4 function that can be executed.- Parameters:
text- the Type 4 function text- Returns:
- the instruction sequence
-
token
public void token(CharSequence text)
Called when a token is encountered. No distinction between operators and values is done here.- Parameters:
text- the token text
-
parseInt
public static int parseInt(String token)
Parses a value of type "int".- Parameters:
token- the token to be parsed- Returns:
- the parsed value
-
parseReal
public static float parseReal(String token)
Parses a value of type "real".- Parameters:
token- the token to be parsed- Returns:
- the parsed value
-
-