Class: Rubex::SymbolTable::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/rubex/symbol_table/entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, c_name, type, value) ⇒ Entry

Returns a new instance of Entry.



21
22
23
24
25
# File 'lib/rubex/symbol_table/entry.rb', line 21

def initialize name, c_name, type, value
  @name, @c_name, @type, @value = name, c_name, type, value
  @times_called = 0
  @no_gil = false
end

Instance Attribute Details

#c_nameObject

Equivalent name in C code.



7
8
9
# File 'lib/rubex/symbol_table/entry.rb', line 7

def c_name
  @c_name
end

#externObject

Is an extern entry



13
14
15
# File 'lib/rubex/symbol_table/entry.rb', line 13

def extern
  @extern
end

#nameObject

Original name.



5
6
7
# File 'lib/rubex/symbol_table/entry.rb', line 5

def name
  @name
end

#no_gilObject

Whether this entry has a no_gil tag or not. Applicable for C functions.



19
20
21
# File 'lib/rubex/symbol_table/entry.rb', line 19

def no_gil
  @no_gil
end

#singletonObject

Is a Ruby singleton method



15
16
17
# File 'lib/rubex/symbol_table/entry.rb', line 15

def singleton
  @singleton
end

#times_calledObject

Number of times this entry is called in a function. Useful for Ruby methods.



17
18
19
# File 'lib/rubex/symbol_table/entry.rb', line 17

def times_called
  @times_called
end

#typeObject

Ctype of the the entry.



9
10
11
# File 'lib/rubex/symbol_table/entry.rb', line 9

def type
  @type
end

#valueObject

Default value of the entry, if any.



11
12
13
# File 'lib/rubex/symbol_table/entry.rb', line 11

def value
  @value
end

Instance Method Details

#c_code(local_scope) ⇒ Object



27
28
29
# File 'lib/rubex/symbol_table/entry.rb', line 27

def c_code local_scope
  c_name
end

#extern?Boolean

Returns:



31
# File 'lib/rubex/symbol_table/entry.rb', line 31

def extern?; @extern; end

#singleton?Boolean

Returns:



33
# File 'lib/rubex/symbol_table/entry.rb', line 33

def singleton?; @singleton; end