LibreOffice Module formula (master) 1
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
formula::FormulaTokenIterator Class Reference

#include <tokenarray.hxx>

Classes

struct  Item
 

Public Member Functions

 FormulaTokenIterator (const FormulaTokenArray &)
 
 ~FormulaTokenIterator ()
 
void Reset ()
 
const FormulaTokenNext ()
 
const FormulaTokenPeekNextOperator ()
 
bool IsEndOfPath () const
 
bool HasStacked () const
 if a jump or subroutine path is done More...
 
short GetPC () const
 
void Jump (short nStart, short nNext, short nStop=SHRT_MAX)
 Jump or subroutine call. More...
 
void Push (const FormulaTokenArray *)
 
void Pop ()
 
void ReInit (const FormulaTokenArray &)
 Reconstruct the iterator afresh from a token array. More...
 

Private Member Functions

const FormulaTokenGetNonEndOfPathToken (short nIdx) const
 

Private Attributes

std::vector< ItemmaStack
 

Detailed Description

Definition at line 534 of file tokenarray.hxx.

Constructor & Destructor Documentation

◆ FormulaTokenIterator()

formula::FormulaTokenIterator::FormulaTokenIterator ( const FormulaTokenArray rArr)

Definition at line 1622 of file token.cxx.

◆ ~FormulaTokenIterator()

formula::FormulaTokenIterator::~FormulaTokenIterator ( )

Definition at line 1627 of file token.cxx.

Member Function Documentation

◆ GetNonEndOfPathToken()

const FormulaToken * formula::FormulaTokenIterator::GetNonEndOfPathToken ( short  nIdx) const
private

◆ GetPC()

short formula::FormulaTokenIterator::GetPC ( ) const
inline

Definition at line 556 of file tokenarray.hxx.

◆ HasStacked()

bool formula::FormulaTokenIterator::HasStacked ( ) const
inline

if a jump or subroutine path is done

Definition at line 555 of file tokenarray.hxx.

◆ IsEndOfPath()

bool formula::FormulaTokenIterator::IsEndOfPath ( ) const

Definition at line 1728 of file token.cxx.

References GetNonEndOfPathToken(), and maStack.

◆ Jump()

void formula::FormulaTokenIterator::Jump ( short  nStart,
short  nNext,
short  nStop = SHRT_MAX 
)

Jump or subroutine call.

The nPC counts after a Push() are -1.

Program counter values will be incremented before code is executed => positions are to be passed with -1 offset.

Parameters
nStartStart on code at position nStart+1 (yes, pass with offset -1)
nNextAfter subroutine continue with instruction at position nNext+1
nStopStop before reaching code at position nStop. If not specified the default is to either run the entire code, or to stop if an ocSep or ocClose is encountered, which are only present in ocIf or ocChoose jumps.

Definition at line 1698 of file token.cxx.

References maStack, and Push().

◆ Next()

const FormulaToken * formula::FormulaTokenIterator::Next ( void  )

Definition at line 1665 of file token.cxx.

References GetNonEndOfPathToken(), maStack, Next(), Pop(), and t.

Referenced by Next().

◆ PeekNextOperator()

const FormulaToken * formula::FormulaTokenIterator::PeekNextOperator ( )

Definition at line 1676 of file token.cxx.

References GetNonEndOfPathToken(), maStack, ocPush, PeekNextOperator(), and t.

Referenced by PeekNextOperator().

◆ Pop()

void formula::FormulaTokenIterator::Pop ( )

Definition at line 1638 of file token.cxx.

References maStack.

Referenced by Next().

◆ Push()

void formula::FormulaTokenIterator::Push ( const FormulaTokenArray pArr)

Definition at line 1631 of file token.cxx.

References maStack.

Referenced by Jump(), and ReInit().

◆ ReInit()

void formula::FormulaTokenIterator::ReInit ( const FormulaTokenArray rArr)

Reconstruct the iterator afresh from a token array.

Definition at line 1709 of file token.cxx.

References maStack, and Push().

◆ Reset()

void formula::FormulaTokenIterator::Reset ( void  )

Definition at line 1643 of file token.cxx.

References maStack.

Member Data Documentation

◆ maStack

std::vector<Item> formula::FormulaTokenIterator::maStack
private

The documentation for this class was generated from the following files: