pub struct BranchResolver { /* private fields */ }Expand description
Handles branch resolution which is more complicated because unnamed branches exist and discipline comparability has to be enforced
§Safety
Branch resolution may only take place after all nets and ports have been folded! UB might occur otherwise.
Implementations§
Source§impl<'lt> BranchResolver
impl<'lt> BranchResolver
pub fn new(ast: &'lt Ast) -> Self
Sourcepub fn resolve_discipline_access(
&mut self,
fold: &mut Fold<'lt>,
nature_name: &Ident,
discipline: DisciplineId,
) -> Option<DisciplineAccess>
pub fn resolve_discipline_access( &mut self, fold: &mut Fold<'lt>, nature_name: &Ident, discipline: DisciplineId, ) -> Option<DisciplineAccess>
Resolves a DisciplineAccess (for example V(b) or V(x,y))
§Arguments
-
fold - The calling fold which is used for name resolution and error handling
-
nature_name - The identifier of the nature (for example
Vin the case ofV(X,Y)) -
discipline - The id of the Discipline of a BranchAccess ( that has been resolved using
resolve_branch_access
§Safety
This is only save to call
pub fn resolve_nature_access( fold: &mut Fold<'lt>, id: NatureId, discipline: DisciplineId, ) -> Option<DisciplineAccess>
Sourcepub fn resolve_branch_access(
&mut self,
fold: &mut Fold<'lt>,
branch_access: &Node<BranchAccess>,
) -> Option<(BranchId, DisciplineId)>
pub fn resolve_branch_access( &mut self, fold: &mut Fold<'lt>, branch_access: &Node<BranchAccess>, ) -> Option<(BranchId, DisciplineId)>
Resolves a branch access such as (NET1,NET2),(<PORT>) or (BRANCH)
§Arguments
-
fold - The calling fold which is used for name resolution and error handling
-
branch_access - A reference to an Ast node for a branch access call
§Returns
The Id of the resolved branch and its Discipline (if the resolution succeeded)