cppToken.h 922 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Filename: cppToken.h
  2. // Created by: drose (22Oct99)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. #ifndef CPPTOKEN_H
  6. #define CPPTOKEN_H
  7. #include <dtoolbase.h>
  8. #include "cppBisonDefs.h"
  9. ///////////////////////////////////////////////////////////////////
  10. // Class : CPPToken
  11. // Description :
  12. ////////////////////////////////////////////////////////////////////
  13. class CPPToken {
  14. public:
  15. CPPToken(int token, int line_number = 0, int col_number = 0,
  16. const CPPFile &file = CPPFile(""),
  17. const string &str = string(),
  18. const YYSTYPE &lval = YYSTYPE());
  19. CPPToken(const CPPToken &copy);
  20. void operator = (const CPPToken &copy);
  21. static CPPToken eof();
  22. bool is_eof() const;
  23. void output(ostream &out) const;
  24. int _token;
  25. YYSTYPE _lval;
  26. YYLTYPE _lloc;
  27. };
  28. inline ostream &operator << (ostream &out, const CPPToken &token) {
  29. token.output(out);
  30. return out;
  31. }
  32. #endif