/**
*
* @File : CToken.cxx
*
* @Authors : D. Mathieu
*
* @Date : 09/05/2001
*
* @Version : V1.0
*
* @Synopsis :
*
**/
#include <fstream>
#include <string>
#include <cctype> // isdigit()
#include <cstdlib> // strtol()
#include "CToken.h"
using namespace std;
namespace nsCompil
{
istream & operator >> (istream & is, CToken & Token)
{
string Str;
is >> Str;
Token = isdigit (Str [0])
? CToken (int (strtol (Str.c_str(), 0, 10)))
: CToken (Str [0]);
return is;
} // operator >>
ostream & operator << (ostream & os, const CToken & Token)
{
if (Token.IsOperator ())
os << Token.m_Symbole;
else
os << Token.m_Value;
return os;
} // operator <<
} // nsCompil
#undef CTOKEN