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
17
18namespace regexp {
19
26public:
30 template < class SymbolType >
32
33 template < class SymbolType >
34 class Unbounded {
35 public:
42 };
43};
44
45template < class SymbolType >
47 return node.getRegExp ( ).getStructure ( ).template accept < bool, GlushkovPos::Unbounded < SymbolType > > ( symbol );
48}
49
50template < class SymbolType >
52 return std::any_of ( node.getElements ( ).begin ( ), node.getElements ( ).end ( ), [ & ] ( const UnboundedRegExpElement < SymbolType > & element ) {
53 return element.template accept < bool, GlushkovPos::Unbounded < SymbolType > > ( symbol );
54 } );
55}
56
57template < class SymbolType >
59 return std::any_of ( node.getElements ( ).begin ( ), node.getElements ( ).end ( ), [ & ] ( const UnboundedRegExpElement < SymbolType > & element ) {
60 return element.template accept < bool, GlushkovPos::Unbounded < SymbolType > > ( symbol );
61 } );
62}
63
64template < class SymbolType >
66 return node.getElement ( ).template accept < bool, GlushkovPos::Unbounded < SymbolType > > ( symbol );
67}
68
69template < class SymbolType >
71 return symbol == node;
72}
73
74template < class SymbolType >
76 return false;
77}
78
79template < class SymbolType >
81 return false;
82}
83
84} /* namespace regexp */
85
Definition: GlushkovPos.h:34
static bool visit(const regexp::UnboundedRegExpAlternation< SymbolType > &node, const regexp::UnboundedRegExpSymbol< SymbolType > &symbol)
Definition: GlushkovPos.h:51
Definition: GlushkovPos.h:25
static bool pos(const UnboundedRegExpSymbol< SymbolType > &symbol, const regexp::UnboundedRegExp< SymbolType > &node)
Definition: GlushkovPos.h:46
Represents the alternation operator in the regular expression. The node can have 0 to n children in l...
Definition: UnboundedRegExpAlternation.h:44
Represents the concatenation operator in the regular expression. The node can have 0 to n children in...
Definition: UnboundedRegExpConcatenation.h:44
Definition: UnboundedRegExpElement.h:62
Represents the empty expression in the regular expression. The node can't have any children.
Definition: UnboundedRegExpEmpty.h:41
Represents the epsilon expression in the regular expression. The node can't have any children.
Definition: UnboundedRegExpEpsilon.h:41
Represents the iteration operator in the regular expression. The node has exactly one child.
Definition: UnboundedRegExpIteration.h:43
Represents the symbol in the regular expression. The can't have any children.
Definition: UnboundedRegExpSymbol.h:42
Unbounded regular expression represents regular expression. It describes regular languages....
Definition: UnboundedRegExp.h:80
any_of(T &&...) -> any_of< T... >
Definition: Node.cpp:11
Definition: ToAutomaton.h:15