// __author__ = Juan Carlos De Abreu (jcabreur@gmail.com)

#ifndef SCENE_DRIVER_H__
#define SCENE_DRIVER_H__

#include <string>
#include <map>
#include "math.h"

#include "../global.h"
#include "../Util/String.h"

//BEGIN_TEG_NAMESPACE();

// Forward declarations.
union YYSTYPE;
namespace yy {
	class location;
	class SceneParser;
}
class SceneDriver;

 // Announce to Flex the prototype we want for lexing function, ...
#define YY_DECL						 \
  int yylex(YYSTYPE* yylval, yy::location* yylloc, SceneDriver& driver)
// ... and declare it for the parser's sake.
YY_DECL;

// Conducting the whole scanning and parsing of Calc++.
class SceneDriver {
public:
  // SceneDriver constructor.
  SceneDriver();

  // SceneDriver destructor.
  virtual ~SceneDriver();

  // Handling the scanner.
  void scan_begin();
  void scan_end();
  bool trace_scanning;

  // Handling the parser.
  void parse(const std::string& f);
  std::string file;
  bool trace_parsing;

  // Error handling.
  void error(const yy::location& l, const std::string& m);
  void error(const std::string& m);
  
  bool bError;
};

//END_TEG_NAMESPACE();

#endif  // SCENE_DRIVER_H__
