PHP Classes
elePHPant
Icontem

PHPCC: Parse language string according to a given grammar

Recommend this page to a friend!
  Info   View files View files (14)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2007-04-03 (9 years ago) RSS 2.0 feedStarStarStarStar 72%Total: 1,050 All time: 3,401 This week: 961Up
Version License PHP version Categories
phpcc 0.5GNU General Publi...4.0Language, Code Generation
Description Author

This package can be used to parse code in any language given the definition of the language grammar, much like YACC or BISON for C.

It takes as parameter a definition of a language grammar as a string. Then the main class can parse and process source code in the defined language.

The main compiler class can assign callback functions that are invoked to process different types of elements of the language syntax.

Innovation Award
PHP Programming Innovation award nominee
April 2007
Number 5


Prize: One copy of Delphi for PHP
Languages provide means to define how programs should behave using a lists of statements. Such statements must be composed with a given syntax.

If you want to process a program in a given language, you need to have a parser that extracts the statements that define the program and validate the statements syntax.

This class provides a generic solution to implement language parsers in PHP. It can be used to process programs with an user-defined syntax.

Manuel Lemos
Picture of Alejandro Siri
Name: Alejandro Siri <contact>
Classes: 2 packages by
Country: United Kingdom United Kingdom
Innovation award
Innovation award
Nominee: 1x

  Files folder image Files  
File Role Description
Plain text file AltParser.class.php Class AltParser
Plain text file example.php Example An Example
Plain text file FunctionObject.class.php Class FunctionObject
Plain text file Grammar.class.php Class Grammar
Plain text file ListParser.class.php Class List Parser
Plain text file MaybeParser.class.php Class Maybe Parser
Plain text file MultiParser.class.php Class Multi Parser
Plain text file Parser.class.php Class Parser
Plain text file pgpcc-manual.txt Doc. A simple manual
Plain text file PHPCC.class.php Class PHPCC
Plain text file PHPGrammar.class.php Class PHP Grammar
Plain text file SeqParser.class.php Class Seq Parser
Plain text file SubParser.class.php Class Sub Parser
Accessible without login Plain text file Symbol.class.php Class Symbol

 Version Control Unique User Downloads Download Rankings  
 0%
Total:1,050
This week:0
All time:3,401
This week:961Up
 User Ratings  
 
 All time
Utility:100%StarStarStarStarStarStar
Consistency:100%StarStarStarStarStarStar
Documentation:58%StarStarStar
Examples:66%StarStarStarStar
Tests:-
Videos:-
Overall:72%StarStarStarStar
Rank:207