6 const std::string
View::TYPENAME("Views.View^");
7 const TypeProxy
<View
> View::PROXY
;
9 View::View(INTEGER id
) : Store(id
) {}
11 const std::string
&View::getType() {
15 const std::string
*View::getSuper() {
16 return &Store::getType();
19 const std::string
&View::getTypeName() const {
23 void View::internalize(Reader
&reader
) {
24 Store::internalize(reader
);
25 if (reader
.isCancelled()) return;
26 reader
.readVersion(0, 0);
29 const std::string
Fold::TYPENAME("StdFolds.Fold^");
30 const TypeProxy
<Fold
> Fold::PROXY
;
32 Fold::Fold(INTEGER id
) : View(id
) {}
34 const std::string
&Fold::getType() {
38 const std::string
*Fold::getSuper() {
39 return &View::getType();
42 const std::string
&Fold::getTypeName() const {
46 void Fold::internalize(Reader
&reader
) {
47 View::internalize(reader
);
48 if (reader
.isCancelled()) return;
49 reader
.readVersion(0, 0);
50 if (reader
.isCancelled()) return;
51 // rd.ReadXInt(xint);fold.leftSide := xint = 0;
53 // rd.ReadXInt(xint); fold.collapsed := xint = 0;
54 SHORTINT c
= reader
.readSInt();
55 d_collapsed
= (c
== 0);
56 // rd.ReadXString(fold.label);
57 d_label
= new SHORTCHAR
[32];
58 reader
.readSString(d_label
); // the label
59 // rd.ReadStore(store);
60 d_hidden
= reader
.readStore(); // the hidden part
61 // IF store # NIL THEN fold.hidden := store(TextModels.Model); Stores.Join(fold.hidden, fold)
62 // ELSE fold.hidden := NIL
64 // fold.leftSide := store # NIL
67 std::string
Fold::toString() {
69 return std::string("Fold(right)");
71 return std::string("Fold(left) \"") + std::string(d_label
) + std::string("\" { ") + d_hidden
->toString() + std::string(" }");
74 void Fold::accept(Visitor
&visitor
) const {
75 if (d_hidden
== 0) { // right part
78 visitor
.foldLeft(d_collapsed
);
79 d_hidden
->accept(visitor
);