#ifndef _KSOURCE_H
#define _KSOURCE_H

#include <cstdlib>
#include <fstream>

using namespace std;

/* ----------------------------------------------------- */

class ksource_type
{
private:
  fstream	kfile;		// source file
  string	buffer;		// input buffer
  int		pos;		// current position
  bool		done;		// file has been read

public:
  void open (const string&);
  void close (void);

  string get_opcode (void);
  string get_operand (void);

  bool read_line (void);

  void trim_lead_blanks (void);

  bool is_eol (void) const;
  bool is_eof (void) const;
};

/* ----------------------------------------------------- */

#endif // _KSOURCE_H
