2017 © Pedro Peláez
 

library tokenizer

A small library for converting tokenized PHP source code into XML and potentially other formats

image

theseer/tokenizer

A small library for converting tokenized PHP source code into XML and potentially other formats

  • Friday, April 7, 2017
  • by theseer
  • Repository
  • 1 Watchers
  • 2742 Stars
  • 14,544,675 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 3 Versions
  • 29 % Grown

The README.md

Tokenizer

A small library for converting tokenized PHP source code into XML., (*1)

Test, (*2)

Installation

You can add this library as a local, per-project dependency to your project using Composer:, (*3)

composer require theseer/tokenizer

If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency:, (*4)

composer require --dev theseer/tokenizer

Usage examples

$tokenizer = new TheSeer\Tokenizer\Tokenizer();
$tokens = $tokenizer->parse(file_get_contents(__DIR__ . '/src/XMLSerializer.php'));

$serializer = new TheSeer\Tokenizer\XMLSerializer();
$xml = $serializer->toXML($tokens);

echo $xml;

The generated XML structure looks something like this:, (*5)

<?xml version="1.0"?>
<source xmlns="https://github.com/theseer/tokenizer">
 <line no="1">
  <token name="T_OPEN_TAG">&lt;?php </token>
  <token name="T_DECLARE">declare</token>
  <token name="T_OPEN_BRACKET">(</token>
  <token name="T_STRING">strict_types</token>
  <token name="T_WHITESPACE"> </token>
  <token name="T_EQUAL">=</token>
  <token name="T_WHITESPACE"> </token>
  <token name="T_LNUMBER">1</token>
  <token name="T_CLOSE_BRACKET">)</token>
  <token name="T_SEMICOLON">;</token>
 </line>
</source>

The Versions

07/04 2017

dev-master

9999999-dev

A small library for converting tokenized PHP source code into XML and potentially other formats

  Sources   Download

BSD-3-Clause

The Requires

  • php ^7.0
  • ext-xmlwriter *
  • ext-dom *
  • ext-tokenizer *

 

by Arne Blankerts

07/04 2017

1.1.0

1.1.0.0

A small library for converting tokenized PHP source code into XML and potentially other formats

  Sources   Download

BSD-3-Clause

The Requires

  • php ^7.0
  • ext-xmlwriter *
  • ext-dom *
  • ext-tokenizer *

 

by Arne Blankerts

05/04 2017

1.0.0

1.0.0.0

A small library for converting tokenized PHP source code into XML and potentially other formats

  Sources   Download

BSD-3-Clause

The Requires

  • php ^7.0
  • ext-xmlwriter *
  • ext-dom *
  • ext-tokenizer *

 

by Arne Blankerts