{"_id":"parser-toolkit","_rev":"240497","name":"parser-toolkit","description":"Toolkit to make streamable scanners and parsers.","dist-tags":{"latest":"0.0.5"},"maintainers":[{"name":"elazutkin","email":"eugene@lazutkin.com"}],"time":{"modified":"2021-06-03T15:56:00.000Z","created":"2013-07-31T06:01:44.409Z","0.0.5":"2015-08-31T05:07:59.566Z","0.0.4":"2013-08-16T02:18:47.533Z","0.0.3":"2013-08-16T00:08:09.274Z","0.0.2":"2013-08-14T21:39:57.910Z","0.0.1":"2013-07-31T06:01:44.409Z"},"users":{},"author":{"name":"Eugene Lazutkin","email":"eugene.lazutkin@gmail.com","url":"http://lazutkin.com/"},"repository":{"type":"git","url":"git://github.com/uhop/parser-toolkit.git"},"versions":{"0.0.5":{"name":"parser-toolkit","version":"0.0.5","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/"},"license":"BSD-3-Clause","contributors":[{"name":"Eugene Lazutkin","email":"eugene.lazutkin@gmail.com","url":"http://lazutkin.com/"}],"gitHead":"9197cbc0815061a9833088d1a8e9a2dda75fc68f","_id":"parser-toolkit@0.0.5","_shasum":"ec4b61729c86318b56ea971bfba6b3c672d62c01","_from":".","_npmVersion":"2.13.3","_nodeVersion":"3.2.0","_npmUser":{"name":"elazutkin","email":"eugene@lazutkin.com"},"maintainers":[{"name":"elazutkin","email":"eugene@lazutkin.com"}],"dist":{"shasum":"ec4b61729c86318b56ea971bfba6b3c672d62c01","size":324411,"noattachment":false,"key":"/parser-toolkit/-/parser-toolkit-0.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/parser-toolkit/download/parser-toolkit-0.0.5.tgz"},"publish_time":1440997679566,"_cnpm_publish_time":1440997679566,"_hasShrinkwrap":false},"0.0.4":{"name":"parser-toolkit","version":"0.0.4","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/"}],"readmeFilename":"README.md","_id":"parser-toolkit@0.0.4","dist":{"shasum":"3f529cc2669e33b46aec5b8443d9084b14213585","size":164208,"noattachment":false,"key":"/parser-toolkit/-/parser-toolkit-0.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/parser-toolkit/download/parser-toolkit-0.0.4.tgz"},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"elazutkin","email":"eugene@lazutkin.com"},"maintainers":[{"name":"elazutkin","email":"eugene@lazutkin.com"}],"publish_time":1376619527533,"_cnpm_publish_time":1376619527533,"_hasShrinkwrap":false},"0.0.3":{"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/"}],"readmeFilename":"README.md","_id":"parser-toolkit@0.0.3","dist":{"shasum":"6fa9dc67ce17a4c7f676638130d0718d7f8a65be","size":164184,"noattachment":false,"key":"/parser-toolkit/-/parser-toolkit-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/parser-toolkit/download/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"}],"publish_time":1376611689274,"_cnpm_publish_time":1376611689274,"_hasShrinkwrap":false},"0.0.2":{"name":"parser-toolkit","version":"0.0.2","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/"}],"readmeFilename":"README.md","_id":"parser-toolkit@0.0.2","dist":{"shasum":"c15673b8181910965b0c887754be6ffbea39b61a","size":163353,"noattachment":false,"key":"/parser-toolkit/-/parser-toolkit-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/parser-toolkit/download/parser-toolkit-0.0.2.tgz"},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"elazutkin","email":"eugene@lazutkin.com"},"maintainers":[{"name":"elazutkin","email":"eugene@lazutkin.com"}],"publish_time":1376516397910,"_cnpm_publish_time":1376516397910,"_hasShrinkwrap":false},"0.0.1":{"name":"parser-toolkit","version":"0.0.1","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/dcl/blob/master/LICENSE"}],"contributors":[{"name":"Eugene Lazutkin","email":"eugene.lazutkin@gmail.com","url":"http://lazutkin.com/"}],"readmeFilename":"README.md","_id":"parser-toolkit@0.0.1","dist":{"shasum":"f490737d907586b4bf0b57101abacd5a5f5b7740","size":163356,"noattachment":false,"key":"/parser-toolkit/-/parser-toolkit-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/parser-toolkit/download/parser-toolkit-0.0.1.tgz"},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"elazutkin","email":"eugene@lazutkin.com"},"maintainers":[{"name":"elazutkin","email":"eugene@lazutkin.com"}],"publish_time":1375250504409,"_cnpm_publish_time":1375250504409,"_hasShrinkwrap":false}},"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","_attachments":{},"homepage":"http://github.com/uhop/parser-toolkit","bugs":{"url":"http://github.com/uhop/parser-toolkit/issues"},"license":"BSD-3-Clause"}