The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

GOBO::Parsers::Parser

SYNOPSIS

  my $p = GOBO::Parser->new;
  $p->parse_file(file => $file, options => $option_h);
  $g = $p->graph;

DESCRIPTION

Base class for all parsers. Parsers take formats (e.g. GOBO::Parsers::OBOParser) and generate objects, typically some combination of GOBO::Node and GOBO::Statement objects

parse_file

$parser->parse_file(file => '/path/to/file', options => $option_h)

input: self file => $f_name # either as /path/to/filename or a FileHandle object options => $opt_h # a hash of options [optional]

The file will be parsed according to the options This method does not return anything; instead, the parser object can be queried for the results.

parse

$parser->parse(options => $option_h)

input: self options => $opt_h # a hash of options [optional]

Parse according to the options. Note that the file to be parsed should already have been specified.

This method does not return anything; instead, the parser object can be queried for the results.

parse_chunk

$parser->parse_chunk(size => 50, options => $option_h)

input: self size => 1000 # the number of lines to parse options => $opt_h # a hash of options [optional]

Parse according to the options. Note that the file to be parsed should already have been specified.

This method does not return anything; instead, the parser object can be queried for the results.

set_file

$parser->set_file($f_name)

input: self $f_name # either as /path/to/filename or a FileHandle object

Set the parser to parse a certain file

set_options

input: self, hash ref of options

Sets a hash of options, accessed by $self->options.

Existing options will remain intact.

set_all_options

input: self, hash ref of options

Sets a hash of options, accessed by $self->options.

Existing options are deleted.

clear_options

input: self, arrayref of strings corresponding to keys in the 'options' hash

Removes key(s) from the options hash

clear_all_options

Delete everything from the options hash

reset_parser

$self->reset_parser

Removes the file handle, data, and options from the parser

reset_temporary_variables

$self->reset_temporary_variables

These variables should be reset every time the parser is used on a new file