Skip to content
Snippets Groups Projects
Commit 808b1cd7 authored by Jan Trávníček's avatar Jan Trávníček
Browse files

blank symbol

parent a777d44a
No related branches found
No related tags found
No related merge requests found
/*
* Blank.cpp
*
* Created on: Mar 26, 2013
* Author: Jan Travnicek
*/
#include "Blank.h"
namespace alphabet {
Blank::Blank() : Symbol("") {
}
} /* namespace alphabet */
/*
* Blank.h
*
* Created on: Mar 26, 2013
* Author: Jan Trávníček
*/
#ifndef BLANK_H_
#define BLANK_H_
#include "Symbol.h"
namespace alphabet {
/**
* Represents blank symbol in an alphabet.
*/
class Blank : public Symbol {
public:
/**
* Creates a blank symbol.
* @param symbol name of the symbol
*/
Blank();
};
} /* namespace alphabet */
#endif /* BLANK_H_ */
...@@ -38,8 +38,11 @@ bool Symbol::operator !=(const Symbol& other) const { ...@@ -38,8 +38,11 @@ bool Symbol::operator !=(const Symbol& other) const {
} }
   
std::ostream& operator<<(std::ostream& out, const Symbol& symbol) { std::ostream& operator<<(std::ostream& out, const Symbol& symbol) {
if(symbol.symbol.size() == 0) {
out << "(Symbol " << symbol.symbol << ")"; out << "(Blank)";
} else {
out << "(Symbol " << symbol.symbol << ")";
}
return out; return out;
} }
   
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment