
//  -*- c++ -*-

#ifndef XPATH_CONTEXT_H
#define XPATH_CONTEXT_H

#include <dom/dom_node.h>

namespace XPath {

/**
 * The context in which a query is being executed.
 * See REC-xpath-19991116 1.0 Section 1.
 *
 * @version $Id: xmldemo.h,v 1.3 2002/02/18 00:45:47 rich Exp $
 * @author Richard Moore, rich@kde.org 
 */
class Context
{
public:
    Context( const DOM::Node &node ) { curr = node; pos = sz = 0; }

    /** Returns the context node. */
    DOM::Node current() const { return curr; }
    /** Returns the context position. */
    uint position() const { return pos; }
    /** Returns the context size. */
    uint size() const { return sz; }

    /** TODO: Symbol table for variables. */
    void *variables;
    /** TODO: Symbol table for functions. */
    void *functions;
    /** TODO: Symbol table for namespaces. */
    void *namespaces;

private:
    DOM::Node curr;
    uint pos;
    uint sz;
};

}; // namespace XPath

#endif // XPATH_CONTEXT_H

// Local Variables:
// c-basic-offset: 4
// End:
