/**
 * 最初の著者:: トゥイー
 * リポジトリ情報:: $Id: GrammarCommonImpl.hpp 52 2011-05-17 06:24:31Z yutaka_at_home $
 * 著作権:: Copyright (C) Ownway.info, 2011. All rights reserved.
 * ライセンス:: CPL(Common Public Licence)
 */

#ifndef _SPEECH_CONTROLLER_FRAMEWORK_GRAMMAR_GRAMMAR_COMMON_IMPL_HPP_
#define _SPEECH_CONTROLLER_FRAMEWORK_GRAMMAR_GRAMMAR_COMMON_IMPL_HPP_

#include "spcf/core/Grammar.hpp"

namespace spcf {

	class GrammarCommonImpl_i;

	class GrammarCommonImpl : public Grammar {
	private:
		GrammarCommonImpl_i* impl;

	public:
		GrammarCommonImpl(const std::string& name);
		virtual ~GrammarCommonImpl();

	public:
		GrammarTransitionPtr addGrammarTransition(const GrammarTransitionPtr& transition);
		GrammarTransitionPtr addGrammarTransition(const std::string& phrase, const Grammar::State& startState, const Grammar::State& endState);
		GrammarTransitionPtr addGrammarTransition(const std::string& phrase, const std::string& propertyName, const Grammar::State& startState, const Grammar::State& endState);
		GrammarTransitionPtr addGrammarTransition(const std::string& phrase, const std::string& propertyName, int propertyInt, const Grammar::State& startState, const Grammar::State& endState);
		GrammarTransitionPtr addGrammarTransition(const std::string& phrase, const std::string& propertyName, const std::string& propertyString, const Grammar::State& startState, const Grammar::State& endState);
		GrammarTransitionPtr addGrammarTransition(const std::string& phrase, const std::string& propertyName, int propertyInt, const std::string& propertyString, const Grammar::State& startState, const Grammar::State& endState);

	public:
		void addGrammarTransition(Grammar& grammar, const Grammar::State& prefix, const Grammar::State& startState, const Grammar::State& endState);
		void addGrammarTransition(Grammar& grammar, const Grammar::State& startState, const Grammar::State& endState);

	public:
		std::string getName();
		GrammarTransitionList::const_iterator beginTransitions();
		GrammarTransitionList::const_iterator endTransitions();
	};

}  // namespace spcf

#endif
