- JetPAG
infobox software
name = JetPAG
developer = Tareq H. Sharafy
latest release version = 0.6.1
latest release date = release date and age|2007|02|07
latest preview version = 0.6.3
latest preview date = 2007
programming language =C++
operating system = Platform-independent
genre =Parser generator
license =GNU General Public License
website = [http://jetpag.sourceforge.net/ JetPAG Homepage] JetPAG (Jet Parser Auto-Generator) is anopen source LL(k) parser and lexical analyzer generator, licensed under theGNU General Public License . It is a personal work of Tareq H. Sharafy, and is currently at final beta stages of development.History
Tareq started JetPAG as a small program written for practice purposes only. Soon when it started expanding many goals were added rapidly, and it was obvious that JetPAG is worthy being a complete project. Real development of JetPAG started in late 2005, targeting a complete framework for a powerful recursive descent lexical analyzer and parser generator with emphasis on ease of use, code readability and performance for both JetPAG and the generated code. After a long period of in-house development and testing, the first development package of JetPAG was release through
SourceForge in 18 November 2006. Development of JetPAG is current at beta stage, current version is 0.6.1. Development of JetPAG is highly active and rapid (project activity at SourceForge is well over 99.4%) and grammars are added to the public archive regularly.Overview
Jetpag incorporates several modules: the front end, the analyzers and the code generators.
The front end accepts the metalanguages as an input. Minor optimizations are don at that stage.
The analyzers mainy perform two operations through tree traversal. The first is calculating strong lookahead sets for the elements in the grammar and the second is constructing lookahead paths from the lookahead sets. Lookahead paths group, factorize and perform many enhancements and optimizations to lookahead sets with common properties creating a nested-check tree structure from the lookahead sets, gaining a great overall efficiency and improvement in all cases.
Code generators generate source code for recognizers compatible with the input grammars based on them along with information collected from the analyzers. Currently JetPAG generates source code in C++ only.
The nature of JetPAG's metalanguage and framework make it easy and simple to integrate generated recognizers into larger applications. JetPAG also includes some facilities in the provided framework to aid developers with small utilities and save development time from many minimal language recognition tasks.
JetPAG grammars
JetPAG's garmmars are written in a meta language based on the
EBNF form andregular expressions , with extensive additions and facilities. Parsers and lexical analyzers are simillary defined and generated for simplicity and ease of use. This is a simple example of a grammar for an addition/subtraction calculator:grammar Calc:parser CalcP:
expression: factor ( '+' factor
'-' factor )* ;factor: INT
'(' expression ')' ;scanner CalcS:
INT: '0'-'9'+;PLUS: '+';MINUS: '-';LP: '(';RP: ')';
ee also
* LL recognizers
*ANTLR
*JavaCC
*Coco/R External links
* [http://jetpag.sourceforge.net/ JetPAG Homepage]
* [http://sourceforge.net/projects/jetpag/ JetPAG at SourceForge]
Wikimedia Foundation. 2010.