Need help with tokenizer?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

theseer
4.8K Stars 23 Forks Other 54 Commits 0 Opened issues

Description

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

Services available

!
?

Need anything else?

Contributors list

# 57,768
PHP
Shell
ast
PHPUnit
37 commits
# 12,948
PHP
php7
yaf
php-fra...
3 commits
# 2,472
PHP
php7
PHPUnit
SQLite
3 commits
# 31,594
PHP
PHPUnit
Compose...
tokeniz...
2 commits
# 38,567
php7
Nette
zend-fr...
PHPUnit
1 commit

Tokenizer

A small library for converting tokenized PHP source code into XML.

Test Scrutinizer Code Quality Code Coverage Build Status

Installation

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

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:

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:


 
  <?php 
  declare
  (
  strict_types
   
  =
   
  1
  )
  ;
 

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.