NAME

Gherkin::TokenScanner - Input-line format abstraction

SYNOPSIS

use Gherkin::TokenScanner;

my $fn = 'my.feature';
my $scanner = Gherkin::TokenScanner->new( $fn );

DESCRIPTION

This module implements an input-line format abstraction, returning inputlines from the indicated source. Currently, only text files are supported input formats, but the idea is that e.g. Excel files could be used as input formats as well, with an abstracted definition of "input line".

METHODS

new( $path_or_ref )

Constructor.

The parameter $path_or_ref can be passed either of two types of values:

A reference to a scalar

In this case, the parameter is assumed to reference the content to be parsed.

A scalar value

In this case, the parameter is assumed to be a filename. The file will be opened for input and parsed as a feature file.

read

Returns the next line (Gherkin::Line) token (Gherkin::Token) from the input.

When the end of a file is reached, the file handle is closed.

SEE ALSO

LICENSE

See Gherkin.