Class: OCL::Forall

Inherits:
IterBlock show all
Defined in:
lib/dbc/ocl.rb

Overview

Exists

Instance Method Summary collapse

Methods inherited from IterBlock

#cexp?, #initialize, #to_cexp, #to_exp

Methods inherited from Block

check_condition, result, #to_s

Constructor Details

This class inherits a constructor from OCL::IterBlock

Instance Method Details

#check_iteration(expression, result, indent_str) ⇒ Object



343
344
345
346
347
348
349
# File 'lib/dbc/ocl.rb', line 343

def check_iteration(expression, result, indent_str)
	str = ''
	str << indent_str << "\tif (!(#{expression})) {\n"
	str << indent_str << "\t\t#{result} = 0;\n"
	str << indent_str << "\t\tbreak;\n"
	str << indent_str << "\t}\n"
end

#initialize_iterator(result, indent_str) ⇒ Object



340
341
342
# File 'lib/dbc/ocl.rb', line 340

def initialize_iterator(result, indent_str)
	'' << indent_str << "#{result} = 1;\n"
end