Struct moore_vhdl::typeck::TypeckContext
[−]
[src]
pub struct TypeckContext<'sbc, 'lazy: 'sbc, 'sb: 'lazy, 'ast: 'sb, 'ctx: 'sb> { pub ctx: &'sbc ScoreContext<'lazy, 'sb, 'ast, 'ctx>, // some fields omitted }
A context to typecheck things in.
This context helps checking the types of things and keeping track of errors.
Fields
ctx: &'sbc ScoreContext<'lazy, 'sb, 'ast, 'ctx>
The parent context.
Methods
impl<'sbc, 'lazy, 'sb, 'ast, 'ctx> TypeckContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>
[src]
fn new(
ctx: &'sbc ScoreContext<'lazy, 'sb, 'ast, 'ctx>
) -> TypeckContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>
[src]
ctx: &'sbc ScoreContext<'lazy, 'sb, 'ast, 'ctx>
) -> TypeckContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>
Create a new type checking context.
fn finish(self) -> bool
[src]
Consume the context and return the result of the typeck.
fn emit(&self, diag: DiagBuilder2)
[src]
Emit a diagnostic message.
fn lazy_typeck<I>(&self, id: I) where
I: Into<NodeId>,
[src]
I: Into<NodeId>,
Check the type of a node.
If the node already had its type checked, immediately returns the result of that operation. Otherwise runs the task scheduled in the lazy table.
fn lazy_typeval<I>(&self, id: I) -> Result<&'ctx Ty> where
I: Into<NodeId>,
[src]
I: Into<NodeId>,
Determine the type of a node.
If the node already had its type determined, immediately returns the result of that operation. Otherwise runs the task scheduled in the lazy table.
fn typeck_delay_mechanism(&self, _node: &'ctx DelayMechanism)
[src]
Type check the time expression in a delay mechanism.
fn typeck_waveform(&self, node: &'ctx Waveform, exp: &'ctx Ty)
[src]
Type check a waveform.
fn typeck_wave_elem(&self, node: &'ctx WaveElem, exp: &'ctx Ty)
[src]
Type check a waveform element.
fn typeck_subprog_spec(&self, node: &'ctx SubprogSpec)
[src]
Type check a subprogram specification.
fn typeck_node<I>(&self, id: I, exp: &'ctx Ty) where
I: 'ctx + Copy + Debug + Into<NodeId>,
ScoreContext<'lazy, 'sb, 'ast, 'ctx>: NodeMaker<I, &'ctx Ty>,
[src]
I: 'ctx + Copy + Debug + Into<NodeId>,
ScoreContext<'lazy, 'sb, 'ast, 'ctx>: NodeMaker<I, &'ctx Ty>,
Type check any node that can have its type calculated.
fn typeck_slice<T, I>(&self, ids: T) where
T: AsRef<[I]>,
I: Copy,
TypeckContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>: Typeck<I>,
[src]
T: AsRef<[I]>,
I: Copy,
TypeckContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>: Typeck<I>,
Type check a slice of nodes.
fn apply_range_constraint(
&self,
ty: &Ty,
con: Spanned<&Range>
) -> Result<&'ctx Ty>
[src]
&self,
ty: &Ty,
con: Spanned<&Range>
) -> Result<&'ctx Ty>
Apply a range constraint to a type.
fn apply_array_constraint(
&self,
ty: &'ctx Ty,
con: Spanned<&ArrayConstraint>
) -> Result<&'ctx Ty>
[src]
&self,
ty: &'ctx Ty,
con: Spanned<&ArrayConstraint>
) -> Result<&'ctx Ty>
Apply an array constraint to a type.
fn apply_record_constraint(
&self,
ty: &'ctx Ty,
con: Spanned<&RecordConstraint>
) -> Result<&'ctx Ty>
[src]
&self,
ty: &'ctx Ty,
con: Spanned<&RecordConstraint>
) -> Result<&'ctx Ty>
Apply a record constraint to a type.
fn apply_index_constraint(
&self,
index: &'ctx ArrayIndex,
con: Spanned<&DiscreteRange>
) -> Result<ArrayIndex>
[src]
&self,
index: &'ctx ArrayIndex,
con: Spanned<&DiscreteRange>
) -> Result<ArrayIndex>
Apply an index constraint to an array index.
fn apply_subtype(
&self,
orig_ty: &'ctx Ty,
subty: Spanned<&Ty>
) -> Result<&'ctx Ty>
[src]
&self,
orig_ty: &'ctx Ty,
subty: Spanned<&Ty>
) -> Result<&'ctx Ty>
Impose a subtype on a type.
fn type_from_discrete_range(
&self,
range: Spanned<&DiscreteRange>
) -> Result<&'ctx Ty>
[src]
&self,
range: Spanned<&DiscreteRange>
) -> Result<&'ctx Ty>
Evaluate a discrete range as a type.
fn type_from_range(&self, range: Spanned<&Range>) -> Result<&'ctx Ty>
[src]
Evaluate a range as a type.
Trait Implementations
impl<'sbc, 'lazy: 'sbc, 'sb: 'lazy, 'ast: 'sb, 'ctx: 'sb, I> Typeck<I> for TypeckContext<'sbc, 'lazy, 'sb, 'ast, 'ctx> where
ScoreContext<'lazy, 'sb, 'ast, 'ctx>: NodeMaker<I, &'ctx Ty>,
[src]
ScoreContext<'lazy, 'sb, 'ast, 'ctx>: NodeMaker<I, &'ctx Ty>,