https://github.com/dundalek/archieml-peg
Alternative parser for ArchieML in JavaScript using PEG (Parsing Expression Grammar)
https://github.com/dundalek/archieml-peg
Last synced: 4 months ago
JSON representation
Alternative parser for ArchieML in JavaScript using PEG (Parsing Expression Grammar)
- Host: GitHub
- URL: https://github.com/dundalek/archieml-peg
- Owner: dundalek
- License: other
- Archived: true
- Created: 2015-03-08T14:57:04.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-04-21T22:10:40.000Z (about 10 years ago)
- Last Synced: 2025-02-09T04:05:14.848Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 145 KB
- Stars: 8
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# archieml-peg
Parse [ArchieML](http://archieml.org) documents into JavaScript objects. This is an alternative implementation using [PEG.js](https://github.com/pegjs/pegjs). Look at the graphical [visualization](http://dundalek.com/GrammKit/#https://cdn.rawgit.com/dundalek/archieml-peg/6d882f42de57d850f72772cde9aadc7a4ee579bf/aml.parser.pegjs) of the grammar. See the code for [parser](aml.parser.pegjs) and [compiler](aml.compiler.js). It passes all the tests from the original implementation.
Be sure to also check out the [official implementation](https://github.com/newsdev/archieml-js).
## Installation
`npm install archieml-peg`
## Usage
```
var parsed = archieml.load("key: value");
>> {"key": "value"}```
```
var archieml = require('archieml-peg');
var parsed = archieml.load("key: value");
>> {"key": "value"}
```## Build
Instal dependencies `npm install`
Build `gulp build`
Development mode - watch for changes and build `gulp watch`
## Testing
Open file `test/indext.html` in a browser or run `npm test`.