Statistics::R::IO::ParserState(3pm)

Statistics::R::IO::ParserState3pm

Current state of the io parser

Usage

    use Statistics::R::IO::ParserState;
    
    my $state = Statistics::R::IO::ParserState->new(
        data => 'file.rds'
    );
    say $state->at
    say $state->next->at;

Version

version 1.0002

Overview

You shouldn't create instances of this class, it exists mainly to handle deserialization of R data files by the "IO" classes.

Methods

Accessors

data

An array reference to the data being parsed. The constructs accepts a scalar, which will be split into individual characters.

position

Position of the next data element to be processed.

at

Returns the element (byte) at the current "position".

eof

Returns true if the cursor ("position") is at the end of the "data".

singletons

An array reference in which unserialized data that should be exists as singletons can be "stashed" by the parser for later reference.

get_singleton $id

Return the singleton data object with the given $id.

Mutators

"ParserState" is intended to be immutable, so the "mutator" methods actually return a new instance with appropriately modified values of the attributes.

next

Returns a new ParserState instance with "position" advanced by one.

add_singleton $singleton

Returns a new ParserState instance with $singleton argument appended to the instance's "singletons".

Bugs and limitations

Instances of this class are intended to be immutable. Please do not try to change their value or attributes.

There are no known bugs in this module. Please see Statistics::R::IO for bug reporting.

Support

See Statistics::R::IO for support and contact information.

Releases

Unchanged in 2 releases since Debian 12 (Bookworm).

  1. 12–13

Author

Davor Cubranic <[email protected]>

From libstatistics-r-io-perl 1.0002-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.