定制 tomzx/abstract-parser 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tomzx/abstract-parser

最新稳定版本:v0.1.0

Composer 安装命令:

composer require tomzx/abstract-parser

包简介

An abstract parser written in PHP

README 文档

README

License Latest Stable Version Latest Unstable Version Build Status Code Quality Code Coverage Total Downloads

An abstract parser written in PHP. Based on nikic's PHP Parser.

Getting started

Abstract parser offers 2 interfaces which you'll want to implement:

  • 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:

<?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.

统计信息

  • 总下载量: 49
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-07-25