Class: Mirah::JVM::Types::ComparisonIntrinsic
Instance Attribute Summary collapse
Attributes inherited from Intrinsic
#argument_types, #return_type
Instance Method Summary
collapse
-
#accept(visitor, expression) ⇒ Object
-
#call(compiler, call, expression) ⇒ Object
-
#initialize(type, name, op, args) ⇒ ComparisonIntrinsic
constructor
A new instance of ComparisonIntrinsic.
-
#jump_if(compiler, call, label) ⇒ Object
-
#jump_if_not(compiler, call, label) ⇒ Object
-
#kind ⇒ Object
Methods inherited from Intrinsic
#abstract?, #constructor?, #declaring_class, #exceptions, #field?, #isVararg, #varargs?
#convert_args
Constructor Details
Returns a new instance of ComparisonIntrinsic.
19
20
21
22
23
|
# File 'lib/mirah/jvm/types/number.rb', line 19
def initialize(type, name, op, args)
super(type, name, args, type.type_system.type(nil, 'boolean')) do; end
@type = type
@op = op
end
|
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
18
19
20
|
# File 'lib/mirah/jvm/types/number.rb', line 18
def name
@name
end
|
#op ⇒ Object
Returns the value of attribute op.
18
19
20
|
# File 'lib/mirah/jvm/types/number.rb', line 18
def op
@op
end
|
Instance Method Details
#accept(visitor, expression) ⇒ Object
39
40
41
|
# File 'lib/mirah/jvm/types/number.rb', line 39
def accept(visitor, expression)
visitor.visitComparison(self, expression)
end
|
#call(compiler, call, expression) ⇒ Object
25
26
27
28
29
|
# File 'lib/mirah/jvm/types/number.rb', line 25
def call(compiler, call, expression)
if expression
@type.compile_boolean_operator(compiler, op, false, call, nil)
end
end
|
#jump_if(compiler, call, label) ⇒ Object
31
32
33
|
# File 'lib/mirah/jvm/types/number.rb', line 31
def jump_if(compiler, call, label)
@type.compile_boolean_operator(compiler, @op, false, call, label)
end
|
#jump_if_not(compiler, call, label) ⇒ Object
35
36
37
|
# File 'lib/mirah/jvm/types/number.rb', line 35
def jump_if_not(compiler, call, label)
@type.compile_boolean_operator(compiler, @op, true, call, label)
end
|
#kind ⇒ Object
43
44
45
|
# File 'lib/mirah/jvm/types/number.rb', line 43
def kind
Java::OrgMirahJvmTypes::MemberKind::COMPARISON_OP
end
|