Work on id/ref mapping started. More updates will follow.
EDIT1: The xml parser for ids is done. I had to mess around a bit with the representation, but it's working. The hard part will now be the actual RAW loading and linking... gonna work some magic (with the partialy working DOM this won't be that much of a problem tho.
I should probably start working on some parser api as well.
EDIT2: The output of the modelbuilder:
OBJECT:ITEM
ITEM_ARMOR
ITEM_ARMOR_BREASTPLATE
NAME
breastplate
breastplates
ARMORLEVEL
3
UBSTEP
0
LBSTEP
0
SHAPED
LAYER
ARMOR
COVERAGE
100
LAYER_SIZE
20
LAYER_PERMIT
50
MATERIAL_SIZE
9
HARD
METAL
ITEM_ARMOR
ITEM_ARMOR_BREASTPLATE
ARMORLEVEL
3
NAME
breastplate
UBSTEP
0
LBSTEP
0
LAYER
ARMOR
COVERAGE
100
SHAPED
HARD
METAL
OBJECT:CREATURE
CREATURE
EQUIPMENT_WAGON
NAME
wagon
wagons
wagon
USE_MATERIAL_TEMPLATE
WOOD
WOOD_TEMPLATE
OBJECT:MATERIAL_TEMPLATE
MATERIAL_TEMPLATE
WOOD_TEMPLATE
STATE_NAME
ALL_SOLID
wood
Id:
Name: MATERIAL_TEMPLATE_ID
Is flat: true
Items: WOOD_TEMPLATE
Id:
Name: ITEM_SUB_ID
Is flat: false
From-to map: ITEM_WEAPON->WEAPON
ITEM_ARMOR->ARMOR
Sub-categories:
Category: ARMOR
ITEM_ARMOR_BREASTPLATE
Id:
Name: REACTION_ID
Is flat: true
Items:
Id:
Name: ITEM_ID
Is flat: true
Items: WEAPON ARMOR
and the testraw.txt
[OBJECT:ITEM]
[ITEM_ARMOR:ITEM_ARMOR_BREASTPLATE]
[NAME:breastplate:breastplates][ARMORLEVEL:3]
[UBSTEP:0]
[LBSTEP:0]
[SHAPED]
[LAYER:ARMOR]
[COVERAGE:100]
[LAYER_SIZE:20]
[LAYER_PERMIT:50]
[MATERIAL_SIZE:9]
[HARD]
[METAL]
[ITEM_ARMOR:ITEM_ARMOR_BREASTPLATE]
[ARMORLEVEL:3]
[NAME:breastplate]
[UBSTEP:0]
[LBSTEP:0]
[LAYER:ARMOR]
[COVERAGE:100]
[SHAPED]
[HARD]
[METAL]
[OBJECT:CREATURE]
[CREATURE:EQUIPMENT_WAGON]
[NAME:wagon:wagons:wagon]
[USE_MATERIAL_TEMPLATE:WOOD:WOOD_TEMPLATE]
[OBJECT:MATERIAL_TEMPLATE]
[MATERIAL_TEMPLATE:WOOD_TEMPLATE]
[STATE_NAME:ALL_SOLID:wood]
What's left is to map ref attributes of token arguments to the apropriate categories (ITEM_ID, ARMOR...). This should be trivial as it only includes a lookup of argument list (to see if there's a subcategory) and one call to map to get the set of values. Those of you who have a desire to help should mobilize and let me know, so I can add you to contribution list on googlecode and to organize the process a bit.
The parser will be available as a stand-alone library with a public API under GPL, for anyone who want to start some other tool, altho I'd like to see all the possible tools integrated into one IDE