src/parser/Debug_Options.cc
unsigned parse_debug_options(Token_Stream &tokens, unsigned const parent) {
  using namespace rtt_parser;

  unsigned Result = parent;

  Token token = tokens.lookahead();
  while (token.type() == KEYWORD || token.text() == "!") {
    bool mask_out = (token.text() == "!");
    if (mask_out) {
      tokens.shift();
      token = tokens.lookahead();
    }
    unsigned mask = get_debug_option(token.text());
    if (mask != 0) {
      if (mask_out) {
        Result = Result & ~mask;
      } else {
        Result = Result | mask;
      }
      tokens.shift();
    } else {
      tokens.check_syntax(!mask_out, "trailing '!'");
      return Result;
    }
    token = tokens.lookahead();
  }
  return Result;
}
//------------------------------------------------------------------------------------------------//
/*!
 * \brief Parse a debug specification.
 *
 * \param[in,out] tokens Token stream from which to parse a debug
 *      specification. The specification is a set of debug keywords, each
 *      optionally prefixed with a '!', and ends with the first token that is
 *      not a recognized debug keyword.
 * \param[in] parent Optional parent mask; defaults to zero. Allows a debug mask
 *      to be based on a parent mask, with selected bits added or masked out.
 * \return A debug options mask.
 */
\brief Parse a debug specification.
\param[in,out] tokens Token stream from which to parse a debug
specification. The specification is a set of debug keywords, each
optionally prefixed with a '!', and ends with the first token that is
not a recognized debug keyword.
\param[in] parent Optional parent mask; defaults to zero. Allows a debug mask
to be based on a parent mask, with selected bits added or masked out.
\return A debug options mask.
\ brief Parse a debug specification . \ param [ in out ] tokens Token stream from which to parse a debug specification . The specification is a set of debug keywords each optionally prefixed with a ' ! ' and ends with the first token that is not a recognized debug keyword . \ param [ in ] parent Optional parent mask ; defaults to zero . Allows a debug mask to be based on a parent mask with selected bits added or masked out . \ return A debug options mask .
unsigned parse_debug_options(Token_Stream &tokens, unsigned const parent) {
  using namespace rtt_parser;
  unsigned Result = parent;
  Token token = tokens.lookahead();
  while (token.type() == KEYWORD || token.text() == "!") {
    bool mask_out = (token.text() == "!");
    if (mask_out) {
      tokens.shift();
      token = tokens.lookahead();
    }
    unsigned mask = get_debug_option(token.text());
    if (mask != 0) {
      if (mask_out) {
        Result = Result & ~mask;
      } else {
        Result = Result | mask;
      }
      tokens.shift();
    } else {
      tokens.check_syntax(!mask_out, "trailing '!'");
      return Result;
    }
    token = tokens.lookahead();
  }
  return Result;
}
unsigned parse_debug_options ( Token_Stream & tokens , unsigned const parent ) { using namespace rtt_parser ; unsigned Result = parent ; Token token = tokens . lookahead ( ) ; while ( token . type ( ) == KEYWORD || token . text ( ) == " " ) { bool mask_out = ( token . text ( ) == " " ) ; if ( mask_out ) { tokens . shift ( ) ; token = tokens . lookahead ( ) ; } unsigned mask = get_debug_option ( token . text ( ) ) ; if ( mask != 0 ) { if ( mask_out ) { Result = Result & ~ mask ; } else { Result = Result | mask ; } tokens . shift ( ) ; } else { tokens . check_syntax ( ! mask_out , " " ) ; return Result ; } token = tokens . lookahead ( ) ; } return Result ; }
\brief Parse a debug specification.
\ brief Parse a debug specification .