#include <codage.h>
Define a container for the op-code produced from the parser.
A container of code is define by a op-code pointer and a list of constraine that needs the index range of the op-code in the CCodeBrancheRun class, where CCodeBrancheRun is the op-code container.
Nevrax France
Definition at line 442 of file codage.h.
Public Member Functions | |
void | addConstraint (CBagOfCode *b) |
allow us to add the all constraint in a bag. | |
void | addConstraint (IConstraint *c) |
allow us to add a constraint in the bag. | |
CBagOfCode (IOpCode *opcode) | |
operator IOpCode * () const | |
That is the only way to have the op-code contened. | |
void | setCode (IOpCode *op) |
That is the only way to set the op-code in container. | |
void | setConstraintIndex (int i, CCodeBrancheRun *c) |
~CBagOfCode () | |
Private Attributes | |
std::list< IConstraint * > | _Constraint |
IOpCode * | _Opcode |
|
Definition at line 449 of file codage.h.
00449 :_Opcode(opcode) 00450 { 00451 00452 } |
|
Definition at line 486 of file codage.h.
00486 {} |
|
allow us to add the all constraint in a bag.
Definition at line 473 of file codage.h. References _Constraint.
00474 { 00475 std::list<IConstraint *>::iterator it = b->_Constraint.begin(); 00476 while(it != b->_Constraint.end()) 00477 { 00478 _Constraint.push_back(*it++); 00479 } 00480 } |
|
allow us to add a constraint in the bag.
Definition at line 467 of file codage.h. Referenced by NLAISCRIPT::CCompilateur::affectation(), NLAISCRIPT::CCompilateur::allocExpression(), NLAISCRIPT::CCompilateur::buildObject(), and NLAISCRIPT::CCompilateur::callFunction().
00468 { 00469 _Constraint.push_back(c); 00470 } |
|
That is the only way to have the op-code contened.
Definition at line 455 of file codage.h.
00456 { 00457 return _Opcode; 00458 } |
|
That is the only way to set the op-code in container.
Definition at line 461 of file codage.h.
00462 { 00463 _Opcode = op; 00464 } |
|
setConstraintIndex method transmit to them constraint the index range of op-code and the base pointer of where they are. Not that the base pointer is a CCodeBrancheRun and when it's built an index range is creat for each of op-code in the container at this moment setConstraintIndex we can call the copnstraints. Definition at line 236 of file codage.cpp. References _Constraint.
00237 { 00238 std::list<IConstraint *>::iterator it = _Constraint.begin(); 00239 while(it != _Constraint.end()) 00240 { 00241 (*it++)->addIndex(i,c); 00242 } 00243 } |
|
Definition at line 446 of file codage.h. Referenced by addConstraint(), and setConstraintIndex(). |
|
|