source: dev/trunk/ab5.0/abdev/ab_common/include/Lexical/Symbol.h@ 626

Last change on this file since 626 was 603, checked in by dai_9181, 17 years ago

ObjectModuleに関連するクラス一式をab_commonプロジェクトに移動した。

File size: 2.0 KB
Line 
1#pragma once
2
3namespace ActiveBasic{ namespace Common{ namespace Lexical{
4
5std::string Operator_NaturalStringToCalcMarkString( const std::string &name );
6std::string Operator_CalcMarkStringToNaturalString( const std::string &name );
7
8class Symbol
9{
10 static const NamespaceSupporter *namespaceSupporter;
11
12 NamespaceScopes namespaceScopes;
13 std::string name;
14
15 // XMLシリアライズ用
16private:
17 friend class boost::serialization::access;
18 BOOST_SERIALIZATION_SPLIT_MEMBER();
19 template<class Archive> void load(Archive& ar, const unsigned int version)
20 {
21 //trace_for_serialize( "serializing(load) - Symbol" );
22
23 ar & BOOST_SERIALIZATION_NVP( namespaceScopes );
24
25 std::string _name;
26 ar & BOOST_SERIALIZATION_NVP( _name );
27 this->name = Operator_NaturalStringToCalcMarkString( _name );
28 }
29 template<class Archive> void save(Archive& ar, const unsigned int version) const
30 {
31 //trace_for_serialize( "serializing(save) - Symbol" );
32
33 ar & BOOST_SERIALIZATION_NVP( namespaceScopes );
34
35 std::string _name = Operator_CalcMarkStringToNaturalString( name );
36 ar & BOOST_SERIALIZATION_NVP( _name );
37 }
38
39public:
40 bool isTargetObjectModule;
41 Symbol( const NamespaceScopes &namespaceScopes, const std::string &name )
42 : namespaceScopes( namespaceScopes )
43 , name( name )
44 , isTargetObjectModule( true )
45 {
46 }
47 Symbol( const Symbol &symbol )
48 : namespaceScopes( symbol.namespaceScopes )
49 , name( symbol.name )
50 , isTargetObjectModule( true )
51 {
52 }
53 Symbol()
54 : isTargetObjectModule( true )
55 {
56 }
57
58 static void RegistNamespaceSupporter( const NamespaceSupporter *namespaceSupporter )
59 {
60 Symbol::namespaceSupporter = namespaceSupporter;
61 }
62
63 virtual const NamespaceScopes &GetNamespaceScopes() const
64 {
65 return namespaceScopes;
66 }
67 const std::string &GetName() const
68 {
69 return name;
70 }
71 std::string GetFullName() const;
72
73 // シンボル比較
74 bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const std::string &name ) const;
75 bool IsEqualSymbol( const Symbol &symbol ) const;
76};
77
78
79}}}
Note: See TracBrowser for help on using the repository browser.