Login   Register  
PHP Classes
elePHPant
Icontem

PHPCC: Parse language string according to a given grammar

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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 (7 years ago) RSS 2.0 feedNot enough user ratingsTotal: 1,039 All time: 3,314 This week: 1,439Up
Version License PHP version Categories  
phpcc 0.5GNU General Public Lice...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 is available for providing paid consulting. Contact Alejandro Siri .
Classes: 2 packages by
Country: United Kingdom United Kingdom
Age: 30
All time rank: 156666 in United Kingdom United Kingdom
Week rank: 1580 Down64 in United Kingdom United Kingdom Up
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,039All time:3,314
 This week:0This week:1,439Up