Pegex::Input - Pegex Parser Input Abstraction
use Pegex; use Pegex::Input; my $ast = pegex($foo_grammar)->parse(Pegex::Input->new(string => $foo_input));
Pegex::Parser parses input. The input can be a string, a string reference, a file path, or an open file handle. Pegex::Input is an abstraction over any type of input. It provides a uniform inteface to the parser.
You call new() with two arguments, where the first argument is the input type:
Pegex::Input->new(file => 'file.txt')
The following input types are available:
Input is a string.
Input is a string reference. This may be desirable for really long strings.
Input is a file path name to be opened and read.
Input is from a opened file handle, to be read.
Ingy döt Net <ingy@cpan.org>
Copyright 2010-2017. Ingy döt Net.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
To install Pegex, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Pegex
CPAN shell
perl -MCPAN -e shell install Pegex
For more information on module installation, please visit the detailed CPAN module installation guide.