diff --git a/reader.cc b/reader.cc
index 46a0b812e7334485a6d22b1add42c62b4eca787a..051ddf555539dbc7440b12694dbe4f2ad7f62383 100644 (file)
--- a/reader.cc
+++ b/reader.cc
Store* Reader::readStore() {
SHORTCHAR kind = readSChar();
if (kind == Store::NIL) {
+ std::cout << "NIL STORE" << std::endl;
return readNilStore();
} else if (kind == Store::LINK) {
+ std::cout << "LINK STORE" << std::endl;
return readLinkStore();
} else if (kind == Store::NEWLINK) {
+ std::cout << "NEWLINK STORE" << std::endl;
return readNewLinkStore();
} else if (kind == Store::STORE) {
+ std::cout << "STORE STORE" << std::endl;
return readStoreOrElemStore(false);
} else if (kind == Store::ELEM) {
+ std::cout << "ELEM STORE" << std::endl;
return readStoreOrElemStore(true);
} else {
throw 20;
++i;
} else if (kind == Store::OLDTYPE) {
int id = readInt();
- d_typeList[d_typeList.size() - 1]->baseId = id;
-// REPEAT
-// GetThisType(rd.tDict, id, path[i]); id := ThisBaseId(rd.tDict, id);
+ if (i > 0) {
+ d_typeList[d_typeList.size() - 1]->baseId = id;
+ }
+ while (id != -1) {
+ path[i] = d_typeList[id]->name;
+ id = d_typeList[id]->baseId;
// IF path[i] # elemTName THEN INC(i) END
-// UNTIL id = -1
+ ++i;
+ }
} else {
throw 100;
}
path[i] = 0;
}
-// PROCEDURE ReadPath (VAR rd: Reader; VAR path: TypePath);
-// VAR h: TypeDict; id, extId: INTEGER; i: INTEGER; kind: SHORTCHAR;
-//
-// PROCEDURE AddPathComp (VAR rd: Reader);
-// BEGIN
-// IF h # NIL THEN AddBaseId(h, extId, rd.nextTypeId) END;
-// AddType(rd.tDict, rd.tHead, rd.nextTypeId, path[i]);
-// h := rd.tHead; extId := rd.nextTypeId
-// END AddPathComp;
-//
-// BEGIN
-// h := NIL; i := 0; rd.ReadSChar(kind);
-// WHILE kind = newExt DO
-// rd.ReadXString(path[i]);
-// AddPathComp(rd); INC(rd.nextTypeId);
-// IF path[i] # elemTName THEN INC(i) END;
-// rd.ReadSChar(kind)
-// END;
-// IF kind = newBase THEN
-// rd.ReadXString(path[i]);
-// AddPathComp(rd); INC(rd.nextTypeId); INC(i)
-// ELSE
-// ASSERT(kind = oldType, 100);
-// rd.ReadInt(id);
-// IF h # NIL THEN AddBaseId(h, extId, id) END;
-// REPEAT
-// GetThisType(rd.tDict, id, path[i]); id := ThisBaseId(rd.tDict, id);
-// IF path[i] # elemTName THEN INC(i) END
-// UNTIL id = -1
-// END;
-// path[i] := ""
-// END ReadPath;
void Reader::addPathComponent(bool first, SHORTCHAR *typeName) {
int next = d_typeList.size();