CxNode
Description
- Derived from
-
PsiNode abstract
ICodeOutput
ICopyable<CxNode> - Extended by
-
CxArgument sealed
CxAttribute sealed
CxCase sealed
CxCodeUnit sealed
CxComponent abstract
CxContract abstract
CxContractExpression abstract
CxExpression abstract
CxItem sealed
CxLibrary sealed
CxLiteral abstract
CxMethodGroup sealed
CxParameter sealed
CxRegion sealed
CxStatement abstract
CxType abstract
CxTypeParameter sealed
CxVariable sealed
CxXmlDoc sealed
CxXmlDocBody sealed
CxXmlDocException sealed
CxXmlDocItem abstract
CxXmlDocParagraph sealed
CxXmlDocParameter sealed
CxXmlDocReference sealed
CxXmlDocSeeAlso sealed
CxXmlDocTypeParameter sealed
CxXmlDocValue sealed
Abstract base class for Code-X PSI nodes.
Code-X PSI nodes (except CxLibrary and CxMethodGroup) produce parseable source code, either via object.ToString or by using the ICodeOutput interface. Since Code-X is a subset of standard C#, the source code may also be used with C# development tools.
Often, a PSI node references another PSI node (for example, a type name that references a type declaration). These references must be resolved by using IPsiNode.Resolve. To check for unresolved references (and other problems), the IValidatableinterface may be used.
PSI nodes are effectively immutable: once created, they cannot be modified any more, with one exception: a node may contain a list of child nodes. In this case, a node may allow to append new child nodes after its creation, as long as the behaviour of both approaches (i.e. passing all child nodes at creation time vs. appending child nodes after creation) is equivalent. For example, by adding new CxCodeUnit objects to a CxLibrary object, already resolved references (e.g. a type name) will still resolve to the same PSI node (e.g. a type declaration), whereas unresolved references might now become resolvable.
Public / Attributes
CanHaveParent
Checks if this PSI node can have a parent.
If the behaviour of a PSI node is independent of the parent node that contains it, this property returns false
. In this case, the same PSI node object may be used as a child in multiple parent PSI node objects.
The default implementation returns true
.
Parent
Returns the parent CxNode object.
After creating a CxNode object, its parent will always be null
. When a CxNode object is aggregated by creating a parent CxNode object, its parent reference will be set accordingly. If a child object has already been attached to another parent, an independent copy will be created with ICopyable.Copy and that copy will then be aggregated. This way, the principle of immutability for PSI nodes is retained.
- See also
Protected / Constants
ContextInner
Context value name for the boolean flag that depicts whether to output only the inner content of a CxXmlDocParagraph, omitting the enclosing <para/> tag.
- See also
ContextWhitespace
Context object name for the Whitespace object that is used to output whitespaces in CxXmlDocBody content.
- See also