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