Trait syntax::ext::build::AstBuilder[src]
pub trait AstBuilder {
fn path(&self, span: Span, strs: Vec<Ident>) -> Path;
fn path_ident(&self, span: Span, id: Ident) -> Path;
fn path_global(&self, span: Span, strs: Vec<Ident>) -> Path;
fn path_all(&self, sp: Span, global: bool, idents: Vec<Ident>, lifetimes: Vec<Lifetime>, types: Vec<P<Ty>>) -> Path;
fn ty_mt(&self, ty: P<Ty>, mutbl: Mutability) -> MutTy;
fn ty(&self, span: Span, ty: Ty_) -> P<Ty>;
fn ty_path(&self, Path, Option<OwnedSlice<TyParamBound>>) -> P<Ty>;
fn ty_ident(&self, span: Span, idents: Ident) -> P<Ty>;
fn ty_rptr(&self, span: Span, ty: P<Ty>, lifetime: Option<Lifetime>, mutbl: Mutability) -> P<Ty>;
fn ty_uniq(&self, span: Span, ty: P<Ty>) -> P<Ty>;
fn ty_option(&self, ty: P<Ty>) -> P<Ty>;
fn ty_infer(&self, sp: Span) -> P<Ty>;
fn ty_nil(&self) -> P<Ty>;
fn ty_vars(&self, ty_params: &OwnedSlice<TyParam>) -> Vec<P<Ty>>;
fn ty_vars_global(&self, ty_params: &OwnedSlice<TyParam>) -> Vec<P<Ty>>;
fn ty_field_imm(&self, span: Span, name: Ident, ty: P<Ty>) -> TypeField;
fn strip_bounds(&self, bounds: &Generics) -> Generics;
fn typaram(&self, span: Span, id: Ident, sized: Sized, bounds: OwnedSlice<TyParamBound>, default: Option<P<Ty>>) -> TyParam;
fn trait_ref(&self, path: Path) -> TraitRef;
fn typarambound(&self, path: Path) -> TyParamBound;
fn lifetime(&self, span: Span, ident: Name) -> Lifetime;
fn stmt_expr(&self, expr: Gc<Expr>) -> Gc<Stmt>;
fn stmt_let(&self, sp: Span, mutbl: bool, ident: Ident, ex: Gc<Expr>) -> Gc<Stmt>;
fn stmt_let_typed(&self, sp: Span, mutbl: bool, ident: Ident, typ: P<Ty>, ex: Gc<Expr>) -> Gc<Stmt>;
fn stmt_item(&self, sp: Span, item: Gc<Item>) -> Gc<Stmt>;
fn block(&self, span: Span, stmts: Vec<Gc<Stmt>>, expr: Option<Gc<Expr>>) -> P<Block>;
fn block_expr(&self, expr: Gc<Expr>) -> P<Block>;
fn block_all(&self, span: Span, view_items: Vec<ViewItem>, stmts: Vec<Gc<Stmt>>, expr: Option<Gc<Expr>>) -> P<Block>;
fn expr(&self, span: Span, node: Expr_) -> Gc<Expr>;
fn expr_path(&self, path: Path) -> Gc<Expr>;
fn expr_ident(&self, span: Span, id: Ident) -> Gc<Expr>;
fn expr_self(&self, span: Span) -> Gc<Expr>;
fn expr_binary(&self, sp: Span, op: BinOp, lhs: Gc<Expr>, rhs: Gc<Expr>) -> Gc<Expr>;
fn expr_deref(&self, sp: Span, e: Gc<Expr>) -> Gc<Expr>;
fn expr_unary(&self, sp: Span, op: UnOp, e: Gc<Expr>) -> Gc<Expr>;
fn expr_managed(&self, sp: Span, e: Gc<Expr>) -> Gc<Expr>;
fn expr_addr_of(&self, sp: Span, e: Gc<Expr>) -> Gc<Expr>;
fn expr_mut_addr_of(&self, sp: Span, e: Gc<Expr>) -> Gc<Expr>;
fn expr_field_access(&self, span: Span, expr: Gc<Expr>, ident: Ident) -> Gc<Expr>;
fn expr_call(&self, span: Span, expr: Gc<Expr>, args: Vec<Gc<Expr>>) -> Gc<Expr>;
fn expr_call_ident(&self, span: Span, id: Ident, args: Vec<Gc<Expr>>) -> Gc<Expr>;
fn expr_call_global(&self, sp: Span, fn_path: Vec<Ident>, args: Vec<Gc<Expr>>) -> Gc<Expr>;
fn expr_method_call(&self, span: Span, expr: Gc<Expr>, ident: Ident, args: Vec<Gc<Expr>>) -> Gc<Expr>;
fn expr_block(&self, b: P<Block>) -> Gc<Expr>;
fn expr_cast(&self, sp: Span, expr: Gc<Expr>, ty: P<Ty>) -> Gc<Expr>;
fn field_imm(&self, span: Span, name: Ident, e: Gc<Expr>) -> Field;
fn expr_struct(&self, span: Span, path: Path, fields: Vec<Field>) -> Gc<Expr>;
fn expr_struct_ident(&self, span: Span, id: Ident, fields: Vec<Field>) -> Gc<Expr>;
fn expr_lit(&self, sp: Span, lit: Lit_) -> Gc<Expr>;
fn expr_uint(&self, span: Span, i: uint) -> Gc<Expr>;
fn expr_int(&self, sp: Span, i: int) -> Gc<Expr>;
fn expr_u8(&self, sp: Span, u: u8) -> Gc<Expr>;
fn expr_bool(&self, sp: Span, value: bool) -> Gc<Expr>;
fn expr_vstore(&self, sp: Span, expr: Gc<Expr>, vst: ExprVstore) -> Gc<Expr>;
fn expr_vec(&self, sp: Span, exprs: Vec<Gc<Expr>>) -> Gc<Expr>;
fn expr_vec_ng(&self, sp: Span) -> Gc<Expr>;
fn expr_vec_slice(&self, sp: Span, exprs: Vec<Gc<Expr>>) -> Gc<Expr>;
fn expr_str(&self, sp: Span, s: InternedString) -> Gc<Expr>;
fn expr_str_uniq(&self, sp: Span, s: InternedString) -> Gc<Expr>;
fn expr_some(&self, sp: Span, expr: Gc<Expr>) -> Gc<Expr>;
fn expr_none(&self, sp: Span) -> Gc<Expr>;
fn expr_fail(&self, span: Span, msg: InternedString) -> Gc<Expr>;
fn expr_unreachable(&self, span: Span) -> Gc<Expr>;
fn expr_ok(&self, span: Span, expr: Gc<Expr>) -> Gc<Expr>;
fn expr_err(&self, span: Span, expr: Gc<Expr>) -> Gc<Expr>;
fn expr_try(&self, span: Span, head: Gc<Expr>) -> Gc<Expr>;
fn pat(&self, span: Span, pat: Pat_) -> Gc<Pat>;
fn pat_wild(&self, span: Span) -> Gc<Pat>;
fn pat_lit(&self, span: Span, expr: Gc<Expr>) -> Gc<Pat>;
fn pat_ident(&self, span: Span, ident: Ident) -> Gc<Pat>;
fn pat_ident_binding_mode(&self, span: Span, ident: Ident, bm: BindingMode) -> Gc<Pat>;
fn pat_enum(&self, span: Span, path: Path, subpats: Vec<Gc<Pat>>) -> Gc<Pat>;
fn pat_struct(&self, span: Span, path: Path, field_pats: Vec<FieldPat>) -> Gc<Pat>;
fn arm(&self, span: Span, pats: Vec<Gc<Pat>>, expr: Gc<Expr>) -> Arm;
fn arm_unreachable(&self, span: Span) -> Arm;
fn expr_match(&self, span: Span, arg: Gc<Expr>, arms: Vec<Arm>) -> Gc<Expr>;
fn expr_if(&self, span: Span, cond: Gc<Expr>, then: Gc<Expr>, els: Option<Gc<Expr>>) -> Gc<Expr>;
fn lambda_fn_decl(&self, span: Span, fn_decl: P<FnDecl>, blk: P<Block>) -> Gc<Expr>;
fn lambda(&self, span: Span, ids: Vec<Ident>, blk: P<Block>) -> Gc<Expr>;
fn lambda0(&self, span: Span, blk: P<Block>) -> Gc<Expr>;
fn lambda1(&self, span: Span, blk: P<Block>, ident: Ident) -> Gc<Expr>;
fn lambda_expr(&self, span: Span, ids: Vec<Ident>, blk: Gc<Expr>) -> Gc<Expr>;
fn lambda_expr_0(&self, span: Span, expr: Gc<Expr>) -> Gc<Expr>;
fn lambda_expr_1(&self, span: Span, expr: Gc<Expr>, ident: Ident) -> Gc<Expr>;
fn lambda_stmts(&self, span: Span, ids: Vec<Ident>, blk: Vec<Gc<Stmt>>) -> Gc<Expr>;
fn lambda_stmts_0(&self, span: Span, stmts: Vec<Gc<Stmt>>) -> Gc<Expr>;
fn lambda_stmts_1(&self, span: Span, stmts: Vec<Gc<Stmt>>, ident: Ident) -> Gc<Expr>;
fn item(&self, span: Span, name: Ident, attrs: Vec<Attribute>, node: Item_) -> Gc<Item>;
fn arg(&self, span: Span, name: Ident, ty: P<Ty>) -> Arg;
fn fn_decl(&self, inputs: Vec<Arg>, output: P<Ty>) -> P<FnDecl>;
fn item_fn_poly(&self, span: Span, name: Ident, inputs: Vec<Arg>, output: P<Ty>, generics: Generics, body: P<Block>) -> Gc<Item>;
fn item_fn(&self, span: Span, name: Ident, inputs: Vec<Arg>, output: P<Ty>, body: P<Block>) -> Gc<Item>;
fn variant(&self, span: Span, name: Ident, tys: Vec<P<Ty>>) -> Variant;
fn item_enum_poly(&self, span: Span, name: Ident, enum_definition: EnumDef, generics: Generics) -> Gc<Item>;
fn item_enum(&self, span: Span, name: Ident, enum_def: EnumDef) -> Gc<Item>;
fn item_struct_poly(&self, span: Span, name: Ident, struct_def: StructDef, generics: Generics) -> Gc<Item>;
fn item_struct(&self, span: Span, name: Ident, struct_def: StructDef) -> Gc<Item>;
fn item_mod(&self, span: Span, inner_span: Span, name: Ident, attrs: Vec<Attribute>, vi: Vec<ViewItem>, items: Vec<Gc<Item>>) -> Gc<Item>;
fn item_static(&self, span: Span, name: Ident, ty: P<Ty>, mutbl: Mutability, expr: Gc<Expr>) -> Gc<Item>;
fn item_ty_poly(&self, span: Span, name: Ident, ty: P<Ty>, generics: Generics) -> Gc<Item>;
fn item_ty(&self, span: Span, name: Ident, ty: P<Ty>) -> Gc<Item>;
fn attribute(&self, sp: Span, mi: Gc<MetaItem>) -> Attribute;
fn meta_word(&self, sp: Span, w: InternedString) -> Gc<MetaItem>;
fn meta_list(&self, sp: Span, name: InternedString, mis: Vec<Gc<MetaItem>>) -> Gc<MetaItem>;
fn meta_name_value(&self, sp: Span, name: InternedString, value: Lit_) -> Gc<MetaItem>;
fn view_use(&self, sp: Span, vis: Visibility, vp: Gc<ViewPath>) -> ViewItem;
fn view_use_simple(&self, sp: Span, vis: Visibility, path: Path) -> ViewItem;
fn view_use_simple_(&self, sp: Span, vis: Visibility, ident: Ident, path: Path) -> ViewItem;
fn view_use_list(&self, sp: Span, vis: Visibility, path: Vec<Ident>, imports: &[Ident]) -> ViewItem;
fn view_use_glob(&self, sp: Span, vis: Visibility, path: Vec<Ident>) -> ViewItem;
}
Required Methods
fn path(&self, span: Span, strs: Vec<Ident>) -> Path
fn path_ident(&self, span: Span, id: Ident) -> Path
fn path_global(&self, span: Span, strs: Vec<Ident>) -> Path
fn path_all(&self, sp: Span, global: bool, idents: Vec<Ident>, lifetimes: Vec<Lifetime>, types: Vec<P<Ty>>) -> Path
fn ty_mt(&self, ty: P<Ty>, mutbl: Mutability) -> MutTy
fn ty(&self, span: Span, ty: Ty_) -> P<Ty>
fn ty_path(&self, Path, Option<OwnedSlice<TyParamBound>>) -> P<Ty>
fn ty_ident(&self, span: Span, idents: Ident) -> P<Ty>
fn ty_rptr(&self, span: Span, ty: P<Ty>, lifetime: Option<Lifetime>, mutbl: Mutability) -> P<Ty>
fn ty_uniq(&self, span: Span, ty: P<Ty>) -> P<Ty>
fn ty_option(&self, ty: P<Ty>) -> P<Ty>
fn ty_infer(&self, sp: Span) -> P<Ty>
fn ty_nil(&self) -> P<Ty>
fn ty_vars(&self, ty_params: &OwnedSlice<TyParam>) -> Vec<P<Ty>>
fn ty_vars_global(&self, ty_params: &OwnedSlice<TyParam>) -> Vec<P<Ty>>
fn ty_field_imm(&self, span: Span, name: Ident, ty: P<Ty>) -> TypeField
fn strip_bounds(&self, bounds: &Generics) -> Generics
fn typaram(&self, span: Span, id: Ident, sized: Sized, bounds: OwnedSlice<TyParamBound>, default: Option<P<Ty>>) -> TyParam
fn trait_ref(&self, path: Path) -> TraitRef
fn typarambound(&self, path: Path) -> TyParamBound
fn lifetime(&self, span: Span, ident: Name) -> Lifetime
fn stmt_expr(&self, expr: Gc<Expr>) -> Gc<Stmt>
fn stmt_let(&self, sp: Span, mutbl: bool, ident: Ident, ex: Gc<Expr>) -> Gc<Stmt>
fn stmt_let_typed(&self, sp: Span, mutbl: bool, ident: Ident, typ: P<Ty>, ex: Gc<Expr>) -> Gc<Stmt>
fn stmt_item(&self, sp: Span, item: Gc<Item>) -> Gc<Stmt>
fn block(&self, span: Span, stmts: Vec<Gc<Stmt>>, expr: Option<Gc<Expr>>) -> P<Block>
fn block_expr(&self, expr: Gc<Expr>) -> P<Block>
fn block_all(&self, span: Span, view_items: Vec<ViewItem>, stmts: Vec<Gc<Stmt>>, expr: Option<Gc<Expr>>) -> P<Block>
fn expr(&self, span: Span, node: Expr_) -> Gc<Expr>
fn expr_path(&self, path: Path) -> Gc<Expr>
fn expr_ident(&self, span: Span, id: Ident) -> Gc<Expr>
fn expr_self(&self, span: Span) -> Gc<Expr>
fn expr_binary(&self, sp: Span, op: BinOp, lhs: Gc<Expr>, rhs: Gc<Expr>) -> Gc<Expr>
fn expr_deref(&self, sp: Span, e: Gc<Expr>) -> Gc<Expr>
fn expr_unary(&self, sp: Span, op: UnOp, e: Gc<Expr>) -> Gc<Expr>
fn expr_managed(&self, sp: Span, e: Gc<Expr>) -> Gc<Expr>
fn expr_addr_of(&self, sp: Span, e: Gc<Expr>) -> Gc<Expr>
fn expr_mut_addr_of(&self, sp: Span, e: Gc<Expr>) -> Gc<Expr>
fn expr_field_access(&self, span: Span, expr: Gc<Expr>, ident: Ident) -> Gc<Expr>
fn expr_call(&self, span: Span, expr: Gc<Expr>, args: Vec<Gc<Expr>>) -> Gc<Expr>
fn expr_call_ident(&self, span: Span, id: Ident, args: Vec<Gc<Expr>>) -> Gc<Expr>
fn expr_call_global(&self, sp: Span, fn_path: Vec<Ident>, args: Vec<Gc<Expr>>) -> Gc<Expr>
fn expr_method_call(&self, span: Span, expr: Gc<Expr>, ident: Ident, args: Vec<Gc<Expr>>) -> Gc<Expr>
fn expr_block(&self, b: P<Block>) -> Gc<Expr>
fn expr_cast(&self, sp: Span, expr: Gc<Expr>, ty: P<Ty>) -> Gc<Expr>
fn field_imm(&self, span: Span, name: Ident, e: Gc<Expr>) -> Field
fn expr_struct(&self, span: Span, path: Path, fields: Vec<Field>) -> Gc<Expr>
fn expr_struct_ident(&self, span: Span, id: Ident, fields: Vec<Field>) -> Gc<Expr>
fn expr_lit(&self, sp: Span, lit: Lit_) -> Gc<Expr>
fn expr_uint(&self, span: Span, i: uint) -> Gc<Expr>
fn expr_int(&self, sp: Span, i: int) -> Gc<Expr>
fn expr_u8(&self, sp: Span, u: u8) -> Gc<Expr>
fn expr_bool(&self, sp: Span, value: bool) -> Gc<Expr>
fn expr_vstore(&self, sp: Span, expr: Gc<Expr>, vst: ExprVstore) -> Gc<Expr>
fn expr_vec(&self, sp: Span, exprs: Vec<Gc<Expr>>) -> Gc<Expr>
fn expr_vec_ng(&self, sp: Span) -> Gc<Expr>
fn expr_vec_slice(&self, sp: Span, exprs: Vec<Gc<Expr>>) -> Gc<Expr>
fn expr_str(&self, sp: Span, s: InternedString) -> Gc<Expr>
fn expr_str_uniq(&self, sp: Span, s: InternedString) -> Gc<Expr>
fn expr_some(&self, sp: Span, expr: Gc<Expr>) -> Gc<Expr>
fn expr_none(&self, sp: Span) -> Gc<Expr>
fn expr_fail(&self, span: Span, msg: InternedString) -> Gc<Expr>
fn expr_unreachable(&self, span: Span) -> Gc<Expr>
fn expr_ok(&self, span: Span, expr: Gc<Expr>) -> Gc<Expr>
fn expr_err(&self, span: Span, expr: Gc<Expr>) -> Gc<Expr>
fn expr_try(&self, span: Span, head: Gc<Expr>) -> Gc<Expr>
fn pat(&self, span: Span, pat: Pat_) -> Gc<Pat>
fn pat_wild(&self, span: Span) -> Gc<Pat>
fn pat_lit(&self, span: Span, expr: Gc<Expr>) -> Gc<Pat>
fn pat_ident(&self, span: Span, ident: Ident) -> Gc<Pat>
fn pat_ident_binding_mode(&self, span: Span, ident: Ident, bm: BindingMode) -> Gc<Pat>
fn pat_enum(&self, span: Span, path: Path, subpats: Vec<Gc<Pat>>) -> Gc<Pat>
fn pat_struct(&self, span: Span, path: Path, field_pats: Vec<FieldPat>) -> Gc<Pat>
fn arm(&self, span: Span, pats: Vec<Gc<Pat>>, expr: Gc<Expr>) -> Arm
fn arm_unreachable(&self, span: Span) -> Arm
fn expr_match(&self, span: Span, arg: Gc<Expr>, arms: Vec<Arm>) -> Gc<Expr>
fn expr_if(&self, span: Span, cond: Gc<Expr>, then: Gc<Expr>, els: Option<Gc<Expr>>) -> Gc<Expr>
fn lambda_fn_decl(&self, span: Span, fn_decl: P<FnDecl>, blk: P<Block>) -> Gc<Expr>
fn lambda(&self, span: Span, ids: Vec<Ident>, blk: P<Block>) -> Gc<Expr>
fn lambda0(&self, span: Span, blk: P<Block>) -> Gc<Expr>
fn lambda1(&self, span: Span, blk: P<Block>, ident: Ident) -> Gc<Expr>
fn lambda_expr(&self, span: Span, ids: Vec<Ident>, blk: Gc<Expr>) -> Gc<Expr>
fn lambda_expr_0(&self, span: Span, expr: Gc<Expr>) -> Gc<Expr>
fn lambda_expr_1(&self, span: Span, expr: Gc<Expr>, ident: Ident) -> Gc<Expr>
fn lambda_stmts(&self, span: Span, ids: Vec<Ident>, blk: Vec<Gc<Stmt>>) -> Gc<Expr>
fn lambda_stmts_0(&self, span: Span, stmts: Vec<Gc<Stmt>>) -> Gc<Expr>
fn lambda_stmts_1(&self, span: Span, stmts: Vec<Gc<Stmt>>, ident: Ident) -> Gc<Expr>
fn item(&self, span: Span, name: Ident, attrs: Vec<Attribute>, node: Item_) -> Gc<Item>
fn arg(&self, span: Span, name: Ident, ty: P<Ty>) -> Arg
fn fn_decl(&self, inputs: Vec<Arg>, output: P<Ty>) -> P<FnDecl>
fn item_fn_poly(&self, span: Span, name: Ident, inputs: Vec<Arg>, output: P<Ty>, generics: Generics, body: P<Block>) -> Gc<Item>
fn item_fn(&self, span: Span, name: Ident, inputs: Vec<Arg>, output: P<Ty>, body: P<Block>) -> Gc<Item>
fn variant(&self, span: Span, name: Ident, tys: Vec<P<Ty>>) -> Variant
fn item_enum_poly(&self, span: Span, name: Ident, enum_definition: EnumDef, generics: Generics) -> Gc<Item>
fn item_enum(&self, span: Span, name: Ident, enum_def: EnumDef) -> Gc<Item>
fn item_struct_poly(&self, span: Span, name: Ident, struct_def: StructDef, generics: Generics) -> Gc<Item>
fn item_struct(&self, span: Span, name: Ident, struct_def: StructDef) -> Gc<Item>
fn item_mod(&self, span: Span, inner_span: Span, name: Ident, attrs: Vec<Attribute>, vi: Vec<ViewItem>, items: Vec<Gc<Item>>) -> Gc<Item>
fn item_static(&self, span: Span, name: Ident, ty: P<Ty>, mutbl: Mutability, expr: Gc<Expr>) -> Gc<Item>
fn item_ty_poly(&self, span: Span, name: Ident, ty: P<Ty>, generics: Generics) -> Gc<Item>
fn item_ty(&self, span: Span, name: Ident, ty: P<Ty>) -> Gc<Item>
fn attribute(&self, sp: Span, mi: Gc<MetaItem>) -> Attribute
fn meta_word(&self, sp: Span, w: InternedString) -> Gc<MetaItem>
fn meta_list(&self, sp: Span, name: InternedString, mis: Vec<Gc<MetaItem>>) -> Gc<MetaItem>
fn meta_name_value(&self, sp: Span, name: InternedString, value: Lit_) -> Gc<MetaItem>
fn view_use(&self, sp: Span, vis: Visibility, vp: Gc<ViewPath>) -> ViewItem
fn view_use_simple(&self, sp: Span, vis: Visibility, path: Path) -> ViewItem
fn view_use_simple_(&self, sp: Span, vis: Visibility, ident: Ident, path: Path) -> ViewItem
fn view_use_list(&self, sp: Span, vis: Visibility, path: Vec<Ident>, imports: &[Ident]) -> ViewItem
fn view_use_glob(&self, sp: Span, vis: Visibility, path: Vec<Ident>) -> ViewItem
Implementors
impl<'a> AstBuilder for ExtCtxt<'a>