Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
CyclicString.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <string/CyclicString.h>
9#include <core/stringApi.hpp>
10
12
15
16namespace core {
17
18template<class SymbolType >
19struct stringApi < string::CyclicString < SymbolType > > {
21 static bool first ( ext::istream & input );
22 static void compose ( ext::ostream & output, const string::CyclicString < SymbolType > & string );
23};
24
25template<class SymbolType >
27 string::StringFromStringLexer::Token token = string::StringFromStringLexer::next ( input );
29 ext::vector < SymbolType > data = string::StringFromStringParserCommon::parseContent < SymbolType > ( input );
33 } else {
34 throw exception::CommonException ( "Invalid linear string terminating character" );
35 }
36 } else {
37 throw exception::CommonException ( "Unrecognised CyclicString token." );
38 }
39}
40
41template<class SymbolType >
43 string::StringFromStringLexer::Token token = string::StringFromStringLexer::next ( input );
46 return res;
47}
48
49template<class SymbolType >
51 output << "<";
52 string::StringToStringComposerCommon::composeContent ( output, string.getContent ( ) );
53 output << ">";
54}
55
56} /* namespace core */
57
Basic exception from which all other exceptions are derived.
Definition: CommonException.h:21
static void putback(ext::istream &input, const Token &token)
Definition: lexer.hpp:61
Definition: istream.h:32
Definition: ostream.h:14
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
Cyclic string.
Definition: CyclicString.h:60
static Token next(ext::istream &input)
Definition: StringFromStringLexer.cpp:10
static void composeContent(ext::ostream &output, const std::vector< SymbolType > &content)
Definition: StringToStringComposerCommon.h:22
return res
Definition: MinimizeByPartitioning.h:145
Definition: normalize.hpp:10
Definition: RandomStringFactory.cpp:12
Definition: stringApi.hpp:26