1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
<!DOCTYPE html>
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-type" />
<title>parslet - About</title>
<meta content="Kaspar Schiess (http://absurd.li)" name="author" />
<link href="images/favicon3.ico" rel="shortcut icon" />
<link href="/parslet/stylesheets/site.css" rel="stylesheet" /><link href="/parslet/stylesheets/sh_whitengrey.css" rel="stylesheet" /><script src="http://code.jquery.com/jquery-2.1.4.min.js"></script><script src="/parslet/javascripts/toc.js"></script><script src="/parslet/javascripts/sh_main.min.js"></script><script src="/parslet/javascripts/sh_ruby.min.js"></script>
</head>
<body class="code" onload="sh_highlightDocument(); $('#toc').toc({selectors: 'h2'});">
<div id="everything">
<div class="main_menu">
<img src="/parslet/images/parsley_logo.png" alt="Parslet Logo" />
<ul>
<li>
<a href="/parslet/">about</a>
</li>
<li>
<a href="/parslet/get-started.html">get started</a>
</li>
<li>
<a href="/parslet/install.html">install</a>
</li>
<li>
<a href="/parslet/documentation.html">docs</a>
</li>
<li>
<a href="/parslet/contribute.html">contribute</a>
</li>
<li>
<a href="/parslet/projects.html">projects</a>
</li>
</ul>
</div>
<div class="content">
<h1>
About
</h1>
<pre class="sh_ruby"><code>
require 'parslet'
include Parslet
# Constructs a parser using a Parser Expression Grammar
parser = str('"') >>
(
str('\\').ignore >> any |
str('"').absent? >> any
).repeat.as(:string) >>
str('"')
result = parser.parse %Q("this is a valid \\"string\\"")
result # => {:string=>"this is a valid \"string\""@1}
</code></pre>
<p>A small Ruby library for constructing parsers in the
<a href="http://en.wikipedia.org/wiki/Parsing_expression_grammar"><span class="caps">PEG</span></a> (Parsing
Expression Grammar) fashion.</p>
<p>Parslet makes developing complex parsers easy. It does so by</p>
<ul>
<li>providing the best <strong>error reporting</strong> possible</li>
<li><strong>not generating</strong> reams of code for you to debug</li>
</ul>
<p>Parslet takes the long way around to make <strong>your job</strong> easier. It allows for
incremental language construction. Often, you start out small, implementing
the atoms of your language first; <em>parslet</em> takes pride in making this
possible.</p>
<p>Eager to try this out? <a href="get-started.html">Get started</a>!</p>
</div>
<div class="copyright">
<p><span class="caps">MIT</span> License, 2010-2018, © <a href="http://absurd.li">Kaspar Schiess</a><br/></p>
</div>
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-16365074-2']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</div>
</body>
</html>
|