function toSource(tree, options = undefined,
    outputName = '<toSourceOutput>', sourceRoot = undefined) {
  let sourceMapGenerator = options && options.sourceMapGenerator;
  let sourcemaps = options && options.sourceMaps;
  if (!sourceMapGenerator && sourcemaps)  {
    sourceMapGenerator = new SourceMapGenerator({
      file: outputName,
      sourceRoot: sourceRoot,
      skipValidation: true
    });
  }

  let sourceMapConfiguration = {
    sourceMapGenerator: sourceMapGenerator,
    sourceRoot: sourceRoot,
    lowResolution: options && options.lowResolutionSourceMap
  };

  let writer;
  if (sourceMapGenerator)
    writer = new ParseTreeMapWriter(sourceMapConfiguration, options);
  else
    writer = new ParseTreeWriter(options);

  writer.visitAny(tree);

  return [writer.toString(),
      sourceMapGenerator && sourceMapGenerator.toString()];
}
Create a ParseTreeWriter configured with options, apply it to tree
@param {ParseTree} tree
@param {Object=} options:
    prettyPrint: {boolean}
    sourceMapGenerator: {SourceMapGenerator} see third-party/source-maps
@param {string} outputName the sourcemap file value.
@param {string} sourceRoot the sourcemap sourceroot.
@return source code; optional side-effect options.sourceMaps set