From: Filip V. <f.v...@ce...> - 2007-05-02 21:11:45
|
Hi everyone! I've just commited a non-tested (though it compiles under linux) compiler for type definition scripts. There are no examples of syntax usage (just the one below), but the BNF should be quite readable. As you may see, I do not include the labels for the fields, only they're names. I'll try to finish (and test) this next week. In the meantime, I'm writing a xml to dtype converter script in perl. It nearly works ok (here is a sneek-peek at resulting structure). The structure comes from telliameds xml definition files from dark utils.: bitfield aiawarenessflags { key "Seen" 0x01 key "Heard" 0x02 key "Can Raycast" 0x04 key "Line of Sight" 0x08 key "Blind" 0x10 key "Deaf" 0x20 key "Highest" 0x40 key "First Hand" 0x80 } enum airating : uint { key "Null" 0 key "Well Below Average" 1 key "Below Average" 2 key "Average" 3 key "Above Average" 4 key "Well Above Average" 5 } namespace Properties { // Label: AnimLight struct AnimLight { int32 unk1 vector offset int32 unk2 = "1" int16 cellindex int16 hitcells int16 lightnum = "-1" uint16 use animlightmode mode = "4" int32 brightentime int32 dimtime float minbrightness float maxbrightness int32 unk4 bool32 rising int32 countdown bool32 inactive float radius int32 unk5 } } It will all look like this. The syntax is not very complex. The "use animlightmode" is an example of enumeration/bitfield referencing. after =, there is a default value. The labels should be defined in some language packs if needed for editor. Note this is only a data structure definition script language. There will be other format - property and link definition scripts. Those will reference these structures. Binary service should work ok, though not tested either. That's it for now. I'll welcome any comments. Volca |