summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (from parent 1: 5194622)
raw | patch | inline | side by side (from parent 1: 5194622)
author | Gert van Valkenhoef <g.h.m.van.valkenhoef@rug.nl> | |
Mon, 7 Nov 2011 22:42:04 +0000 (22:42 +0000) | ||
committer | Gert van Valkenhoef <g.h.m.van.valkenhoef@rug.nl> | |
Mon, 7 Nov 2011 22:42:04 +0000 (22:42 +0000) |
fold.cc | patch | blob | history | |
fold.h | patch | blob | history |
index 5cdbbb46ec12e89c40c4d1be530c937f5505e7e8..b416401ede108ab39c71e3c7ab11c64de0560a00 100644 (file)
--- a/fold.cc
+++ b/fold.cc
// rd.ReadXInt(xint); fold.collapsed := xint = 0;
reader.readSInt();
// rd.ReadXString(fold.label);
- SHORTCHAR label[32];
- reader.readSString(label); // the label
+ d_label = new SHORTCHAR[32];
+ reader.readSString(d_label); // the label
// rd.ReadStore(store);
- reader.readStore(); // the hidden part
+ d_hidden = reader.readStore(); // the hidden part
// IF store # NIL THEN fold.hidden := store(TextModels.Model); Stores.Join(fold.hidden, fold)
// ELSE fold.hidden := NIL
// END;
// fold.leftSide := store # NIL
}
+std::string Fold::toString() {
+ if (d_hidden == 0) {
+ return std::string("Fold(right)");
+ }
+ return std::string("Fold(left)") + std::string(" { ") + d_hidden->toString() + std::string(" }");
+}
+
} // namespace odc
index ad566426064087187b09af61640a33f812b72d5a..78eaa4e004aafb20da4f18afaa96796374b20b86 100644 (file)
--- a/fold.h
+++ b/fold.h
static const std::string TYPENAME;
static const TypeProxy<Fold> PROXY;
+ Store *d_hidden;
+ SHORTCHAR *d_label;
+
public:
Fold(INTEGER id);
static const std::string &getType();
static const std::string *getSuper();
virtual const std::string &getTypeName() const;
virtual void internalize(Reader &reader);
+
+ virtual std::string toString();
};
}