Skip to content
Snippets Groups Projects
BlankSymbol.cpp 979 B
Newer Older
  • Learn to ignore specific revisions
  • /*
     * BlankSymbol.cpp
     *
     *  Created on: Mar 26, 2013
     *      Author: Jan Travnicek
     */
    
    #include "BlankSymbol.h"
    
    Jan Trávníček's avatar
    Jan Trávníček committed
    #include "Symbol.h"
    
    #include <object/Object.h>
    
    Jan Trávníček's avatar
    Jan Trávníček committed
    #include "UniqueSymbol.h"
    
    #include <registration/ValuePrinterRegistration.hpp>
    
    
    namespace alphabet {
    
    
    BlankSymbol::BlankSymbol() {
    
    SymbolBase* BlankSymbol::clone ( ) const & {
    
    	return new BlankSymbol(*this);
    }
    
    
    SymbolBase* BlankSymbol::clone() && {
    
    	return new BlankSymbol(std::move(*this));
    }
    
    
    int BlankSymbol::compare(const BlankSymbol&) const {
    	return 0;
    
    }
    
    void BlankSymbol::operator>>(std::ostream& out) const {
    	out << "(Blank symbol)";
    }
    
    BlankSymbol::operator std::string () const {
    
    	return BlankSymbol::instance < std::string > ( );
    
    Jan Trávníček's avatar
    Jan Trávníček committed
    SymbolBase* BlankSymbol::inc() && {
    	return new UniqueSymbol(Symbol(std::move(*this)), primitive::Integer(0));
    }
    
    
    } /* namespace alphabet */
    
    namespace {
    
    static auto valuePrinter = registration::ValuePrinterRegister < alphabet::BlankSymbol > ( );
    
    } /* namespace */