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

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

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

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