absyntax_utils/type_initial_value.cc
changeset 850 484beb3b1dcb
parent 762 a3d917474ae4
child 925 a942c55fb769
equal deleted inserted replaced
849:1f8885ae539a 850:484beb3b1dcb
   218   return handle_type_spec(symbol->enumerated_specification, symbol->enumerated_value);
   218   return handle_type_spec(symbol->enumerated_specification, symbol->enumerated_value);
   219 }
   219 }
   220 /* helper symbol for enumerated_specification->enumerated_spec_init */
   220 /* helper symbol for enumerated_specification->enumerated_spec_init */
   221 /* enumerated_value_list ',' enumerated_value */
   221 /* enumerated_value_list ',' enumerated_value */
   222 void *type_initial_value_c::visit(enumerated_value_list_c *symbol) {
   222 void *type_initial_value_c::visit(enumerated_value_list_c *symbol) {
       
   223   /* stage1_2 never creates an enumerated_value_list_c with no entries. If this occurs, then something must have changed! */
       
   224   if (symbol->n <= 0) ERROR;
   223  /* if no initial value explicitly given, then use the lowest value of the subrange */
   225  /* if no initial value explicitly given, then use the lowest value of the subrange */
   224   return (void *)symbol->elements[0];
   226   return (void *)symbol->elements[0];
   225 }
   227 }
   226 /* enumerated_type_name '#' identifier */
   228 /* enumerated_type_name '#' identifier */
   227 // SYM_REF2(enumerated_value_c, type, value)
   229 // SYM_REF2(enumerated_value_c, type, value)