Skip to content

Instantly share code, notes, and snippets.

@premchalmeti
Created July 25, 2021 16:09
Show Gist options
  • Save premchalmeti/716d33d99d3a36f1f1edefa9e1541918 to your computer and use it in GitHub Desktop.
Save premchalmeti/716d33d99d3a36f1f1edefa9e1541918 to your computer and use it in GitHub Desktop.
The CLISH XML parsing algortihm
0. START
1. Traverse the CmdTree node from the root CALL process_node(CmdTree.root)
2. START process_node:
If the CmdNode is not a leaf node then
2.1. Process all the child nodes of the current node first. CALL process_node(node)
2.2. After processing all child CmdNode. Set current node visibility
If all the childs are removed then
node.visible = False
Else
node.visible = True
End if
Else
CALL action_node(node)
End If
END process_node
3. START action_node:
if the node is not visible then
Remove the node from the XML
END action_node
4. END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment