Class: OCL::Block

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

Overview

IteratorRange

Direct Known Subclasses

Binary, Implies, IterBlock, Paren, Unary

Constant Summary collapse

@@results =
0

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.check_condition(condition, result, indent_str = '') ⇒ Object


100
101
102
# File 'lib/dbc/ocl.rb', line 100

def Block.check_condition(condition, result, indent_str = '')
	"#{indent_str}#{result} = (int)(#{condition});\n"
end

.resultObject


97
98
99
# File 'lib/dbc/ocl.rb', line 97

def Block.result
	"__ocl_#{@@results += 1}_"
end

Instance Method Details

#to_sObject

Raises:

  • (ParseError)

104
105
106
107
# File 'lib/dbc/ocl.rb', line 104

def to_s
	raise ParseError, "invalid expression" unless cexp?
	to_cexp
end