babel-bridge
a 'runtime' parsing expression grammar parser
Last updated 3 years ago by shanebdavis .
ISC · Original npm · Tarball · package.json
$ cnpm install babel-bridge 
SYNC missed versions from official npm registry.

RENAME

BabelBridgeJs is now CaffeineEight

BabelBridgeJs Build Status

BabelBridge empowers you to write parsers quickly, elegantly and with very little code. BabelBridge is based on Parsing Expression Grammars (PEG), but unlike other libraries, BabelBridge is not a parser-generator. There is no build step. Just extend a class, add some rules and you are ready to parse. With BabelBridge you can create and, more importantly, extend your parsers at runtime.

  • Inspired by my earlier Babel Bridge Ruby Gem, the JavaScript version is turning out to be even more awesome!

Motivating Example

  BabelBridge = require 'babel-bridge'

  class MyParser extends BabelBridge.Parser
    @rule foo: "/foo/ bar?"
    @rule bar: /bar/

  myParser = new MyParser
  myParser.parse "foo"
  myParser.parse "foobar"
  # yay! it worked

Goals

  • Define PEG parsers 100% in JavaScript
  • Runtime-extensible parsers
  • Reasonably fast
  • No globals - each parser instance parses in its own space

Features

  • Full parsing expression grammer support with memoizing
  • Full JavaScript regular expressions support for terminals
  • Simple, convention-over-configuration parse-tree class structure
  • Human-readable parse-tree dumps
  • Detailed information about parsing failures
  • Custom sub-parser hooks
    • Which enable indention-based block parsing for languages like Python, CoffeeScript, or my own CaffeineScript

Current Tags

  • 1.12.11                                ...           latest (3 years ago)

24 Versions

  • 1.12.11                                ...           3 years ago
  • 1.12.10                                ...           3 years ago
  • 1.12.9                                ...           3 years ago
  • 1.12.8                                ...           3 years ago
  • 1.12.6                                ...           3 years ago
  • 1.12.5                                ...           3 years ago
  • 1.12.4                                ...           3 years ago
  • 1.12.3                                ...           3 years ago
  • 1.12.2                                ...           3 years ago
  • 1.12.1                                ...           3 years ago
  • 1.12.0                                ...           3 years ago
  • 1.11.0                                ...           3 years ago
  • 1.10.2                                ...           3 years ago
  • 1.10.1                                ...           3 years ago
  • 1.10.0                                ...           3 years ago
  • 1.9.2                                ...           3 years ago
  • 1.8.1                                ...           3 years ago
  • 1.6.0                                ...           3 years ago
  • 1.5.1                                ...           3 years ago
  • 1.5.0                                ...           3 years ago
  • 1.2.2                                ...           3 years ago
  • 1.0.0                                ...           4 years ago
  • 0.10.0                                ...           4 years ago
  • 0.7.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 6
Last Day 0
Last Week 1
Last Month 15
Dev Dependencies (0)
None
Dependents (2)

Copyright 2014 - 2017 © taobao.org |