ChasmXMLParse


Chasm loads ChasmXML in three passes; parents, structures, and responses. It then takes the name information from the CHASMConcept tag and checks if there is a PCO with that name. It then checks for instance information. If there is no instance and existing PCO, then returns. If this is an instance and no PCO, it parses the PCO then comes back and parses the instance.

NOTE: The list is important as while we are loading PCOs, they may reference each other and we do not want to create a loop. Thus, by checking the list, we can see if there is a concept being loaded in this pass and simply reference that. They will be filled in in due time.

Parsing PCOs

Chasm first creates a blank list of currently creating PCOs. It then creates a blank PCO with the given name information and places it in the list.

1) Parent Pass

In this pass, it looks for <parent...> tags. When it finds one, it sees if that parent exists as a PCO or if it is in a list of currently being created. If neither, then parse the PCO. When it returns, set this PCO inheriting off of the returned PCO.

2) Structure Pass

In this pass, it looks for all the other tags except responses. It adds this information to the PCO.

NOTE: If it read in responses now, it could try and make a response on a PCO which has not added all of its components and an error would occur.

3) Response Pass

In this pass, it loads all the responses. The concepts should be loaded so no errors.

Parsing Instances

Chasm makes sure it can find the PCO, if not it parses it. Then, parse the instance.