Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
TreeNormalize.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <alib/tree>
9
12
13namespace tree {
14
19public:
20 template < class SymbolType >
22
23 template < class SymbolType >
25
26};
27
28template < class SymbolType >
31
32 for ( ext::tree < SymbolType > & child : tree.getChildren ( ) ) {
33 children.push_back ( normalizeTree ( std::move ( child ) ) );
34 }
35
36 return ext::tree < DefaultSymbolType > ( alphabet::SymbolNormalize::normalizeSymbol ( std::move ( tree.getData ( ) ) ), std::move ( children ) );
37}
38
39template < class SymbolType >
42
43 for ( ext::tree < common::ranked_symbol < SymbolType > > & child : tree.getChildren ( ) ) {
44 children.push_back ( normalizeRankedTree ( std::move ( child ) ) );
45 }
46
47 return ext::tree < common::ranked_symbol < DefaultSymbolType > > ( alphabet::SymbolNormalize::normalizeRankedSymbol ( std::move ( tree.getData ( ) ) ), std::move ( children ) );
48}
49
50} /* namespace tree */
51
52
static common::ranked_symbol< DefaultSymbolType > normalizeRankedSymbol(common::ranked_symbol< SymbolType > &&symbol)
Definition: SymbolNormalize.h:81
static DefaultSymbolType normalizeSymbol(SymbolType &&symbol)
Definition: SymbolNormalize.h:68
Definition: ranked_symbol.hpp:20
Class introducing a tree with interface trying to be close to the interface of standard library conta...
Definition: tree.hpp:52
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
Definition: TreeNormalize.h:18
static ext::tree< DefaultSymbolType > normalizeTree(ext::tree< SymbolType > &&tree)
Definition: TreeNormalize.h:29
static ext::tree< common::ranked_symbol< DefaultSymbolType > > normalizeRankedTree(ext::tree< common::ranked_symbol< SymbolType > > &&tree)
Definition: TreeNormalize.h:40
Definition: BackwardOccurrenceTest.h:17