rnapoles/jlex-php-library

A Lexical Analyzer Generator for PHP

dev-main 2022-02-10 07:33 UTC

This package is auto-updated.

Last update: 2024-05-10 12:11:29 UTC


README

Latest Version on Packagist Software License Total Downloads

JLexPHP: a Lexical Analyzer Generator for PHP, based on JLex. For copyright and licensing information, see the COPYING file.

This is an adaptation of some Java code that generates lexers from lex style input files.

The porting effort was pretty trivial, with the hardest part being the buffer management.

Usage is fairly typical of lexers; you'll want to create a lexer file like this:

The syntax is described here.

Requirements

Parser that extends AbstractLexer requires lexer generated by JLexPHP.

Install

Via Composer:

composer require rnapoles/jlex-php-library

Examples

Some examples is contained in the link-demos directory in root of repo.

Credits

License

The MIT License (MIT). Please see License File for more information.