From f527fc9398e0e1c3054ad8ddfdfa36eebacac9af Mon Sep 17 00:00:00 2001
From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz>
Date: Wed, 27 May 2015 10:44:15 +0200
Subject: [PATCH] fix string parsing of alphabet symbols

---
 alib2data/src/alphabet/SymbolFeatures.h           | 1 -
 alib2data/src/alphabet/SymbolFromStringLexer.cpp  | 4 ++--
 alib2data/src/alphabet/SymbolFromStringParser.cpp | 2 +-
 alib2data/src/alphabet/SymbolFromXMLParser.cpp    | 2 +-
 alib2data/src/alphabet/SymbolToStringComposer.cpp | 2 +-
 5 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/alib2data/src/alphabet/SymbolFeatures.h b/alib2data/src/alphabet/SymbolFeatures.h
index 4b15999981..670faf1358 100644
--- a/alib2data/src/alphabet/SymbolFeatures.h
+++ b/alib2data/src/alphabet/SymbolFeatures.h
@@ -17,7 +17,6 @@ enum class FEATURES {
 	END,
 	RANKED,
 	BAR,
-	RANKED_BAR,
 	SUBTREE_WILDCARD,
 	SYMBOL_SET_SYMBOL,
 	SYMBOL_PAIR_SYMBOL,
diff --git a/alib2data/src/alphabet/SymbolFromStringLexer.cpp b/alib2data/src/alphabet/SymbolFromStringLexer.cpp
index 7336722182..e7617cfd8a 100644
--- a/alib2data/src/alphabet/SymbolFromStringLexer.cpp
+++ b/alib2data/src/alphabet/SymbolFromStringLexer.cpp
@@ -47,11 +47,11 @@ L1:
 		token.type = TokenType::BOTTOM;
 		token.raw += character;
 		return token;
-	} else if(character == 'E') {
+	} else if(character == '$') {
 		token.type = TokenType::END;
 		token.raw += character;
 		return token;
-	} else if(character == 'S') {
+	} else if(character == '^') {
 		token.type = TokenType::START;
 		token.raw += character;
 		return token;
diff --git a/alib2data/src/alphabet/SymbolFromStringParser.cpp b/alib2data/src/alphabet/SymbolFromStringParser.cpp
index 4bccee507d..e75cfc7881 100644
--- a/alib2data/src/alphabet/SymbolFromStringParser.cpp
+++ b/alib2data/src/alphabet/SymbolFromStringParser.cpp
@@ -20,7 +20,7 @@
 namespace alphabet {
 
 Symbol SymbolFromStringParser::parseSymbol(std::istream& input) const {
-	return parseSymbol(input, std::set<FEATURES>({FEATURES::LABELED, FEATURES::BLANK, FEATURES::BOTTOM, FEATURES::END, FEATURES::BAR, FEATURES::SUBTREE_WILDCARD, FEATURES::START}));
+	return parseSymbol(input, std::set<FEATURES>({FEATURES::LABELED, FEATURES::BLANK, FEATURES::BOTTOM, FEATURES::END, FEATURES::START}));
 }
 
 Symbol SymbolFromStringParser::parseSymbol(std::istream& input, const std::set<FEATURES>& features) const {
diff --git a/alib2data/src/alphabet/SymbolFromXMLParser.cpp b/alib2data/src/alphabet/SymbolFromXMLParser.cpp
index 21b3f052ec..c37d1a98be 100644
--- a/alib2data/src/alphabet/SymbolFromXMLParser.cpp
+++ b/alib2data/src/alphabet/SymbolFromXMLParser.cpp
@@ -15,7 +15,7 @@
 namespace alphabet {
 
 Symbol SymbolFromXMLParser::parseSymbol(std::deque<sax::Token>& input) const {
-	return parseSymbol(input, std::set<FEATURES>({FEATURES::LABELED, FEATURES::BLANK, FEATURES::BOTTOM, FEATURES::END, FEATURES::RANKED, FEATURES::BAR, FEATURES::RANKED_BAR, FEATURES::SUBTREE_WILDCARD, FEATURES::SYMBOL_PAIR_SYMBOL, FEATURES::SYMBOL_SET_SYMBOL, FEATURES::UNIQUE_SYMBOL, FEATURES::START}));
+	return parseSymbol(input, std::set<FEATURES>({FEATURES::LABELED, FEATURES::BLANK, FEATURES::BOTTOM, FEATURES::END, FEATURES::RANKED, FEATURES::BAR, FEATURES::SUBTREE_WILDCARD, FEATURES::SYMBOL_PAIR_SYMBOL, FEATURES::SYMBOL_SET_SYMBOL, FEATURES::UNIQUE_SYMBOL, FEATURES::START}));
 }
 
 Symbol SymbolFromXMLParser::parseSymbol(std::deque<sax::Token>& input, const std::set<FEATURES>& features) const {
diff --git a/alib2data/src/alphabet/SymbolToStringComposer.cpp b/alib2data/src/alphabet/SymbolToStringComposer.cpp
index e944bb41e2..6da95cc610 100644
--- a/alib2data/src/alphabet/SymbolToStringComposer.cpp
+++ b/alib2data/src/alphabet/SymbolToStringComposer.cpp
@@ -43,7 +43,7 @@ void SymbolToStringComposer::Visit(void* userData, const EndSymbol&) const {
 void SymbolToStringComposer::Visit(void* userData, const StartSymbol&) const {
 	std::ostream &out = *((std::ostream*) userData);
 
-	out << "#S";
+	out << "#^";
 }
 
 void SymbolToStringComposer::Visit(void* userData, const RankedSymbol& symbol) const {
-- 
GitLab