Unicorn XML Toolkit
Version 1.00.00

Namespace Xpath
Class CExprToken

class CExprToken {
public:
    enum {
        none,
        endOfStream,
        parenleft,
        parenright,
        bracketleft,
        bracketright,
        period,
        periodPeriod,
        at,
        comma,
        colonColon,
        nameTest,
        nodeType,
        operatorName,
        multiplyOperator,
        slash,
        slashSlash,
        bar,
        plus,
        minus,
        equal,
        exclamEqual,
        less,
        lessEqual,
        greater,
        greaterEqual,
        functionName,
        axisName,
        literal,
        number,
        variableReference
        };
    enum {
        ntypComment,
        ntypText,
        ntypProcessingInstruction,
        ntypNode
        };
    enum {
        operAnd,
        operOr,
        operMod,
        operDiv
        };
    enum {
        axisAncestor,
        axisAncestorOrSelf,
        axisAttribute,
        axisChild,
        axisDescendant,
        axisDescendantOrSelf,
        axisFollowing,
        axisFollowingSibling,
        axisNamespace,
        axisParent,
        axisPreceding,
        axisPrecedingSibling,
        axisSelf
        };
public:
    CExprToken();
    ~CExprToken();
public:
    void Create(int nType);
    void Create(int nType, int nValue);
    void Create(int nType, CNumber numValue);
    void Create(int nType, const CString &strValue);
public:
    const CExprToken &operator=(const CExprToken &token);
    int GetType() const;
    int GetCode() const;
    CNumber GetNumber() const;
    CString GetString() const;
    };

The XPath expression token.

This class may be used by applications which implement languages based on the XPath expression language (for example, the XSLT pattern language).

Every token has the associated type value. Type values are represented via constants specified by the anonymous enumeration in this class declaration. Furthermore, certain tokens may have associated integer, number or string values.

Since:
1.00.00
Version:
1.00.00
Author:
Alexey Gokhberg
See Also:
CNumber
Constructor/Destructor Summary
CExprToken ();
����������Constructs the token.
~CExprToken ();
����������Destroys the token.

Function Summary
void Create (int nType);
����������Creates the token with the given type.
void Create (int nType, int nValue);
����������Creates the token with the given type and integer value.
void Create (int nType, CNumber numValue);
����������Creates the token with the given type and number value.
void Create (int nType, const CString &strValue);
����������Creates the token with the given type and string value.
int GetType ();
����������Returns the type of this token.
int GetCode ();
����������Returns the integer value assigned to this token.
CNumber GetNumber ();
����������Returns the number value assigned to this token.
CString GetString ();
����������Returns the string value assigned to this token.

Constructor/Destructor Detail

CExprToken

CExprToken();

Constructs the token.

The content of the newly constructed token is initially unspecified; it must be set explicitly using the Create function.

~CExprToken

~CExprToken();

Destroys the token.

Function Detail

Create

void Create(int nType);

Creates the token with the given type.

Parameters:
nType - the type of this token

Create

void Create(int nType, int nValue);

Creates the token with the given type and integer value.

Parameters:
nType - the of this token
nValue - the integer value of this token

Create

void Create(int nType, CNumber numValue);

Creates the token with the given type and number value.

Parameters:
nType - the type of this token
numValue - the number value of this token

Create

void Create(int nType, const CString &strValue);

Creates the token with the given type and string value.

Parameters:
nType - the type of this token
strValue - the string value of this token

GetType

int GetType();

Returns the type of this token.

Returns:
the type of this token

GetCode

int GetCode();

Returns the integer value assigned to this token.

Returns:
the integer value assigned to this token; unspecified if no integer value was assigned

GetNumber

CNumber GetNumber();

Returns the number value assigned to this token.

Returns:
the number value assigned to this token; unspecified if no number value was assigned

GetString

CString GetString();

Returns the string value assigned to this token.

Returns:
the string value assigned to this token; unspecified if no string value was assigned

Unicorn XML Toolkit
Version 1.00.00


This document was created using Unicorn DOC++.

Copyright 1999-2001 Unicorn Enterprises SA.
All Rights Reserved.