NAME

MarpaX::Database::Terminfo - Parse a terminfo data base using Marpa

VERSION

version 0.012

SYNOPSIS

use strict;
use warnings FATAL => 'all';
use MarpaX::Database::Terminfo;
use Log::Log4perl qw/:easy/;
use Log::Any::Adapter;
use Log::Any qw/$log/;
#
# Init log
#
our $defaultLog4perlConf = '
log4perl.rootLogger              = WARN, Screen
log4perl.appender.Screen         = Log::Log4perl::Appender::Screen
log4perl.appender.Screen.stderr  = 0
log4perl.appender.Screen.layout  = PatternLayout
log4perl.appender.Screen.layout.ConversionPattern = %d %-5p %6P %m{chomp}%n
';
Log::Log4perl::init(\$defaultLog4perlConf);
Log::Any::Adapter->set('Log4perl');
#
# Parse terminfo
#
my $terminfoSourceCode = "ansi|ansi/pc-term compatible with color,\n\tmc5i,\n";
my $terminfoAstObject = MarpaX::Database::Terminfo->new();
$terminfoAstObject->parse(\$terminfoSourceCode)->value;

DESCRIPTION

This module parses a terminfo database and produces an AST from it. If you want to enable logging, be aware that this module is a Log::Any thingy.

The grammar is a slightly revisited version of the one found at http://nixdoc.net/man-pages/HP-UX/man4/terminfo.4.html#Formal%20Grammar, taking into account ncurses compatibility.

SUBROUTINES/METHODS

new($class)

Instantiate a new object. Takes no parameter.

parse($self, $bufferp)

Parses a terminfo database. Takes a pointer to a string as parameter.

value($self)

Returns Marpa value on the parse tree. Ambiguous parse tree result is disabled and the module will croak if this happen.

SEE ALSO

Unix Documentation Project - terminfo

GNU Ncurses

AUTHOR

jddurand <jeandamiendurand@free.fr>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Jean-Damien Durand.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.