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___cpp_token_hh___included
00029 #define lestes__lang__cplus__lex___cpp_token_hh___included
00030
00031
00032
00033
00034
00035
00036
00037 #include <lestes/common.hh>
00038 #include <lestes/lang/cplus/lex/basic_token.hh>
00039 #include <lestes/std/map.hh>
00040
00041 package(lestes);
00042 package(std);
00043
00044 class source_location;
00045 end_package(std);
00046 package(lang);
00047 package(cplus);
00048 package(lex);
00049
00050
00051 class lex_literal;
00052 class token_value;
00053
00054
00055 typedef basic_token<int,ptr<source_location>,ptr<token_value> > basic_cpp_token;
00056
00057
00058
00059
00060
00061
00062 class cpp_token: public basic_cpp_token {
00063 public:
00064
00065 typedef ptr<lex_literal> literal_type;
00066
00067 #include <lestes/lang/cplus/syn/cpp_token_type_enum.s.hh>
00068
00069 bool equals(const ptr<cpp_token> &rhs) const;
00070
00071 ptr<lex_literal> literal_get(void) const;
00072
00073 lstring description_get(void) const;
00074
00075 static ptr<cpp_token> create(const location_type &a_location, const type_type &a_type);
00076
00077 static ptr<cpp_token> create(const location_type &a_location,
00078 const type_type &a_type, const value_type &a_value);
00079
00080 static ptr<cpp_token> create_literal(const location_type &a_location,
00081 const literal_type &a_literal, const value_type &a_value);
00082
00083 virtual ptr<reflection_list> reflection_get(void) const;
00084
00085 virtual ptr<field_list_list> field_values_get(void) const;
00086 protected:
00087
00088 cpp_token(const location_type &a_location, const type_type &a_type, const value_type &a_value,
00089 const literal_type &a_literal);
00090
00091 virtual void gc_mark(void);
00092 private:
00093
00094 typedef map<type_type,lstring> descriptions_type;
00095
00096 srp<lex_literal> literal;
00097
00098 static ptr<descriptions_type> descriptions;
00099
00100 static ptr<reflection_list> reflection;
00101
00102 cpp_token(const cpp_token &);
00103
00104 cpp_token &operator=(const cpp_token &);
00105 };
00106
00107
00108 typedef cpp_token::type_type cpp_token_type;
00109
00110 end_package(lex);
00111 end_package(cplus);
00112 end_package(lang);
00113 end_package(lestes);
00114 #endif
00115