static int val ( char c ) {
  if ( c >= '0' && c <= '9' ) return ( int ) c - '0' ;
  else return ( int ) c - 'A' + 10 ;
}

static int val ( char c ) { if ( c >= '0' && c <= '9' ) return ( int ) c - '0' ; else return ( int ) c - ' A ' + 10 ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (character_literal)) right: (binary_expression left: (identifier) right: (character_literal)))) consequence: (return_statement (binary_expression left: (cast_expression type: (integral_type) value: (identifier)) right: (character_literal))) alternative: (return_statement (binary_expression left: (binary_expression left: (cast_expression type: (integral_type) value: (identifier)) right: (character_literal)) right: (decimal_integer_literal))))))