00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef lestes__lang__cplus__lex___ucn_token_hh___included
00029 #define lestes__lang__cplus__lex___ucn_token_hh___included
00030
00031
00032
00033
00034
00035
00036
00037 #include <lestes/common.hh>
00038 #include <lestes/lang/cplus/lex/simple_location.hh>
00039 #include <lestes/lang/cplus/lex/basic_token.hh>
00040 #include <lestes/msg/message.hh>
00041
00042 package(lestes);
00043 package(lang);
00044 package(cplus);
00045 package(lex);
00046
00047
00048 typedef basic_token<lc_host_uint_least9,ptr<simple_location>,ucn> basic_ucn_token;
00049
00050
00051
00052
00053
00054
00055
00056 class ucn_token: public basic_ucn_token {
00057 public:
00058
00059 typedef ptr< ::lestes::msg::message > error_type;
00060
00061 error_type error_get(void) const;
00062
00063 ptr<ucn_token> clone_type(const type_type &a_type) const;
00064
00065 ptr<ucn_token> clone_value(const value_type &a_value) const;
00066
00067 ptr<ucn_token> clone_location(const location_type &a_location) const;
00068
00069 static ptr<ucn_token> create(const type_type &a_type);
00070
00071 static ptr<ucn_token> create(const type_type &a_type, const value_type &a_value);
00072
00073 static ptr<ucn_token> create(const type_type &a_type, const value_type &a_value,
00074 const location_type &a_location);
00075
00076 static ptr<ucn_token> create_error(const error_type &a_error, const location_type &a_location);
00077
00078 static ptr<ucn_token> create_error(const error_type &a_error);
00079
00080 bool equals(const ptr<ucn_token> &rhs) const;
00081
00082 enum token_types {
00083
00084 TOK_EOF = 0,
00085
00086 TOK_TRANSLATED = 1,
00087
00088 TOK_NOT_EOF = 2,
00089
00090 TOK_BASIC = 3,
00091
00092 TOK_ERROR = 4
00093 };
00094 protected:
00095
00096 ucn_token(const location_type &a_location, const type_type &a_type, const value_type &a_value);
00097
00098 ucn_token(const location_type &a_location, const error_type &a_error);
00099
00100 virtual void gc_mark(void);
00101 private:
00102
00103 srp< ::lestes::msg::message > error;
00104
00105 ucn_token(const ucn_token &);
00106
00107 ucn_token &operator=(const ucn_token &);
00108 };
00109
00110
00111 typedef ucn_token::type_type ucn_token_type;
00112
00113 end_package(lex);
00114 end_package(cplus);
00115 end_package(lang);
00116 end_package(lestes);
00117 #endif
00118