Skip to content
Snippets Groups Projects
GlushkovIndexate.h 1.9 KiB
Newer Older
  • Learn to ignore specific revisions
  • /*
     * GlushkovIndexate.h
     *
     *  Created on: 14. 4. 2016
     *	  Author: Tomas Pecka
     */
    
    #ifndef RTE_GLUSHKOV_INDEXATE_H_
    #define RTE_GLUSHKOV_INDEXATE_H_
    
    #include <rte/formal/FormalRTE.h>
    #include <rte/RTEFeatures.h>
    
    #include <alphabet/RankedSymbol.h>
    
    namespace rte {
    
    class GlushkovIndexate {
    public:
    	/**
    	 * @param re rte to index
    	 * @return FormalRTE with indexed elements
    	 */
    	static FormalRTE < > index ( const rte::FormalRTE < > & re );
    
    	/**
    	 * @param symbol Glushkov Pair symbol, i.e., SymbolPair of RankedSymbol < > and integer index
    	 * @return RankedSymbol < > from the pair on input
    	 */
    
    	static common::ranked_symbol < > getSymbolFromGlushkovPair ( const common::ranked_symbol < > & symbol );
    
    		static ext::rvalue_ref < FormalRTEElement < DefaultSymbolType, primitive::Unsigned > > visit ( const rte::FormalRTEAlternation < DefaultSymbolType, primitive::Unsigned > & node, int & i );
    		static ext::rvalue_ref < FormalRTEElement < DefaultSymbolType, primitive::Unsigned > > visit ( const rte::FormalRTESubstitution < DefaultSymbolType, primitive::Unsigned > & node, int & i );
    		static ext::rvalue_ref < FormalRTEElement < DefaultSymbolType, primitive::Unsigned > > visit ( const rte::FormalRTEIteration < DefaultSymbolType, primitive::Unsigned > & node, int & i );
    		static ext::rvalue_ref < FormalRTEElement < DefaultSymbolType, primitive::Unsigned > > visit ( const rte::FormalRTESymbolAlphabet < DefaultSymbolType, primitive::Unsigned > & node, int & i );
    		static ext::rvalue_ref < FormalRTEElement < DefaultSymbolType, primitive::Unsigned > > visit ( const rte::FormalRTESymbolSubst < DefaultSymbolType, primitive::Unsigned > & node, int & i );
    		static ext::rvalue_ref < FormalRTEElement < DefaultSymbolType, primitive::Unsigned > > visit ( const rte::FormalRTEEmpty < DefaultSymbolType, primitive::Unsigned > & node, int & i );
    
    	};
    };
    
    } /* namespace rte */
    
    #endif /* RTE_GLUSHKOV_INDEXATE_H_ */