code: function Parser(debug) {
  
      // the debug flag is a private attribute so methods that use it are defined in the constructor
      debug = debug || false;
  
      this.parseComponent = function(document) {
          const parser = initializeParser(document, debug);
          const antlrTree = parser.component();
          const component = convertParseTree(antlrTree);
          return component;
      };
  
      this.parseDocument = function(document, parameters) {
          const parser = initializeParser(document, debug);
          const antlrTree = parser.document();
          const component = convertParseTree(antlrTree, parameters);
          return component;
      };
  
      return this;
  }
docs: PUBLIC FUNCTIONS 
  This class implements a parser that parses strings containing Bali Document Notation™ and
  generates the corresponding component structures.
  
  @constructor
  @param {Boolean} debug Whether of not the parser should be run in debug mode, the
  default is false. Debug mode is only useful for debugging the language grammar and
  need not be used otherwise.
  @returns {Parser} The new string parser.