[][src]Struct moore_vhdl::add_ctx::AddContext

pub struct AddContext<'sbc, 'lazy: 'sbc, 'sb: 'lazy, 'ast: 'sb, 'ctx: 'sb> {
    pub ctx: &'sbc ScoreContext<'lazy, 'sb, 'ast, 'ctx>,
    pub scope: ScopeRef,
}

A context within which nodes can be added.

See the module documentation for details.

Fields

ctx: &'sbc ScoreContext<'lazy, 'sb, 'ast, 'ctx>

The outer context.

scope: ScopeRef

The scope to which items will be added.

Implementations

impl<'sbc, 'lazy, 'sb, 'ast, 'ctx> AddContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>[src]

pub fn new(
    ctx: &'sbc ScoreContext<'lazy, 'sb, 'ast, 'ctx>,
    scope: ScopeRef
) -> AddContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>
[src]

Create a new context.

pub fn with_scope(
    &self,
    scope: ScopeRef
) -> AddContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>
[src]

Create a new context with different scope.

pub fn make<I>(
    &self,
    span: Span
) -> (MakeContext<'sbc, 'lazy, 'sb, 'ast, 'ctx, I>, I, ScopeRef) where
    I: NodeRef
[src]

Create a new context for describing a node.

pub fn unimp<T, R>(&self, node: &T) -> Result<R> where
    T: HasSpan + HasDesc
[src]

Emit a diagnostic that a node is not implemented.

pub fn add_optional<T, F, R>(
    &self,
    node: &'ast Option<T>,
    f: F
) -> Result<Option<R>> where
    F: FnOnce(&Self, &'ast T) -> Result<R>, 
[src]

Add an optional node.

This convenience function performs a few things at a time. First it applies a closure f to the value of an option, returning an error if the closure returns one. Otherwise it wraps the result in an option and returns it.

impl<'sbc, 'lazy, 'sb, 'ast, 'ctx> AddContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>[src]

pub fn add_expr(&self, expr: &'ast Expr) -> Result<ExprRef>[src]

Add an expression.

pub fn add_expr_hir(&self, hir: Expr) -> Result<ExprRef>[src]

Add an expression already lowered to HIR.

pub fn schedule_expr(&self, mk: &MakeContext<'_, '_, '_, '_, '_, ExprRef>)[src]

Schedule expression tasks.

pub fn add_choices<I>(&self, ast: Spanned<I>) -> Result<Spanned<Choices>> where
    I: IntoIterator<Item = &'ast Expr>, 
[src]

Add a list of choices.

pub fn add_discrete_range(
    &self,
    ast: &'ast Expr
) -> Result<Spanned<DiscreteRange>>
[src]

Add a discrete range.

pub fn add_aggregate_hir(&self, hir: Aggregate) -> Result<AggregateRef>[src]

Add an aggregate already lowered to HIR.

pub fn schedule_aggregate(
    &self,
    mk: &MakeContext<'_, '_, '_, '_, '_, AggregateRef>
)
[src]

Schedule aggregate tasks.

impl<'sbc, 'lazy, 'sb, 'ast, 'ctx> AddContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>[src]

pub fn add_subtype_ind(&self, ind: &'ast SubtypeInd) -> Result<SubtypeIndRef>[src]

Add a subtype indication.

pub fn add_subtype_ind_hir(&self, hir: SubtypeInd) -> Result<SubtypeIndRef>[src]

Add a subtype indication already lowered to HIR.

pub fn schedule_subtype_ind(
    &self,
    mk: &MakeContext<'_, '_, '_, '_, '_, SubtypeIndRef>
)
[src]

Schedule subtype indication tasks.

impl<'sbc, 'lazy, 'sb, 'ast, 'ctx> AddContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>[src]

pub fn add_const_decl<I>(&self, decl: &'ast ObjDecl) -> Result<Vec<I>> where
    I: From<ConstDeclRef>, 
[src]

Add a constant declaration.

pub fn add_signal_decl<I>(&self, decl: &'ast ObjDecl) -> Result<Vec<I>> where
    I: From<SignalDeclRef>, 
[src]

Add a signal declaration.

pub fn add_var_decl<I>(&self, decl: &'ast ObjDecl) -> Result<Vec<I>> where
    I: From<VarDeclRef>, 
[src]

Add a variable declaration.

pub fn add_file_decl<I>(&self, decl: &'ast ObjDecl) -> Result<Vec<I>> where
    I: From<FileDeclRef>, 
[src]

Add a file declaration.

impl<'sbc, 'lazy, 'sb, 'ast, 'ctx> AddContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>[src]

pub fn add_seq_stmts<I, B>(&self, stmts: I, container_name: &str) -> Result<B> where
    I: IntoIterator<Item = &'ast Stmt>,
    B: FromIterator<SeqStmtRef>, 
[src]

Add multiple sequential statements.

pub fn add_seq_stmt(
    &self,
    stmt: &'ast Stmt,
    container_name: &str
) -> Result<SeqStmtRef>
[src]

Add a sequential statement.

pub fn add_wait_stmt(&self, stmt: &'ast Stmt) -> Result<WaitStmtRef>[src]

Add a wait statement.

pub fn add_assert_stmt(&self, stmt: &'ast Stmt) -> Result<AssertStmtRef>[src]

Add an assert statement.

pub fn add_report_stmt(&self, stmt: &'ast Stmt) -> Result<ReportStmtRef>[src]

Add a report statement.

pub fn add_sig_assign_stmt(&self, stmt: &'ast Stmt) -> Result<SigAssignStmtRef>[src]

Add a sig_assign statement.

pub fn add_var_assign_stmt(&self, stmt: &'ast Stmt) -> Result<VarAssignStmtRef>[src]

Add a var_assign statement.

pub fn add_call_stmt(&self, stmt: &'ast Stmt) -> Result<CallStmtRef>[src]

Add a call statement.

pub fn add_if_stmt(&self, stmt: &'ast Stmt) -> Result<IfStmtRef>[src]

Add an if statement.

pub fn add_case_stmt(&self, stmt: &'ast Stmt) -> Result<CaseStmtRef>[src]

Add a case statement.

pub fn add_loop_stmt(&self, stmt: &'ast Stmt) -> Result<LoopStmtRef>[src]

Add a while loop statement.

pub fn add_nexit_stmt(&self, stmt: &'ast Stmt) -> Result<NexitStmtRef>[src]

Add a next statement.

pub fn add_return_stmt(&self, stmt: &'ast Stmt) -> Result<ReturnStmtRef>[src]

Add a return statement.

pub fn add_null_stmt(&self, stmt: &'ast Stmt) -> Result<NullStmtRef>[src]

Add a null statement.

pub fn add_sensitivity_list<I>(
    &self,
    ast: Spanned<I>
) -> Result<Spanned<SensitivityList>> where
    I: IntoIterator<Item = &'ast CompoundName>, 
[src]

Add a sensitivity list.

pub fn add_label(&self, ast: &'ast Spanned<Name>) -> Result<Spanned<StmtRef>>[src]

Add a label.

Immediately resolves the label name and returns the corresponding statement.

pub fn add_target(
    &self,
    ast: &'ast Spanned<AssignTarget>
) -> Result<Spanned<Target>>
[src]

Add a target variable.

This is an target for a variable assignment.

impl<'sbc, 'lazy, 'sb, 'ast, 'ctx> AddContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>[src]

pub fn add_type_decl(&self, decl: &'ast TypeDecl) -> Result<TypeDeclRef>[src]

Add a type declaration.

pub fn add_type_data(
    &self,
    id: TypeDeclRef,
    name: Spanned<Name>,
    data: &'ast Spanned<TypeData>
) -> Result<Spanned<TypeData>>
[src]

Add a type definition.

Trait Implementations

impl<'sbc, 'lazy: 'sbc, 'sb: 'lazy, 'ast: 'sb, 'ctx: 'sb> Clone for AddContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>[src]

impl<'sbc, 'lazy: 'sbc, 'sb: 'lazy, 'ast: 'sb, 'ctx: 'sb> Copy for AddContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>[src]

impl<'sbc, 'lazy, 'sb, 'ast, 'ctx> DiagEmitter for AddContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>[src]

Auto Trait Implementations

impl<'sbc, 'lazy, 'sb, 'ast, 'ctx> !RefUnwindSafe for AddContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>

impl<'sbc, 'lazy, 'sb, 'ast, 'ctx> !Send for AddContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>

impl<'sbc, 'lazy, 'sb, 'ast, 'ctx> !Sync for AddContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>

impl<'sbc, 'lazy, 'sb, 'ast, 'ctx> Unpin for AddContext<'sbc, 'lazy, 'sb, 'ast, 'ctx> where
    'ast: 'sbc,
    'ctx: 'sbc,
    'lazy: 'sbc,
    'sb: 'sbc, 

impl<'sbc, 'lazy, 'sb, 'ast, 'ctx> !UnwindSafe for AddContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.