company logo

DictionaryHandle :: ParseExpression - Parse expression

The function allows parsing an OSI script expression (OSI and ODL data model definitions). The function returns a BNFData tree, which can be used for further evaluation. In case of an error the function produces an error in the trace file.

The application must destroy the BNFData object, when not being used anymore.

Return value:  Expression in BNF format ( BNFData * )

An expression can be converted from a string into BNF format by calling the dictionary function ParseExpression().

Implementation details

BNFData * DictionaryHandle  :: ParseExpression ( NString &expression, NString &symbol_w=NString::Null(), logical opt_cache=NO )
  • expression - Inline expression

    An ad hoc expression can be passed as operand (something like a + b) or as complete expression. As operand, an expression may contain any expression, which is allowed in a statement, but no semicolon should be appended. Complete expressions include expression header (optional) and may include different sections in the expression body which is enclosed in { ... }.

    In contrast to class expressions, ad hoc expressions are not defined explicitly as class expressions but passed as strings to the application at run time.

    operand: a + funct(b)

    complete expression :

    bool expr(int a)

    {

    return(a*a);

    }

  • symbol_w - Symbol name the passed expression corresponds to

    The symbol name is a symbol name known in the BNF specification. The symbol name is passed as 0-terminated string.

    Default: NString::Null()
  • opt_cache - - internal feature (not documented) Default: NO