DCGs from streams



I have quite a few sources, e.g. _Prolog Programming for Artificial Intelligence_, of examples and explanations of using DCGs to specify parsing of natural languages. However, I am looking for examples, either books or code, of using DCGs to do things like parse messages as is done in network programming. For example, using a DCG to both read a message from a socket (or a file (or anything else which acts as the source for a stream of octets)) while parsing it at the same time because, for example, one must parse the stream to determine when the end of a message on that stream has been received. Or, to use a DCG, or something like a DCG, for parsing of binary message formats from a stream as opposed to from a list, as is typical of what I find in the Prolog literature with which I'm a familiar.
.



Relevant Pages

  • Re: DCGs from streams
    ... parsing of natural languages. ... using a DCG to both read a ... because, for example, one must parse the stream to determine when the ... backtrack in the stream when a partial parsing fails. ...
    (comp.lang.prolog)
  • Re: DCGs from streams
    ... DCG implements generic context sensitive grammars which aren't the best choice for the kind of parsing you're doing. ... For example, using a DCG to both read a message from a socket (or a file (or anything else which acts as the source for a stream of octets)) while parsing it at the same time because, for example, one must parse the stream to determine when the end of a message on that stream has been received. ...
    (comp.lang.prolog)
  • Re: DCGs from streams
    ... parsing of natural languages. ... using a DCG to both read a ... because, for example, one must parse the stream to determine when the ... Prolog literature with which I'm a familiar. ...
    (comp.lang.prolog)