parsing format/{1,2,3} format strings

Michael Hendricks <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <CAFHuXuZDq_SXLPssQ8iDtxBeVZ56_rFv0uc_hOiU_SPBLmRQqA@mail.gmail.com>
Does anyone have code for parsing format strings used by format/{1,2,3}
predicates?  I'm imagining something roughly like this:

?- parse_format("Total: ~2:d~n", X).
X = [string("Total: "), tilde(2, :, d), tilde(default, '', n)].

It'd be great if the predicate worked in both directions (for generating
format strings too), but I really only need the parser at the moment.

Thanks.

-- 
Michael
-------------- next part --------------
HTML attachment scrubbed and removed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.