For Programmers: Free Programming Magazines  


Home > Archive > Functional > May 2007 > Re: Type of a Skip Parser?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Type of a Skip Parser?
Joachim Durchholz

2007-05-16, 4:13 am

Alex Rubinsteyn schrieb:
> Well, the skip parser isn't optional. It's meant to parse elements
> which are structurually necessary but carry no information you would
> want to hang to...such as the angled brackets of HTML or lisp parens.


Ah, now *that*s an entirely different box of strings.
I was thinking you were trying to handle stuff like optional else parts.

The result of such a "syntactic element removal parser" would be
irrelevant, so it should be either void or (if that's impossible for
typing reasons) a constant of your choosing.
Whatever you do, the calling parser should not expect the skip parser to
return a value. If your framework does not properly handle that case,
you probably have to rework it in this area.

One implicit parameter and result of any parser is the read position in
the input string. If you include that in the parse result (possibly just
as a mental exercize), this may help you see the overall structure better.
(Returning the ending position of a parse is a good idea anyway. You
need it for all kinds of activity beyond parsing, such as generating
error messages or beautifying code.)

Regards,
Jo
Krissilis

2007-05-16, 11:14 pm

Hardcore BDSM movie! Absolutely free!
http://free-bdsm-movies.info/movies/218571.avi
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com