Proof of concept converter between the JSON and the URI+Fragment representation of Selectors and States. See the separate editors’ draft for details.

The script is rudimentary in the sense that it does not check all possible error situations, and does not provide more information on bugs than the exception messages, as raised by the underlying API-s. It definitely does not check the validity of the Selector/State structures, for example.

The files are:

  • converter.js: the top level (jQuery based) layer to perform the conversion. It contains the Selector/State -> URI conversion code (which is quite simple), but relies on the separate parser for the URI -> Selector/State conversion
  • fragment.pegjs: a PEG.js grammar for the fragment specification
  • fragment.js: parser generated by pegjs, to be used in node.js.
  • parser.js: parser generated by pegjs, to be used in a browser. Use the --export-var window.Parser option with pegjs.
  • index.html: Web interface for the conversion

All the software in this folder are licensed via the W3C Software and Document Notice and License.