Login   Register  
PHP Classes
elePHPant
Icontem

Pragmatic BNF-a-like parser

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

  Author  
Picture of Richard Keizer
Name: Richard Keizer is available for providing paid consulting. Contact Richard Keizer .
Packages: 7 Browse all classes by Richard Keizer Browse all classes by
Country: The Netherlands The Netherlands - PHP jobs in The Netherlands
Age: 38
All time rank: 50913 in The Netherlands The Netherlands
Week rank: 211 Up7 in The Netherlands The Netherlands Up
Innovation award
Innovation award
Nominee: 5x

Winner: 1x


  Detailed description   Download .zip .tar.gz  
This package can parse source code in a given language based on the language syntax defined in the BNF format (Backus-Naur Form).

It takes a grammar with syntax rules defined in BNF format and parses the syntax to build a XML parse tree.

The main class also takes as parameter a reference to a lexer object that splits the source code text in tokens.

A SQL parser and a RTF parser are provided as examples.

  Classes of Richard Keizer  >  Pragmatic BNF-a-like parser  >  Download .zip .tar.gz  >  Support forum Support forum (1)  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: Pragmatic BNF-a-like parser
Base name: pragmatic-parser
Description: Parse language source with a BNF grammar syntax
Version: 0.3
PHP version: 5.3
License: GNU General Public License (GPL)
All time users: 404 users
All time rank: 5462
Week users: 3 users
Week rank: 914 Up
 
  Groups   Rate classes User ratings   Applications   Files Files  

  Groups  
Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
Group folder image Text processing Manipulating and validating text data View top rated classes
Group folder image Parsers Programming language interpreters and format parsers View top rated classes


  Innovation Award  
PHP Programming Innovation award nominee
October 2011
Number 4

Prize: One book of choice by Packt
BNF (Backus-Naur Form) defines a syntax for representing the grammar of the commands of a given programming language.

This implements a parser to process a language grammar in the BNF format, so it can be used to implement parsers and compilers for that language.

Manuel Lemos

  User ratings  
There are not enough user ratings to display for this class.

  Applications that use this class  
No application links were specified for this class.
Add link image If you know an application of this package, send a message to the author to add a link here.
  Files folder image Files  
File Role Description
Files folder imageRTF (3 files)
Files folder imageSQL (2 files)
Accessible without login Plain text file example_rtf.php Example usage example
Accessible without login Plain text file example_sql.php Example usage example
Accessible without login Plain text file howto_grammar.txt Doc. grammar basics explained
Accessible without login Plain text file howto_lexer.txt Doc. lexer basics explained
Plain text file parser.class.php Class main class(es)

  Files  /  Files folder image RTF  
File Role Description
  Accessible without login Plain text file rtf.grammar.txt Data simplified rtf grammar
  Plain text file RTFLexer.class.php Class rtf lexer
  Accessible without login Plain text file simple.rtf Data rtf file

  Files  /  Files folder image SQL  
File Role Description
  Accessible without login Plain text file sql.grammar.txt Data sql grammar
  Plain text file SQLLexer.class.php Class sql lexer

Download all files: pragmatic-parser.tar.gz pragmatic-parser.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.