Class: Mirah::JVM::Types::ComparisonIntrinsic
- Defined in:
- lib/mirah/jvm/types/number.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#op ⇒ Object
readonly
Returns the value of attribute op.
Attributes inherited from Intrinsic
Instance Method Summary collapse
- #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
Methods inherited from Intrinsic
#abstract?, #constructor?, #declaring_class, #exceptions, #field?
Methods included from ArgumentConversion
Constructor Details
#initialize(type, name, op, args) ⇒ ComparisonIntrinsic
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, Boolean) do; end @type = type @op = op end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
18 19 20 |
# File 'lib/mirah/jvm/types/number.rb', line 18 def name @name end |
#op ⇒ Object (readonly)
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
#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 |