This library module provides a recursive descent grammar parser to help analyze and modify a source code file. The goal is that, by organizing the source code based on the grammar of the programming language (as opposed to low-level tokens), complex changes to the code can be more readily made in a programmatic fashion (i.e. by other code using the parser engine).
This library handles PHP grammar, building on the tokenizer functions available in PHP.
Some of the applications for this library module are:
- writing upgrade routines for the Coder Upgrade (formerly Deadwood) module
- parsing source code for the API module used with the Drupal API site
- creating core patches (for example, this one for SimpleTest test files)
- rewriting code files in compliance with coding standards
Suggestions for other applications are welcome.
A few things to note:
- This project is a PHP code library available as a library using the Libraries API (2.x-dev) and also as a Drupal module (because the Drupal project API does not offer a library type).
- This code library is not specific to a Drupal version. It is more likely specific to a PHP library version. When used as a module, the download below labeled as a 7.x version can be used with any version of Drupal (simply by changing the version string in the info file).
- If used as a library, then install it in a libraries directory (e.g., "sites/all/libraries" or equivalent) but do not "enable" it as a module.
- If used as a module, then install it in a modules directory.
- A user interface is provided by the Grammar Parser UI module.
- A library interface is provided by the Grammar Parser Library module.
This project was part of the 2009 Google Summer of Code.
This project is sponsored by Boombatower Development.
Looking for 6.x support?
The Grammar Parser library module is not specific to a Drupal version. To run the Grammar Parser as a 6.x module, simply change the '7.x' references in the .info file to '6.x' (e.g., the 'core = 7.x' line becomes 'core = 6.x'). For use with Drush Make, see this issue.
Project information
- Module categories: Developer Tools
- 22 sites report using this module
- Created by solotandem on , updated
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
Development version: 7.x-2.x-dev updated 25 Sep 2015 at 12:44 UTC
Development version: 7.x-1.x-dev updated 19 Oct 2010 at 18:02 UTC