MarpaX::Database::Terminfo - Parse a terminfo data base using Marpa
version 0.012
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;
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.
Instantiate a new object. Takes no parameter.
Parses a terminfo database. Takes a pointer to a string as parameter.
Returns Marpa value on the parse tree. Ambiguous parse tree result is disabled and the module will croak if this happen.
Unix Documentation Project - terminfo
GNU Ncurses
jddurand <jeandamiendurand@free.fr>
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.
To install MarpaX::Database::Terminfo, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MarpaX::Database::Terminfo
CPAN shell
perl -MCPAN -e shell install MarpaX::Database::Terminfo
For more information on module installation, please visit the detailed CPAN module installation guide.