##JavaScript APG
Version: 1.0
Description:
- JavaScript APG is a version of APG – an ABNF Parser Generator written entirely in JavaScript.
- generates recursive-descent parsers directly from ABNF (RFC5234) grammar specifications
- no target-language code imbedded in the grammars
AND
andNOT
syntactic-predicate operators for conditional parsing based on look-ahead phrases- user-written callback functions allow recognition of non-Context-Free language phrases
- user-written callback functions provide complete monitoring and flow control of the parser
- optional generation of an Abstract Syntax Tree (AST)
- translation of the AST with user-written callback functions
- extensive tracing facilities
- statistics gathering for a full picture of parse tree node coverage
- extensive attribute generation for an overview of the grammar's characteristics
NOTE: Currently this repository includes only the APG runtime library required for running APG-generated parsers. The generator itself is currently only available at the APG website. Full instructions for building a parser are given in the example files.
Files:
file name | description |
---|---|
apgAst.js | the AST class, required for generating an AST from the parse |
apgLib.js | the APG runtime library, required for all JavaScript parsers |
apgStats.js | the Stats class, required for collecting parsing statistics |
apgTrace.js | the Trace class, required for tracing the parser´s path through the parse tree |
apgUtilities.js | a collection of optional, but useful utilities, many to assist output of results |
example/example.css | a simple stylesheet for the example HTML page |
example/example.js | a complete example of how to set up and run a JavaScript APG parser |
example/example.html | a simple web page for implementing the example parser |
example/iniFileOpcodes.js | the APG-generated opcodes object for the example grammar |
example/iniFile.bnf | the example ABNF grammar used to generate the parser´s opcodes object |
LICENSE | Version 2 of the GNU General Public License |
README.md | this file |
Documentation:
To generate the documentation install jsdoc and from the project directory run:
/path/to/jsdoc . README.md -r -d documentation
To view the documentation open the file
documentation/index.html
in any web browser, or view it at the APG website.
Example:
To run the example, open
example/example.html
in any web browser.
Copyright:
Copyright © 2009 Lowell D. Thomas, all rights reserved
License:
JavaScript APG and this Runtime Library, Version 1.0 are released under Version 2.0 or higher of the
GNU General Public License.