Summary

In this chapter, you learned how to use the PHP-PEG library to implement a parser, interpreter, and compiler for a custom expression language. You also learned how to define grammars for such languages and how you can use them to develop domain-specific languages. These can be used to offer end-user development features in large software systems, which allow users to customize their software's business rules to a large extent.

Dynamically modifying a program using domain-specific languages can be a strong selling point, especially in enterprise systems. They allow users to modify a program's behavior by themselves, without having to wait for a developer to change a business rule and trigger a lengthy release process. This way, new business ...

Get PHP 7 Programming Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.