[206] | 1 | #pragma once
|
---|
| 2 |
|
---|
[509] | 3 | namespace ActiveBasic{ namespace Common{ namespace Lexical{
|
---|
[206] | 4 |
|
---|
[603] | 5 | std::string Operator_NaturalStringToCalcMarkString( const std::string &name );
|
---|
| 6 | std::string Operator_CalcMarkStringToNaturalString( const std::string &name );
|
---|
[215] | 7 |
|
---|
[206] | 8 | class Symbol
|
---|
| 9 | {
|
---|
[504] | 10 | static const NamespaceSupporter *namespaceSupporter;
|
---|
| 11 |
|
---|
[206] | 12 | NamespaceScopes namespaceScopes;
|
---|
[509] | 13 | std::string name;
|
---|
[206] | 14 |
|
---|
| 15 | // XMLシリアライズ用
|
---|
| 16 | private:
|
---|
| 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] | 39 | public:
|
---|
[509] | 40 | Symbol( const NamespaceScopes &namespaceScopes, const std::string &name )
|
---|
[206] | 41 | : namespaceScopes( namespaceScopes )
|
---|
| 42 | , name( name )
|
---|
| 43 | {
|
---|
| 44 | }
|
---|
| 45 | Symbol( const Symbol &symbol )
|
---|
| 46 | : namespaceScopes( symbol.namespaceScopes )
|
---|
| 47 | , name( symbol.name )
|
---|
| 48 | {
|
---|
| 49 | }
|
---|
| 50 | Symbol()
|
---|
| 51 | {
|
---|
| 52 | }
|
---|
| 53 |
|
---|
[504] | 54 | static void RegistNamespaceSupporter( const NamespaceSupporter *namespaceSupporter )
|
---|
| 55 | {
|
---|
| 56 | Symbol::namespaceSupporter = namespaceSupporter;
|
---|
| 57 | }
|
---|
| 58 |
|
---|
[208] | 59 | virtual const NamespaceScopes &GetNamespaceScopes() const
|
---|
[206] | 60 | {
|
---|
| 61 | return namespaceScopes;
|
---|
| 62 | }
|
---|
[509] | 63 | const std::string &GetName() const
|
---|
[206] | 64 | {
|
---|
| 65 | return name;
|
---|
| 66 | }
|
---|
[348] | 67 | std::string GetFullName() const;
|
---|
[206] | 68 |
|
---|
| 69 | // シンボル比較
|
---|
[509] | 70 | bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const std::string &name ) const;
|
---|
[206] | 71 | bool IsEqualSymbol( const Symbol &symbol ) const;
|
---|
| 72 | };
|
---|
[509] | 73 |
|
---|
| 74 |
|
---|
| 75 | }}}
|
---|