Module syntex_syntax::ast [] [src]

Reexports

pub use self::BinOp_::*;
pub use self::BlockCheckMode::*;
pub use self::CaptureClause::*;
pub use self::Decl_::*;
pub use self::ExplicitSelf_::*;
pub use self::Expr_::*;
pub use self::FloatTy::*;
pub use self::FunctionRetTy::*;
pub use self::ForeignItem_::*;
pub use self::IntTy::*;
pub use self::Item_::*;
pub use self::KleeneOp::*;
pub use self::Lit_::*;
pub use self::LitIntType::*;
pub use self::MacStmtStyle::*;
pub use self::MetaItem_::*;
pub use self::Mutability::*;
pub use self::Pat_::*;
pub use self::PathListItem_::*;
pub use self::PrimTy::*;
pub use self::Sign::*;
pub use self::Stmt_::*;
pub use self::StrStyle::*;
pub use self::StructFieldKind::*;
pub use self::TraitItem_::*;
pub use self::Ty_::*;
pub use self::TyParamBound::*;
pub use self::UintTy::*;
pub use self::UnOp::*;
pub use self::UnsafeSource::*;
pub use self::ViewPath_::*;
pub use self::Visibility::*;
pub use self::PathParameters::*;

Structs

AngleBracketedParameterData

A path like Foo<'a, T>

Arg

represents an argument in a function header

Arm

represents one arm of a 'match'

AttrId
Attribute_

Doc-comments are promoted to attributes that have is_sugared_doc = true

BareFnTy
Block
Crate
Delimited

A delimited sequence of token trees

EnumDef
Expr

An expression

Field
FieldPat

A single field in a struct pattern

FnDecl

Represents the header (not the body) of a function declaration

ForeignItem
ForeignMod
Generics

Represents lifetimes and type parameters attached to a declaration of a function, enum, trait, etc.

Ident

An identifier contains a Name (index into the interner table) and a SyntaxContext to track renaming and macro expansion per Flatt et al., "Macros That Work Together"

ImplItem
InlineAsm
InlineAsmOutput
Item

An item

Lifetime
LifetimeDef

A lifetime definition, eg 'a: 'b+'c+'d

Local

Local represents a let statement, e.g., let <pat>:<ty> = <expr>;

Mac_

Represents a macro invocation. The Path indicates which macro is being invoked, and the vector of token-trees contains the source of the macro invocation.

MacroDef

A macro definition, in this crate or imported from another.

MethodSig

Represents a method's signature in a trait declaration, or in an implementation.

Mod
MutTy
Name

A name is a part of an identifier, representing a string or gensym. It's the result of interning.

ParenthesizedParameterData

A path like Foo(A,B) -> C

Pat
Path

A "Path" is essentially Rust's notion of a name; for instance: std::cmp::PartialEq . It's represented as a sequence of identifiers, along with a bunch of supporting information.

PathSegment

A segment of a path: an identifier, an optional lifetime, and a set of types.

PolyTraitRef
QSelf

The explicit Self type in a "qualified path". The actual path, including the trait and the associated item, is stored separately. position represents the index of the associated item qualified with this Self type.

SequenceRepetition

A sequence of token treesee

StructField_
SyntaxContext

A SyntaxContext represents a chain of macro-expandings and renamings. Each macro expansion corresponds to a fresh u32. This u32 is a reference to a table stored

TraitItem

Represents a method declaration in a trait declaration, possibly including a default implementation A trait method is either required (meaning it doesn't have an implementation, just a signature) or provided (meaning it has a default implementation).

TraitRef

TraitRef's appear in impls.

Ty
TyParam
TypeBinding
Variant_
WhereBoundPredicate

A type bound, eg for<'c> Foo: Send+Clone+'c

WhereClause

A where clause in a definition

WhereEqPredicate

An equality predicate (unsupported), e.g. T=int

WhereRegionPredicate

A lifetime predicate, e.g. 'a: 'b+'c

Enums

AsmDialect
AttrStyle

Distinguishes between Attributes that decorate items and Attributes that are contained as statements within items. These two cases need to be distinguished for pretty-printing.

BinOp_
BindingMode
BlockCheckMode
CaptureClause
Constness
Decl_
ExplicitSelf_

Represents the kind of 'self' associated with a method

Expr_
FloatTy
ForeignItem_

An item within an extern block

FunctionRetTy
ImplItemKind
ImplPolarity
IntTy
Item_
KleeneOp

A Kleene-style repetition operator for token sequences.

LitIntType
Lit_
MacStmtStyle
MetaItem_
Mutability
Pat_
PathListItem_
PathParameters
PrimTy

Not represented directly in the AST, referred to by name through a ty_path.

Sign
Stmt_
StrStyle
StructFieldKind
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.

TraitBoundModifier

A modifier on a bound, currently this is only used for ?Sized, where the modifier is Maybe. Negative bounds should also be handled here.

TraitItem_
TyParamBound

The AST represents all type param bounds as types. typeck::collect::compute_bounds matches these against the "special" built-in traits (see middle::lang_items) and detects Copy, Send and Sync.

Ty_

The different kinds of types recognized by the compiler

UintTy
UnOp
UnsafeSource
Unsafety
VariantData

Fields and Ids of enum variants and structs

ViewPath_
Visibility
WherePredicate

A single predicate in a where clause

Constants

CRATE_NODE_ID

Node id used to represent the root of the crate.

DUMMY_NODE_ID

When parsing and doing expansions, we initially give all AST nodes this AST node value. Then later, in the renumber pass, we renumber them to have small, positive ids.

EMPTY_CTXT

Traits

IntSign
NodeIdAssigner

Type Definitions

Attribute

Meta-data associated with an item

BinOp
CrateConfig

The set of MetaItems that define the compilation environment of the crate, used to drive conditional compilation

CrateNum
Decl
ExplicitSelf
Lit

A literal

Mac
MetaItem
Mrk

A mark represents a unique id associated with a macro expansion

NodeId
PathListItem
SpannedIdent
Stmt

A statement

StructField
TyParamBounds
Variant
ViewPath