Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Update README and logo.

  • Loading branch information...
commit d9035e7fc1c69d15f24fbf103d21661d9231fce3 1 parent 851c9dd
Patrick Lioi authored April 01, 2012
17  README.md
Source Rendered
... ...
@@ -1,12 +1,11 @@
1  
-Introduction
2  
-============
  1
+![Parsley](https://github.com/plioi/parsley/raw/master/parsley.png)
  2
+# Parsley
3 3
 
4  
-Parsley (https://github.com/plioi/parsley) is a monadic parser combinator library inspired by Haskell's Parsec (http://www.haskell.org/haskellwiki/Parsec) and F#'s FParsec (http://www.quanttec.com/fparsec/).  It can parse context-sensitive, infinite look-ahead grammars but it performs best on predictive (LL[1]) grammars.
  4
+Parsley is a monadic parser combinator library inspired by Haskell's [Parsec](http://www.haskell.org/haskellwiki/Parsec) and F#'s [FParsec](http://www.quanttec.com/fparsec/).  It can parse context-sensitive, infinite look-ahead grammars but it performs best on predictive (LL[1]) grammars.
5 5
 
6 6
 Unlike Parsec/FParsec, Parsley provides separate lexer/parser phases.  The lexer phase is usually performed with a prioritized list of regex patterns, and parser grammars are expressed in terms of the tokens produced by the lexer.
7 7
 
8  
-Lexer Phase (Tokenization)
9  
-==========================
  8
+## Lexer Phase (Tokenization)
10 9
 
11 10
 Strings being parsed are represented with a `Text` instance, which tracks the original string as well as the current parsing position:
12 11
 
@@ -25,8 +24,7 @@ Above, the array `tokens` will contain 6 `Token` objects. Each `Token` contains
25 24
 
26 25
 The collection of `Token` produced by the lexer phase is wrapped in a `TokenStream`, which allows the rest of the system to traverse the collection of tokens in an immutable fashion.
27 26
 
28  
-Parser Functions
29  
-================
  27
+## Parser Functions
30 28
 
31 29
 A parser of thingies is a method that consumes a `TokenStream` and produces a parsed-thingy:
32 30
 
@@ -37,12 +35,11 @@ A parser of thingies is a method that consumes a `TokenStream` and produces a pa
37 35
 
38 36
 A `Reply<T>` describes whether or not the parser succeeded, the parsed-thingy (on success), a possibly-empty error message list, and a reference to a `TokenStream` representing the remaining unparsed tokens.
39 37
 
40  
-Grammars
41  
-========
  38
+## Grammars
42 39
 
43 40
 Grammars should inherit from `Grammar` to take advantage of several `Parser` primitives.  Grammars should define each grammar rule in terms of these primitives, ultimately exposing the start rule as some `Parser<T>`.  Grammar rule bodies may consist of LINQ queries, which allow you to glue together other grammar rules in sequence:
44 41
 
45  
-See /src/Parsley.Test/IntegrationTests for a sample JSON grammar.
  42
+See the integration tests for a [sample JSON grammar](https://github.com/plioi/parsley/tree/master/src/Parsley.Test/IntegrationTests/Json).
46 43
 
47 44
 Finally, we can put all these pieces together to parse some text:
48 45
 
BIN  parsley.png

0 notes on commit d9035e7

Please sign in to comment.
Something went wrong with that request. Please try again.