Signature XlDecode
This signature is a subset of the fxp "Decode" signature, containing just those things required by XlParseInput.
It is assumed that XlParse applications will not open files (they will be passed an open file) and will not know about encoding (they may be operating on an unencoded unicode data source).
So this signature is a very small part of the original.

Signature XlStream
This signature defines the facilities required by XLogic parsers.
It looks as if it's just renaming the XlDecode features, but it is semantically different because the input file is "lazy".
This means that if you invooke getChar on the same InStream value several times you get the same results each time.
You have to use the returned inStream if you want to get the next character.

Functor XlDecodeStream
This functor addresses only the first item on the list of requirements, building from the XLogic subset of the decode signature a lazy input file.
The second requirement is satisfied by a structure which makes no use of XlDecode.

Structure XlVectorStream
This is the conversion to a stream of the Decode structure from the fxp library.
xlsml
structure XlFileStream = XlFileStream(Decode)


Structure XlVectorStream
xlsml
structure XlVectorStream:XlStream =
struct
type streamData = UniChar.Char
type inStream = UniChar.Vector * int * int
type openInfo = UniChar.Vector
exception Eof of inStream
fun openStream v = (v,1,Vector.length v)
fun closeStream (v,p,len) = (v,0,len)
fun getChar (f as (v,p,len))
= if p<len
then (Vector.sub(v,p),(v,p+1,len))
else raise Eof f
end


