LPeg Parsing Expression Grammars For Lua, version

Introduction

LPeg is a new pattern-matching library for Lua, based on Parsing Expression Grammars (PEGs). In this text, I assume you are familiar with PEGs. If you are not, you can get a quick start reading the Wikipedia Entry for PEGs or Section 2 of Parsing Expression Grammars: A Recognition-Based Syntactic Foundation (the section has only one page). The nice thing about PEGs is that it has a formal basis (instead of being an ad-hoc set of features), allows an efficient and simple implementation, and does most things we expect from a pattern-matching library (and more, as we can define entire grammars).

作者是Lua语言的Robert, 2100行ANSI c代码, 和boost:spirit差不多强大。我等有福气了,做个小型的文法分析器轻轻松松.  作者200行用lpeg实现了一个regex模块. 一起来吧, lua也有了yacc & lex.



你可能感兴趣的:(C++,c,mysql,C#,lua)