Click or drag to resize

CommonTree Class

A tree node that is wrapper for a Token object. After 3.0 release while building tree rewrite stuff, it became clear that computing parent and child index is very difficult and cumbersome. Better to spend the space in every tree node. If you don't want these extra fields, it's easy to cut them out in your own BaseTree subclass.
Inheritance Hierarchy

Namespace:  Stimulsoft.Data.Expressions.Antlr.Runtime.Tree
Assembly:  Stimulsoft.Data (in Stimulsoft.Data.dll) Version: 2019.3.1.0
Syntax
[SerializableAttribute]
public class CommonTree : BaseTree

The CommonTree type exposes the following members.

Constructors
  NameDescription
Public methodCommonTree
Initializes a new instance of the CommonTree class
Public methodCommonTree(CommonTree)
Initializes a new instance of the CommonTree class
Public methodCommonTree(IToken)
Initializes a new instance of the CommonTree class
Top
Properties
Methods
  NameDescription
Public methodAddChild
Add t as child of this node.
(Inherited from BaseTree.)
Public methodAddChildren
Add all elements of kids list as children of this node
(Inherited from BaseTree.)
Protected methodCreateChildrenList
Override in a subclass to change the impl of children list
(Inherited from BaseTree.)
Public methodDeleteChild (Inherited from BaseTree.)
Public methodDupNode (Overrides BaseTreeDupNode.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFreshenParentAndChildIndexes
Set the parent and child index values for all child of t
(Inherited from BaseTree.)
Public methodFreshenParentAndChildIndexes(Int32) (Inherited from BaseTree.)
Public methodFreshenParentAndChildIndexesDeeply (Inherited from BaseTree.)
Public methodFreshenParentAndChildIndexesDeeply(Int32) (Inherited from BaseTree.)
Public methodGetAncestor
Walk upwards and get first ancestor with this token type.
(Inherited from BaseTree.)
Public methodGetAncestors
Return a list of all ancestors of this node. The first node of list is the root and the last is the parent of this node.
(Inherited from BaseTree.)
Public methodGetChild (Inherited from BaseTree.)
Public methodGetFirstChildWithType (Inherited from BaseTree.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodHasAncestor
Walk upwards looking for ancestor with this token type.
(Inherited from BaseTree.)
Public methodInsertChild (Inherited from BaseTree.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodReplaceChildren
Delete children from start to stop and replace with t even if t is a list (nil-root tree). num of children can increase or decrease. For huge child lists, inserting children can force walking rest of children to set their childindex; could be slow.
(Inherited from BaseTree.)
Public methodSanityCheckParentAndChildIndexes (Inherited from BaseTree.)
Public methodSanityCheckParentAndChildIndexes(ITree, Int32) (Inherited from BaseTree.)
Public methodSetChild (Inherited from BaseTree.)
Public methodSetUnknownTokenBoundaries
For every node in this subtree, make sure it's start/stop token's are set. Walk depth first, visit bottom up. Only updates nodes with at least one token index < 0.
Public methodToString (Overrides BaseTreeToString.)
Public methodToStringTree
Print out a whole tree not just a node
(Inherited from BaseTree.)
Top
Fields
  NameDescription
Protected fieldstartIndex
What token indexes bracket all tokens associated with this node and below?
Protected fieldstopIndex
Top
See Also