CBNFParser Class Reference

#include <mw/cbnfparser.h>

Link against: bnf.lib

class CBNFParser : public CBase

Inherits from

  • CBNFParser
    Protected Member Type Definitions
    typedef CStack< CBNFNode, EFalse > CRuleStack
    typedefvoid( TRuleCallback
    Protected Attributes
    CBNFNode *iCurrentRule
    CAttributeLookupTable &iLUT
    CFragmentedString::TStringMatch iMatched
    const TDesC *iMoreCount
    const TDesC *iMoreMaximum
    const TDesC *iMoreMinimum
    TBool iOptionalMatched
    TParseState iParsing
    const TDesC *iPostRuleCallback
    const TDesC *iPreRuleCallback
    const TDesC *iRangeEnd
    const TDesC *iRangeStart
    const TDesC *iReferenceString
    CRuleStack iRuleStack
    CFragmentedString iString
    TBool iStringComplete
    CBNFNode *iSubRule
    TBool iSubRuleMatched
    CBNFNode *iTree
    Public Member Functions
    virtual ~CBNFParser()
    IMPORT_C voidAddComponentAttributeL(CBNFNode &, CBNFNodeAttributeType, TInt)
    IMPORT_C voidCommitL()
    CBNFNode *CurrentRule()
    voidDeleteMark()
    virtual IMPORT_C voidMDataProviderObserverReserved1()
    virtual IMPORT_C voidMDataProviderObserverReserved2()
    voidMark()
    HBufC *MarkedL()
    HBufC *MarkedWithInitialTextL(const TDesC &)
    IMPORT_C CBNFNode *NewBNFL()
    IMPORT_C CBNFNode *NewComponentL(TParserNodeTypes, const TDesC &)
    IMPORT_C CBNFNode *NewComponentL(TParserNodeTypes, HBufC *, TRuleCallback *, TRuleCallback *)
    IMPORT_C CBNFNode *NewComponentL(CBNFNode *, const TDesC &)
    IMPORT_C CBNFNode &NewComponentL(CBNFNode &, TParserNodeTypes, const TDesC &)
    IMPORT_C CBNFNode &NewComponentL(CBNFNode &, TParserNodeTypes, HBufC *, TRuleCallback *, TRuleCallback *)
    IMPORT_C CBNFNode &NewComponentL(CBNFNode *, CBNFNode &, const TDesC &)
    IMPORT_C CBNFParser *NewL(CAttributeLookupTable &)
    IMPORT_C CBNFNode &NewRuleL(CBNFNode *, const TDesC &, TParserNodeTypes, HBufC *, TRuleCallback *, TRuleCallback *)
    IMPORT_C CBNFNode &NewRuleL(CBNFNode *, const TDesC &, TParserNodeTypes, const TDesC &, TRuleCallback *, TRuleCallback *)
    TBool OptionalMatched()
    virtual IMPORT_C voidProcessDataL(HBufC8 &)
    virtual IMPORT_C voidResetL()
    TBool RuleMatched()
    voidSetAttributeLookupTable(CAttributeLookupTable &)
    virtual IMPORT_C voidSetBaseUriL(const TDesC *)
    virtual IMPORT_C voidSetDataExpected(TInt)
    virtual IMPORT_C voidSetDocumentTypeL(const TDesC &)
    virtual IMPORT_C voidSetDocumentTypeL(const TDesC &, const TDesC &)
    virtual IMPORT_C voidSetStatus(TInt)
    TParseState State()
    HBufC *StringL()
    TBool Valid()
    Protected Member Functions
    CBNFParser(CAttributeLookupTable &)
    virtual IMPORT_C voidAddRuleCallbackL(CBNFNode &, const TDesC *, TRuleCallback *)
    virtual IMPORT_C TBoolAndL(CBNFNode &, CFragmentedString::TStringMatch &)
    IMPORT_C CAttributeLookupTable &AttributeLUT()
    virtual IMPORT_C voidEndConditional(TParserNodeTypes, TBool)
    virtual IMPORT_C TBoolExactL(CBNFNode &, CFragmentedString::TStringMatch &)
    virtual IMPORT_C voidExecutePostRuleCallbackL(CBNFNode &)
    virtual IMPORT_C voidExecutePreRuleCallbackL(CBNFNode &)
    IMPORT_C voidMarkCallback(CBNFParser &)
    virtual IMPORT_C TBoolNMoreL(CBNFNode &, CFragmentedString::TStringMatch &)
    virtual IMPORT_C TBoolOptionalL(CBNFNode &, CFragmentedString::TStringMatch &)
    virtual IMPORT_C TBoolOrL(CBNFNode &, CFragmentedString::TStringMatch &)
    IMPORT_C TBoolParseL()
    virtual IMPORT_C TBoolPerformRuleL(CBNFNode &, CFragmentedString::TStringMatch &)
    virtual IMPORT_C TBoolRangeL(CBNFNode &, CFragmentedString::TStringMatch &)
    virtual IMPORT_C TBoolReferenceL(CBNFNode &, CFragmentedString::TStringMatch &)
    virtual IMPORT_C TBoolSelectL(CBNFNode &, CFragmentedString::TStringMatch &)
    voidSetState(TParseState)
    virtual IMPORT_C voidStartConditional(TParserNodeTypes)
    virtual IMPORT_C CBNFNode *TreeL()
    virtual IMPORT_C TBoolWithoutL(CBNFNode &, CFragmentedString::TStringMatch &)
    Inherited Functions
    CBase::CBase()
    CBase::Delete(CBase *)
    CBase::Extension_(TUint,TAny *&,TAny *)
    CBase::operator new(TUint)
    CBase::operator new(TUint,TAny *)
    CBase::operator new(TUint,TLeave)
    CBase::operator new(TUint,TLeave,TUint)
    CBase::operator new(TUint,TUint)
    CBase::~CBase()

    Detailed Description

    Base class for parsers that use a BNF tree to parse an input stream.

    The BNF tree form used is a variation on Extended BNF described in the XML1.0 specification. The general form of the tree is as follows:

    Each node in the tree defines a rule that the input stream must meet to satisfy the grammar.

    1. a node type is set to the rule type, as defined in TParserNodeTypes

    2. node data stores any string required by the rule: e.g. for a comparison rule, the string to match against

    3. the parser allows callback functions to be called either before or after the rule is processed. If these are present, they are stored as attributes of the node.

    4. some rules allow sub-rules: for example, the AND rule expects a number of sub-rules, all of which must be successful if the AND rule itself is to succeed. Each sub-rule is represented as a child node of the parent rule. Sub-rules in turn can have sub-rules.

    5. reference rule nodes are also allowed: these do not define themselves rules, but direct the parser to another rule. They can link rules to each other and so build rule sequences more complex than a simple tree.

    All the top-level rules are stored as attributes of the root node. The attribute type is a string that names the rule; the attribute value is a pointer to the node that implements the rule.

    The class supplies functions that encapsulate adding rules appropriately to the tree. The parser provider creates a derived class that implements the virtual method TreeL() that uses these functions to create a BNF rule tree.

    The user of the parser initialises the parser with ResetL(), and then passes input data to the parser using ProcessData(). The parser supports partial parsing: the input stream does not have to completed before parsing can begin. As soon as data is added, the parser attempts to parse it.

    Deprecated

    Member Type Definition Documentation

    Typedef CRuleStack

    typedef CStack< CBNFNode, EFalse >CRuleStack[protected]

    Defines a type to handle a stack of rules.

    Typedef TRuleCallback

    typedef void(TRuleCallback[protected]

    Type definition for a callback function pointer Callback functions need to get a reference to the parser as parameter and they need to be static.

    Member Attribute Documentation

    iCurrentRule

    CBNFNode *iCurrentRule[protected]

    The BNF rule that is currently being processed.

    iLUT

    CAttributeLookupTable &iLUT[protected]

    Storage object for all the attributes and identifiers in a tree

    iMatched

    CFragmentedString::TStringMatch iMatched[protected]

    Input stream matched rule flag.

    iMoreCount

    const TDesC *iMoreCount[protected]

    Stores attribute identifier for nmore count attributes.

    iMoreMaximum

    const TDesC *iMoreMaximum[protected]

    Stores attribute identifier for nmore maximum attributes.

    iMoreMinimum

    const TDesC *iMoreMinimum[protected]

    Stores attribute identifier for nmore minimum attributes.

    iOptionalMatched

    TBool iOptionalMatched[protected]

    Flag that indicates when returning to a rule in the rulestack if an optional rule matched correctly.

    iParsing

    TParseState iParsing[protected]

    Parser state.

    iPostRuleCallback

    const TDesC *iPostRuleCallback[protected]

    Stores attribute identifier for post-rule callback attributes.

    iPreRuleCallback

    const TDesC *iPreRuleCallback[protected]

    Stores attribute identifier for pre-rule callback attributes.

    iRangeEnd

    const TDesC *iRangeEnd[protected]

    Stores attribute identifier for range end attributes.

    iRangeStart

    const TDesC *iRangeStart[protected]

    Stores attribute identifier for range start attributes.

    iReferenceString

    const TDesC *iReferenceString[protected]

    Stores attribute identifier for reference string attributes.

    iRuleStack

    CRuleStack iRuleStack[protected]

    A stack of rules from iTree which are waiting to be completed. The stack basically holds the path along the rule tree.

    iString

    CFragmentedString iString[protected]

    An utility object which stores all the buffers passed into the parser and represents them as if they would form a single, continuous string. This class also performs the actual physical matching/selection of the strings and holds the marks set onto the string.

    iStringComplete

    TBool iStringComplete[protected]

    Flag indicating if the input stream has been completely processed.

    iSubRule

    CBNFNode *iSubRule[protected]

    The child rule we are returning from (if any). If this is NULL we are new to this BNF rule.

    iSubRuleMatched

    TBool iSubRuleMatched[protected]

    Flag that indicates when returning to a rule in the rulestack if the child rule matched correctly.

    iTree

    CBNFNode *iTree[protected]

    The BNF tree the parser is using to parse the input stream.

    Constructor & Destructor Documentation

    CBNFParser ( CAttributeLookupTable & )

    IMPORT_CCBNFParser(CAttributeLookupTable &aLUT)[protected]

    Constructor.

    ParameterDescription
    aLUTAttribute lookup table

    ~CBNFParser ( )

    IMPORT_C~CBNFParser()[virtual]

    Destructor.

    Member Function Documentation

    AddComponentAttributeL ( CBNFNode &, CBNFNodeAttributeType, TInt )

    IMPORT_C voidAddComponentAttributeL(CBNFNode &aRule,
    CBNFNodeAttributeTypeaAttribute,
    TIntaInt
    )

    Adds an additional attribute to an existing rule node.

    For example, this is used with range rules, which specify the range boundaries using start and end attributes.

    ParameterDescription
    aRuleRule node on which to set the attribute
    aAttributeAttribute type
    aIntAttribute value

    AddRuleCallbackL ( CBNFNode &, const TDesC *, TRuleCallback * )

    IMPORT_C voidAddRuleCallbackL(CBNFNode &aRule,
    const TDesC *aCallbackID,
    TRuleCallback *aCallback
    )[protected, virtual]

    Adds a callback to a rule.

    ParameterDescription
    aRuleThe rule to which the callback is to be added
    aCallbackIDCallback type: either CBNFNode::KPreRuleCallback() or CBNFNode::KPostRuleCallback()
    aCallbackCallback function

    AndL ( CBNFNode &, CFragmentedString::TStringMatch & )

    IMPORT_C TBoolAndL(CBNFNode &aRule,
    CFragmentedString::TStringMatch &aMatched
    )[protected, virtual]

    Processes an EAnd rule node.

    It is called by PerformRuleL().

    ParameterDescription
    aRuleThe rule node being processed
    aMatchedOn return, flag indicating if input stream matched the rule

    Returns: ETrue if the function completed processing this node, otherwise EFalse

    AttributeLUT ( )

    IMPORT_C CAttributeLookupTable &AttributeLUT()const [protected]

    Gets the attribute look-up table used by this parser.

    Returns: Attribute look-up table

    CommitL ( )

    IMPORT_C voidCommitL()

    Notifies the parser that all the data has been passed in.

    It causes the parser to parse any of the input stream not already parsed.

    CurrentRule ( )

    CBNFNode *CurrentRule()[inline]

    Gets a pointer to the rule node currently being processed.

    Returns: Rule node

    DeleteMark ( )

    voidDeleteMark()[inline]

    Removes the latest mark. All the marks are stored in a stack and this removes the topmost mark.

    EndConditional ( TParserNodeTypes, TBool )

    IMPORT_C voidEndConditional(TParserNodeTypesaRuleType,
    TBoolaSuccess
    )[protected, virtual]

    ExactL ( CBNFNode &, CFragmentedString::TStringMatch & )

    IMPORT_C TBoolExactL(CBNFNode &aRule,
    CFragmentedString::TStringMatch &aMatched
    )[protected, virtual]

    Processes an EExact rule node.

    It is called by PerformRuleL().

    ParameterDescription
    aRuleThe rule node being processed
    aMatchedOn return, flag indicating if input stream matched the rule

    Returns: ETrue if the function completed processing this node, otherwise EFalse

    ExecutePostRuleCallbackL ( CBNFNode & )

    IMPORT_C voidExecutePostRuleCallbackL(CBNFNode &aRule)[protected, virtual]

    Executes a post-rule callback function.

    ParameterDescription
    aRuleNode specifying the callback

    ExecutePreRuleCallbackL ( CBNFNode & )

    IMPORT_C voidExecutePreRuleCallbackL(CBNFNode &aRule)[protected, virtual]

    Executes a pre-rule callback function.

    ParameterDescription
    aRuleNode specifying the callback

    MDataProviderObserverReserved1 ( )

    IMPORT_C voidMDataProviderObserverReserved1()[virtual]

    MDataProviderObserverReserved2 ( )

    IMPORT_C voidMDataProviderObserverReserved2()[virtual]

    Mark ( )

    voidMark()[inline]

    Set a mark to the current position of the input stream.

    The mark acts as a tag in the stream currently being processed. As we process further along the stream after adding the mark, we can perform a rollback to the most previously set mark and start processing again (e.g. OR rule works this way). The string fragments won't be consumed (deleted) until all the marks on a fragment (and fragments before that) are deleted.

    MarkCallback ( CBNFParser & )

    IMPORT_C voidMarkCallback(CBNFParser &aParser)[protected, static]

    Inserts a mark to the current position of the stream being processed.

    Adding a mark is a very common callback operation before starting to process a rule, so the method is provided by the parser.

    ParameterDescription
    aParserParser processing the stream

    MarkedL ( )

    HBufC *MarkedL()[inline]

    Get string between the "cursor position" and the latest mark on the stream.

    Returns: Pointer to the string from the previous mark on to the current position of processed string. OWNERSHIP OF THE STRING GIVEN TO THE CALLER.

    MarkedWithInitialTextL ( const TDesC & )

    HBufC *MarkedWithInitialTextL(const TDesC &aInitialText)[inline]

    Gets the marked string with a string added before the mached string.

    See also: MarkedL()

    Returns: A string cosisting of aInitialText appended with the marked string. OWNERSHIP OF THE CONSTRUCTED STRING IS GIVEN TO THE CALLER.

    NMoreL ( CBNFNode &, CFragmentedString::TStringMatch & )

    IMPORT_C TBoolNMoreL(CBNFNode &aRule,
    CFragmentedString::TStringMatch &aMatched
    )[protected, virtual]

    Processes an ENMore rule node.

    It is called by PerformRuleL().

    ParameterDescription
    aRuleThe rule node being processed
    aMatchedOn return, flag indicating if input stream matched the rule

    Returns: ETrue if the function completed processing this node, otherwise EFalse

    NewBNFL ( )

    IMPORT_C CBNFNode *NewBNFL()

    Creates a new rule tree root node.

    It creates a new single instance of CBNFNode as the root node of the rule tree. All the top-level rules are attached as attributes to this node. The root node should have single child node, which should be a reference to the logical root of the rule tree. This can be done be attaching the logical root rule as a component to the root rule.

    Returns: New rule tree root node

    NewComponentL ( TParserNodeTypes, const TDesC & )

    IMPORT_C CBNFNode *NewComponentL(TParserNodeTypesaRuleType,
    const TDesC &aData
    )

    Creates a new rule node, but does not add it to the tree.

    This overload sets no rule callbacks.

    ParameterDescription
    aRuleTypeRule type
    aDataRule data reference. This is used with EExact and ESelect type rules to match actual text strings.

    Returns: The new rule node

    NewComponentL ( TParserNodeTypes, HBufC *, TRuleCallback *, TRuleCallback * )

    IMPORT_C CBNFNode *NewComponentL(TParserNodeTypesaRuleType,
    HBufC *aData = NULL,
    TRuleCallback *aPreRule = NULL,
    TRuleCallback *aPostRule = NULL
    )

    Creates a new rule node, but does not add it to the tree.

    This overload allows rule callbacks to be set.

    ParameterDescription
    aRuleTypeRule type
    aDataRule data pointer. This is used with EExact and ESelect type rules to match actual text strings.
    aPreRuleFunction pointer to a pre-rule function that gets called before the parser starts processing this rule and its subtree.
    aPostRuleThe new rule node

    Returns: The new rule node

    NewComponentL ( CBNFNode *, const TDesC & )

    IMPORT_C CBNFNode *NewComponentL(CBNFNode *aRootRule,
    const TDesC &aRuleName
    )

    Creates a new reference rule node.

    ParameterDescription
    aRootRuleRoot node
    aRuleNameRule name

    Returns: The new reference rule node

    NewComponentL ( CBNFNode &, TParserNodeTypes, const TDesC & )

    IMPORT_C CBNFNode &NewComponentL(CBNFNode &aParentRule,
    TParserNodeTypesaRuleType,
    const TDesC &aData
    )

    Creates a new sub-rule, and makes it a child of a specified parent rule.

    This overload sets no rule callbacks.

    ParameterDescription
    aParentRuleThe rule to the new sub-rule shall be added as a child
    aRuleTypeRule type
    aDataRule data reference. This is used with EExact and ESelect type rules to match actual text strings.

    Returns: The new sub-rule node

    NewComponentL ( CBNFNode &, TParserNodeTypes, HBufC *, TRuleCallback *, TRuleCallback * )

    IMPORT_C CBNFNode &NewComponentL(CBNFNode &aParentRule,
    TParserNodeTypesaRuleType,
    HBufC *aData = NULL,
    TRuleCallback *aPreRule = NULL,
    TRuleCallback *aPostRule = NULL
    )

    Creates a new sub-rule, and makes it a child of a specified parent rule.

    This overload sets rule callbacks.

    ParameterDescription
    aParentRuleThe rule to the new sub-rule shall be added as a child
    aRuleTypeRule type
    aDataRule data pointer. This is used with EExact and ESelect type rules to match actual text strings.
    aPreRuleFunction pointer to a pre-rule function that gets called before the parser starts processing this rule and its subtree.
    aPostRuleFunction pointer to a post-rule function that gets called after the parser has processed this rule and its subtree.

    Returns: The new sub-rule node

    NewComponentL ( CBNFNode *, CBNFNode &, const TDesC & )

    IMPORT_C CBNFNode &NewComponentL(CBNFNode *aRootRule,
    CBNFNode &aParentRule,
    const TDesC &aRuleName
    )

    Creates a new reference rule node, and adds it as a child of the specified parent.

    Note that the function succeeds even if the target rule aRuleName does not yet exist.

    ParameterDescription
    aRootRuleRoot node: the function needs this to find the target rule identified by aRuleName
    aParentRuleParent rule to which to attach the new rule as a child
    aRuleNameThe name of the rule that the new node refers to

    Returns: The new reference rule node

    NewL ( CAttributeLookupTable & )

    IMPORT_C CBNFParser *NewL(CAttributeLookupTable &aLUT)[static]

    Allocates and constructs a new BNF parser.

    ParameterDescription
    aLUTAttribute lookup table in which to store attributes for the rule tree

    Returns: New parser

    NewRuleL ( CBNFNode *, const TDesC &, TParserNodeTypes, HBufC *, TRuleCallback *, TRuleCallback * )

    IMPORT_C CBNFNode &NewRuleL(CBNFNode *aRootRule,
    const TDesC &aRuleName,
    TParserNodeTypesaRuleType,
    HBufC *aData,
    TRuleCallback *aPreRule,
    TRuleCallback *aPostRule
    )

    Creates a new rule node and adds it to the root of the rule tree.

    This overload takes ownership of the node data.

    ParameterDescription
    aRootRulePointer to the root BNF node, created with NewBNFL()
    aRuleNameReference to a string identifying this rule. The string is used to make references to this rule from other rule's subtrees.
    aRuleTypeRule type
    aDataRule data pointer. This is used with EExact and ESelect type rules to match actual text strings.
    aPreRuleFunction pointer to a pre-rule function that gets called before the parser starts processing this rule and its children (i.e. the rule subtree).
    aPostRuleFunction pointer to a post-rule function that gets called after the parser has processed this rule and its subtree.

    Returns: The newly created rule node in the rule tree

    NewRuleL ( CBNFNode *, const TDesC &, TParserNodeTypes, const TDesC &, TRuleCallback *, TRuleCallback * )

    IMPORT_C CBNFNode &NewRuleL(CBNFNode *aRootRule,
    const TDesC &aRuleName,
    TParserNodeTypesaRuleType,
    const TDesC &aData,
    TRuleCallback *aPreRule,
    TRuleCallback *aPostRule
    )

    Creates a new rule node and adds it to the root of the rule tree.

    This overload takes a reference to the node data instead of owning it.

    ParameterDescription
    aRootRulePointer to the root BNF node, created with NewBNFL()
    aRuleNameReference to a string identifying this rule. The string is used to make references to this rule from other rule's subtrees.
    aRuleTypeRule type
    aDataRule data pointer. This is used with EExact and ESelect type rules to match actual text strings.
    aPreRuleFunction pointer to a pre-rule function that gets called before the parser starts processing this rule and its children (i.e. the rule subtree).
    aPostRuleFunction pointer to a post-rule function that gets called after the parser has processed this rule and its subtree.

    Returns: The newly created rule node in the rule tree

    OptionalL ( CBNFNode &, CFragmentedString::TStringMatch & )

    IMPORT_C TBoolOptionalL(CBNFNode &aRule,
    CFragmentedString::TStringMatch &aMatched
    )[protected, virtual]

    OptionalMatched ( )

    TBool OptionalMatched()const [inline]

    Tests if an Optional node sub-rule matched.

    Returns: True if the sub- rule matched; otherwise false

    OrL ( CBNFNode &, CFragmentedString::TStringMatch & )

    IMPORT_C TBoolOrL(CBNFNode &aRule,
    CFragmentedString::TStringMatch &aMatched
    )[protected, virtual]

    Processes an EOr rule node.

    It is called by PerformRuleL().

    ParameterDescription
    aRuleThe rule node being processed
    aMatchedOn return, flag indicating if input stream matched the rule

    Returns: ETrue if the function completed processing this node, otherwise EFalse

    ParseL ( )

    IMPORT_C TBoolParseL()[protected]

    PerformRuleL ( CBNFNode &, CFragmentedString::TStringMatch & )

    IMPORT_C TBoolPerformRuleL(CBNFNode &aRule,
    CFragmentedString::TStringMatch &aMatched
    )[protected, virtual]

    Handles a node in the rule tree.

    It calls the appropriate handler method for the rule type.

    ParameterDescription
    aRuleRule node
    aMatchedOn return, flag indicating if input stream matched the rule

    Returns: ETrue if the function completed processing this node, otherwise EFalse

    ProcessDataL ( HBufC8 & )

    IMPORT_C voidProcessDataL(HBufC8 &aData)[virtual]

    Called by the data provider to add data for the parser to process.

    This implements MDataProviderObserver::ProcessDataL().

    ParameterDescription
    aDataThe data to process

    RangeL ( CBNFNode &, CFragmentedString::TStringMatch & )

    IMPORT_C TBoolRangeL(CBNFNode &aRule,
    CFragmentedString::TStringMatch &aMatched
    )[protected, virtual]

    Processes an ERange rule node.

    It is called by PerformRuleL().

    ParameterDescription
    aRuleThe rule node being processed
    aMatchedOn return, flag indicating if input stream matched the rule

    Returns: ETrue if the function completed processing this node, otherwise EFalse

    ReferenceL ( CBNFNode &, CFragmentedString::TStringMatch & )

    IMPORT_C TBoolReferenceL(CBNFNode &aRule,
    CFragmentedString::TStringMatch &aMatched
    )[protected, virtual]

    Processes a reference rule node.

    It is called by PerformRuleL().

    ParameterDescription
    aRuleThe rule node being processed
    aMatchedOn return, flag indicating if input stream matched the rule

    Returns: ETrue if the function completed processing this node, otherwise EFalse

    ResetL ( )

    IMPORT_C voidResetL()[virtual]

    Reset the parser to a state where it can accept and parse new input.

    If no BNF tree yet exists the virtual method TreeL() is called to obtain the BNF tree for this parser. Any existing state of parsing and input data is destroyed.

    RuleMatched ( )

    TBool RuleMatched()const [inline]

    Tests if the used rule matched.

    This is typically used in post-rule callbacks.

    Returns: True if the used rule matched; otherwise false

    SelectL ( CBNFNode &, CFragmentedString::TStringMatch & )

    IMPORT_C TBoolSelectL(CBNFNode &aRule,
    CFragmentedString::TStringMatch &aMatched
    )[protected, virtual]

    Processes an ESelect rule node.

    It is called by PerformRuleL().

    ParameterDescription
    aRuleThe rule node being processed
    aMatchedOn return, flag indicating if input stream matched the rule

    Returns: ETrue if the function completed processing this node, otherwise EFalse

    SetAttributeLookupTable ( CAttributeLookupTable & )

    voidSetAttributeLookupTable(CAttributeLookupTable &aAttributeLookupTable)

    SetBaseUriL ( const TDesC * )

    IMPORT_C voidSetBaseUriL(const TDesC *aBaseUri)[virtual]

    SetDataExpected ( TInt )

    IMPORT_C voidSetDataExpected(TInt)[virtual]

    SetDocumentTypeL ( const TDesC & )

    IMPORT_C voidSetDocumentTypeL(const TDesC &)[virtual]

    SetDocumentTypeL ( const TDesC &, const TDesC & )

    IMPORT_C voidSetDocumentTypeL(const TDesC &,
    const TDesC &
    )[virtual]

    SetState ( TParseState )

    voidSetState(TParseStateaState)[protected, inline]

    Sets the parser state.

    ParameterDescription
    aStateParser state

    SetStatus ( TInt )

    IMPORT_C voidSetStatus(TIntaStatus =  KErrNone )[virtual]

    Called by the data provider to report its status to its observer.

    This implements MDataProviderObserver::SetStatus().

    ParameterDescription
    aStatusStatus code

    StartConditional ( TParserNodeTypes )

    IMPORT_C voidStartConditional(TParserNodeTypesaRuleType)[protected, virtual]

    State ( )

    TParseState State()const [inline]

    Get the current state of the parser.

    Returns: Parser state

    StringL ( )

    HBufC *StringL()const [inline]

    Concatenates the rest of the input stream (which hasn't yet been processed) into a single string. The ownership of the string is given to the caller.

    Returns: String containing the remaining data to be parsed. OWNERSHIP PASSED TO CALLED.

    TreeL ( )

    IMPORT_C CBNFNode *TreeL()[protected, virtual]

    Valid ( )

    TBool Valid()const [inline]

    Checks if the input stream was completely processed

    Returns: ETrue if all of the data was processed, EFalse if the data didn't match to the parsing rules

    WithoutL ( CBNFNode &, CFragmentedString::TStringMatch & )

    IMPORT_C TBoolWithoutL(CBNFNode &aRule,
    CFragmentedString::TStringMatch &aMatched
    )[protected, virtual]

    Processes an EWithout rule node.

    It is called by PerformRuleL().

    ParameterDescription
    aRuleThe rule node being processed
    aMatchedOn return, flag indicating if input stream matched the rule

    Returns: ETrue if the function completed processing this node, otherwise EFalse