<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=KOI8-R" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 10/16/2012 07:27 AM, Alexei Golovko wrote:
<blockquote cite="mid:671031350386864@web5g.yandex.ru" type="cite">
  <div>Can someone suggest some parser generator, suitable for pure
strict lambda calculus?</div>
  <div>š</div>
  <div>For example, does it make sense to try PEG like in <a
 moz-do-not-send="true"
 href="http://www.impredicative.com/pipermail/ur/2011-February/000520.html">http://www.impredicative.com/pipermail/ur/2011-February/000520.html</a>
?</div>
</blockquote>
<br>
I don't think any parser generators have been written for Ur yet.š
Personally, I would just write a direct recursive descent parser for
XML (and that is what I did in the Feed library).<br>
<br>
If you run into performance problems with a direct recursive descent
parser, then probably it's a fundamental limitation with
optimization/code generation to JavaScript in the Ur/Web compiler.<br>
<br>
<blockquote cite="mid:671031350386864@web5g.yandex.ru" type="cite">
  <div>12.10.2012, 17:12, "Alexei Golovko" <<a moz-do-not-send="true"
 href="mailto:m-lj@yandex.ru">m-lj@yandex.ru</a>>:</div>
  <blockquote type="cite">
    <div>šI parse them to list of elements:</div>
    <div>datatype myXml =<br>
ššš Text of string<br>
ššš | Open of string * list { N : string, V : string } * option string<br>
ššš | Close of string<br>
ššš | Other<br>
    <br>
    </div>
    <div>I've attached related modules, but the main problem is that I
don't want to write full XML parser (dealing with entities, for
example). Current code does not cover all cases (it is dirty and seems
to have a silly bugs even with escaping; I have used it for two test
files only for work with UI part). Probably, it is better do not invest
time to optimization...</div>
    <div>12.10.2012, 16:53, "Adam Chlipala" <<a
 moz-do-not-send="true" href="mailto:adamc@csail.mit.edu">adamc@csail.mit.edu</a>>:</div>
    <blockquote type="cite"><br>
OK, then I'd expect to parse fragments into a simple tree datatype.<br>
      <br>
Maybe if you point us to an example of your parsing code, I can give
some advice on making it faster.š (Linear-time/space parsing of strings
in pure Ur code should be pretty easy, if you use the right standard
library functions.)</blockquote>
  </blockquote>
</blockquote>
</body>
</html>