[−][src]Struct moore_vhdl::term::TermContext
A context within which termification can occur.
Fields
ctx: C
The underlying scoreboard context.
scope: S
The scope within which the terms will resolve their names.
Implementations
impl<C, S, D> TermContext<C, S, D>
[src]
pub fn fold<'t>(&self, term: Spanned<Term<'t>>) -> Spanned<Term<'t>>
[src]
Perform term folding.
This is a post-processing step that should be applied to all terms once
they are constructed. Folding applies transformations to the terms, e.g.
changing Ident(Type|Subtype)
to TypeMark
, or gobbling up subtype
constraints where appropriate.
impl<'a, C, S, D> TermContext<C, S, D> where
Self: DefSpecificTermContext<'a, D>,
Self: ScopeSpecificTermContext<'a, S, D>,
C: DiagEmitter + Copy,
S: Copy,
D: Copy,
[src]
Self: DefSpecificTermContext<'a, D>,
Self: ScopeSpecificTermContext<'a, S, D>,
C: DiagEmitter + Copy,
S: Copy,
D: Copy,
pub fn termify_literal(
&self,
ast: Spanned<&Literal>
) -> Result<Spanned<Term<'a>>>
[src]
&self,
ast: Spanned<&Literal>
) -> Result<Spanned<Term<'a>>>
Map an AST literal to a term.
pub fn ensure_resolved<'t>(
&self,
term: Spanned<Term<'t>>
) -> Result<Spanned<Term<'t>>>
[src]
&self,
term: Spanned<Term<'t>>
) -> Result<Spanned<Term<'t>>>
Make sure the term is not an unresolved name.
This function emits a diagnostic if the term is Term::Unresolved(..)
.
It is non-recursive.
pub fn termify_compound_name(
&self,
ast: &CompoundName
) -> Result<Spanned<Term<'a>>>
[src]
&self,
ast: &CompoundName
) -> Result<Spanned<Term<'a>>>
Map an AST compound name to a term.
pub fn termify_name(
&self,
name: Spanned<ResolvableName>
) -> Result<Spanned<Term<'a>>>
[src]
&self,
name: Spanned<ResolvableName>
) -> Result<Spanned<Term<'a>>>
Map a resolvable name to a term.
This function is the bottom of the pit. Names are resolved here and mapped to the corresponding term. Calling functions may then proceed to handle the term as they see fit, usually inspecting what exact kind the term is of.
pub fn termify_paren_elems(
&self,
elems: &ParenElems
) -> Result<Spanned<Term<'a>>>
[src]
&self,
elems: &ParenElems
) -> Result<Spanned<Term<'a>>>
Map multiple parenthesis elements to a term.
pub fn termify_subtype_ind(
&self,
subty: &SubtypeInd
) -> Result<Spanned<Term<'a>>>
[src]
&self,
subty: &SubtypeInd
) -> Result<Spanned<Term<'a>>>
Map an AST subtype indication to a term.
pub fn termify_expr(&self, ast: &Expr) -> Result<Spanned<Term<'a>>>
[src]
Map an AST expression to a term.
impl<'sbc, 'lazy, 'sb, 'ast, 'ctx> TermContext<&'sbc ScoreContext<'lazy, 'sb, 'ast, 'ctx>, ScopeRef, Def> where
'lazy: 'sbc,
'sb: 'lazy,
'ast: 'sb,
'ctx: 'sb,
[src]
'lazy: 'sbc,
'sb: 'lazy,
'ast: 'sb,
'ctx: 'sb,
pub fn new(
ctx: &'sbc ScoreContext<'lazy, 'sb, 'ast, 'ctx>,
scope: ScopeRef
) -> Self
[src]
ctx: &'sbc ScoreContext<'lazy, 'sb, 'ast, 'ctx>,
scope: ScopeRef
) -> Self
Create a new termification context.
pub fn termify_latent_name(
&self,
name: LatentName<'ast>
) -> Result<Spanned<Term<'_>>>
[src]
&self,
name: LatentName<'ast>
) -> Result<Spanned<Term<'_>>>
Map a latent name to a term.
pub fn term_to_expr(&self, term: Spanned<Term<'_>>) -> Result<ExprRef>
[src]
Map a term to an expression and schedule the necessary tasks.
pub fn term_to_expr_spanned(
&self,
term: Spanned<Term<'_>>
) -> Result<Spanned<ExprRef>>
[src]
&self,
term: Spanned<Term<'_>>
) -> Result<Spanned<ExprRef>>
Same as term_to_expr
, but the result is spanned.
pub fn term_to_expr_raw(&self, term: Spanned<Term<'_>>) -> Result<Expr>
[src]
Map a term to an expression.
pub fn term_to_type_mark(
&self,
term: Spanned<Term<'_>>
) -> Result<Spanned<TypeMarkRef>>
[src]
&self,
term: Spanned<Term<'_>>
) -> Result<Spanned<TypeMarkRef>>
Map a term to a type mark.
pub fn fold_term_as_type<'t>(
&self,
term: Spanned<Term<'t>>
) -> Result<Spanned<Term<'t>>>
[src]
&self,
term: Spanned<Term<'t>>
) -> Result<Spanned<Term<'t>>>
Perform term folding expecting to yield a type.
This is a pre-processing step on terms. It is applied as soon as it is
clear that a certain term should yield a type, e.g. when mapping to a
subtype indication. This function performs certain precedence swaps and
combines terms into higher level ones, e.g. Term::SubtypeInd
.
pub fn term_to_subtype_ind(
&self,
term: Spanned<Term<'_>>
) -> Result<Spanned<SubtypeInd>>
[src]
&self,
term: Spanned<Term<'_>>
) -> Result<Spanned<SubtypeInd>>
Map a term to a subtype indication.
pub fn term_to_resolution_indication(
&self,
term: Spanned<Term<'_>>
) -> Result<Spanned<()>>
[src]
&self,
term: Spanned<Term<'_>>
) -> Result<Spanned<()>>
Map a term to a resolution indication.
pub fn term_to_constraint(
&self,
term: Spanned<Term<'_>>
) -> Result<Spanned<Constraint>>
[src]
&self,
term: Spanned<Term<'_>>
) -> Result<Spanned<Constraint>>
Map a term to a constraint.
pub fn term_to_array_constraint(
&self,
span: Span,
terms: Vec<Spanned<Term<'_>>>,
elem: Option<Spanned<Term<'_>>>
) -> Result<Spanned<ArrayConstraint>>
[src]
&self,
span: Span,
terms: Vec<Spanned<Term<'_>>>,
elem: Option<Spanned<Term<'_>>>
) -> Result<Spanned<ArrayConstraint>>
Map a term to an array constraint.
pub fn term_to_record_constraint(
&self,
span: Span,
terms: Vec<Spanned<Term<'_>>>
) -> Result<Spanned<RecordConstraint>>
[src]
&self,
span: Span,
terms: Vec<Spanned<Term<'_>>>
) -> Result<Spanned<RecordConstraint>>
Map a term to a record constraint.
pub fn term_to_element_constraint(
&self,
term: Spanned<Term<'_>>
) -> Result<Spanned<ElementConstraint>>
[src]
&self,
term: Spanned<Term<'_>>
) -> Result<Spanned<ElementConstraint>>
Map a term to an element constraint.
pub fn term_to_discrete_range(
&self,
term: Spanned<Term<'_>>
) -> Result<Spanned<DiscreteRange>>
[src]
&self,
term: Spanned<Term<'_>>
) -> Result<Spanned<DiscreteRange>>
Map a term to a discrete range.
pub fn term_to_range(&self, term: Spanned<Term<'_>>) -> Result<Spanned<Range>>
[src]
Map a term to a range.
pub fn term_to_ident(&self, term: Spanned<Term<'_>>) -> Result<Spanned<Def>>
[src]
Map a term to a definition.
This works for terms that are actually identifiers.
pub fn term_to_label(&self, term: Spanned<Term<'_>>) -> Result<Spanned<StmtRef>>
[src]
Map a term to a label.
Returns the statement the label refers to.
pub fn term_to_signal(
&self,
term: Spanned<Term<'_>>
) -> Result<Spanned<SignalRef>>
[src]
&self,
term: Spanned<Term<'_>>
) -> Result<Spanned<SignalRef>>
Map a term to a signal.
pub fn term_to_choice(&self, term: Spanned<Term<'_>>) -> Result<Spanned<Choice>>
[src]
Map a term to a choice.
See IEEE 1076-2008 section 9.3.3.1. A choice can be a simple expression,
a discrete range, an identifier, or the keyword others
.
pub fn term_to_aggregate(
&self,
term: Spanned<Term<'_>>
) -> Result<Spanned<AggregateRef>>
[src]
&self,
term: Spanned<Term<'_>>
) -> Result<Spanned<AggregateRef>>
Map a term to an aggregate.
See IEEE 1076-2008 section 9.3.3.1.
pub fn term_to_assoc_list(
&self,
term: Spanned<Term<'_>>
) -> Result<Spanned<AssocList>>
[src]
&self,
term: Spanned<Term<'_>>
) -> Result<Spanned<AssocList>>
Map a term to an association list.
See IEEE 1076-2008 section 6.5.7.
pub fn term_to_assoc_actual(
&self,
term: Spanned<Term<'_>>
) -> Result<Spanned<AssocActual>>
[src]
&self,
term: Spanned<Term<'_>>
) -> Result<Spanned<AssocActual>>
Map a term to an association actual.
impl<'t> TermContext<AllocContext<'t>, &'t ScopeData<'t>, Def2<'t>>
[src]
pub fn new2(ctx: AllocContext<'t>) -> Self
[src]
Create a new termification context.
Trait Implementations
impl<'t, C: DiagEmitter, S> DefSpecificTermContext<'t, Def> for TermContext<C, S, Def>
[src]
fn termify_defs(
&self,
name: Spanned<ResolvableName>,
defs: Vec<Spanned<Def>>
) -> Result<Spanned<Term<'t>>>
[src]
&self,
name: Spanned<ResolvableName>,
defs: Vec<Spanned<Def>>
) -> Result<Spanned<Term<'t>>>
impl<'t, C: DiagEmitter, S> DefSpecificTermContext<'t, Def2<'t>> for TermContext<C, S, Def2<'t>>
[src]
fn termify_defs(
&self,
name: Spanned<ResolvableName>,
defs: Vec<Spanned<Def2<'t>>>
) -> Result<Spanned<Term<'t>>>
[src]
&self,
name: Spanned<ResolvableName>,
defs: Vec<Spanned<Def2<'t>>>
) -> Result<Spanned<Term<'t>>>
impl<C: DiagEmitter, S, D> DiagEmitter for TermContext<C, S, D>
[src]
fn emit(&self, diag: DiagBuilder2)
[src]
impl<'t> ScopeSpecificTermContext<'t, &'t ScopeData<'t>, Def2<'t>> for TermContext<AllocContext<'t>, &'t ScopeData<'t>, Def2<'t>>
[src]
fn termify_name_in_scope(
&self,
name: Spanned<ResolvableName>,
scope: &'t ScopeData<'t>
) -> Result<Spanned<Term<'t>>>
[src]
&self,
name: Spanned<ResolvableName>,
scope: &'t ScopeData<'t>
) -> Result<Spanned<Term<'t>>>
Map a resolvable name to a term, resolving it within a scope.
fn maybe_selectable_scope(&self, term: &Term<'t>) -> Option<&'t ScopeData<'t>>
[src]
impl<'t, 'sbc, 'lazy, 'sb, 'ast, 'ctx> ScopeSpecificTermContext<'t, ScopeRef, Def> for TermContext<&'sbc ScoreContext<'lazy, 'sb, 'ast, 'ctx>, ScopeRef, Def> where
'lazy: 'sbc,
'sb: 'lazy,
'ast: 'sb,
'ctx: 'sb,
[src]
'lazy: 'sbc,
'sb: 'lazy,
'ast: 'sb,
'ctx: 'sb,
fn termify_name_in_scope(
&self,
name: Spanned<ResolvableName>,
scope: ScopeRef
) -> Result<Spanned<Term<'t>>>
[src]
&self,
name: Spanned<ResolvableName>,
scope: ScopeRef
) -> Result<Spanned<Term<'t>>>
Map a resolvable name to a term, resolving it within a scope.
fn maybe_selectable_scope(&self, term: &Term<'t>) -> Option<ScopeRef>
[src]
Auto Trait Implementations
impl<C, S, D> RefUnwindSafe for TermContext<C, S, D> where
C: RefUnwindSafe,
D: RefUnwindSafe,
S: RefUnwindSafe,
C: RefUnwindSafe,
D: RefUnwindSafe,
S: RefUnwindSafe,
impl<C, S, D> Send for TermContext<C, S, D> where
C: Send,
D: Send,
S: Send,
C: Send,
D: Send,
S: Send,
impl<C, S, D> Sync for TermContext<C, S, D> where
C: Sync,
D: Sync,
S: Sync,
C: Sync,
D: Sync,
S: Sync,
impl<C, S, D> Unpin for TermContext<C, S, D> where
C: Unpin,
D: Unpin,
S: Unpin,
C: Unpin,
D: Unpin,
S: Unpin,
impl<C, S, D> UnwindSafe for TermContext<C, S, D> where
C: UnwindSafe,
D: UnwindSafe,
S: UnwindSafe,
C: UnwindSafe,
D: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,