2017 © Pedro Peláez
 

library abstract-parser

An abstract parser written in PHP

image

tomzx/abstract-parser

An abstract parser written in PHP

  • Saturday, September 10, 2016
  • by tomzx
  • Repository
  • 1 Watchers
  • 1 Stars
  • 29 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 2 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Abstract parser

License Latest Stable Version Latest Unstable Version Build Status Code Quality Code Coverage Total Downloads, (*1)

An abstract parser written in PHP. Based on nikic's PHP Parser., (*2)

Getting started

Abstract parser offers 2 interfaces which you'll want to implement:, (*3)

  • NodeInterface: A basic interface for all of the elements of your tree structured data structure.
  • NodeVisitorInterface: Actions to execute when entering/exiting a NodeInterface element or at the beginning/end of a traversal.

Once you have implemented the NodeInterface for your data elements, you can walk through them using something like the following:, (*4)

<?php

$rootElement = ...; // Root element of your data structure

$traverser = new NodeTraverser();
$traverser->addVisitor(new MyVisitor());

$traverser->traverse([$rootElement]);

License

The code is licensed under the MIT license. See LICENSE., (*5)

The Versions

10/09 2016

dev-master

9999999-dev https://github.com/tomzx/abstract-parser

An abstract parser written in PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

parser visitor traversal

24/01 2016

v0.1.0

0.1.0.0 https://github.com/tomzx/abstract-parser

An abstract parser written in PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

parser visitor traversal