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

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

ab_commonプロジェクト内にLexicalディレクトリを作成。

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