abnf

Augmented Backus-Naur Form (ABNF) parsing. See RFC 5234.

Parse ABNF grammars

For more information on ABNF, See RFC5234.

npm install abnf
var abnf = require('abnf');
abnf.Parse("myfile.abnf", function(er, rules) {
    if (er) {
        console.error(er);
    } else {
        // Do something with rules
    }
});

Parse the given input (string or readable stream), then call the callback with an error (will be null on success) and a Rules object

Parse the file with the given name, then call the callback with an error (will be null on success) and a Rules object

A hash of Rule objects indexed by uppercase rulename.

An array of RuleRef objects.

The name of the rule

The line in the input file where the rule name was defined

The definition of the rule. More information forthcoming.

The name of the rule that was referenced

The line in the input file where the rule name was referenced.