//---------------------------------------------------------------------------

#ifndef benchH
#define benchH
#include <string>
#include <list>

#include "lexan_bench.h"
#include "import.h"

// --------------------------------------------------------------------------
class BenchParserClient { 
public:
    // ---- interface to semantic classes - callbacks
    virtual void haveDesign (void);
    virtual void endDesign (void);
    virtual void haveInPort  (const std::string& portName);
    virtual void haveOutPort (const std::string& portName);
    virtual void haveAssign (const std::string& outputName, 
			     int function,		// lexical symbol 
                 const std::list <std::string> listInputNames);
    virtual ~BenchParserClient ();
};

// --------------------------------------------------------------------------
class BenchParser {
    // ----- link to semantic actions
	BenchParserClient* client_;
    
    // ----- actions
    void inputs();
    void outputs();
    void assigns();
    void hradlo(std::list <std::string> *);
    void idents(std::list <std::string> *);
    void r_o_idents(std::list <std::string> *);

public:
    // ---- lexical analysis and current token
    LexanBench l;
    int token;

    // ---- start import
    void run (std::istream&, const std::string&);
    BenchParser(BenchParserClient* client): client_(client) {}
   ~BenchParser() {}
};
//---------------------------------------------------------------------------
#endif
