Skip to main content

%CPT.Tree.Path

Method Inventory

Methods

method %OnNew(Language As %String, Path As %String) as %Status

A path is a list of terms, separated by "/"s. Each term is basically the name of either a nodetype or nodeclasstype (for the given language), with optional additions described below.

The path matches a "descendant chain" in the parse tree. For example, a path "A/B/C" would match a node of type A, with a child of type B, and a type C child of the B child. Unless QuitOnFound is passed as 1 to MatchPathToTree() the path will match all the descendant chains it can find.

Optional additions to a term in the path are :-

  • one of the terms can have a "*" prepended, which makes it the focus node (see MatchPathToTree() for more details)
  • any of the nodetype (not class) terms can have a "." followed by an annotation name appended, this means that the annotation values will be returned in the matches list from MatchPathToTree()
method MatchPathFocusToNode(TreeIndex As %Integer, NodeIndex As %Integer, Output PathMatch As %List, Output FocusIndex As %Integer) as %Boolean

Try to match the path focus to the given node

If it matches :-

  • return 1
  • PathMatch is a list of the form [I1,I2...In] where each I is a list of the nodeindex and either an empty list or a binding: [annname,annvalue]
  • I1 is the node index of the node which matched the start of the path and In is the node index matching the end of the path
  • FocusIndex is set to the index of the focus node (within PathMatch)

Otherwise returns 0, sets PathMatch to "" and kills FocusIndex

method MatchPathToTree(TreeIndex As %Integer, SubtreeTopNodeIndex As %Integer, QuitOnFound As %Boolean, Output PathMatches As %List, Output FocusIndex As %Integer) as %Boolean

Try to match the path to the given subtree

For each match, PathMatches has a sublist of the form [I1,I2...In] where each I is a list of the nodeindex and either an empty list or a binding: [annname,annvalue]

I1 is the node index of the node which matched the start of the path (i.e. NodeIndex) and In is the node index matching the end of the path

If any match: FocusIndex is set to the index of the focus node (within each sublist) - otherwise it's killed

method PathSpecGet() as %String
classmethod TestNode()
classmethod TestTree()

Inherited Members

Inherited Methods

FeedbackOpens in a new tab