1 | #pragma once
|
---|
2 |
|
---|
3 | class ObjectModule;
|
---|
4 |
|
---|
5 | namespace ActiveBasic{ namespace Common{ namespace Lexical{
|
---|
6 |
|
---|
7 |
|
---|
8 | class RelationalObjectModuleItem
|
---|
9 | : public Symbol
|
---|
10 | {
|
---|
11 | int relationalObjectModuleIndex;
|
---|
12 |
|
---|
13 | // XMLシリアライズ用
|
---|
14 | private:
|
---|
15 | friend class boost::serialization::access;
|
---|
16 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
17 | {
|
---|
18 | ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Symbol );
|
---|
19 | ar & BOOST_SERIALIZATION_NVP( relationalObjectModuleIndex );
|
---|
20 | }
|
---|
21 |
|
---|
22 | public:
|
---|
23 | RelationalObjectModuleItem( const RelationalObjectModuleItem &relationalObjectModuleItem )
|
---|
24 | : Symbol( relationalObjectModuleItem )
|
---|
25 | , relationalObjectModuleIndex( relationalObjectModuleItem.relationalObjectModuleIndex )
|
---|
26 | , isNeedResolve( false )
|
---|
27 | {
|
---|
28 | }
|
---|
29 | RelationalObjectModuleItem( const Symbol &symbol )
|
---|
30 | : Symbol( symbol )
|
---|
31 | , relationalObjectModuleIndex( 0 )
|
---|
32 | , isNeedResolve( false )
|
---|
33 | {
|
---|
34 | }
|
---|
35 | RelationalObjectModuleItem()
|
---|
36 | : relationalObjectModuleIndex( -1 )
|
---|
37 | , isNeedResolve( false )
|
---|
38 | {
|
---|
39 | }
|
---|
40 |
|
---|
41 | int GetRelationalObjectModuleIndex() const
|
---|
42 | {
|
---|
43 | return relationalObjectModuleIndex;
|
---|
44 | }
|
---|
45 | void SetRelationalObjectModuleIndex( int relationalObjectModuleIndex )
|
---|
46 | {
|
---|
47 | this->relationalObjectModuleIndex = relationalObjectModuleIndex;
|
---|
48 | }
|
---|
49 |
|
---|
50 | virtual void ResetRelationalObjectModuleIndex( const std::vector<int> &relationTable )
|
---|
51 | {
|
---|
52 | this->relationalObjectModuleIndex = relationTable[this->relationalObjectModuleIndex];
|
---|
53 | }
|
---|
54 |
|
---|
55 | bool IsExternal() const
|
---|
56 | {
|
---|
57 | return ( relationalObjectModuleIndex != 0 );
|
---|
58 | }
|
---|
59 |
|
---|
60 | bool isNeedResolve;
|
---|
61 | bool IsNeedResolve() const
|
---|
62 | {
|
---|
63 | return isNeedResolve;
|
---|
64 | }
|
---|
65 | void NeedResolve()
|
---|
66 | {
|
---|
67 | isNeedResolve = true;
|
---|
68 | }
|
---|
69 |
|
---|
70 | virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors ) = 0;
|
---|
71 | };
|
---|
72 |
|
---|
73 |
|
---|
74 | }}}
|
---|