Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
alib2algo
src
grammar
properties
IsLanguageEmpty.h
Go to the documentation of this file.
1
6
#pragma once
7
8
#include <
grammar/properties/ProductiveNonterminals.h
>
9
10
namespace
grammar
{
11
12
namespace
properties {
13
17
class
IsLanguageEmpty
{
18
public
:
19
/*
20
* Decides whether L( grammar ) = \0
21
*
22
* Severals steps implemented in method @see grammar::properties::ProductiveNonterminals::getProductiveNonTerminals();
23
*
24
* \tparam T the type of the tested grammar
25
*
26
* \param grammar the tested grammar
27
*
28
* \returns true if L(@p grammar) = \0
29
*/
30
template
<
class
T>
31
static
bool
isLanguageEmpty
(
const
T &
grammar
);
32
};
33
34
template
<
class
T>
35
bool
IsLanguageEmpty::isLanguageEmpty
(
const
T &
grammar
) {
36
return
!
grammar::properties::ProductiveNonterminals::getProductiveNonterminals
(
grammar
).contains (
grammar
.getInitialSymbol( ) );
37
}
38
39
}
/* namespace properties */
40
41
}
/* namespace grammar */
42
ProductiveNonterminals.h
grammar::properties::IsLanguageEmpty
Definition:
IsLanguageEmpty.h:17
grammar::properties::IsLanguageEmpty::isLanguageEmpty
static bool isLanguageEmpty(const T &grammar)
Definition:
IsLanguageEmpty.h:35
grammar::properties::ProductiveNonterminals::getProductiveNonterminals
static ext::set< NonterminalSymbolType > getProductiveNonterminals(const T &grammar)
Definition:
ProductiveNonterminals.h:42
grammar
Definition:
ToAutomaton.h:24
Generated on Mon Dec 27 2021 10:21:51 for Algorithms Library Toolkit by
1.9.2