Class: Mirah::JVM::Types::Intrinsic

Inherits:
Object
  • Object
show all
Includes:
ArgumentConversion
Defined in:
lib/mirah/jvm/types/methods.rb

Direct Known Subclasses

ComparisonIntrinsic, MathIntrinsic

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ArgumentConversion

#convert_args

Constructor Details

#initialize(klass, name, args, type, kind = nil, &block) ⇒ Intrinsic

Returns a new instance of Intrinsic.

Raises:

  • (ArgumentError)


79
80
81
82
83
84
85
86
87
# File 'lib/mirah/jvm/types/methods.rb', line 79

def initialize(klass, name, args, type, kind=nil, &block)
  raise ArgumentError, "Block required" unless block_given?
  @class = klass
  @name = name
  @argument_types = args
  @return_type = type
  @block = block
  @kind = kind
end

Instance Attribute Details

#argument_typesObject (readonly)

Returns the value of attribute argument_types.



77
78
79
# File 'lib/mirah/jvm/types/methods.rb', line 77

def argument_types
  @argument_types
end

#nameObject (readonly)

Returns the value of attribute name.



77
78
79
# File 'lib/mirah/jvm/types/methods.rb', line 77

def name
  @name
end

#return_typeObject (readonly)

Returns the value of attribute return_type.



77
78
79
# File 'lib/mirah/jvm/types/methods.rb', line 77

def return_type
  @return_type
end

Instance Method Details

#abstract?Boolean

Returns:

  • (Boolean)


114
115
116
# File 'lib/mirah/jvm/types/methods.rb', line 114

def abstract?
  false
end

#accept(visitor, expression) ⇒ Object



93
94
95
96
# File 'lib/mirah/jvm/types/methods.rb', line 93

def accept(visitor, expression)
  name = "visit_#{@kind.downcase}".sub(/_op$/,"")
  visitor.send(name, self, expression)
end

#call(builder, ast, expression, *args) ⇒ Object



98
99
100
# File 'lib/mirah/jvm/types/methods.rb', line 98

def call(builder, ast, expression, *args)
  @block.call(builder, ast, expression, *args)
end

#constructor?Boolean

Returns:

  • (Boolean)


106
107
108
# File 'lib/mirah/jvm/types/methods.rb', line 106

def constructor?
  false
end

#declaring_classObject



102
103
104
# File 'lib/mirah/jvm/types/methods.rb', line 102

def declaring_class
  @class
end

#exceptionsObject



118
119
120
# File 'lib/mirah/jvm/types/methods.rb', line 118

def exceptions
  []
end

#field?Boolean

Returns:

  • (Boolean)


110
111
112
# File 'lib/mirah/jvm/types/methods.rb', line 110

def field?
  false
end

#isVarargObject



126
127
128
# File 'lib/mirah/jvm/types/methods.rb', line 126

def isVararg
  varargs?
end

#kindObject



89
90
91
# File 'lib/mirah/jvm/types/methods.rb', line 89

def kind
  Java::OrgMirahJvmTypes::MemberKind.const_get(@kind)
end

#varargs?Boolean

Returns:

  • (Boolean)


122
123
124
# File 'lib/mirah/jvm/types/methods.rb', line 122

def varargs?
  false
end