NLAISCRIPT::CIndexStackPointer Class Reference

#include <codage.h>

Inheritance diagram for NLAISCRIPT::CIndexStackPointer:

NLAISCRIPT::CStackPointer

Detailed Description

Class CIndexStackPointer.

Defined a basic fonctionality of an index pointer.

Author:
Chafik sameh

Nevrax France

Date:
2000

Definition at line 52 of file codage.h.

Public Member Functions

 CIndexStackPointer ()
void clear ()
 Reinitializ the stack manager.

virtual int mark ()
 Get the last mark.

virtual int markSize ()
virtual operator int ()
 To get the pointer.

virtual void operator++ (int)
 To inc the pointer.

virtual void operator+= (int k)
 To add by k range.

virtual void operator-- (int)
 To dec the pointer.

virtual void operator-= (int k)
 To dec by k range.

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.

virtual ~CIndexStackPointer ()

Protected Attributes

int _Sp
 Index of the stack pointer.


Private Attributes

std::list< int > _Marque
 List of mark for the pop-push mark method.


Constructor & Destructor Documentation

NLAISCRIPT::CIndexStackPointer::CIndexStackPointer  )  [inline]
 

Definition at line 63 of file codage.h.

References _Sp.

00063                                     :_Sp(0)
00064                 {
00065                 }

virtual NLAISCRIPT::CIndexStackPointer::~CIndexStackPointer  )  [inline, virtual]
 

Definition at line 130 of file codage.h.

00131                 {
00132                 }


Member Function Documentation

void NLAISCRIPT::CIndexStackPointer::clear void   )  [inline]
 

Reinitializ the stack manager.

Definition at line 124 of file codage.h.

References _Marque, and _Sp.

Referenced by NLAISCRIPT::CCompilateur::initParam().

00125                 {
00126                         _Sp = 0;                        
00127                         _Marque.clear();
00128                 }

virtual int NLAISCRIPT::CIndexStackPointer::mark  )  [inline, virtual]
 

Get the last mark.

Definition at line 118 of file codage.h.

References _Marque.

Referenced by NLAISCRIPT::CFreeAlloc::getDebugResult(), and NLAISCRIPT::CFreeAllocDebug::getDebugResult().

00119                 {
00120                         return _Marque.back();          
00121                 }

virtual int NLAISCRIPT::CIndexStackPointer::markSize  )  [inline, virtual]
 

Definition at line 112 of file codage.h.

References _Marque.

00113                 {
00114                         return _Marque.size();
00115                 }

virtual NLAISCRIPT::CIndexStackPointer::operator int  )  [inline, virtual]
 

To get the pointer.

Definition at line 68 of file codage.h.

References _Sp.

00069                 {
00070                         return _Sp;
00071                 }

virtual void NLAISCRIPT::CIndexStackPointer::operator++ int   )  [inline, virtual]
 

To inc the pointer.

Definition at line 74 of file codage.h.

References _Sp.

00075                 {               
00076                         _Sp ++;
00077                 }

virtual void NLAISCRIPT::CIndexStackPointer::operator+= int  k  )  [inline, virtual]
 

To add by k range.

Definition at line 86 of file codage.h.

References _Sp.

00087                 {
00088                         _Sp += k;
00089                 }

virtual void NLAISCRIPT::CIndexStackPointer::operator-- int   )  [inline, virtual]
 

To dec the pointer.

Reimplemented in NLAISCRIPT::CStackPointer.

Definition at line 80 of file codage.h.

References _Sp.

00081                 {               
00082                         _Sp --;
00083                 }

virtual void NLAISCRIPT::CIndexStackPointer::operator-= int  k  )  [inline, virtual]
 

To dec by k range.

Reimplemented in NLAISCRIPT::CStackPointer.

Definition at line 92 of file codage.h.

References _Sp.

00093                 {               
00094                         _Sp -= k;
00095                 }

virtual int NLAISCRIPT::CIndexStackPointer::popMark  )  [inline, virtual]
 

Get the last mark pushed in the list.

Definition at line 104 of file codage.h.

References _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                 }

virtual void NLAISCRIPT::CIndexStackPointer::pushMark  )  [inline, virtual]
 

Add a mark to store the pointer possition in a list.

Definition at line 98 of file codage.h.

References _Marque, and _Sp.

Referenced by NLAISCRIPT::CCompilateur::ifInterrogation(), NLAISCRIPT::CCompilateur::ifInterrogationPoint(), NLAISCRIPT::CCompilateur::initParam(), and NLAISCRIPT::CMarkAlloc::runOpCode().

00099                 {
00100                         _Marque.push_back(_Sp);
00101                 }


Field Documentation

std::list<int> NLAISCRIPT::CIndexStackPointer::_Marque [private]
 

List of mark for the pop-push mark method.

Definition at line 60 of file codage.h.

Referenced by clear(), mark(), markSize(), popMark(), and pushMark().

int NLAISCRIPT::CIndexStackPointer::_Sp [protected]
 

Index of the stack pointer.

Definition at line 56 of file codage.h.

Referenced by CIndexStackPointer(), clear(), operator int(), operator++(), operator+=(), operator--(), operator-=(), and pushMark().


The documentation for this class was generated from the following file:
Generated on Tue Mar 16 11:43:39 2004 for NeL by doxygen 1.3.6