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?
Thant Tessman

2007-05-16, 4:13 am

Alex Rubinsteyn wrote:

> I'm concerned about the syntactic jumble this might create. Something
> relative clear such as:
> integer >> skip(ch('+')) >> integer
> becomes
> integer >> skip(ch('+), integer)


I kinda assumed that parsers were being passed as constructor arguments
to other parsers anyway. I don't know enough about your approach using
the >> operator.


> Also, how would I handle skipping the last parser?


Right. It would be impossible to construct a grammar with the skip
parser as the last parser. I suppose you could have two versions of the
skip parser, one that returned the value of the next parser, and one
that returned the value of the previous.

Ick. Maybe this idea of mine isn't quite the right fit for your approach...

-thant
Sponsored Links







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

Copyright 2009 codecomments.com