company logo

BNFParser :: analyzeFile - Analyze file

The function analyzes data in the passed file and creates a hierarchy of BNFNode elements (symbols). Each BNFNode element refers to the symbol or token and to a sub string in the file, that contains the value for the symbol.

The function will parse the file according to the syntax defined in the BNF (top-symbol) or according to a given symbol of the syntax. When the file contains errors, the function returns an invalid BNFNode (BNFNode::isValid()). In this case an error text is returned by function BNFParser::lastError().

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

Implementation overview

Implementation details

  1. Analyze file
    odaba::BNFNode BNFParser  :: analyzeFile ( odaba::String &sPath )

    The function analyzes the file passed in sPath which must correspond to the top symbol of the parser definition.

    • sPath - File path
  2. to list
  3. Analyze file for symbol
    odaba::BNFNode BNFParser  :: analyzeFile ( odaba::String &sPath, odaba::String &sSymbol )

    The function analyzes the file passed in sPath which must correspond to the symbol (sSymbol) of the parser definition.

    • sPath - File path
    • sSymbol - BNF symbol name

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

  4. to list