PHP text analysis and / or creating your own language?

They talk without finding much, so that someone knows a class or library that will help you parse any language, for example Domain Specific Language (I create one, so I'm flexible in what syntax and format can be) in PHP code or some useful hiearchy structure or class or ...? Something is coming at this moment. :)

I want to experiment with the analysis of text files in the token, creating a small library of grammar and syntax for expressing such things as Business Natural the Languages .

+3
source share
1 answer

If you like BNF style input syntax, you should look:

http://pear.php.net/PHP_ParserGenerator

or

http://pear.php.net/PHP_LexerGenerator

The PHP code they created is a little worrying, but it works and is a good start for some parser tasks.

+2
source

Source: https://habr.com/ru/post/1707105/


All Articles