Module: Rubber::RegisterChildren
- Included in:
- C_Array, C_Class, C_Enum, C_Flags, C_Float, C_GCRefPool, C_GEnum, C_GFlags, C_Integer, C_Module, C_String, C_Struct
- Defined in:
- lib/rubber/codegen.rb
Instance Attribute Summary collapse
-
#child_names ⇒ Object
readonly
Returns the value of attribute child_names.
-
#source_file ⇒ Object
Returns the value of attribute source_file.
-
#source_line ⇒ Object
Returns the value of attribute source_line.
Instance Method Summary collapse
Instance Attribute Details
#child_names ⇒ Object (readonly)
Returns the value of attribute child_names.
86 87 88 |
# File 'lib/rubber/codegen.rb', line 86 def child_names @child_names end |
#source_file ⇒ Object
Returns the value of attribute source_file.
85 86 87 |
# File 'lib/rubber/codegen.rb', line 85 def source_file @source_file end |
#source_line ⇒ Object
Returns the value of attribute source_line.
85 86 87 |
# File 'lib/rubber/codegen.rb', line 85 def source_line @source_line end |
Instance Method Details
#cname ⇒ Object
101 102 103 104 105 106 107 |
# File 'lib/rubber/codegen.rb', line 101 def cname if parent && parent.child_names && parent.child_names[name] && parent.child_names[name] != self parent.child_names[name].cname else default_cname() end end |
#register_children(io) ⇒ Object
87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/rubber/codegen.rb', line 87 def register_children(io) @child_names = {} contents.each { |f| f.register(io, @child_names.has_key?(f.name)) if @child_names.has_key?(f.name) puts "#{self.cname} has duplicate definitiion of #{f.name}" else @child_names[f.name]= f end } if respond_to?(:register_aliases) register_aliases(io) end end |