jreut / parslet Goto Github PK
View Code? Open in Web Editor NEWThis project forked from kschiess/parslet
A small PEG based parser library. See the Hacking page in the Wiki as well.
Home Page: kschiess.github.com/parslet
License: MIT License
This project forked from kschiess/parslet
A small PEG based parser library. See the Hacking page in the Wiki as well.
Home Page: kschiess.github.com/parslet
License: MIT License
INTRODUCTION Parslet makes developing complex parsers easy. It does so by * providing the best error reporting possible * not generating reams of code for you to debug Parslet takes the long way around to make your job easier. It allows for incremental language construction. Often, you start out small, implementing the atoms of your language first; _parslet_ takes pride in making this possible. Eager to try this out? Please see the associated web site: http://kschiess.github.io/parslet SYNOPSIS require 'parslet' include Parslet # parslet parses strings str('foo'). parse('foo') # => "foo"@0 # it matches character sets match['abc'].parse('a') # => "a"@0 match['abc'].parse('b') # => "b"@0 match['abc'].parse('c') # => "c"@0 # and it annotates its output str('foo').as(:important_bit). parse('foo') # => {:important_bit=>"foo"@0} # you can construct parsers with just a few lines quote = str('"') simple_string = quote >> (quote.absent? >> any).repeat >> quote simple_string. parse('"Simple Simple Simple"') # => "\"Simple Simple Simple\""@0 # or by making a fuss about it class Smalltalk < Parslet::Parser root :smalltalk rule(:smalltalk) { statements } rule(:statements) { # insert smalltalk parser here (outside of the scope of this readme) } end # and then Smalltalk.new.parse('smalltalk') FEATURES * Tools for every part of the parser chain * Transformers generate Abstract Syntax Trees * Accelerators transform parsers, making them quite a bit faster * Pluggable error reporters * Graphviz export for your parser * Rspec testing support rig * Simply Ruby, composable and hackable COMPATIBILITY This library is intended to work with Ruby variants >= 1.9. I've tested it on MRI 1.9, rbx-head, jruby. Please report as a bug if you encounter issues. STATUS Production worthy. (c) 2010-2016 Kaspar Schiess
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.