kothman/

lexer

词法分析器。

0.1.2 2016-08-21 01:05 UTC

This package is not auto-updated.

Last update: 2024-09-23 06:38:26 UTC


README

在给定一组规则的情况下对字符串执行词法分析。

安装

通过 Composer

composer require kothman\lexer

使用

$expression = '( 1 + 2 )-3';
$lexer = new Kothman\Lexer\Lexer($expression, Kothman\Lexer\ArithmeticRules::class);
print_r($lexer->getTokens());