Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 74 lines (52 sloc) 1.923 kb
ba3ef46 @kschiess . Updates readme to include latest API
authored
1 INTRODUCTION
982ea5d @kschiess . a small readme
authored
2
550c91f @kschiess . updated the readme
authored
3 Parslet makes developing complex parsers easy. It does so by
4
68b37ca @kschiess . preparing 1.2.3
authored
5 * providing the best error reporting possible
6 * not generating reams of code for you to debug
550c91f @kschiess . updated the readme
authored
7
68b37ca @kschiess . preparing 1.2.3
authored
8 Parslet takes the long way around to make your job easier. It allows for
9 incremental language construction. Often, you start out small, implementing
10 the atoms of your language first; _parslet_ takes pride in making this
11 possible.
550c91f @kschiess . updated the readme
authored
12
13 Eager to try this out? Please see the associated web site:
18a4bdf @postmodern Use kschiess.github.io.
postmodern authored
14 http://kschiess.github.io/parslet
e89a175 @kschiess + An example for the readme (what the heck is this?)
authored
15
ba3ef46 @kschiess . Updates readme to include latest API
authored
16 SYNOPSIS
e89a175 @kschiess + An example for the readme (what the heck is this?)
authored
17
18 require 'parslet'
19 include Parslet
20
2da5063 @kschiess + start of a documentation love project
authored
21 # parslet parses strings
22 str('foo').
23 parse('foo') # => "foo"@0
24
25 # it matches character sets
26 match['abc'].parse('a') # => "a"@0
27 match['abc'].parse('b') # => "b"@0
28 match['abc'].parse('c') # => "c"@0
29
30 # and it annotates its output
31 str('foo').as(:important_bit).
32 parse('foo') # => {:important_bit=>"foo"@0}
33
34 # you can construct parsers with just a few lines
35 quote = str('"')
36 simple_string = quote >> (quote.absent? >> any).repeat >> quote
37
38 simple_string.
39 parse('"Simple Simple Simple"') # => "\"Simple Simple Simple\""@0
40
41 # or by making a fuss about it
42 class Smalltalk < Parslet::Parser
43 root :smalltalk
44
45 rule(:smalltalk) { statements }
46 rule(:statements) {
47 # insert smalltalk parser here (outside of the scope of this readme)
48 }
88a01fc @kschiess + Adapted examples and introduced another simplification
authored
49 end
2da5063 @kschiess + start of a documentation love project
authored
50
51 # and then
52 Smalltalk.new.parse('smalltalk')
32e2a7c @kschiess . corrected the synopsis
authored
53
9befb96 @kschiess Updated readme
authored
54 FEATURES
3e222ab @kschiess . updated the readme
authored
55
9befb96 @kschiess Updated readme
authored
56 * Tools for every part of the parser chain
57 * Transformers generate Abstract Syntax Trees
58 * Accelerators transform parsers, making them quite a bit faster
59 * Pluggable error reporters
60 * Graphviz export for your parser
61 * Rspec testing support rig
62 * Simply Ruby, composable and hackable
ba3ef46 @kschiess . Updates readme to include latest API
authored
63
9befb96 @kschiess Updated readme
authored
64 COMPATIBILITY
ad967b4 @kschiess . preparing a 1.2.1 release
authored
65
9befb96 @kschiess Updated readme
authored
66 This library is intended to work with Ruby variants >= 1.9. I've tested it on
67 MRI 1.9, rbx-head, jruby. Please report as a bug if you encounter issues.
5315919 @kschiess . documenting the segfaults I've been having
authored
68
ba3ef46 @kschiess . Updates readme to include latest API
authored
69 STATUS
e89a175 @kschiess + An example for the readme (what the heck is this?)
authored
70
636b8a2 @kschiess Updates a few versions
authored
71 Production worthy.
982ea5d @kschiess . a small readme
authored
72
f80ffe8 @kschiess Updates year in README
authored
73 (c) 2010-2014 Kaspar Schiess
Something went wrong with that request. Please try again.