source: dev/trunk/abdev/BasicCompiler_Common/include/Symbol.h@ 402

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

UserProc::SetParamsAndReturnTypeメソッドをリファクタリング
LexicalAnalysis.hのインクルードを除去した

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