[libmarpa-r2-perl] 05/32: Experiment
Jonas Smedegaard
dr at jones.dk
Sat Nov 22 18:38:35 UTC 2014
This is an automated email from the git hooks/post-receive script.
js pushed a commit to annotated tag Marpa-R2-2.087_000
in repository libmarpa-r2-perl.
commit 264bce3629c7f405c89e218936df7f28ab9e2c3d
Author: Jeffrey Kegler <JKEGL at cpan.org>
Date: Thu Jun 26 19:17:15 2014 -0700
Experiment
---
noway.pl | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/noway.pl b/noway.pl
new file mode 100644
index 0000000..d0e1384
--- /dev/null
+++ b/noway.pl
@@ -0,0 +1,38 @@
+#!/bin/env perl
+
+use 5.010;
+use strict;
+use warnings;
+use Marpa::R2 2.086000;
+use Data::Dumper;
+
+my $dsl = <<'EO_DSL';
+:default ::= action => [name,values]
+lexeme default = latm => 1
+
+exp ::= [a-z]
+ || '(' exp ')' assoc => group
+ | '[' exp ']' assoc => group
+ | '<' exp '>' assoc => group
+ | '{' exp '}' assoc => group
+ | [({[<] exp [>\x{5D}})] assoc => group rank => -1
+EO_DSL
+
+my $g = Marpa::R2::Scanless::G->new( { source => \$dsl } );
+
+my @input = (
+'(<(({a>>>>>',
+# '(>((<{a>>>>',
+);
+
+for my $input (@input) {
+ my $r = Marpa::R2::Scanless::R->new( { grammar => $g
+ , trace_terminals => 1
+ } );
+ $r->read(\$input);
+ my $value_ref = $r->value();
+ die "No parse" unless defined $value_ref;
+ say Data::Dumper::Dumper( $value_ref );
+}
+
+exit 0;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmarpa-r2-perl.git
More information about the Pkg-perl-cvs-commits
mailing list