POE::Filter::RecDescent - Parse an incoming data stream under specified rules.


POE-Filter-RecDescent documentation Contained in the POE-Filter-RecDescent distribution.

Index


Code Index:

NAME

Top

POE::Filter::RecDescent - Parse an incoming data stream under specified rules.

SYNOPSIS

Top

  $msg = POE::Filter::RecDescent->new($grammar_string);
  $parse_tree = $msg->get($array_ref_of_raw_chunks_from_driver);

DESCRIPTION

Top

The RecDescent filter relies on Parse::RecDescent for its grammar and parser. Each call to get() invokes the parser on the text string passed in.

PUBLIC FILTER METHODS

Top

Please see POE::Filter.

SEE ALSO

Top

POE::Filter, Parse::RecDescent

The SEE ALSO section in POE contains a table of contents covering the entire POE distribution.

AUTHORS & COPYRIGHTS

Top

Jeff Goff, <jgoff@cpan.org> (DrForr on irc.perl.org)

Please see POE for more information about authors and contributors.


POE-Filter-RecDescent documentation Contained in the POE-Filter-RecDescent distribution.

package POE::Filter::RecDescent;

use strict;
use Parse::RecDescent;
use Carp qw(croak);
use vars qw($VERSION);

$VERSION = '0.02';

sub DEBUG() { 0 };
#sub DEBUG() { 1 };

# {{{ new
sub new {
  my $type = shift;
  my $grammar = shift;
  my $self = {
    parser => Parse::RecDescent->new($grammar),
    buffer => '',
    crlf => "\x0D\x0A",
  };
  bless $self, $type;
  return $self;
}
# }}}
# {{{ get
sub get {
  my ($self, $stream) = @_;

  return [ $self->{parser}->startrule(join('',@$stream)) ];
}
# }}}
#sub get_one_start { }
#sub get_one { }
sub put { }
sub get_pending { }

1;

__END__

# {{{ Documentation
# }}}