2017 © Pedro Peláez
 

library parser-combinator

image

vektah/parser-combinator

  • Wednesday, February 12, 2014
  • by Vektah
  • Repository
  • 0 Watchers
  • 1 Stars
  • 27,832 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 1 Forks
  • 4 Open issues
  • 8 Versions
  • 1 % Grown

The README.md

parser-combinator Build Status

A simple parser combinator framework written in PHP., (*1)

Google protobuffer parser:

$parser = new ProtoParser();
$out = $parser->parse('
    message Bar {
        required MessageType type = 0;
        required bytes data = 1;

        enum Foo {
            asdf = 0;
            qwer = 1;
        }
    }
');

// $out will contain return a parse tree that looks like this:
[
    new Message('Bar', [
        new Field('required', 'MessageType', 'type', 0),
        new Field('required', 'bytes', 'data', 1),
        new Enum('Foo', [
            new EnumValue('asdf', 0),
            new EnumValue('qwer', 1)
        ])
    ])
];

Json parser:

The only reason you would use this parser is for error messages. It is much slower then the C library used by php to parse json. It could be used to automatically reparse json in failure cases and display helpful error messages., (*2)

$parser = new JsonParser();
$out = $parser->parse('{"asdf": { "foo" : "bar" }}');

// $out will contain a parse tree that looks like this:
[
  'asdf' => [
    'foo' => 'bar'
  ]
]

The Versions

12/02 2014

dev-master

9999999-dev https://github.com/Vektah/parser-combinator

  Sources   Download

BSD-2-Clause

The Requires

  • php >=5.4.0

 

The Development Requires

parser lexer combinator parser combinator

12/02 2014

0.2.4

0.2.4.0 https://github.com/Vektah/parser-combinator

  Sources   Download

BSD-2-Clause

The Requires

  • php >=5.4.0

 

The Development Requires

parser lexer combinator parser combinator

10/02 2014

0.2.3

0.2.3.0 https://github.com/Vektah/parser-combinator

  Sources   Download

BSD-2-Clause

The Requires

  • php >=5.4.0

 

The Development Requires

parser lexer combinator parser combinator

21/01 2014

0.2.2

0.2.2.0 https://github.com/Vektah/parser-combinator

  Sources   Download

BSD-2-Clause

The Requires

  • php >=5.4.0

 

The Development Requires

parser lexer combinator parser combinator

21/01 2014

0.2.1

0.2.1.0 https://github.com/Vektah/parser-combinator

  Sources   Download

BSD-2-Clause

The Requires

  • php >=5.4.0

 

The Development Requires

parser lexer combinator parser combinator

16/01 2014

0.2.0

0.2.0.0 https://github.com/Vektah/parser-combinator

  Sources   Download

BSD-2-Clause

The Requires

  • php >=5.4.0

 

The Development Requires

parser lexer combinator parser combinator

22/09 2013

0.1.2

0.1.2.0 https://github.com/Vektah/parser-combinator

  Sources   Download

BSD-2-Clause

The Requires

  • php >=5.4.0

 

The Development Requires

parser lexer combinator parser combinator

12/09 2013

0.1.1

0.1.1.0 https://github.com/Vektah/parser-combinator

  Sources   Download

BSD-2-Clause

The Requires

  • php >=5.4.0

 

The Development Requires

parser lexer combinator parser combinator