#include <codage.h>
Inheritance diagram for NLAISCRIPT::CStackPointer:
Defined a basic fonctionality of a stack index pointer.
Nevrax France
Definition at line 148 of file codage.h.
Public Member Functions | |
void | addStack (int bp) |
set an bp shift to relative stack pointer _Bp. | |
void | clear () |
Reinitializ the stack manager. | |
CStackPointer (int count=1024 *8) | |
virtual int | mark () |
Get the last mark. | |
virtual int | markSize () |
virtual | operator int () |
To get the pointer. | |
operator NLAIAGENT::IObjectIA * () | |
Get the IObjectIA pointer in current position. | |
virtual void | operator++ (int) |
To inc the pointer. | |
virtual void | operator+= (int k) |
To add by k range. | |
virtual void | operator-- (int) |
Dec the current position of the stack point by one. | |
virtual void | operator-= (int k) |
Dec the current position of the stack point by k unite. | |
NLAIAGENT::IObjectIA *& | operator[] (int i) |
Get the pointer in the position i. | |
virtual int | popMark () |
Get the last mark pushed in the list. | |
virtual void | pushMark () |
Add a mark to store the pointer possition in a list. | |
void | restoreShift () |
restore the last _Sh shift to the stack pointer. | |
bool | restoreShiftState () |
if there is any _Sh shift. | |
void | restoreStack () |
restore the last _Bp shift to the stack pointer. | |
bool | restoreStackState () |
if there is any _Bp shift. | |
void | setShift (int s) |
set an s shift to relative stack pointer _Sh. | |
~CStackPointer () | |
Protected Attributes | |
int | _Sp |
Index of the stack pointer. | |
Private Attributes | |
int | _Bp |
_Bp is a relative pointer to upright the stack point at the entry point of a methode. | |
int | _Count |
the count of allocation table. | |
std::list< int > | _Decalage |
list to storager the last shift release in _Bp | |
int | _Sh |
_Sh is a relative pointer to upright the stack after allocat the argument of a methode. | |
std::list< int > | _Shift |
list to storager the last shift release in _Sh | |
NLAIAGENT::IObjectIA ** | _Stack |
this IObjectIA table have _Count size. |
|
Definition at line 168 of file codage.h. References _Bp, _Sh, and count.
|
|
Definition at line 293 of file codage.h.
|
|
set an bp shift to relative stack pointer _Bp.
Definition at line 245 of file codage.h. Referenced by NLAISCRIPT::CMethodContextDebug::saveContext(), and NLAISCRIPT::CMethodContext::saveContext().
|
|
Reinitializ the stack manager.
Definition at line 124 of file codage.h. References NLAISCRIPT::CIndexStackPointer::_Marque, and NLAISCRIPT::CIndexStackPointer::_Sp. Referenced by NLAISCRIPT::CCompilateur::initParam().
00125 { 00126 _Sp = 0; 00127 _Marque.clear(); 00128 } |
|
Get the last mark.
Definition at line 118 of file codage.h. References NLAISCRIPT::CIndexStackPointer::_Marque. Referenced by NLAISCRIPT::CFreeAlloc::getDebugResult(), and NLAISCRIPT::CFreeAllocDebug::getDebugResult().
00119 {
00120 return _Marque.back();
00121 }
|
|
Definition at line 112 of file codage.h. References NLAISCRIPT::CIndexStackPointer::_Marque.
00113 {
00114 return _Marque.size();
00115 }
|
|
To get the pointer.
Definition at line 68 of file codage.h. References NLAISCRIPT::CIndexStackPointer::_Sp.
00069 { 00070 return _Sp; 00071 } |
|
Get the IObjectIA pointer in current position.
Definition at line 194 of file codage.h. References _Bp, _Sh, and operator NLAIAGENT::IObjectIA *(). Referenced by operator NLAIAGENT::IObjectIA *().
|
|
To inc the pointer.
Definition at line 74 of file codage.h. References NLAISCRIPT::CIndexStackPointer::_Sp.
00075 { 00076 _Sp ++; 00077 } |
|
To add by k range.
Definition at line 86 of file codage.h. References NLAISCRIPT::CIndexStackPointer::_Sp.
00087 { 00088 _Sp += k; 00089 } |
|
Dec the current position of the stack point by one.
Reimplemented from NLAISCRIPT::CIndexStackPointer. Definition at line 206 of file codage.h.
|
|
Dec the current position of the stack point by k unite.
Reimplemented from NLAISCRIPT::CIndexStackPointer. Definition at line 224 of file codage.h.
00225 { 00226 #ifdef NL_DEBUG 00227 if ( (_Sp + _Bp + _Sh) >= _Count ) 00228 { 00229 throw NLAIE::CExceptionIndexError(); 00230 } 00231 #endif 00232 int n = _Sp + _Bp + _Sh; 00233 for(int i = n - k; i < n; i ++) 00234 { 00235 if(_Stack[i]) 00236 { 00237 _Stack[i]->release(); 00238 _Stack[i] = NULL; 00239 } 00240 } 00241 _Sp -= k; 00242 } |
|
Get the pointer in the position i.
Definition at line 182 of file codage.h.
|
|
Get the last mark pushed in the list.
Definition at line 104 of file codage.h. References NLAISCRIPT::CIndexStackPointer::_Marque. Referenced by NLAISCRIPT::CCompilateur::getCode(), NLAISCRIPT::CCompilateur::ifInterrogationEnd(), NLAISCRIPT::CCompilateur::ifInterrogationPoint(), NLAISCRIPT::CCompilateur::interrogationEnd(), NLAISCRIPT::CFreeAlloc::runOpCode(), and NLAISCRIPT::CFreeAllocDebug::runOpCode().
00105 { 00106 int i = 0; 00107 i = _Marque.back(); 00108 _Marque.pop_back(); 00109 return i; 00110 } |
|
Add a mark to store the pointer possition in a list.
Definition at line 98 of file codage.h. References NLAISCRIPT::CIndexStackPointer::_Marque, and NLAISCRIPT::CIndexStackPointer::_Sp. Referenced by NLAISCRIPT::CCompilateur::ifInterrogation(), NLAISCRIPT::CCompilateur::ifInterrogationPoint(), NLAISCRIPT::CCompilateur::initParam(), and NLAISCRIPT::CMarkAlloc::runOpCode().
00099 { 00100 _Marque.push_back(_Sp); 00101 } |
|
restore the last _Sh shift to the stack pointer.
Definition at line 272 of file codage.h. References s. Referenced by NLAISCRIPT::CCompilateur::getCode(), NLAISCRIPT::CMethodContextDebug::loadContext(), NLAISCRIPT::CMethodContext::loadContext(), and NLAISCRIPT::CCompilateur::registerMethod().
|
|
if there is any _Sh shift.
Definition at line 288 of file codage.h. Referenced by NLAISCRIPT::CCompilateur::getCode(), and NLAISCRIPT::CCompilateur::registerMethod().
00289 { 00290 return _Shift.size() != 0; 00291 } |
|
restore the last _Bp shift to the stack pointer.
Definition at line 253 of file codage.h. Referenced by NLAISCRIPT::CCompilateur::getCode(), NLAISCRIPT::CMethodContextDebug::loadContext(), NLAISCRIPT::CMethodContext::loadContext(), and NLAISCRIPT::CCompilateur::registerMethod().
|
|
if there is any _Bp shift.
Definition at line 282 of file codage.h. Referenced by NLAISCRIPT::CCompilateur::getCode(), and NLAISCRIPT::CCompilateur::registerMethod().
00283 { 00284 return _Decalage.size() != 0; 00285 } |
|
set an s shift to relative stack pointer _Sh.
Definition at line 264 of file codage.h. References s. Referenced by NLAISCRIPT::CCompilateur::registerMethod(), NLAISCRIPT::CMethodContextDebug::saveContext(), and NLAISCRIPT::CMethodContext::saveContext().
|
|
_Bp is a relative pointer to upright the stack point at the entry point of a methode.
Definition at line 154 of file codage.h. Referenced by CStackPointer(), operator NLAIAGENT::IObjectIA *(), and operator[](). |
|
the count of allocation table.
|
|
list to storager the last shift release in _Bp
|
|
_Sh is a relative pointer to upright the stack after allocat the argument of a methode.
Definition at line 157 of file codage.h. Referenced by CStackPointer(), operator NLAIAGENT::IObjectIA *(), and operator[](). |
|
list to storager the last shift release in _Sh
|
|
|
this IObjectIA table have _Count size.
|