# File lib/rgen/transformer.rb, line 330
        def trans(obj)
                if obj.is_a?(Hash)
                        raise StandardError.new("No input environment available to find model element.") unless @env_in
                        obj = @env_in.find(obj) 
                end
                return nil if obj.nil?
                return obj if obj.is_a?(TrueClass) or obj.is_a?(FalseClass) or obj.is_a?(Numeric) or obj.is_a?(Symbol)
                return @transformer_results[obj] if @transformer_results[obj]
                return @transformer_results[obj] = obj.dup if obj.is_a?(String)
                return obj.collect{|o| trans(o)}.compact if obj.is_a? Array
                raise StandardError.new("No transformer for class #{obj.class.name}") unless _transformerBlock(obj.class)
                block_desc = _evaluateCondition(obj)
                return nil unless block_desc
                @transformer_results[obj] = _instantiateTargetClass(obj, block_desc.target)
                # we will transform the properties later

                @transformer_jobs << TransformerJob.new(self, obj, block_desc)
                # if there have been jobs in the queue before, don't process them in this call

                # this way calls to trans are not nested; a recursive implementation 

                # may cause a "Stack level too deep" exception for large models

                return @transformer_results[obj] if @transformer_jobs.size > 1
                # otherwise this is the first call of trans, process all jobs here

                # more jobs will be added during job execution

                while @transformer_jobs.size > 0
                        @transformer_jobs.first.execute
                        @transformer_jobs.shift
                end
                @transformer_results[obj]
        end