Exponents

Exponents are used to indicate repetition.

ExponentExpr :
    '('  ExpressionOrStar  ')'
|   '*'  MultExprTerm
|   '*'  '*'      
                     
ExpressionOrStar :
    AddExpr
|   '*'

ParenExponentOpt :
    /*empty*/
|   '('  ExpressionOrStar  ')'


AddExpr :
    AddExpr  '-'  MultExpr
|   AddExpr  '+'  MultExpr
|   MultExpr

MultExpr :
    MultExpr  '*'  MultExprTerm
|   MultExpr  '/'  MultExprTerm
|   MultExprTerm

MultExprTerm :
    INTEGER
|   '('  AddExpr  ')'
|   FunctionCall

FunctionCall :
    IDENTIFIER  '('  EXTENDED_NAME  ')'      
        
  1. An exponent can be wrapped in parenthesis (first alternative of ExponentExpr) or else introduced by an asterisk (second alternative). The third alternative is equivalent to (*) and is used to indicate 0 to infinity repetitions. All exponent expressions other than "(*)" and "**" indicate a fixed number of repetitions, though this fixed number may not be known statically if the exponent uses a function.

  2. Exponents may use the usual mathematical operators.

  3. 3GPP 24.007 does not discuss the use of functions in exponents. The following information about functions is based on non-official sources.

  4. The function name is given by the IDENTIFIER. The name really can be anything, including user defined functions, but the definition of the functions is not part of the CSN.1 notation. All functions take a single argument, an EXTENDED_NAME, which is a reference to a labeled string that appears in the encoding prior to the string having the exponent.

  5. There are two predefined functions: val and len. In practice, we have only seen val used. Function val returns the integer value of the referenced string, interpreted as a non-negative binary integer. Function len returns the number of bits for the referenced string.