source: dev/trunk/ab5.0/abdev/BasicCompiler_Common/include/TypeDef.h@ 542

Last change on this file since 542 was 542, checked in by dai_9181, 16 years ago

CollectTypeDefsメソッドをLexicalAnalyzerクラスに移動した。

File size: 1.5 KB
RevLine 
[193]1#pragma once
2
3class TypeDefCollection;
4
[206]5class TypeDef : public Symbol
6{
[193]7 friend TypeDefCollection;
8
[523]9 std::string baseName;
[193]10 Type baseType;
[206]11
12 // XMLシリアライズ用
13private:
14 friend class boost::serialization::access;
15 template<class Archive> void serialize(Archive& ar, const unsigned int version)
16 {
17 trace_for_serialize( "serializing - TypeDef" );
18
19 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Symbol );
20 ar & BOOST_SERIALIZATION_NVP( baseName );
21 ar & BOOST_SERIALIZATION_NVP( baseType );
22 }
23
[193]24public:
[542]25 TypeDef( const NamespaceScopes &namespaceScopes, const std::string &name, const std::string &baseName, const Type &baseType );
[206]26 TypeDef()
[193]27 {
28 }
[206]29 ~TypeDef()
30 {
31 }
32
[523]33 const std::string &GetBaseName() const
[193]34 {
35 return baseName;
36 }
37 const Type &GetBaseType() const
38 {
39 return baseType;
40 }
41};
42
[206]43class TypeDefCollection : public std::vector<TypeDef>
[193]44{
[206]45 // XMLシリアライズ用
46private:
47 friend class boost::serialization::access;
48 template<class Archive> void serialize(Archive& ar, const unsigned int version)
49 {
50 trace_for_serialize( "serializing - TypeDefCollection" );
51
52 ar & boost::serialization::make_nvp("vector_TypeDef",
53 boost::serialization::base_object<std::vector<TypeDef>>(*this));
54 }
55
[193]56public:
57 TypeDefCollection();
58 ~TypeDefCollection();
59
[523]60 void Add( const NamespaceScopes &namespaceScopes, const std::string &name, const std::string &baseName, int nowLine );
61 int GetIndex( const NamespaceScopes &namespaceScopes, const std::string &name ) const;
62 int GetIndex( const std::string &fullName ) const;
[193]63};
Note: See TracBrowser for help on using the repository browser.