All Projects → theseer → Tokenizer

theseer / Tokenizer

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

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to Tokenizer

Wikiteam
Tools for downloading and preserving wikis. We archive wikis, from Wikipedia to tiniest wikis. As of 2020, WikiTeam has preserved more than 250,000 wikis.
Stars: ✭ 404 (-91.53%)
Mutual labels:  xml
Node Xml2js
XML to JavaScript object converter.
Stars: ✭ 4,402 (-7.71%)
Mutual labels:  xml
Iguana
universal serialization engine
Stars: ✭ 481 (-89.92%)
Mutual labels:  xml
Moo
Optimised tokenizer/lexer generator! 🐄 Uses /y for performance. Moo.
Stars: ✭ 434 (-90.9%)
Mutual labels:  tokenizer
Open Korean Text
Open Korean Text Processor - An Open-source Korean Text Processor
Stars: ✭ 438 (-90.82%)
Mutual labels:  tokenizer
Xmlcoder
Easy XML parsing using Codable protocols in Swift
Stars: ✭ 460 (-90.36%)
Mutual labels:  xml
Better Xlsx
A better xlsx library.
Stars: ✭ 395 (-91.72%)
Mutual labels:  xml
Log4rs
A highly configurable logging framework for Rust
Stars: ✭ 483 (-89.87%)
Mutual labels:  xml
Veditorkit
Lightweight and Powerful Editor Kit
Stars: ✭ 441 (-90.75%)
Mutual labels:  xml
Folder Explorer
分析文件目录,统计数据并以树形结构和图表的形式展示结果,也可以导出多种格式留存
Stars: ✭ 479 (-89.96%)
Mutual labels:  xml
Ekphrasis
Ekphrasis is a text processing tool, geared towards text from social networks, such as Twitter or Facebook. Ekphrasis performs tokenization, word normalization, word segmentation (for splitting hashtags) and spell correction, using word statistics from 2 big corpora (english Wikipedia, twitter - 330mil english tweets).
Stars: ✭ 433 (-90.92%)
Mutual labels:  tokenizer
Camaro
camaro is an utility to transform XML to JSON, using Node.js binding to native XML parser pugixml, one of the fastest XML parser around.
Stars: ✭ 438 (-90.82%)
Mutual labels:  xml
Wiremock
A tool for mocking HTTP services
Stars: ✭ 4,790 (+0.42%)
Mutual labels:  xml
Fluidxml
FluidXML, the PHP library for manipulating XML with a concise and fluent API.
Stars: ✭ 417 (-91.26%)
Mutual labels:  xml
Quick Xml
Rust high performance xml reader and writer
Stars: ✭ 480 (-89.94%)
Mutual labels:  xml
Php Parser
🌿 NodeJS PHP Parser - extract AST or tokens (PHP5 and PHP7)
Stars: ✭ 400 (-91.61%)
Mutual labels:  tokenizer
Zek
Generate a Go struct from XML.
Stars: ✭ 451 (-90.55%)
Mutual labels:  xml
Untangle
Converts XML to Python objects
Stars: ✭ 499 (-89.54%)
Mutual labels:  xml
Corexlsx
Excel spreadsheet (XLSX) format parser written in pure Swift
Stars: ✭ 481 (-89.92%)
Mutual labels:  xml
Soapengine
This generic SOAP client allows you to access web services using a your iOS app, Mac OS X app and AppleTV app.
Stars: ✭ 468 (-90.19%)
Mutual labels:  xml

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:

<?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>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].