b027bd57299f3347c75b7c87d98c8dbcddc73c37
1 #include <reader.h>
2 #include <alien.h>
4 #include <string>
5 #include <assert.h>
9 Reader::Reader(std::istream &rider): d_rider(rider), d_cancelled(false), d_readAlien(false), d_typeList(),
13 SHORTCHAR out;
16 }
19 BYTE out;
22 }
33 }
34 }
39 }
40 }
47 }
51 }
57 }
59 }
81 }
82 }
83 // PROCEDURE (VAR rd: Reader) ReadStore* (OUT x: Store), NEW;
84 // VAR a: Alien; t: Kernel.Type;
85 // len, pos, pos1, id, comment, next, down, downPos, nextTypeId, nextElemId, nextStoreId: INTEGER;
86 // kind: SHORTCHAR; path: TypePath; type: TypeName;
87 // save: ReaderState;
90 }
91 // IF kind = nil THEN
92 // rd.ReadInt(comment); rd.ReadInt(next);
93 // rd.st.end := rd.Pos();
94 // IF (next > 0) OR ((next = 0) & ODD(comment)) THEN rd.st.next := rd.st.end + next ELSE rd.st.next := 0 END;
95 // x := NIL
98 }
99 // ELSIF kind = link THEN
100 // rd.ReadInt(id); rd.ReadInt(comment); rd.ReadInt(next);
101 // rd.st.end := rd.Pos();
102 // IF (next > 0) OR ((next = 0) & ODD(comment)) THEN rd.st.next := rd.st.end + next ELSE rd.st.next := 0 END;
103 // x := ThisStore(rd.eDict, id)
106 }
107 // ELSIF kind = newlink THEN
108 // rd.ReadInt(id); rd.ReadInt(comment); rd.ReadInt(next);
109 // rd.st.end := rd.Pos();
110 // IF (next > 0) OR ((next = 0) & ODD(comment)) THEN rd.st.next := rd.st.end + next ELSE rd.st.next := 0 END;
111 // x := ThisStore(rd.sDict, id)
128 }
132 }
140 }
141 }
145 }
153 }
165 }
169 // rd.cause := inconsistentType; AlienTypeReport(rd.cause, type);
171 }
172 }
178 // join(d_store, x)
180 }
185 }
193 // join(d_store, alien)
195 }
200 }
208 // we've just read the alien, so reset the state
213 }
216 }
235 }
236 }
237 }
243 }
245 }
248 TypePath path;
250 SHORTCHAR *buf = new SHORTCHAR[64]; // TypeName has a maximum of length 64 (including terminator).
257 // IF path[i] # elemTName THEN INC(i) END;
259 }
271 }
275 // IF path[i] # elemTName THEN INC(i) END
277 }
280 }
282 }
289 }
291 }