NAME

Rserve::ParserState - Current state of the parser

SYNOPSIS

use Rserve::ParserState;

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

DESCRIPTION

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

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.

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.