note
	description: "Objects that represent a Vision2 action sequence class."
	legal: "See notice at end of class."
	status: "See notice at end of class."
	author: ""
	date: "$Date$"
	revision: "$Revision$"

deferred class
	GB_EV_ACTION_SEQUENCE

inherit
	ANY

	GB_CONSTANTS
		export
			{NONE} all
		end

feature -- Access

	count: INTEGER
			-- Number of arguments
		do
			Result := argument_types.count
		end

	argument_types: ARRAYED_LIST [STRING]
			-- All argument types of action sequence represented by `Current'.
		deferred
		end

	argument_names: ARRAYED_LIST [STRING]
			-- All argument names of action sequence represented by `Current'.
		deferred
		end

	argument_types_as_string: STRING
			-- `Result' is string representing argument types
			-- of `Current'. i.e. BOOLEAN INTEGER INTEGER
			-- Void if `count' = 0 (No arguments).
		do
			if count > 0 then
				create Result.make (0)
				from
					argument_types.start
				until
					argument_types.off
				loop
					Result := Result + "argument_types.item"
					if not (argument_types.index = count) then
						Result := Result + " "
					end
					argument_types.forth
				end
			end
		ensure
			result_void_implies_count_zero: Result = Void implies count = 0
			result_not_void_implies_count_valid: Result /= Void implies count > 0
		end

	open_arguments: STRING
			--`Result' is string representing open arguments
			-- of `Current'. i.e. ?, ?, ?
			-- Void if `count' = 0 (No arguments).
		do
			if count > 0 then
				create Result.make (0)
				from
					argument_types.start
				until
					argument_types.off
				loop
					Result := Result + "?"
					if not (argument_types.index = count) then
						Result := Result + ", "
					end
					argument_types.forth
				end
			end
		ensure
			result_void_implies_count_zero: Result = Void implies count = 0
			result_not_void_implies_count_valid: Result /= Void implies count > 0
		end

	parameter_list: STRING
			-- `Result' is string representatiion of paramters.
			-- i.e. an_x, a_y: INTEGER; count: DOUBLE
			-- Void if `count' = 0 (No arguments).
		do
			if count > 0 then
				create Result.make (0)
				from
					argument_types.start
					argument_names.start
				until
					argument_types.off
				loop
					Result := Result + argument_names.item
					if argument_types.index /= argument_types.count then
						if (argument_types @ (argument_types.index + 1)).same_string (argument_types.item) then
							Result := Result + ", "
						else
							Result := Result  + ": " + argument_types.item + "; "
						end
					else
						Result := Result + ": " + argument_types.item
					end
					argument_types.forth
					argument_names.forth
				end
			end
		ensure
			result_void_implies_count_zero: Result = Void implies count = 0
			result_not_void_implies_count_valid: Result /= Void implies count > 0
		end

	debugging_info: STRING
			-- `Result' is a string representation
			-- which when compiled will generate debugging
			-- information for `Current'.
		do
			create Result.make (0)
			from
				argument_names.start
			until
				argument_names.off
			loop
				Result := Result + "io.putstring (%"" + argument_names.item + " : %" + " + argument_names.item
					-- Now add newlines for last output of `Current'.
				if argument_names.index = count then
					Result := Result + ".out + %"%%N%%N%%N%")"
				else
					Result := Result + ".out + %"%%N%")" + indent
				end
				argument_names.forth
			end
		end

note
	copyright:	"Copyright (c) 1984-2006, Eiffel Software"
	license:	"GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
	licensing_options:	"http://www.eiffel.com/licensing"
	copying: "[
			This file is part of Eiffel Software's Eiffel Development Environment.
			
			Eiffel Software's Eiffel Development Environment is free
			software; you can redistribute it and/or modify it under
			the terms of the GNU General Public License as published
			by the Free Software Foundation, version 2 of the License
			(available at the URL listed under "license" above).
			
			Eiffel Software's Eiffel Development Environment is
			distributed in the hope that it will be useful,	but
			WITHOUT ANY WARRANTY; without even the implied warranty
			of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
			See the	GNU General Public License for more details.
			
			You should have received a copy of the GNU General Public
			License along with Eiffel Software's Eiffel Development
			Environment; if not, write to the Free Software Foundation,
			Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
		]"
	source: "[
			 Eiffel Software
			 356 Storke Road, Goleta, CA 93117 USA
			 Telephone 805-685-1006, Fax 805-685-6869
			 Website http://www.eiffel.com
			 Customer support http://support.eiffel.com
		]"


end -- class GB_EV_ACTION_SEQUENCE