## Xalan-C++ API Documentation

### The Xalan C++ XSLT Processor Version 1.5

Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# VariablesStack Class Reference

Defines a class to keep track of a stack for macro arguments. More...

`#include <VariablesStack.hpp>`

List of all members.

## Public Types

- typedef std::vector<ParamsVectorEntry> ParamsVectorType
- typedef std::vector<const
  ElemVariable*> RecursionGuardStackType
- typedef std::vector<StackEntry> VariableStackStackType
- enum { eDefaultStackSize = 100 }

## Public Methods

- VariablesStack ()
    Constructor for a variable stack. More...
- ~VariablesStack ()
- void reset ()
    Reset the stack. More...
- void pushElementFrame (const ElemTemplateElement *elem)
    Push a frame marker for an element. More...
- void popElementFrame (const ElemTemplateElement *elem)
    Pop a frame marker for an element. More...
- void pushContextMarker ()
    Push a context marker onto the stack to let us know when to stop searching for a var. More...
- void popContextMarker ()
    Pop the current context from the current context stack. More...
- void pushParams (const ParamsVectorType &theParams, const ElemTemplateElement *targetTemplate)
    Push the provided objects as parameters. More...
- const XObjectPtr getParamVariable (const XalanQName &qname, StylesheetExecutionContext &executionContext, bool &fNameFound)
    Given a name, return a string representing the value, but don't look in the global space. More...
- const XObjectPtr getVariable (const XalanQName &qname, StylesheetExecutionContext &executionContext, bool &fNameFound)
    Given a name, find the corresponding XObject. More...
- void pushVariable (const XalanQName &name, const ElemVariable *var, const ElemTemplateElement *e)
    Push a named variable onto the processor variable stack. More...
- void pushVariable (const XalanQName &name, const XObjectPtr &val, const ElemTemplateElement *e)
    Push a named variable onto the processor variable stack. More...
- void start ()
    Mark the top of the stack. More...
- void resetParams ()
    Reset all params in the current stack frame. More...
- void markGlobalStackFrame ()
    Mark the top of the global stack frame. More...
- void unmarkGlobalStackFrame ()
    Clear the marking of the global stack frame. More...
- void setCurrentStackFrameIndex (int currentStackFrameIndex=-1)
    Set the top of the stack frame from where a search for a variable or param should take place. More...
- int getCurrentStackFrameIndex () const
    Get the top of the stack frame from where a search for a variable or param should take place. More...
- int getGlobalStackFrameIndex () const
    Get the top of the global stack frame. More...

## Detailed Description

Defines a class to keep track of a stack for macro arguments.

## Member Typedef Documentation

typedef std::vector< ParamsVectorEntry > VariablesStack::ParamsVectorType<ParamsVectorEntry>

typedef std::vector< const ElemVariable *> VariablesStack::RecursionGuardStackType<const ElemVariable*>

typedef std::vector< StackEntry > VariablesStack::VariableStackStackType<StackEntry>

## Member Enumeration Documentation

anonymous enum

  | Enumeration values:
  eDefaultStackSize |

## Constructor & Destructor Documentation

VariablesStack::VariablesStack ( | )`[explicit]`

| Constructor for a variable stack.

VariablesStack::~VariablesStack ( | )

## Member Function Documentation

int VariablesStack::getCurrentStackFrameIndex ( | ) const

| Get the top of the stack frame from where a search for a variable or param should take place. Returns: current value of index

int VariablesStack::getGlobalStackFrameIndex ( | ) const

| Get the top of the global stack frame. Returns: current value of index

const XObjectPtr VariablesStack::getParamVariable ( | const XalanQName & qname,
| StylesheetExecutionContext & executionContext,
| bool & fNameFound )

  | Given a name, return a string representing the value, but don't look in the global space. Since the variable may not yet have been evaluated, this may return a null XObjectPtr. Parameters:
  theName | name of variable
  exeuctionContext | the current execution context
  fNameFound | set to true if the name was found, false if not.
Returns: pointer to XObject for variable

const XObjectPtr VariablesStack::getVariable ( | const XalanQName & qname,
| StylesheetExecutionContext & executionContext,
| bool & fNameFound )

  | Given a name, find the corresponding XObject. If the variable exists, but has not yet been evaluated, the variable will be evaluated and the result returned. This may return a null XObjectPtr, if the variable was not found. Parameters:
  qname | name of variable
  exeuctionContext | the current execution context
  fNameFound | set to true if the name was found, false if not.
Returns: pointer to the corresponding XObject

void VariablesStack::markGlobalStackFrame ( | )

| Mark the top of the global stack frame.

void VariablesStack::popContextMarker ( | )

| Pop the current context from the current context stack.

void VariablesStack::popElementFrame ( | const ElemTemplateElement * elem )

  | Pop a frame marker for an element. Parameters:
  elem | the element

void VariablesStack::pushContextMarker ( | )

  | Push a context marker onto the stack to let us know when to stop searching for a var. Parameters:
  caller | caller node
  sourceNode | source node

void VariablesStack::pushElementFrame ( | const ElemTemplateElement * elem )

  | Push a frame marker for an element. Parameters:
  elem | the element

void VariablesStack::pushParams ( | const ParamsVectorType & theParams,
| const ElemTemplateElement * targetTemplate )

  | Push the provided objects as parameters. You must call popContextMarker() when you are done with the arguments. Parameters:
  theParam | The vector containing the parameters.
  targetTemplate | target template for the parameters

void VariablesStack::pushVariable ( | const XalanQName & name,
| const XObjectPtr & val,
| const ElemTemplateElement * e )

  | Push a named variable onto the processor variable stack. Don't forget to call startContext before pushing a series of arguments for a given template. Parameters:
  name | name of variable
  val | pointer to XObject value
  e | element marker for variable

void VariablesStack::pushVariable ( | const XalanQName & name,
| const ElemVariable * var,
| const ElemTemplateElement * e )

  | Push a named variable onto the processor variable stack. Don't forget to call startContext before pushing a series of arguments for a given template. Parameters:
  name | name of variable
  val | pointer to ElemVariable
  e | element marker for variable

void VariablesStack::reset ( | )

| Reset the stack.

void VariablesStack::resetParams ( | )

| Reset all params in the current stack frame.

void VariablesStack::setCurrentStackFrameIndex ( | int currentStackFrameIndex = -1 )

  | Set the top of the stack frame from where a search for a variable or param should take place. Calling with no parameter will cause the index to be set to the size of the stack. Parameters:
  currentStackFrameIndex | new value of index

void VariablesStack::start ( | )

| Mark the top of the stack.

void VariablesStack::unmarkGlobalStackFrame ( | )

| Clear the marking of the global stack frame.

## Friends And Related Function Documentation

class CommitPushElementFrame`[friend]`

class EnsurePop`[friend]`

class PushParamFunctor`[friend]`

class SetAndRestoreForceGlobalSearch`[friend]`

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

- VariablesStack.hpp

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

Xalan-C++ XSLT Processor Version 1.5 Copyright © 2000, 2001, 2002, 2003 The Apache Software Foundation. All Rights Reserved.