[−][src]Trait pattern_compiler::PatternProvider
Associated Types
type PatternNodeKey: Copy + Hash + Debug + PartialEq + Eq
A reference to a unique node in the pattern graph.
Every PatternNodeKey
should belong to ONE and ONLY one
PatternNodeKind
.
type PatternNodeKind: Copy + Hash + Debug + PartialEq + Eq
The type of pattern node.
type CfgVariable: Copy + Hash + Debug + PartialEq + Eq
A variable in the output CFG.
The provider is responsible for creating these as specializations
are performed by expand_clause_nodes
.
Associated Constants
const WILDCARD: Self::PatternNodeKind
Required methods
fn get_root(
&self
) -> ExpandedClauseNodes<Self::CfgVariable, Self::PatternNodeKey>
&self
) -> ExpandedClauseNodes<Self::CfgVariable, Self::PatternNodeKey>
fn kind_includes(
&self,
kind: Self::PatternNodeKind,
key: Self::PatternNodeKey
) -> bool
&self,
kind: Self::PatternNodeKind,
key: Self::PatternNodeKey
) -> bool
Used to determine if the given key
should be included in the
specialization on kind
.
When passed a wildcard as kind, we are specializing on the default matrix. It should match wildcards ONLY.
Invariants
- Every
PatternNodeKey
should match on one and ONLY onePatternNodeKind
.
fn expand_clause_nodes(
&mut self,
clause_nodes: Vec<Self::PatternNodeKey>
) -> ExpandedClauseNodes<Self::CfgVariable, Self::PatternNodeKey>
&mut self,
clause_nodes: Vec<Self::PatternNodeKey>
) -> ExpandedClauseNodes<Self::CfgVariable, Self::PatternNodeKey>
After clauses have been selected for specialization, this will be called with the set of all nodes that should be specialized on.
fn get_kind(&self, key: Self::PatternNodeKey) -> Self::PatternNodeKind
Every PatternNodeKey
should belong to one and only one
PatternNodeKind
.
Provided methods
fn is_wildcard(&self, kind: Self::PatternNodeKind) -> bool
fn get_wildcard(&self) -> Self::PatternNodeKind
Implementors
impl PatternProvider for SimplePatternProvider
[src]
type PatternNodeKey = NodeIndex
type PatternNodeKind = NodeKind
type CfgVariable = CfgVar
const WILDCARD: NodeKind
[src]
fn get_root(
&self
) -> ExpandedClauseNodes<Self::CfgVariable, Self::PatternNodeKey>
[src]
&self
) -> ExpandedClauseNodes<Self::CfgVariable, Self::PatternNodeKey>
fn kind_includes(
&self,
kind: Self::PatternNodeKind,
key: Self::PatternNodeKey
) -> bool
[src]
&self,
kind: Self::PatternNodeKind,
key: Self::PatternNodeKey
) -> bool
fn expand_clause_nodes(
&mut self,
clause_nodes: Vec<Self::PatternNodeKey>
) -> ExpandedClauseNodes<Self::CfgVariable, Self::PatternNodeKey>
[src]
&mut self,
clause_nodes: Vec<Self::PatternNodeKey>
) -> ExpandedClauseNodes<Self::CfgVariable, Self::PatternNodeKey>