lib/cfg.js
function CFG(rules) {
  let arr = [];

  arr.__proto__ = CFG.prototype;
  if (Array.isArray(rules)) {
    rules.forEach(arr.rule.bind(arr));
  }

  return arr;
}
function CFG(rules) {
  let arr = [];

  arr.__proto__ = CFG.prototype;
  if (Array.isArray(rules)) {
    rules.forEach(arr.rule.bind(arr));
  }

  return arr;
}
function CFG ( rules ) { let arr = [ ] ; arr . __proto__ = CFG . prototype ; if ( Array . isArray ( rules ) ) { rules . forEach ( arr . rule . bind ( arr ) ) ; } return arr ; }
Constructs a new context-free grammar, which is just a container for
production rules

@class CFG
@extends Array
@constructor
@param {rules=} - Optional array of {@link Rule}s to initialize the grammar
with
Constructs a new context - free grammar which is just a container for production rules