src/parser/Expression.cc
std::shared_ptr<Expression> Expression::parse(unsigned const number_of_variables,
                                              Variable_Map const &variable_map,
                                              Token_Stream &tokens) {
  // No index in the variable map can be greater than or equal to the number of
  // variables.

  // The top expression is the or expression, which we anticipate will be useful
  // for piecewise functions.

  std::shared_ptr<Expression> Result = parse_or(number_of_variables, variable_map, tokens);
  while (tokens.lookahead().text() == "|") {
    tokens.shift();
    Result = std::make_shared<Or_Expression>(Result,
                                             parse_or(number_of_variables, variable_map, tokens));
  }
  return Result;
}
//------------------------------------------------------------------------------------------------//
/*!
 * \param[in] number_of_variables Number of distinct independent variables in
 *                 the expression.
 *
 * \param[in] variable_map Map specifying variable names and the associated
 *                 index and units. It is acceptable to alias variable
 *                 names. The unit dimensions must be identical for aliases. The
 *                 conversion factor is ignored but should be nonzero.
 *
 * \param tokens Token stream from which to parse an Expression.
 *
 * \return Pointer to the Expression. If null, the expression was empty or
 *         grammatically ill-formed.
 *
 * \bug Doxygen doesn't like this definition
 * \cond doxygen_skip_this
 */
\param[in] number_of_variables Number of distinct independent variables in
the expression.

\param[in] variable_map Map specifying variable names and the associated
index and units. It is acceptable to alias variable
names. The unit dimensions must be identical for aliases. The
conversion factor is ignored but should be nonzero.

\param tokens Token stream from which to parse an Expression.

\return Pointer to the Expression. If null, the expression was empty or
grammatically ill-formed.

\bug Doxygen doesn't like this definition
\cond doxygen_skip_this
\ param [ in ] number_of_variables Number of distinct independent variables in the expression . \ param [ in ] variable_map Map specifying variable names and the associated index and units . It is acceptable to alias variable names . The unit dimensions must be identical for aliases . The conversion factor is ignored but should be nonzero . \ param tokens Token stream from which to parse an Expression . \ return Pointer to the Expression . If null the expression was empty or grammatically ill - formed . \ bug Doxygen doesn ' t like this definition \ cond doxygen_skip_this
std::shared_ptr<Expression> Expression::parse(unsigned const number_of_variables,
                                              Variable_Map const &variable_map,
                                              Token_Stream &tokens) {
  std::shared_ptr<Expression> Result = parse_or(number_of_variables, variable_map, tokens);
  while (tokens.lookahead().text() == "|") {
    tokens.shift();
    Result = std::make_shared<Or_Expression>(Result,
                                             parse_or(number_of_variables, variable_map, tokens));
  }
  return Result;
}
std :: shared_ptr < Expression > Expression :: parse ( unsigned const number_of_variables , Variable_Map const & variable_map , Token_Stream & tokens ) { std :: shared_ptr < Expression > Result = parse_or ( number_of_variables , variable_map , tokens ) ; while ( tokens . lookahead ( ) . text ( ) == " " ) { tokens . shift ( ) ; Result = std :: make_shared < Or_Expression > ( Result , parse_or ( number_of_variables , variable_map , tokens ) ) ; } return Result ; }
\param[in] number_of_variables Number of distinct independent variables in
                 the expression.
\ param [ in ] number_of_variables Number of distinct independent variables in the expression .
// No index in the variable map can be greater than or equal to the number of // variables. // The top expression is the or expression, which we anticipate will be useful // for piecewise functions.