Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
AutomatonFromStringParserCommon.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <exception>
9
10#include <ext/istream>
11
13#include <core/stringApi.hpp>
14
15namespace automaton {
16
18 static void initialFinalState(ext::istream& input, bool& rightArrow, bool& leftArrow);
19
20 template < class Type >
22};
23
24template < class Type >
27
28 automaton::AutomatonFromStringLexer::Token token = automaton::AutomatonFromStringLexer::next(input);
30 throw exception::CommonException("Expected LEFT_BRACKET token.");
31 }
32
36 while(true) {
37 Type symbol = core::stringApi<Type>::parse(input);
38 res.push_back(symbol);
39
42 break;
43 }
45 throw exception::CommonException("Expected RIGHT_BRACKET or COMMA token");
46 }
47 }
48 }
49
51 throw exception::CommonException("Expected RIGHT_BRACKET token");
52 }
53
54 return res;
55}
56
57} /* namespace automaton */
58
static Token next(ext::istream &input)
Definition: AutomatonFromStringLexer.cpp:12
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
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
return res
Definition: MinimizeByPartitioning.h:145
Definition: ToGrammar.h:31
Type
Definition: MeasurementTypes.hpp:20
Definition: AutomatonFromStringParserCommon.h:17
static ext::vector< Type > parseList(ext::istream &input)
Definition: AutomatonFromStringParserCommon.h:25
static void initialFinalState(ext::istream &input, bool &rightArrow, bool &leftArrow)
Definition: AutomatonFromStringParserCommon.cpp:10
Definition: stringApi.hpp:26