use MarpaX::Symboltable; my $symboltable = new MarpaX::Symboltable;
my $grammartext = readFile($infile); my $data = MarpaX::G4::parse_rules($grammartext); $symboltable->importParseTree($data); $symboltable->validateSymbolTable();
my $generator = new MarpaX::MarpaGen;
$generator->stripallcomments if exists $options->{c}; $generator->embedactions if exists $options->{e}; $generator->fragment2class if exists $options->{f}; $generator->shiftlazytogreedy if exists $options->{g}; $generator->buildkeywords if exists $options->{k}; $generator->stripactions if exists $options->{p}; $generator->setVerbosity(2) if exists $options->{t}; $generator->matchcaseinsensitive if exists $options->{u} || exists $options->{k};
my $outputfile = '-'; $outputfile = $options->{o} if exists $options->{o}; $generator->setoutputfile($outputfile);
$generator->generate($symboltable);
To install MarpaX::G4, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MarpaX::G4
CPAN shell
perl -MCPAN -e shell install MarpaX::G4
For more information on module installation, please visit the detailed CPAN module installation guide.