Versions in this module Expand all Collapse all v1 v1.2.0 Aug 8, 2023 v1.1.0 Aug 8, 2023 Changes in this version + var ErrRangeCheck = errors.New("range check error") + var ErrStackOverflow = errors.New("stack overflow") + var ErrStackUnderflow = errors.New("stack underflow") + var ErrTypeCheck = errors.New("type check error") + var ErrUndefinedResult = errors.New("undefined result error") + var ErrUnsupportedOperand = errors.New("unsupported operand") + func PSObjectArrayToFloat64Array(objects []PSObject) ([]float64, error) + type PSBoolean struct + Val bool + func MakeBool(val bool) *PSBoolean + func (bool *PSBoolean) DebugString() string + func (bool *PSBoolean) Duplicate() PSObject + func (bool *PSBoolean) String() string + type PSExecutor struct + Stack *PSStack + func NewPSExecutor(program *PSProgram) *PSExecutor + func (exec *PSExecutor) Execute(objects []PSObject) ([]PSObject, error) + type PSInteger struct + Val int + func MakeInteger(val int) *PSInteger + func (int *PSInteger) DebugString() string + func (int *PSInteger) Duplicate() PSObject + func (int *PSInteger) String() string + type PSObject interface + DebugString func() string + Duplicate func() PSObject + String func() string + type PSOperand string + func MakeOperand(val string) *PSOperand + func (op *PSOperand) DebugString() string + func (op *PSOperand) Duplicate() PSObject + func (op *PSOperand) Exec(stack *PSStack) error + func (op *PSOperand) String() string + type PSParser struct + func NewPSParser(content []byte) *PSParser + func (p *PSParser) Parse() (*PSProgram, error) + type PSProgram []PSObject + func NewPSProgram() *PSProgram + func (prog *PSProgram) Append(obj PSObject) + func (prog *PSProgram) DebugString() string + func (prog *PSProgram) Duplicate() PSObject + func (prog *PSProgram) Exec(stack *PSStack) error + func (prog *PSProgram) String() string + type PSReal struct + Val float64 + func MakeReal(val float64) *PSReal + func (real *PSReal) DebugString() string + func (real *PSReal) Duplicate() PSObject + func (real *PSReal) String() string + type PSStack []PSObject + func NewPSStack() *PSStack + func (stack *PSStack) DebugString() string + func (stack *PSStack) Empty() + func (stack *PSStack) Pop() (PSObject, error) + func (stack *PSStack) PopInteger() (int, error) + func (stack *PSStack) PopNumberAsFloat64() (float64, error) + func (stack *PSStack) Push(obj PSObject) error + func (stack *PSStack) String() string