<div>Sigrid - </div>
<div> </div>
<div class="gmail_quote">On Wed, Jan 6, 2010 at 10:01 AM, <a href="mailto:keydana@gmx.de" target="_blank">keydana@gmx.de</a> <span dir="ltr"><<a href="mailto:keydana@gmx.de" target="_blank">keydana@gmx.de</a>></span> wrote: </div>
<div class="gmail_quote"> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>For the first part, the main question for me was how to represent the parse results, which in the Hutton & Meijer article are lists of tuples. I chose to have lists of a struct parse-result with fields "value" and "remaining". </div>
</blockquote>
<div class="gmail_quote"> </div>
<div class="gmail_quote">This is similar to my choice. Take a look at bzlib/parseq/input.ss. I also tried to directly port Hutton & Meijer but I didn't want to maintain all possible parses, so I moved away from the list representation and the plus operator.</div>
<div class="gmail_quote"> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Another question during coding was whether I'd encounter problems by not using a lazy language - I didn't, but I'm still wondering whether I missed something :-;</blockquote>
<div class="gmail_quote"> </div>
<div class="gmail_quote">AFAIK laziness will not cause parsing issues - many parsers are written in non-lazy languages. </div>
<div class="gmail_quote"> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">For this specific application, I wanted to parse an input file and end up with an output suitable for loading the transactions into a program like Excel (for an imaginary accountant to use).
<div>So I didn't want to get out a string, but structured and verified output, which I did by possibly "misusing" the bind operator to perform other operations than parsing:</div></blockquote>
<div class="gmail_quote"> </div>
<div class="gmail_quote">Parsers are functions and hence you can have them return anything as long as their callers knows what to expect. Scheme is a dynamically typed language - so take advantage of it ;) </div>
<div class="gmail_quote"> </div>
<div class="gmail_quote">Also - feel free to use bzlib/parseq to build your DTA parser. I would be interested in your feedbacks. </div>
<div class="gmail_quote">Cheers,</div>
<div class="gmail_quote">yc</div>
<div> </div>