SYNOPSIS use MarpaX::G4::MarpaGen; my $generator = new MarpaX::MarpaGen; $generator->generate($symboltable); =head1 DESCRIPTION Translate the rules from the symbol table created from the imported ANTLR4 grammar into Marpa syntax and write them to output.

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);