This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Vim syntax file | |
" Language: Marpa grammar | |
" Maintainer: Peter Stuifzand <peter@tweevijftig.nl> | |
" URL: http://peterstuifzand.nl | |
" Version: 1 | |
" Last Change: 2012 Apr 1 | |
" | |
" Read the HTML syntax to start with | |
if version < 600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include "config.php"; | |
$n = $_GET['n']; | |
if ($n == 1) { | |
echo "fib($n) == 1"; | |
mysql_query("REPLACE INTO `fib` (`n`, `fib`) VALUES ('1','1')"); | |
} | |
else if ($n == 2) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use Marpa::R2 2.038000; | |
use Data::Dumper; | |
my $grammar = Marpa::R2::Scanless::G->new( | |
{ | |
action_object => 'My_Actions', | |
default_action => 'do_first_arg', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use Marpa::R2 2.038000; | |
use Data::Dumper; | |
my $grammar = Marpa::R2::Scanless::G->new( | |
{ | |
action_object => 'My_Actions', | |
default_action => 'do_first_arg', | |
source => \(<<'END_OF_SOURCE'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package MarpaX::JSON; | |
use strict; | |
use Marpa::R2 2.039_000; | |
sub new { | |
my ($class) = @_; | |
my $self = bless {}, $class; | |
$self->{grammar} = Marpa::R2::Scanless::G->new( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Demo::MarpaX::Makefile; | |
use strict; | |
use Marpa::R2; | |
sub new { | |
my ($class) = @_; | |
my $self = bless {}, $class; | |
$self->{grammar} = Marpa::R2::Scanless::G->new( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use Marpa::R2; | |
my $g = Marpa::R2::Scanless::G->new({ | |
action_object => 'main', | |
default_action => 'do_first_arg', | |
source => \(<<'END_OF_SOURCE'), | |
:start ::= string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Marpa::R2 2.023008; | |
use Data::Dumper; | |
my %type = ( | |
boy => 'noun', | |
girl => 'noun', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Logic; | |
use strict; | |
use Marpa::R2 2.041_000; | |
sub new { | |
my ($class) = @_; | |
my $self = bless {}, $class; | |
$self->{grammar} = Marpa::R2::Scanless::G->new( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package RR; | |
use strict; | |
use Marpa::R2 2.042000; | |
use Data::Dumper; | |
use base 'Exporter'; | |
our @EXPORT_OK = qw/replace/; | |
sub new { | |
my ($class) = @_; |