Crate lexx [] [src]

Rust Lex

The goal of this crate is to make interacting with the AST construct parts of Rust a little easier. It is more or less a high level wrapping around the various syntex_syntax crates. Those crates have partially complete documentation. This crate is the result of a few days of trial and error.

Some of the public types will force you to jump into the syntex crates, but it should only be inspecting tokens/error messages.

Structs

Delimited

A delimited sequence of token trees

DiagnosticBuilder

Used for emitting structured error messages and other diagnostic information.

IOErr

The error type for I/O operations of the Read, Write, Seek, and associated traits.

Parser

Parser type

SequenceRepetition

A sequence of token trees

Enums

DelimToken

A delimiter token

Fault

Error Wrapper

Token
TokenTree

When the main rust parser encounters a syntax-extension invocation, it parses the arguments to the invocation as a token-tree. This is a very loose structure, such that all sorts of different AST-fragments can be passed to syntax extensions using a uniform type.

Functions

dr

For deconstructor a branch of TokenTree into a usable type

flatten_token_tree

Flatten TokenTree

sr

For deconstructor a branch of TokenTree into a usable type

tt

For dispatching to dr/sr for deconstructing TokenTrees