Skip to content

tasoftch/php-string-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP String Parser

My php string parser library provides an abstract mechanism to tokenize, parse and until compile any kind of scripts you want.
There are some implemented parsers ready to use for expressions.

$parser = new SimpleTokenParser();
print_r($parser->parseString("12 + 13 / 6"));

This list all parsed tokens.
Token parsing is done by php token_get_all function, but you can easy subclass a tokenizer to customize string tokenizing.

Install

PHP String Parser is a composer package. So you can simply install it by

$ composer require tasoft/php-string-parser

Now the library is available under namespace \TASoft\Parser...

Examples

The package tasoft/predicate uses this parser to create predicates from string.

About

Abstract parser template written in PHP to extend in every kind you want.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages