Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
SymbolOrEpsilon.h
Go to the documentation of this file.
1
6#pragma once
7
9#include <core/stringApi.hpp>
10
11namespace core {
12
13template < class SymbolType >
14struct stringApi < common::symbol_or_epsilon < SymbolType > > {
16 static bool first ( ext::istream & input );
17 static void compose ( ext::ostream & output, const common::symbol_or_epsilon < SymbolType > & symbol );
18};
19
20template < class SymbolType >
22 throw exception::CommonException("Parsing of symbol or epsilon from string not implemented.");
23}
24
25template < class SymbolType >
27 return false;
28}
29
30template < class SymbolType >
32 if ( symbol.is_epsilon ( ) )
33 output << "#E";
34 else
36}
37
38} /* namespace core */
39
Definition: symbol_or_epsilon.hpp:24
const SymbolType & getSymbol() const &
Definition: symbol_or_epsilon.hpp:41
bool is_epsilon() const
Definition: symbol_or_epsilon.hpp:58
Basic exception from which all other exceptions are derived.
Definition: CommonException.h:21
Definition: istream.h:32
Definition: ostream.h:14
Definition: Permutation.hpp:18
Definition: normalize.hpp:10
Definition: stringApi.hpp:26