Are you a regular stikked user? Signup so you can keep track of your pastes!

token

By Ben, 7 Months ago, written in C++. This paste is a reply to scanner by Ben
URL http://stikked.com/view/5923391
  1. //
  2. //  token.h
  3. //  trunk
  4. //  
  5. //  Created by Ben McRedmond on 2008-11-06.
  6. //  Copyright 2008 Ben McRedmond. All rights reserved.
  7. //
  8.  
  9. #ifndef token_h
  10. #define token_h
  11.  
  12. #include <string>
  13.  
  14. #include "buffer.h"
  15. #include "common.h"
  16. #include "scanner.h"
  17.  
  18. namespace cirrus {
  19.         extern characterCode charCodeMap[];
  20.                        
  21.         class token {
  22.         protected:
  23.                 tokenCode tkCode;
  24.                 std::string tkString;
  25.         public:
  26.                 void print(token *tToken);
  27.                 virtual void get(buffer &source);
  28.         };
  29.        
  30.         class wordToken : public token {
  31.                 void isReservedKeyword(); // Is the word token a reserved keyword?
  32.                
  33.         public:
  34.                 virtual void get(buffer &source);
  35.         };
  36.  
  37.         class stringToken : public token {
  38.         public:
  39.                 void get(buffer &source);
  40.         };
  41.        
  42.         class numberToken : public token {
  43.         public:
  44.                 void get(buffer &source);
  45.         };
  46.  
  47.         class symbolToken : public token {
  48.         public:
  49.                 void get(buffer &source);
  50.         };
  51.        
  52.         class eofToken : public token {
  53.         public:
  54.                 void get(buffer &soure);
  55.         };
  56.        
  57.         class errorToken : public token {
  58.         public:
  59.                 void get(buffer &source);
  60.         };
  61. }
  62.  
  63. #endif

Reply to "token"

Here you can reply to the paste above

Create a snipurl

Make Private

Feeling clever? Set some advanced options.