function compute_state_enums(~,chart)

%   Copyright 1995-2005 The MathWorks, Inc.
   global gChartInfo

	if ~isempty(gChartInfo.states)
		for state = [chart,gChartInfo.states]
			subStates = sf('SubstatesOf',state);
			if(~isempty(subStates))
				switch sf('get',state,'.decomposition')
				case 0  % CLUSTER_STATE
					for substate = subStates
						enumStr = ['IN_',sf('CodegenNameOf',substate)];
						sf('set',substate,'.activeChildEnumString',enumStr);
					end
				case 1  % SET_STATE
				otherwise
					construct_coder_error(state,'Bad decomposition.');
				end
			end
		end
	end

