PHP Lexer和解析器生成器? [英] PHP Lexer and Parser Generator?
问题描述
我知道问题使用PHP的Lex和Yacc 是在1年前问到的.
I know question Lex and Yacc in PHP was asked before but 1 year ago.
现在是否有任何新的成熟的PHP解析器生成器? 我的搜索将我带到了以下搜索对象,您如何看待其他搜索对象?
Is there any new mature PHP parser generator now? My searches drove me to the following ones, what do you think about them, any others?
- code.google.com/p/antlrphpruntime/:ANTLR PHP版本,但它似乎是beta版本,我认为还有很多工作要做.好处是我可以在ANTLR Works工具中编写语法.
- pear.php.net/package/PHP_ParserGenerator/docs/0.1.7/:我尝试过,但是与PHP_LexerGenerator一起使用似乎很复杂.
- sourceforge.net/projects/lime-php/:我没有尝试
- bitbucket.org/wez/lemon-php/downloads:我没有尝试
- bitbucket.org/wez/jlexphp/downloads:我没有尝试
[Answer :] Somebody gave me this wonderful link to an old question : Is there an alternative for flex/bison that is usable on 8-bit embedded systems?
这篇文章使我了解生成的大多数ANTLR代码.因此,我的选择保持不变:ANTLR,尽管该项目似乎已经死了.我希望我不必为了保持可维护性而更改代码.
This posts allowed me to understand most of the ANTLR code generated. So my choice keeps being the same : ANTLR although the project seems dead. I hope I wont have to alter the code as I would like to keep it maintainable.
我会稍等一下,看看是否还有其他答案,否则我会接受您的建议继续使用ANTLR
I will wait a bit to see if there is another answer otherwise I'll accept your advise to keep using ANTLR
推荐答案
我建议尝试一下ANTLR. ANTLRWorks 可能会有所帮助.
I'd propose to give ANTLR a try. ANTLRWorks might be helpful.
由于我不了解其他基于PHP的解决方案,所以我自己用纯PHP编写了LL(1)解析器生成器.
I wrote an LL(1) parser generator myself in pure PHP, since I wasn't aware of other PHP-based solutions.
这篇关于PHP Lexer和解析器生成器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!