{"name":"parser-toolkit","version":"0.0.3","description":"Toolkit to make streamable scanners and parsers.","homepage":"http://github.com/uhop/parser-toolkit","bugs":{"url":"http://github.com/uhop/parser-toolkit/issues"},"directories":{"test":"tests"},"dependencies":{},"devDependencies":{},"scripts":{"test":"node tests/test_jsonsc.js"},"github":"http://github.com/uhop/parser-toolkit","repository":{"type":"git","url":"git://github.com/uhop/parser-toolkit.git"},"keywords":["scanner","lexer","tokenizer","parser"],"author":{"name":"Eugene Lazutkin","email":"eugene.lazutkin@gmail.com","url":"http://lazutkin.com/"},"licenses":[{"type":"New BSD","url":"http://github.com/uhop/parser-toolkit/blob/master/LICENSE"}],"contributors":[{"name":"Eugene Lazutkin","email":"eugene.lazutkin@gmail.com","url":"http://lazutkin.com/"}],"_id":"parser-toolkit@0.0.3","dist":{"shasum":"6fa9dc67ce17a4c7f676638130d0718d7f8a65be","tarball":"http://registry-npm.ywwl.com/parser-toolkit/download/parser-toolkit-0.0.3.tgz","integrity":"sha512-9o1SpE1BL/ov7qoKIvVjiHJy2UqdZSESFgSIzkW31CNvFmC4VqWqRKE9CBCXb5p9ORcEj68Eb6NPBxqJsSzTsA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICbsIqWReBoQDfpNULJPOXg161uoX9D1rxem5a6UAgBbAiAR2oCJE27826m41zOTmlYpYUDzYAnbjhMPUVfLWITw4A=="}],"size":164184,"noattachment":false,"key":"/parser-toolkit/-/parser-toolkit-0.0.3.tgz"},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"elazutkin","email":"eugene@lazutkin.com"},"maintainers":[{"name":"elazutkin","email":"eugene@lazutkin.com"}],"readme":"# parser-toolkit\n\n[![Build status][travis-image]][travis-url]\n[![Dependencies][deps-image]][deps-url]\n[![devDependencies][dev-deps-image]][dev-deps-url]\n[![NPM version][npm-image]][npm-url]\n\n\nparser-toolkit is a collection of scanner and parser components, which allows fast creation of efficient parser for custom languages. The main point of a toolkit is to support streamable chunked input.\n\nA standard-compiant implementation of JSON is included as a test. This is how JSON is defined:\n\n```js\nvar ws           = {id: \"ws\",           pattern: /\\s{1,256}/},\n    // numeric tokens\n    nonZero      = {id: \"nonZero\",      pattern: /[1-9]/},\n    exponent     = {id: \"exponent\",     pattern: /[eE]/},\n    numericChunk = {id: \"numericChunk\", pattern: /\\d{1,256}/},\n    // string tokens\n    plainChunk   = {id: \"plainChunk\",   pattern: /[^\\\"\\\\]{1,256}/},\n    escapedChars = {id: \"escapedChars\",\n        pattern: /\\\\(?:[bfnrt\\\"\\\\\\/]|u[0-9a-fA-F]{4})/};\n\nvar json = new Grammar({\n    main:   [rule(\"ws\"), rule(\"value\")],\n    ws:     repeat(ws),\n    value:  [\n        any(rule(\"object\"), rule(\"array\"), rule(\"string\"),\n            rule(\"number\"), [\"-\", rule(\"number\")],\n            \"true\", \"false\", \"null\"),\n        rule(\"ws\")\n    ],\n    object: [\n        \"{\",\n            rule(\"ws\"),\n            maybe(rule(\"pair\"),\n                repeat(\",\", rule(\"ws\"), rule(\"pair\"))),\n        \"}\"\n    ],\n    pair:   [\n        rule(\"string\"), rule(\"ws\"), \":\", rule(\"ws\"), rule(\"value\")\n    ],\n    array:  [\n        \"[\",\n            rule(\"ws\"),\n            maybe(rule(\"value\"),\n                repeat(\",\", rule(\"ws\"), rule(\"value\"))),\n        \"]\"\n    ],\n    string: [\"\\\"\", repeat(any(plainChunk, escapedChars)), \"\\\"\"],\n    number: [\n        any(\"0\", [nonZero, repeat(numericChunk)]),\n        maybe(\".\", repeat(numericChunk)),\n        maybe(exponent, maybe(any(\"-\", \"+\")),\n            numericChunk, repeat(numericChunk))\n    ]\n});\n```\n\nThe whole definition is taken verbatim from [JSON.org](http://json.org/).\n\nThe test file `sample.json` is copied as is from an open source project [json-simple](https://code.google.com/p/json-simple/) under Apache License 2.0.\n\n[npm-image]:      https://img.shields.io/npm/v/parser-toolkit.svg\n[npm-url]:        https://npmjs.org/package/parser-toolkit\n[deps-image]:     https://img.shields.io/david/uhop/parser-toolkit.svg\n[deps-url]:       https://david-dm.org/uhop/parser-toolkit\n[dev-deps-image]: https://img.shields.io/david/dev/uhop/parser-toolkit.svg\n[dev-deps-url]:   https://david-dm.org/uhop/parser-toolkit#info=devDependencies\n[travis-image]:   https://img.shields.io/travis/uhop/parser-toolkit.svg\n[travis-url]:     https://travis-ci.org/uhop/parser-toolkit\n","publish_time":1376611689274,"_cnpm_publish_time":1376611689274,"dist-tags":{"latest":"0.0.5"}}