Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
GlushkovPos.h
Go to the documentation of this file.
1
6#pragma once
7
9
12
13namespace rte {
14
16public:
20 template < class SymbolType >
21 static bool pos ( const common::ranked_symbol < SymbolType > & symbol, const rte::FormalRTE < SymbolType > & rte );
22
23 template < class SymbolType >
24 class Formal {
25 public:
32 };
33};
34
35template < class SymbolType >
37 return rte.getRTE ( ).getStructure ( ).template accept < bool, GlushkovPos::Formal < SymbolType > > ( symbol );
38}
39
40template < class SymbolType >
42 return node.getLeftElement ( ).template accept < bool, GlushkovPos::Formal < SymbolType > > ( symbolF ) || node.getRightElement ( ).template accept < bool, GlushkovPos::Formal < SymbolType > > ( symbolF );
43}
44
45template < class SymbolType >
47 return node.getLeftElement ( ).template accept < bool, GlushkovPos::Formal < SymbolType > > ( symbolF ) || node.getRightElement ( ).template accept < bool, GlushkovPos::Formal < SymbolType > > ( symbolF );
48}
49
50template < class SymbolType >
52 return node.getElement ( ).template accept < bool, GlushkovPos::Formal < SymbolType > > ( symbolF );
53}
54
55template < class SymbolType >
57 if ( symbolF == node.getSymbol ( ) ) return true;
58
59 return std::any_of ( node.getElements ( ).begin ( ), node.getElements ( ).end ( ), [ & ] ( const rte::FormalRTEElement < SymbolType > & element ) {
60 return element.template accept < bool, GlushkovPos::Formal < SymbolType > > ( symbolF );
61 } );
62}
63
64template < class SymbolType >
66 return symbolF == node.getSymbol ( );
67}
68
69template < class SymbolType >
71 return false;
72}
73
74} /* namespace rte */
75
Definition: ranked_symbol.hpp:20
Represents the alternation operator in the regular tree expression. The node must have exactly two ch...
Definition: FormalRTEAlternation.h:44
Definition: FormalRTEElement.h:54
Represents the empty expression in the regular tree expression. The node can't have any children.
Definition: FormalRTEEmpty.h:40
Represents the iteration operator in the regular tree expression. The node has exactly one child.
Definition: FormalRTEIteration.h:45
Represents the concatenation operator in the regular tree expression. The node must have exactly two ...
Definition: FormalRTESubstitution.h:44
Represents the terminal symbol in the regular tree expression. The number of children must be the sam...
Definition: FormalRTESymbolAlphabet.h:44
Represents the substitution symbol in the regular tree expression. The node can't have any children.
Definition: FormalRTESymbolSubst.h:43
Formal regular tree expression represents regular tree expression. It describes regular tree language...
Definition: FormalRTE.h:71
Definition: GlushkovPos.h:24
static bool visit(const rte::FormalRTEAlternation< SymbolType > &node, const common::ranked_symbol< SymbolType > &symbolF)
Definition: GlushkovPos.h:41
Definition: GlushkovPos.h:15
static bool pos(const common::ranked_symbol< SymbolType > &symbol, const rte::FormalRTE< SymbolType > &rte)
Definition: GlushkovPos.h:36
any_of(T &&...) -> any_of< T... >
Definition: Node.cpp:11
Definition: ToFTAGlushkov.h:22