Moved the interpreter
[repair.git] / Repair / RepairInterpreter / teststruct
diff --git a/Repair/RepairInterpreter/teststruct b/Repair/RepairInterpreter/teststruct
new file mode 100755 (executable)
index 0000000..fd4c2ff
--- /dev/null
@@ -0,0 +1,53 @@
+structure Block {
+     reserved byte[d.s.blocksize];
+}
+
+structure Disk {
+     Block  b[d.s.NumberofBlocks];
+     label b[literal(0)]: Superblock s;
+     label b[literal(1)]: Groupblock g;
+}
+
+structure Superblock subtype of Block {
+     int FreeBlockCount;
+     int FreeInodeCount;
+     int NumberofBlocks;
+     int NumberofInodes;
+     int RootDirectoryInode;
+     int blocksize;
+}
+
+structure Groupblock subtype of Block {
+     int BlockBitmapBlock;
+     int InodeBitmapBlock;
+     int InodeTableBlock; 
+     int GroupFreeBlockCount;
+     int GroupFreeInodeCount;
+}
+
+structure InodeTable subtype of Block {
+     Inode itable[d.s.NumberofInodes];
+}
+
+structure InodeBitmap subtype of Block {
+     bit inodebitmap[d.s.NumberofInodes];
+}
+
+structure BlockBitmap subtype of Block {
+     bit blockbitmap[d.s.NumberofBlocks];
+}
+
+structure Inode {
+     int filesize;
+     int Blockptr[literal(12)];
+     int referencecount;
+}
+
+structure DirectoryBlock subtype of Block {
+     DirectoryEntry de[d.s.blocksize/literal(128)];
+}
+
+structure DirectoryEntry {
+     byte name[literal(124)];
+     int inodenumber;
+}