#ifndef TOKEN_H #define TOKEN_H class Number; namespace Bu { class String; class Formatter; }; class Token { public: enum Type { tNumber = 0x1001, tVariable = 0x2002, tCommand = 0x2003, tPlus = 0x4004, tMinus = 0x4005, tDivide = 0x4006, tMultiply = 0x4007, tModulus = 0x4008, tOpenParen = 0x8009, tCloseParen = 0x800a, tEquals = 0x400b, tString = 0x200c, tNegate = 0x800d, tEndOfLine = 0x010e, tEndOfInput = 0x010f, tUninitialized = 0x0110, tComputedValue = 0x0111, mMetaNumber = 0x1000, mMetaString = 0x2000, mMetaOperator = 0x4000, mMetaAltOp = 0x8000, mMetaMeta = 0x0100, }; Token(); Token( Type eType ); Token( Type eType, Bu::String *s ); Token( Type eType, Number *n ); Token( const Token &rSrc ); ~Token(); Token &operator=( const Token &rhs ); Type eType; union { Bu::String *sVal; class Number *nVal; }; }; Bu::Formatter &operator<<( Bu::Formatter &f, Token::Type eType ); Bu::Formatter &operator<<( Bu::Formatter &f, const Token &t ); #endif