FaultTree v0.1.0 FaultTree.Parser.XML View Source

Parse an XML document into a FaultTree. The XML schema expected is mostly for opsa-mef, defined at: https://github.com/rakhimov/scram/blob/master/share/input.rng

Link to this section Summary

Functions

Parse the XML document into a FaultTree.

Link to this section Functions

Parse the XML document into a FaultTree.

Steps:

  • create a new tree
  • parse xml and add all events/gates to the tree
  • walk the tree and set parent field for anything showing up as a child of another node

    • for duplicates, set all references after the first as a transfer gate
  • walk the tree again and remove original child references

Things missing:

  • parameter parsing
  • only the first defined fault-tree will be parsed
  • unsupported gate types
  • nested gates are not supported, each gate must be defined with define-gate and only use event refs
  • boolean events
  • a bunch of other things from https://raw.githubusercontent.com/rakhimov/scram/master/share/input.rng