/*******************************************************************************
 * Copyright (c) 2015-2016 ONERA.
 * Ce logiciel est la propriété de l’ONERA (the French Aerospace Lab).
 * Tous droits réservés.
 *
 * Ce programme et les éléments qui l'accompagnent sont mis à disposition
 * aux conditions définies par le contrat de licence logiciel CeCILL-C soumise
 * au droit français et respectant les principes de diffusion des logiciels libres.
 * Vous pouvez utiliser, modifier et/ou redistribuer ce programme
 * sous les conditions de la licence CeCILL-C (http://www.cecill.info).

 * This software is property of ONERA (the French Aerospace Lab).
 * All rights reserved.
 *
 * This program and the accompanying materials are made available under
 * the terms of the CeCILL-C license under French law and
 * abiding by the rules of distribution of free software.
 * You can  use, modify and/ or redistribute the software under the terms of
 * the CeCILL-C license (http://www.cecill.info).
 *
 * Contributeurs/contributors:
 *     Guillaume Infantes (ONERA - Centre de Toulouse) - initial API and implementation
 *
 *******************************************************************************/

#ifndef ALTARICA_DRIVER_H
#define ALTARICA_DRIVER_H


#include <string>
#include <vector>
#include "grammars/altarica/altarica_parser.hh"
#include "grammars/parsingdriverbase.hh"
#include "grammars/altarica/AltaricaModel.hh"



#undef YY_DECL
#define YY_DECL epoch::altarica::altarica_parser::token_type yylex (epoch::altarica::altarica_parser::semantic_type * yylval, epoch::altarica::altarica_parser::location_type * yylloc,  altarica_driver & driver, void* yyscanner)

YY_DECL;



class altarica_driver : public epoch::ParsingDriverBase {
public :
    altarica_driver(epoch::ParsingDriverReporter& reporter, const std::string& parsedRessource,
					bool traceScanning = false, bool traceParsing = false);
    virtual ~altarica_driver();
    
    epoch::altarica::AltaricaModel * amodel;
    
    
    virtual int Parse ();

    void scan_end();

    typedef epoch::altarica::altarica_parser Parser;
	
private :
	/**
	 * Deletes a stacked rule (useful for Bison-based parsers)
	 * The derived parsing driver must cast the given rule to any possible rule in the parser
	 * Typically, all %type declared rules must be deleted in case of matching cast
	 * @param rule Rule to delete
	 * @see #ClearRuleStack
	 */
	virtual void DeleteRule(boost::any& rule);
	
	// Bison friend
	friend class epoch::altarica::altarica_parser;
};




#endif
