Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
UnrankedNonlinearPattern.h
Go to the documentation of this file.
1
6#pragma once
7
9#include <core/stringApi.hpp>
10
12
15
16namespace core {
17
18template<class SymbolType >
19struct stringApi < tree::UnrankedNonlinearPattern < SymbolType > > {
21 static bool first ( ext::istream & input );
22 static void compose ( ext::ostream & output, const tree::UnrankedNonlinearPattern < SymbolType > & tree );
23};
24
25template<class SymbolType >
27 tree::TreeFromStringLexer::Token token = tree::TreeFromStringLexer::next ( input );
29 throw exception::CommonException ( "Unrecognised UNRANKED_NONLINEAR_PATTERN token." );
30
31 ext::set < SymbolType > nonlinearVariables;
32 bool isPattern = false;
33 bool isExtendedPattern = false;
34
35 ext::tree < SymbolType > content = tree::TreeFromStringParserCommon::parseUnrankedContent < SymbolType > ( input, isPattern, isExtendedPattern, nonlinearVariables );
36
37 if ( isExtendedPattern )
38 throw exception::CommonException ( "Unexpected node wildcards recognised" );
39
40 return tree::UnrankedNonlinearPattern < SymbolType > ( alphabet::WildcardSymbol::instance < SymbolType > ( ), alphabet::GapSymbol::instance < SymbolType > ( ), nonlinearVariables, content );
41}
42
43template<class SymbolType >
45 tree::TreeFromStringLexer::Token token = tree::TreeFromStringLexer::next ( input );
48 return res;
49}
50
51template<class SymbolType >
53 throw exception::CommonException ( "Unimplemented." );
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
Definition: set.hpp:44
Class introducing a tree with interface trying to be close to the interface of standard library conta...
Definition: tree.hpp:52
static Token next(ext::istream &input)
Definition: TreeFromStringLexer.cpp:10
Nonlinear tree pattern represented in its natural representation. The representation is so called unr...
Definition: UnrankedNonlinearPattern.h:75
return res
Definition: MinimizeByPartitioning.h:145
Definition: normalize.hpp:10
Definition: BackwardOccurrenceTest.h:17
Definition: stringApi.hpp:26