#ifndef _SCALAR_HPP_
#define _SCALAR_HPP_

#include <string>
#include <iostream>
using namespace std;

typedef enum {INT, STRING} scalar_type;

class scalar
{
public:
  scalar(const string& s);
  scalar(int i);
  int GetIntValue() const;
  string GetStringValue() const;
  scalar* Copy() const;
  void Print(ostream& ostr) const;

private:
  scalar_type _type;
  string _string_value;
  int _int_value;
};

ostream& operator<<(ostream& ostr, const scalar& s);

#endif
