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
CxGroup abstract
CxItem sealed
CxLibrary sealed
CxLiteral abstract
CxNamespace 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, CxNamespace and CxMethodGroup) produce parsable 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 IValidatable interface may be used.
PSI nodes are quasi immutable: once created, modifications may only be performed in specific ways, which are exposed as methods and/or properties in the API. A modification usually influences how references resolve to their target nodes. The respective modification method / property takes care of this, for example by clearing references where necessary.
Parent/child relations between PSI nodes are implemented with strong parent-to-child references and weak child-to-parent references. Therefore, the using code must retain a reference to the root PSI node, to make sure that all weak references remain valid.
Public / Methods
AttachTo
Attaches this node to the given parent in.
This node must not have a parent. Use this method to allow orphan nodes to resolve their reference using an existing PSI model.
Before returning true
, this method calls IPsiNode.Resolve on this
.
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