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
}
Expand description
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.
Implementations
pub fn new(
ctx: &'sbc ScoreContext<'lazy, 'sb, 'ast, 'ctx>
) -> TypeckContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>
pub fn new(
ctx: &'sbc ScoreContext<'lazy, 'sb, 'ast, 'ctx>
) -> TypeckContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>
Create a new type checking context.
Emit a diagnostic message.
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.
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.
Ensure that two types are compatible.
Ensure that one type can be cast into the other.
Type check the time expression in a delay mechanism.
Type check a waveform.
Type check a waveform element.
Type check a subprogram specification.
pub 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>,
pub 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>,
Type check any node that can have its type calculated.
pub fn typeck_slice<T, I>(&self, ids: T) where
T: AsRef<[I]>,
I: Copy,
TypeckContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>: Typeck<I>,
pub fn typeck_slice<T, I>(&self, ids: T) where
T: AsRef<[I]>,
I: Copy,
TypeckContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>: Typeck<I>,
Type check a slice of nodes.
Apply a range constraint to a type.
pub fn apply_array_constraint(
&self,
ty: &'ctx Ty,
con: Spanned<&ArrayConstraint>
) -> Result<&'ctx Ty>
pub fn apply_array_constraint(
&self,
ty: &'ctx Ty,
con: Spanned<&ArrayConstraint>
) -> Result<&'ctx Ty>
Apply an array constraint to a type.
pub fn apply_record_constraint(
&self,
ty: &'ctx Ty,
con: Spanned<&RecordConstraint>
) -> Result<&'ctx Ty>
pub fn apply_record_constraint(
&self,
ty: &'ctx Ty,
con: Spanned<&RecordConstraint>
) -> Result<&'ctx Ty>
Apply a record constraint to a type.
pub fn apply_index_constraint(
&self,
index: &'ctx ArrayIndex,
con: Spanned<&DiscreteRange>
) -> Result<ArrayIndex>
pub fn apply_index_constraint(
&self,
index: &'ctx ArrayIndex,
con: Spanned<&DiscreteRange>
) -> Result<ArrayIndex>
Apply an index constraint to an array index.
Impose a subtype on a type.
Evaluate a discrete range as a type.