Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
CSG.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 < grammar::CSG < SymbolType > > {
20 static grammar::CSG < SymbolType > parse ( ext::istream & input );
21 static bool first ( ext::istream & input );
22 static void compose ( ext::ostream & output, const grammar::CSG < SymbolType > & grammar );
23};
24
25template<class SymbolType >
27 grammar::GrammarFromStringLexer::Token token = grammar::GrammarFromStringLexer::next(input);
29 throw exception::CommonException("Unrecognised CSG token.");
30
31 return grammar::GrammarFromStringParserCommon::parsePreservingCSLikeGrammar < grammar::CSG < SymbolType > > ( input );
32}
33
34template<class SymbolType >
36 grammar::GrammarFromStringLexer::Token token = grammar::GrammarFromStringLexer::next ( input );
39 return res;
40}
41
42template<class SymbolType >
44 output << "CSG";
46}
47
48} /* namespace core */
49
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
Context sensitive grammar in Chomsky hierarchy or type 1 in Chomsky hierarchy. Generates context sens...
Definition: CSG.h:64
static Token next(ext::istream &input)
Definition: GrammarFromStringLexer.cpp:10
static void composePreservingCSLikeGrammar(ext::ostream &output, const T &grammar)
Definition: GrammarToStringComposerCommon.h:136
return res
Definition: MinimizeByPartitioning.h:145
Definition: normalize.hpp:10
Definition: ToAutomaton.h:24
Definition: stringApi.hpp:26