Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

The latest version of JavaScript APG. Supersedes and obsoletes all previous versions. APG is an ABNF Parser Generator. It generates recursive-descent parsers from a superset of ABNF.

License

NotificationsYou must be signed in to change notification settings

ldthomas/apg-js

Repository files navigation

4.4.0 Release Notes

Version 4.4.0 adds an option,--typescript, to the APG genererator which willgenerate atypescript-compatible grammar object. The new scriptregen willregenerate all the grammar objects in place anytime a change is made to any ofthe ABNF grammars or if the generator is modified in any way.

4.3.0 Release Notes

Version 4.3.0 adds support forapg-lite,a new, light-weight version of the parsers built from this library.The parser generator (src/apg/apg.js) has a new option,--lite, that willgenerate grammar objects for theapg-lite parsers.See the documentation forapg-lite for a complete description.

Version 4.3.0 makes no other changes to the previous version other than adding the newapg-lite feature.

4.2.1 Release Notes

Some ABNF grammar authors will use zero repetitions as an explicit empty string acceptor.That is, one or the other of something like,

char = %d33-127
empty1 = 0char
empty2 = 0"x"

Previous version of APG have rejected zero repititions as an empty string acceptor in favor ofthe more intuitive and simpler to produce and simpler to process empty literal string

empty = ""

apg-js version 4.2.0 and lower neglects to reject the zero repetitions form and, unfortunately,it only sometimes actually accepts an empty string and sometimes fails.Version 4.2.1 corrects this. Zero repetitions are allowed as explicit empty string acceptors andare processed correctly.

Note, however, that zero repetitions is deprecated in that not all implementations of APG accept itand that is it is slightly less efficient to implement.Favored is the more streamlined empty literal string,""

4.2.0 Release Notes

Version 4.2.0 fixes some issues that have been causing problems for some bundlers and/or development tools../src/apg-conv-api/converter.js,./src/apg-conv-api/transformers.js and./src/apg-lib/utilities.js now referexplicitly to the exported functions rather than relying on a saved copy of thethis reference.Also, use of the globalBuffer object has been replaced with

const { Buffer } = require('buffer');

and similary forfs and other globalnode.js properties, as recommended in the Node.js v20.5.1 documentation.(Note thatrequire('node:buffer') causes problems with usingbrowerify to bundle the libraries for web page use.Removing thenode: prefix solves that problem without causing problems with the bundle usage. Thanks to contributionsin the GitHub issue #13 thread for this suggestion.)

This updated version ofapg-js has been tested with all of the examples inapg-js-examples. All examples including the web page examples work as expected.

Also, all dependencies have been moved to devDependencies, removing the need for any globally installed packages.

Overview

apg-js is the JavaScript version of APG, an ABNF Parser Generator. APG generates recursive-descent parsers directly from a superset ofABNF (SABNF). Visit theAPG website for a completeoverview of APG and SABNF.

apg-js obsoletesapg-js2,apg-js2-lib,apg-js2-exp,apg-js2-api,apg-conv andapg-conv-api. It changes them in two significant ways.

  • It fixes a major problem in the attributes algorithm. Previous versions could fail on large grammars with many or large sets of mutually-recursive rules.
  • It combines all of those packages into a single, easier to manage and maintain package.

Documentation

This package is meant to assist other parsing applications and is normally not installed by itself, rather installed along with those other applications. For details and many examples of using of the libraries, both innode.js and browser web page applications, seeapg-js-examples atGitHub ornpmjs.However, it does provide access to two,node.js applications,apg andapg-conv.

Applications

apg is the parser generator. To see its usage run,

npm run apg -- --help

apg-conv is a data conversion application. To see its usage run,

npm run apg-conv -- --help

Libraries

This package contains four libraries that can be used in eithernode.js or browser applications.The libraries depend upon one another and the dependency tree looks like so:

apg-exp|- apg-api|-|- apg-lib|-|-|- apg-conv-api

Each of the libraries is bundled for browser use along with some special styles.Each bundle contains all of its dependencies explicitly. That is, if a browser application needs bothapg-api andapg-lib, only theapg-api bundle need be scripted into the page.

The library and css bundles are in the./dist directory.

./dist/apg-exp-bundle.js./dist/apg-api-bundle.js./dist/apg-lib-bundle.js./dist/apg-conv-api-bundle.js./dist/apg-lib-bundle.css

The bundles can all be regenerated with the scripts:

npm run bundle-apg-conv-apinpm run bundle-apg-libnpm run bundle-apg-apinpm run bundle-apg-expnpm run bundle-apg-lib-css

Code Documentation

The code documentation is indocco format and can be generated with:

npm run docco

The documentation is then at./docs/index.html or see ithere at theAPG website.

About

The latest version of JavaScript APG. Supersedes and obsoletes all previous versions. APG is an ABNF Parser Generator. It generates recursive-descent parsers from a superset of ABNF.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors3

  •  
  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp