Commit 1f91ca7a authored by Ing. Jan Trávníček's avatar Ing. Jan Trávníček

more simplifications in ExactPatternMatch

parent 777e526a
......@@ -80,7 +80,7 @@ private:
static bool matchUnorderedHelper ( const ext::tree < common::ranked_symbol < SymbolType > > & subject, const ext::tree < common::ranked_symbol < SymbolType > > & pattern, const common::ranked_symbol < SymbolType > & subtreeVariable );
template < class SymbolType >
static void matchUnorderedInternal ( unsigned & index, ext::set < unsigned > & occ, const ext::tree < common::ranked_symbol < SymbolType > > & subject, const ext::tree < common::ranked_symbol < SymbolType > > & pattern, const common::ranked_symbol < SymbolType > & subtreeVariable );
static void matchUnorderedInternal ( unsigned & index, ext::set < unsigned > & occ, const ext::tree < SymbolType > & subject, const ext::tree < SymbolType > & pattern, const SymbolType & subtreeVariable );
};
......@@ -190,12 +190,12 @@ bool ExactPatternMatch::matchUnorderedHelper ( const ext::tree < common::ranked_
}
template < class SymbolType >
void ExactPatternMatch::matchUnorderedInternal ( unsigned & index, ext::set < unsigned > & occ, const ext::tree < common::ranked_symbol < SymbolType > > & subject, const ext::tree < common::ranked_symbol < SymbolType > > & pattern, const common::ranked_symbol < SymbolType > & subtreeVariable ) {
void ExactPatternMatch::matchUnorderedInternal ( unsigned & index, ext::set < unsigned > & occ, const ext::tree < SymbolType > & subject, const ext::tree < SymbolType > & pattern, const SymbolType & subtreeVariable ) {
if ( matchUnorderedHelper ( subject, pattern, subtreeVariable ) ) occ.insert ( index );
index++;
for ( const ext::tree < common::ranked_symbol < SymbolType > > & child : subject.getChildren ( ) )
for ( const ext::tree < SymbolType > & child : subject.getChildren ( ) )
matchUnorderedInternal ( index, occ, child, pattern, subtreeVariable );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment