Comments
Loading Dream Comments...
You must be logged in to write a comment - Log In
So that we can test and run certain ::SHE+ILA:: programs under MS-Windows etc., we have bundled the important FBI (Fundamental Buffer Interface) operators into a class :
class FBI {
FBI& operator <= (Buf& buf); // This is used as the Specify operator, since C++ does not allow the "<::" syntax :)
FBI& operator -> (Buf& buf); // This is used as the Instantiate operator, for the above reason
FBI& operator << (Buf& buf); // Insert
FBI& operator >>= (Buf& buf); // Extract
Buf operator + (Buf& buf); // This is used as the "#" (length) operator
FBI& operator [] (Buf& buf); // Subscript, but C++ doesn't like an inline vector here (such as [1, 2, 3])
FBI& operator() (int opcode, buf& buf); // Reduce (since "op/" is nonsense to C++)
};
Plus appropriate constructors and destructors. We have omitted the "reflected" versions of the FBI operators, because they are redundant,
e.g. "::>" can be put on the other end of the expression as "<::", etc.
Also we have omitted the "Wait" (?x and x?) operators for now (we can use a named method, such as WaitFull() and WaitEmpty() ).
The Index versions of these operators can be coded with an ancilliary class,
for example a <<[N] b can be written as
a << woo(N, b), where woo builds a tuple to be used by "<<".