Example #1
0
// Parse a qualified type.
//
//    unary-type:
//      postfix-type
//      '*' unary-type 
//      'const' unary-type
//      'volatile' unary-type
Type&
Parser::unary_type()
{
  if (match_if(const_tok)) {
    Type& t = unary_type();
    return on_const_type(t);
  }
  if (match_if(volatile_tok)) {
    Type& t = unary_type();
    return on_volatile_type(t);
  }
  if (match_if(star_tok)) {
    Type& t = unary_type();
    return on_pointer_type(t);
  }
  return postfix_type();
}
Example #2
0
// Parse a type.
//
//    type -> postfix-type
Type const*
Parser::type()
{
  return postfix_type();
}