company logo

BNFNode :: tryGet - Try to locate BNF tree node

The function locates a BNF tree node with a specific symbol name. The located tree node will be returned. When the current BNF tree node is not valid, the function throws an exception. When the requested tree node could not be located, the returned BNF tree node is invalid.

Return value:  BNF tree node ( odaba::BNFNode & )

Implementation details

odaba::BNFNode BNFNode  :: tryGet ( odaba::String &sSymbol, bool bRecursive )

The function tries to locate a subordinated BNF tree node with the symbol name passed in sSymbol . When bRecursive is false , the function only looks at next lower level. Otherwise, the function also looks at lower subordinated levels until the symbol is located. When no such tree node exists, the function returns an invalid BNF tree node.

  • sSymbol - BNF symbol name

    The BNF symbol name is a name that has been defined as symbol in the BNF parser definition.

  • bRecursive - Process recursive

    The function is called recursively for subordinated elements.