code: function KeyValueDecoder() {
      'use strict';
  
      var self = this, root, depths, depth,
          inString, stringType, building, curKey;
  
      this.onInit = function () {
          depths = [];
          depth = 0;
          inString = false;
          stringType = 0;
          building = '';
          curKey = null;
  
          depths.push({});
      };
  
      this.onKeyValue = function (key, value) {
          depths[depth][key] = value;
      };
  
      this.onValue = function (value) {
          depths[depth].push(value);
      };
  
      this.onBlock = function (key, type) {
          depth += 1;
          switch (type) {
          case 0:
              depths.push({});
              break;
          case 1:
              depths.push([]);
              break;
          default:
              throw new Error('Unknown block type: ' + type);
          }
      };
  
      this.onEndBlock = function (key, type) {
          var d = (depth -= 1), obj;
          switch (KeyValue.parserGetParentType()) {
          case 0:
              obj = depths.pop();
              depths[d][key] = obj;
              break;
          case 1:
              depths[d].push(depths.pop());
              break;
          default:
              throw new Error('Unknown block type: ' + type);
          }
      };
  
      this.onFinish = function () {
          root = depths[0];
          self.root = root;
      };
  }
docs: //