lightweight JavaScript APG parser
npm install apg-liteapg-lite is a light-weight parser of ABNF grammars.
--lite option
apg-lite features:
apg-js can parse any arbitrary array of positive integers.
apg-js.
./ast-app/).
./trace-app/).
./trace-app/).
apg-lite is fully contained in a single JavaScript file.
./lib/parser.js contains ECMAScript Modules (ESM) which can be import-ed into your application.
./lib/web-parser.js can be scripted into your web page application with no bundling necessary.
apg-lite in both
documentation.md.
./basic-app/ - A simple parser demonstrating the most basic construction and use of a parser.
./ast-app/ - Use of the AST - how to construct the AST and translate or semantically manipulate the phrases captured by the AST nodes.
./udt-app/ - Use of a UDT, a handwritten code snippet to recognize a somewhat complicated phrase.
./lookahead-app/ - Demonstration of the look ahead operators.
./trace-app/ - How to debug and profile the parse tree.
./cool-app/ - A simple demonstration of parsing a string with UTF+32 (in this case emoticon) characters.
./uri-app/ - This example builds a light-weight, but robust and well-tested URI parser.
package.json scripts.
npm run to see the script names of the demonstrations.
apg-lite parser or any of the other examples have been made.
UriParser object in the ./uri-app/ application is of special interest.
UriParser is well-tested with Jest unit tests in the __tests__ directory.
./uri-app/documentation.md for complete documentation.
./uri-app/node-app.js for a sample Node.js application
./uri-app/web.html for sample web page application.