class HexaPDF::Type::AcroForm::JavaScriptActions::SimplifiedFieldNotationParser

Parent

Implements a parser for the simplified field notation used for calculating field values.

This notation is used if the predefined functions are too simple but the calculation can still be done by simple arithmetic.

Constants

CALCULATE_OPERATIONS

Implementation of the operations for calculating the result.

JS_GENERATE_OPERATIONS

Implementation of the operations for generating the equivalent JavaScript code.

Public Class Methods

new(form, sfn_string)

Creates a new instance for the given AcroForm form instance and simplified field notation string sfn_string.

Public Instance Methods

parse(operations = :calculate)

Parses the string holding the simplified field notation.

If operations is :calculate, the calculation is performed and the result returned. If operations is :generate, a JavaScript representation is generated and returned.

+nil+ is returned regardless of the +operations+ value if there was any problem.