Class InstructionSequenceBuilder
java.lang.Object
org.apache.pdfbox.pdmodel.common.function.type4.Parser.AbstractSyntaxHandler
org.apache.pdfbox.pdmodel.common.function.type4.InstructionSequenceBuilder
- All Implemented Interfaces:
Parser.SyntaxHandler
Basic parser for Type 4 functions which is used to build up instruction sequences.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Pattern
private final InstructionSequence
private static final Pattern
private final Stack<InstructionSequence>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate InstructionSequence
Returns the instruction sequence that has been build from the syntactic elements.static InstructionSequence
parse
(CharSequence text) Parses the given text into an instruction sequence representing a Type 4 function that can be executed.static int
Parses a value of type "int".static float
Parses a value of type "real".void
token
(CharSequence text) Called when a token is encountered.private void
Methods inherited from class org.apache.pdfbox.pdmodel.common.function.type4.Parser.AbstractSyntaxHandler
comment, newLine, whitespace
-
Field Details
-
INTEGER_PATTERN
-
REAL_PATTERN
-
mainSequence
-
seqStack
-
-
Constructor Details
-
InstructionSequenceBuilder
private InstructionSequenceBuilder()
-
-
Method Details
-
getInstructionSequence
Returns the instruction sequence that has been build from the syntactic elements.- Returns:
- the instruction sequence
-
parse
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
-
getCurrentSequence
-
token
Called when a token is encountered. No distinction between operators and values is done here.- Parameters:
text
- the token text
-
token
-
parseInt
Parses a value of type "int".- Parameters:
token
- the token to be parsed- Returns:
- the parsed value
-
parseReal
Parses a value of type "real".- Parameters:
token
- the token to be parsed- Returns:
- the parsed value
-