Module cstree::syntax[][src]

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

ResolvedNode

Syntax tree node that is guaranteed to belong to a tree that contains an associated Resolver.

ResolvedToken

Syntax tree token that is guaranteed to belong to a tree that contains an associated Resolver.

SyntaxElementChildren

An iterator over the children of a SyntaxNode.

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.

SyntaxNodeChildren

An iterator over the child nodes of a SyntaxNode.

SyntaxText

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.

SyntaxToken

Syntax tree token.

Type Definitions

ResolvedElement

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.

ResolvedElementRef

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.

SyntaxElement

An element of the tree, can be either a node or a token.

SyntaxElementRef

A reference to an element of the tree, can be either a reference to a node or one to a token.