087724d7949217d016d2a03006c6470a6422e324
1 (* Copyright (C) DooM 2D:Forever Developers
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *)
16 {$INCLUDE a_modes.inc}
19 interface
21 uses
22 Classes,
26 // ////////////////////////////////////////////////////////////////////////// //
27 type
37 // this is base type for all scalars (and arrays)
39 public
40 type
41 TType = (TBool, TChar, TByte, TUByte, TShort, TUShort, TInt, TUInt, TString, TPoint, TSize, TList, TTrigData);
42 // TPoint: pair of Integers
43 // TSize: pair of UShorts
44 // TList: actually, array of records
45 // TTrigData: array of mMaxDim bytes, but internally a record (mRecRef)
46 // arrays of chars are pascal shortstrings (with counter in the first byte)
51 private
52 type
55 private
76 // default value
83 mEBSType: TObject; // either TDynRecord or TDynEBS; nil means "simple type"; nil for `TTrigData` too
85 // for binary parser
88 private
93 procedure parseDefaultValue (); // parse `mDefUnparsed` to `mDefSVal`, `mDefIVal`, `mDefIVal2`, `mDefRecRef`
97 public
114 // won't work for lists
119 public
127 //property list: TDynRecordArray read mRVal write mRVal;
144 // "value" header record contains TList fields, with name equal to record type
146 private
156 mHeaderRec: TDynRecord; // for "value" records this is header record with data, for "type" records this is header type record
158 private
168 protected
173 public
190 public
204 private
213 private
222 public
228 // return empty string if not found
231 public
240 public
245 private
250 public
258 // creates new header record
261 // creates new header record
264 public
269 implementation
271 uses
272 SysUtils;
275 // ////////////////////////////////////////////////////////////////////////// //
277 begin
288 begin
295 begin
302 begin
336 var
338 begin
349 begin
352 end
353 else
354 begin
381 // won't work for lists
383 begin
401 begin
411 var
413 begin
415 try
417 finally
424 var
430 begin
432 begin
437 end
438 else
439 begin
445 try
452 finally
464 // default value should be parsed
466 begin
469 begin
471 raise Exception.Create(Format('field ''%s'' in record ''%s'' of record type ''%s'' is not set', [mName, mOwner.mId, mOwner.mName]));
481 // default value should be parsed
483 begin
496 begin
517 begin
526 TEBS.TBitSet: begin result += ' bitset '; if mBitSetUnique then result += 'unique '; result += mEBSTypeName; end;
530 begin
531 if (mType = TType.TPoint) then begin if (mAsT) then result += ' as txy' else result += ' as xy'; end
532 else if (mType = TType.TSize) then begin if (mAsT) then result += ' as twh' else result += ' as wh'; end;
540 var
557 begin
578 // field name
581 // field type
585 // fixed-size array?
587 begin
589 if (lmaxdim < 1) then raise Exception.Create(Format('invalid field ''%s'' array size', [fldname]));
594 begin
596 begin
597 if (fldofs >= 0) then raise Exception.Create(Format('duplicate field ''%s'' offset', [fldname]));
600 continue;
604 begin
610 continue;
614 begin
616 if (Length(fldrecname) <> 0) then raise Exception.Create(Format('field ''%s'' already typed as ''%s''', [fldname, fldrecname]));
618 continue;
622 begin
624 if (Length(fldrecname) <> 0) then raise Exception.Create(Format('field ''%s'' already typed as ''%s''', [fldname, fldrecname]));
627 continue;
631 begin
632 if hasdefStr or hasdefInt or hasdefId then raise Exception.Create(Format('field ''%s'' has duplicate default', [fldname]));
635 begin
640 begin
645 begin
649 else
652 continue;
656 begin
658 continue;
662 begin
664 continue;
667 if (pr.tokType <> pr.TTId) then raise Exception.Create(Format('field ''%s'' has something unexpected in definition', [fldname]));
669 if (Length(fldrecname) <> 0) then raise Exception.Create(Format('field ''%s'' already typed as ''%s''', [fldname, fldrecname]));
676 // create field
691 else raise Exception.Create(Format('field ''%s'' has invalid type ''%s''', [fldname, fldtype]));
693 if (lmaxdim > 0) and (mType <> TType.TChar) and (mType <> TType.TTrigData) then raise Exception.Create(Format('field ''%s'' of type ''%s'' cannot be array', [fldname, fldtype]));
695 begin
696 if (lmaxdim < 1) then raise Exception.Create(Format('field ''%s'' of type ''%s'' cannot be array', [fldname, fldtype]));
697 if (Length(fldrecname) > 0) then raise Exception.Create(Format('field ''%s'' of type ''%s'' cannot have another type', [fldname, fldtype]));
721 var
727 begin
731 begin
733 begin
734 // this must be triggerdata
736 begin
737 raise Exception.Create(Format('record reference type ''%s'' in field ''%s'' cannot be written', [mEBSTypeName, mName]));
739 // write triggerdata
741 if (buf = nil) then raise Exception.Create(Format('record reference type ''%s'' in field ''%s'' cannot be written', [mEBSTypeName, mName]));
742 try
745 begin
750 finally
754 exit;
756 // record reference
758 begin
759 // no ref, write -1
764 else raise Exception.Create(Format('record reference type ''%s'' in field ''%s'' cannot be written', [mEBSTypeName, mName]));
766 exit;
775 else raise Exception.Create(Format('record reference type ''%s'' in field ''%s'' cannot be written', [mEBSTypeName, mName]));
777 // find record number
779 if (f < 0) then raise Exception.Create(Format('record reference type ''%s'' in field ''%s'' not found in record list', [mEBSTypeName, mName]));
780 if (f > maxv) then raise Exception.Create(Format('record reference type ''%s'' in field ''%s'' has too big index', [mEBSTypeName, mName]));
785 else raise Exception.Create(Format('record reference type ''%s'' in field ''%s'' cannot be written', [mEBSTypeName, mName]));
787 exit;
796 begin
798 begin
800 end
801 else
802 begin
805 exit;
808 begin
809 if (mMaxDim = 0) then raise Exception.Create(Format('invalid string size definition for field ''%s''', [mName]));
811 begin
812 if (Length(mSVal) <> 1) then raise Exception.Create(Format('invalid string size definition for field ''%s''', [mName]));
814 end
815 else
816 begin
817 if (Length(mSVal) > mMaxDim) then raise Exception.Create(Format('invalid string size definition for field ''%s''', [mName]));
822 exit;
826 begin
827 // triggerdata array was processed earlier
828 if (mMaxDim >= 0) then Exception.Create(Format('byte array in field ''%s'' cannot be written', [mName]));
830 exit;
834 begin
835 if (mMaxDim >= 0) then raise Exception.Create(Format('short array in field ''%s'' cannot be written', [mName]));
837 exit;
841 begin
842 if (mMaxDim >= 0) then raise Exception.Create(Format('int array in field ''%s'' cannot be written', [mName]));
844 exit;
847 begin
851 begin
852 if (mMaxDim >= 0) then raise Exception.Create(Format('pos/size array in field ''%s'' cannot be written', [mName]));
855 exit;
858 begin
859 if (mMaxDim >= 0) then raise Exception.Create(Format('pos/size array in field ''%s'' cannot be written', [mName]));
862 exit;
865 begin
867 exit;
870 begin
872 exit;
880 var
884 begin
890 begin
892 begin
894 end
896 begin
898 end
899 else
900 begin
904 exit;
907 begin
908 //def := mOwner.mOwner;
909 //es := def.findEBSType(mEBSTypeName);
912 if (es = nil) or (not es.mIsEnum) then raise Exception.Create(Format('record enum type ''%s'' for field ''%s'' not found', [mEBSTypeName, mName]));
914 begin
916 begin
919 exit;
922 raise Exception.Create(Format('value %d in record enum type ''%s'' for field ''%s'' not found', [mIVal, mEBSTypeName, mName]));
925 begin
926 //def := mOwner.mOwner;
927 //es := def.findEBSType(mEBSTypeName);
930 if (es = nil) or es.mIsEnum then raise Exception.Create(Format('record bitset type ''%s'' for field ''%s'' not found', [mEBSTypeName, mName]));
931 // none?
933 begin
935 begin
937 begin
940 exit;
943 raise Exception.Create(Format('value %d in record bitset type ''%s'' for field ''%s'' not found', [0, mEBSTypeName, mName]));
945 // not none
949 begin
951 begin
954 begin
956 begin
960 break;
963 if not found then raise Exception.Create(Format('value %d in record bitset type ''%s'' for field ''%s'' not found', [mask, mEBSTypeName, mName]));
968 exit;
975 begin
977 exit;
980 begin
981 if (mMaxDim = 0) then raise Exception.Create(Format('invalid string size definition for field ''%s''', [mName]));
984 exit;
992 begin
994 exit;
997 begin
1000 exit;
1004 begin
1006 exit;
1009 begin
1011 exit;
1014 begin
1016 exit;
1025 var
1032 begin
1036 begin
1037 // this must be triggerdata
1039 begin
1042 // find trigger definition
1044 if (tfld = nil) then raise Exception.Create(Format('triggerdata value for field ''%s'' in record ''%s'' without ''type'' field', [mName, rec.mName]));
1045 if (tfld.mEBS <> TEBS.TEnum) then raise Exception.Create(Format('triggerdata value for field ''%s'' in record ''%s'' with bad ''type'' field', [mName, rec.mName]));
1047 if (rc = nil) then raise Exception.Create(Format('triggerdata definition for field ''%s'' in record ''%s'' with type ''%s'' not found', [mName, rec.mName, tfld.mSVal]));
1050 try
1054 finally
1058 exit;
1059 end
1060 else
1061 begin
1062 // not a trigger data
1070 else raise Exception.Create(Format('invalid non-numeric type ''%s'' for field ''%s'' of record ''%s''', [getTypeName(mType), mName, mEBSTypeName]));
1075 exit;
1079 begin
1088 else raise Exception.Create(Format('invalid non-numeric type ''%s'' for field ''%s'' of record ''%s''', [getTypeName(mType), mName, mEBSTypeName]));
1092 if (es = nil) or (es.mIsEnum <> (mEBS = TEBS.TEnum)) then raise Exception.Create(Format('record enum type ''%s'' for field ''%s'' not found', [mEBSTypeName, mName]));
1094 // build enum/bitfield values
1096 begin
1098 if (Length(mSVal) = 0) then raise Exception.Create(Format('record enum type ''%s'' for field ''%s'' has invalid value %d', [mEBSTypeName, mName, mIVal]));
1099 end
1100 else
1101 begin
1102 // special for 'none'
1104 begin
1106 if (Length(mSVal) = 0) then raise Exception.Create(Format('record bitset type ''%s'' for field ''%s'' has invalid value %d', [mEBSTypeName, mName, mIVal]));
1107 end
1108 else
1109 begin
1113 begin
1115 begin
1117 if (Length(s) = 0) then raise Exception.Create(Format('record bitset type ''%s'' for field ''%s'' has invalid value %d', [mEBSTypeName, mName, mask]));
1125 //writeln('ebs <', es.mName, '>: ', mSVal);
1127 exit;
1134 begin
1140 exit;
1143 begin
1145 begin
1147 end
1148 else
1149 begin
1152 try
1157 begin
1162 finally
1167 exit;
1176 begin
1178 exit;
1181 begin
1185 exit;
1188 begin
1192 exit;
1195 begin
1197 exit;
1200 begin
1202 exit;
1213 begin
1215 if (mIVal < min) or (mIVal > max) then raise Exception.Create(Format('invalid %s value for field ''%s''', [getTypeName(mType), mName]));
1219 var
1224 begin
1225 // if this field should contain struct, convert type and parse struct
1229 begin
1230 // ugly hack. sorry.
1232 begin
1235 begin
1236 // '{}'
1239 end
1240 else
1241 begin
1243 // find trigger definition
1245 if (tfld = nil) then raise Exception.Create(Format('triggerdata value for field ''%s'' in record ''%s'' without ''type'' field', [mName, rec.mName]));
1246 if (tfld.mEBS <> TEBS.TEnum) then raise Exception.Create(Format('triggerdata value for field ''%s'' in record ''%s'' with bad ''type'' field', [mName, rec.mName]));
1248 if (rc = nil) then raise Exception.Create(Format('triggerdata definition for field ''%s'' in record ''%s'' with type ''%s'' not found', [mName, rec.mName, tfld.mSVal]));
1251 //writeln(rc.definition);
1252 try
1256 finally
1262 exit;
1264 // other record types
1266 begin
1268 begin
1270 end
1271 else
1272 begin
1274 if (rec = nil) then raise Exception.Create(Format('record ''%s'' (%s) value for field ''%s'' not found', [pr.tokStr, mEBSTypeName, mName]));
1280 exit;
1281 end
1283 begin
1284 //rec := mOwner.mOwner.findRecType(mEBSTypeName); // find in mapdef
1287 if (rec = nil) then raise Exception.Create(Format('record type ''%s'' for field ''%s'' not found', [mEBSTypeName, mName]));
1295 exit;
1300 begin
1301 //es := mOwner.mOwner.findEBSType(mEBSTypeName); // find in mapdef
1304 if (es = nil) or (not es.mIsEnum) then raise Exception.Create(Format('record enum type ''%s'' for field ''%s'' not found', [mEBSTypeName, mName]));
1306 if not es.has[tk] then raise Exception.Create(Format('record enum value ''%s'' of type ''%s'' for field ''%s'' not found', [tk, mEBSTypeName, mName]));
1309 //writeln('ENUM ', mEBSName, '; element <', mSVal, '> with value ', mIVal);
1312 exit;
1315 begin
1316 //es := mOwner.mOwner.findEBSType(mEBSTypeName); // find in mapdef
1319 if (es = nil) or es.mIsEnum then raise Exception.Create(Format('record bitset type ''%s'' for field ''%s'' not found', [mEBSTypeName, mName]));
1322 begin
1324 if not es.has[tk] then raise Exception.Create(Format('record bitset value ''%s'' of type ''%s'' for field ''%s'' not found', [tk, mEBSTypeName, mName]));
1328 if mBitSetUnique then raise Exception.Create(Format('record bitset of type ''%s'' for field ''%s'' expects only one value', [tk, mEBSTypeName, mName]));
1329 //pr.expectDelim('|');
1334 exit;
1341 begin
1347 exit;
1350 begin
1351 if (mMaxDim = 0) then raise Exception.Create(Format('invalid string size definition for field ''%s''', [mName]));
1354 begin
1355 // single char
1356 if (Length(mSVal) <> 1) then raise Exception.Create(Format('invalid string size for field ''%s''', [mName]));
1359 end
1360 else
1361 begin
1362 // string
1363 if (Length(mSVal) > mMaxDim) then raise Exception.Create(Format('invalid string size for field ''%s''', [mName]));
1367 exit;
1370 begin
1373 exit;
1376 begin
1379 exit;
1382 begin
1385 exit;
1388 begin
1391 exit;
1394 begin
1397 exit;
1400 begin
1403 exit;
1406 begin
1410 exit;
1414 begin
1418 begin
1419 if (mIVal < 0) or (mIVal > 32767) then raise Exception.Create(Format('invalid %s value for field ''%s''', [getTypeName(mType), mName]));
1423 begin
1424 if (mIVal2 < 0) or (mIVal2 > 32767) then raise Exception.Create(Format('invalid %s value for field ''%s''', [getTypeName(mType), mName]));
1429 exit;
1432 begin
1434 exit;
1437 begin
1439 exit;
1447 // ////////////////////////////////////////////////////////////////////////// //
1449 begin
1450 if (pr = nil) then raise Exception.Create('cannot create record type without type definition');
1464 begin
1475 begin
1486 begin
1489 begin
1498 begin
1504 var
1506 begin
1513 begin
1519 var
1521 begin
1529 var
1532 begin
1540 begin
1553 var
1556 begin
1559 // find record data
1562 if (fld.mType <> fld.TType.TList) then raise Exception.Create(Format('cannot get record of type ''%s'' due to name conflict with ordinary field', [atypename]));
1563 // find by id
1565 begin
1567 begin
1571 // alas
1575 function TDynRecord.findRecordNumByType (const atypename: AnsiString; rc: TDynRecord): Integer;
1576 var
1579 begin
1581 // find record data
1584 if (fld.mType <> fld.TType.TList) then raise Exception.Create(Format('cannot get record of type ''%s'' due to name conflict with ordinary field', [atypename]));
1585 // find by ref
1587 begin
1589 begin
1593 // alas
1598 var
1600 begin
1601 // find record data
1604 begin
1605 // first record
1610 if (fld.mType <> fld.TType.TList) then raise Exception.Create(Format('cannot append record of type ''%s'' due to name conflict with ordinary field', [atypename]));
1611 // append
1618 var
1620 begin
1626 begin
1634 var
1637 begin
1639 begin
1642 begin
1644 begin
1648 if isForTrig[tdn] then raise Exception.Create(Format('duplicate trigdata ''%s'' trigtype ''%s''', [mName, tdn]));
1652 end
1653 else
1654 begin
1660 end
1661 else
1662 begin
1667 begin
1670 begin
1671 if (mSize > 0) then raise Exception.Create(Format('duplicate `size` in record ''%s''', [mName]));
1673 if (mSize < 1) then raise Exception.Create(Format('invalid record ''%s'' size: %d', [mName, mSize]));
1675 continue;
1678 begin
1679 if (mBinBlock >= 0) then raise Exception.Create(Format('duplicate `binblock` in record ''%s''', [mName]));
1681 if (mBinBlock < 1) then raise Exception.Create(Format('invalid record ''%s'' binblock: %d', [mName, mBinBlock]));
1682 continue;
1688 // load fields
1690 begin
1692 if hasByName(fld.name) then begin fld.Free(); raise Exception.Create(Format('duplicate field ''%s''', [fld.name])); end;
1693 // append
1696 // done with field
1703 var
1705 begin
1707 begin
1708 // trigger data
1711 begin
1714 begin
1719 end
1720 else
1721 begin
1724 end
1725 else
1726 begin
1727 // record
1734 begin
1744 var
1756 var
1759 begin
1760 //writeln('*** rec: ', rec.mName, '.', rec.mId, ' (', rec.mFields.count, ')');
1762 begin
1764 begin
1766 continue;
1771 if (rt = nil) then raise Exception.Create(Format('record of type ''%s'' with id ''%s'' links to inexistant record of type ''%s'' with id ''%d''', [rec.mName, rec.mId, fld.mEBSTypeName, fld.mRecRefId]));
1772 //writeln(' ', rec.mName, '.', rec.mId, ':', fld.mName, ' -> ', rt.mName, '.', rt.mId, ' (', fld.mEBSTypeName, '.', fld.mRecRefId, ')');
1778 begin
1779 //writeln(' ', fld.mName);
1784 begin
1787 try
1789 begin
1790 // parse map file as sequence of blocks
1794 // parse blocks
1796 begin
1802 if (bsize < 0) or (bsize > $1fffffff) then raise Exception.Create(Format('block of type %d has invalid size %d', [btype, bsize]));
1803 if loaded[btype] then raise Exception.Create(Format('block of type %d already loaded', [btype]));
1805 // find record type for this block
1808 if (rect = nil) then raise Exception.Create(Format('block of type %d has no corresponding record', [btype]));
1810 if (rec.mSize = 0) or ((bsize mod rec.mSize) <> 0) then raise Exception.Create(Format('block of type %d has invalid number of records', [btype]));
1811 // header?
1813 begin
1814 if (bsize <> mSize) then raise Exception.Create(Format('header block of type %d has invalid number of records', [btype]));
1819 end
1820 else
1821 begin
1822 // create list for this type
1827 begin
1831 begin
1838 //writeln('parsed ''', rec.mId, '''...');
1844 //st.position := st.position+bsize;
1846 // link fields
1848 begin
1852 exit;
1855 // read fields
1857 if (mSize < 1) then raise Exception.Create(Format('cannot read record of type ''%s'' with unknown size', [mName]));
1861 begin
1864 if (fld.mBinOfs >= st.size) then raise Exception.Create(Format('record of type ''%s'' has invalid field ''%s''', [fld.mName]));
1866 //writeln('parsing ''', mName, '.', fld.mName, '''...');
1869 finally
1877 var
1883 //f, c: Integer;
1886 begin
1888 begin
1889 if (mBinBlock < 1) then raise Exception.Create('cannot write binary record without block number');
1892 end
1893 else
1894 begin
1897 try
1902 // write normal fields
1904 begin
1905 // record list?
1909 if (fld.mBinOfs >= bufsz) then raise Exception.Create('binary value offset is outside of the buffer');
1911 //writeln('writing field <', fld.mName, '>');
1915 // write block with normal fields
1917 begin
1918 //writeln('writing header...');
1919 // signature and version
1930 // write other blocks, if any
1932 begin
1933 // calculate blkmax
1936 begin
1937 // record list?
1939 begin
1947 // write blocks
1949 begin
1953 begin
1954 // record list?
1956 begin
1965 // flush block
1967 begin
1978 // write end marker
1983 finally
1991 var
1994 begin
1996 begin
2003 try
2005 begin
2006 // record list?
2008 begin
2011 begin
2013 begin
2019 continue;
2026 finally
2035 var
2038 begin
2039 if (mOwner = nil) then raise Exception.Create(Format('can''t parse record ''%s'' value without owner', [mName]));
2041 // not a header?
2043 begin
2044 // id?
2046 end
2047 else
2048 begin
2052 //writeln('parsing record <', mName, '>');
2055 begin
2057 //writeln('<', mName, '.', pr.tokStr, '>');
2059 // records
2061 begin
2062 // add records with this type (if any)
2065 begin
2068 try
2072 begin
2075 begin
2077 begin
2078 if (Length(rv.mId) > 0) and (CompareText(rv.mId, rec.mId) = 0) then raise Exception.Create(Format('duplicate thing ''%s'' in record ''%s''', [fld.mName, mName]));
2084 finally
2087 continue;
2091 // fields
2094 begin
2095 if fld.defined then raise Exception.Create(Format('duplicate field ''%s'' in record ''%s''', [fld.mName, mName]));
2096 if fld.internal then raise Exception.Create(Format('internal field ''%s'' in record ''%s''', [fld.mName, mName]));
2099 continue;
2102 // something is wrong
2106 // fix field defaults
2108 //writeln('done parsing record <', mName, '>');
2112 // ////////////////////////////////////////////////////////////////////////// //
2114 begin
2121 begin
2128 begin
2139 begin
2142 begin
2151 begin
2157 var
2159 begin
2166 var
2168 begin
2172 // fields
2175 begin
2179 begin
2183 end
2184 else
2185 begin
2190 // max field
2197 var
2199 begin
2201 begin
2209 var
2215 begin
2224 begin
2227 begin
2228 if (CompareText(mIds[f], idname) = 0) then raise Exception.Create(Format('duplicate field ''%s'' in enum/bitset ''%s''', [idname, mName]));
2230 if (CompareText(mMaxName, idname) = 0) then raise Exception.Create(Format('duplicate field ''%s'' in enum/bitset ''%s''', [idname, mName]));
2234 // has value?
2236 begin
2238 begin
2239 if (Length(mMaxName) > 0) then raise Exception.Create(Format('duplicate max field ''%s'' in enum/bitset ''%s''', [idname, mName]));
2242 end
2243 else
2244 begin
2250 // append it?
2252 begin
2253 // fix maxvalue
2255 begin
2262 // next cv
2264 begin
2273 // add max field
2275 begin
2284 // ////////////////////////////////////////////////////////////////////////// //
2286 begin
2295 var
2298 begin
2313 begin
2320 var
2322 begin
2324 begin
2332 var
2334 begin
2336 begin
2344 var
2346 begin
2348 begin
2356 var
2361 // setup header links and type links
2363 var
2365 begin
2368 begin
2373 begin
2375 if (fld.mEBSType = nil) then raise Exception.Create(Format('field ''%s'' of type ''%s'' has no correcponding record definition', [fld.mName, fld.mEBSTypeName]));
2379 begin
2381 if (fld.mEBSType = nil) then raise Exception.Create(Format('field ''%s'' of type ''%s'' has no correcponding enum/bitset', [fld.mName, fld.mEBSTypeName]));
2382 if ((fld.mEBS = TDynField.TEBS.TEnum) <> (fld.mEBSType as TDynEBS).mIsEnum) then raise Exception.Create(Format('field ''%s'' of type ''%s'' enum/bitset type conflict', [fld.mName, fld.mEBSTypeName]));
2388 // setup default values
2390 var
2392 begin
2396 begin
2399 begin
2404 begin
2407 begin
2413 //writeln(eb.definition); writeln;
2414 continue;
2418 begin
2421 begin
2423 begin
2430 //writeln(dr.definition); writeln;
2431 continue;
2435 //writeln(dr.definition); writeln;
2436 if (findRecType(rec.name) <> nil) then begin rec.Free(); raise Exception.Create(Format('duplicate record ''%s''', [rec.name])); end;
2437 if (hdr <> nil) and (CompareText(rec.name, hdr.name) = 0) then begin rec.Free(); raise Exception.Create(Format('duplicate record ''%s''', [rec.name])); end;
2440 begin
2441 if (hdr <> nil) then begin rec.Free(); raise Exception.Create(Format('duplicate header record ''%s'' (previous is ''%s'')', [rec.name, hdr.name])); end;
2443 end
2444 else
2445 begin
2450 // put header record to top
2456 // setup header links and type links
2460 // setup default values
2466 // ////////////////////////////////////////////////////////////////////////// //
2468 var
2470 begin
2472 try
2480 begin
2489 var
2491 begin
2493 try
2500 begin