View fail.t
#!perl
use strict;
use warnings;
use 5.010;
use Data::Dumper;
use Marpa::R2;
sub My_Actions::dwim {
shift;
return $_[0] if scalar @_ == 1;
View longest.t
#!perl
use strict;
use warnings;
use 5.010;
use Data::Dumper;
use Marpa::R2;
sub My_Actions::dwim {
shift;
return $_[0] if scalar @_ == 1;
View try2.t
#!perl
use strict;
use warnings;
use 5.010;
use Data::Dumper;
use Marpa::R2;
sub My_Actions::dwim {
shift;
return $_[0] if scalar @_ == 1;
View try.t
#!perl
use strict;
use warnings;
use 5.010;
use Data::Dumper;
use Marpa::R2;
# This grammar tries to be equivalent to a PEG or Regex with ordered choice:
# List: Item*
# Item: VAR = VAR // VAR = // VAR
View sat-life.w
\datethis
@*Intro. This program generates clauses for the transition relation
from time $t$ to time $t+1$ in Conway's Game of Life, assuming that
all of the potentially live cells at time $t$ belong to a pattern
that's specified in |stdin|. The pattern is defined by one or more
lines representing rows of cells, where each line has `\..' in a
cell that's guaranteed to be dead at time~$t$, otherwise it has `\.*'.
The time is specified separately as a command-line parameter.
The Boolean variable for cell $(x,y)$ at time $t$ is named by its
View Parus major subset
#!/usr/bin/perl
use 5.010;
use strict;
use warnings;
use Data::Dumper;
use English qw( -no_match_vars );
use Test::More tests => 6;
View andreas.out
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
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.