View andreas.out
1 2 3 4 5 6 7 8 9 10
DSL:
:default ::= action => [values] bless => ::lhs
lexeme default = action => [ start, length, value ]
bless => ::name latm => 1
 
:start ::= Script
Script ::= Expression+ separator => comma
comma ~ [,]
Expression ::=
Number bless => primary
View small233.pl
1 2 3 4 5 6 7 8 9
use strict;
use warnings;
 
use Test::More;
 
use Data::Dumper;
$Data::Dumper::Indent = 1;
$Data::Dumper::Terse = 1;
$Data::Dumper::Deepcopy = 1;
View gist:3563fd82932663837f01

These are my notes on Andrew's interview for FLOSS Weekly, #321, which aired 14 January, 2015. Readers may also want to look at Andrew's prepared talk on Marpa.

3:19 Randal talks about ambiguous grammars, which in fact Marpa can handle. But most new users are going to care about grammars that are unambiguous or nearly so. Because of its power Marpa can handle, not just any grammar you're likely to want to parse, but a lot of grammars that you probably did not feel a need to get into. Consider it like the ability of a good sports car to run smoothly at 120mph. Not something that's advisable to do on the US highways, but a sign of the kind of power and handling that can be very nice to have.

View rodland.md

Andrew Rodland at the 2014 YAPC:NA gave a talk on Marpa. A video is available. Here are my notes on it.

The talk is very well-organized, and well-written. Andrew was a last minute fill-in, so there are glitches in the actual delivery of the material, but the material itself is near perfect.

At 4:20, it says that Marpa can modify its grammar at run time. Pedantically, this is not actually true.

View bracket.pl
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/env perl
# Copyright 2014 Jeffrey Kegler
# This file is part of Marpa::R2. Marpa::R2 is free software: you can
# redistribute it and/or modify it under the terms of the GNU Lesser
# General Public License as published by the Free Software Foundation,
# either version 3 of the License, or (at your option) any later version.
#
# Marpa::R2 is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
View ambig.pl
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/perl
# Copyright 2014 Jeffrey Kegler
# This file is part of Marpa::R2. Marpa::R2 is free software: you can
# redistribute it and/or modify it under the terms of the GNU Lesser
# General Public License as published by the Free Software Foundation,
# either version 3 of the License, or (at your option) any later version.
#
# Marpa::R2 is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
View marpa-test7
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/perl
# Copyright 2012 Jeffrey Kegler
# This file is part of Marpa::R2. Marpa::R2 is free software: you can
# redistribute it and/or modify it under the terms of the GNU Lesser
# General Public License as published by the Free Software Foundation,
# either version 3 of the License, or (at your option) any later version.
#
# Marpa::R2 is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
View kv_extend.pl
1 2 3 4 5 6 7 8 9 10
use 5.010;
use strict;
use warnings;
 
use Data::Dumper;
use Marpa::R2 2.082000;
 
my $input = <<'END_OF_STRING';
{
name => 'test hash 1',
View scraper2.pl
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/env perl
 
use 5.010;
use strict;
use warnings;
 
use Marpa::R2 2.082000;
use Marpa::R2::HTML qw(html);
 
# ---------------------------
View Scraper
1 2 3 4 5 6 7 8 9 10
use 5.010;
use strict;
use warnings;
use Marpa::R2 2.082000;
use Marpa::R2::HTML qw(html);
 
my %handlers_to_keep_only_tables = (
table => sub { return Marpa::R2::HTML::original() },
':TOP' => sub { return \( join q{}, @{ Marpa::R2::HTML::values() } ) }
);
Something went wrong with that request. Please try again.