12.06.2015 Views

The Annoyance Filter.pdf - Fourmilab

The Annoyance Filter.pdf - Fourmilab

The Annoyance Filter.pdf - Fourmilab

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

§131 ANNOYANCE-FILTER MAIL FOLDER 115<br />

131. <strong>The</strong> nextByte method is used by the tokenParser when scouring byte stream data for plausible<br />

strings. It must only be used when byteStream is set. It returns the next byte from the stream or −1<br />

at the end of the stream and cancels byteStream mode. How we get out of here depends on a fairly<br />

intimate mutual understanding between mailFolder and tokenParser of each other’s innards.<br />

〈 Class implementations 11 〉 +≡<br />

int mailFolder ::nextByte (void)<br />

{<br />

assert(mdp ≠ Λ);<br />

int c = mdp ⃗ getDecodedChar ( );<br />

if (c < 0) {<br />

byteStream = false ;<br />

if (Annotate (’d’)) {<br />

ostringstream os ;<br />

os ≪ "End␣of␣byte␣stream.␣␣Deactivating␣byte␣stream␣parser.";<br />

reportParserDiagnostic(os );<br />

}<br />

}<br />

return c;<br />

}

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!