Module cstree::syntax

source ·
Expand description

Implementation of the outer, “red” tree.

Inner SyntaxNodes represent only structural information, but can hold additional, user-defined data. Leaf SyntaxTokens represent individual pieces of source text. Use SyntaxNode::new_root and SyntaxNode::new_root_with_resolver to construct a syntax tree on top of a green tree.

Structs

  • Syntax tree node that is guaranteed to belong to a tree that contains an associated Resolver.
  • Syntax tree token that is guaranteed to belong to a tree that contains an associated Resolver.
  • An iterator over the children of a SyntaxNode.
  • Inner syntax tree node. Syntax nodes can be shared between threads. Every syntax tree is reference counted as a whole and nodes are pointer-sized, so copying individual nodes is relatively cheap.
  • An iterator over the child nodes of a SyntaxNode.
  • An efficient representation of the text that is covered by a SyntaxNode, i.e. the combined source text of all tokens that are descendants of the node.
  • Syntax tree token.

Type Definitions

  • An element of the tree that is guaranteed to belong to a tree that contains an associated Resolver, can be either a node or a token.
  • A reference to an element of the tree that is guaranteed to belong to a tree that contains an associated Resolver, can be either a reference to a node or one to a token.
  • An element of the tree, can be either a node or a token.
  • A reference to an element of the tree, can be either a reference to a node or one to a token.