Click or drag to resize

BaseTree Class

A generic tree implementation with no payload. You must subclass to actually have any user data. ANTLR v3 uses a list of children approach instead of the child-sibling approach in v2. A flat tree (a list) is an empty node whose children represent the list. An empty, but non-null node is called "nil".
Inheritance Hierarchy

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

The BaseTree type exposes the following members.

Constructors
  NameDescription
Public methodBaseTree
Initializes a new instance of the BaseTree class
Public methodBaseTree(ITree)
Create a new node from an existing node does nothing for BaseTree as there are no fields other than the children list, which cannot be copied as the children are not considered part of this node.
Top
Properties
  NameDescription
Public propertyCharPositionInLine
Public propertyChildCount
Public propertyChildIndex
BaseTree doesn't track child indexes.
Public propertyChildren
Get the children internal List; note that if you directly mess with the list, do so at your own risk.
Public propertyIsNil
Public propertyLine
Public propertyParent
BaseTree doesn't track parent pointers.
Public propertyText
Public propertyTokenStartIndex
Public propertyTokenStopIndex
Public propertyType
Top
Methods
  NameDescription
Public methodAddChild
Add t as child of this node.
Public methodAddChildren
Add all elements of kids list as children of this node
Protected methodCreateChildrenList
Override in a subclass to change the impl of children list
Public methodDeleteChild
Public methodDupNode
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
Public methodFreshenParentAndChildIndexes(Int32)
Public methodFreshenParentAndChildIndexesDeeply
Public methodFreshenParentAndChildIndexesDeeply(Int32)
Public methodGetAncestor
Walk upwards and get first ancestor with this token type.
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.
Public methodGetChild
Public methodGetFirstChildWithType
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.
Public methodInsertChild
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.
Public methodSanityCheckParentAndChildIndexes
Public methodSanityCheckParentAndChildIndexes(ITree, Int32)
Public methodSetChild
Public methodToString
Override to say how a node (not a tree) should look as text
(Overrides ObjectToString.)
Public methodToStringTree
Print out a whole tree not just a node
Top
See Also