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



339
340
341
342
343
344
345
# File 'lib/dbc/ocl.rb', line 339

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



336
337
338
# File 'lib/dbc/ocl.rb', line 336

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