Class: MrbParser::IrepSection

Inherits:
Section
  • Object
show all
Defined in:
lib/mrb_parser/irep_section.rb

Constant Summary

Constants inherited from Section

Section::BINARY_EOF, Section::DEBUG_IDENTIFIER, Section::IREP_IDENTIFIER, Section::LINENO_IDENTIFIER

Instance Attribute Summary collapse

Attributes inherited from Section

#signature, #size

Instance Method Summary collapse

Methods inherited from Section

#end?, #parse, parse

Constructor Details

#initializeIrepSection

Returns a new instance of IrepSection.



7
8
9
# File 'lib/mrb_parser/irep_section.rb', line 7

def initialize(*)
  super
end

Instance Attribute Details

#recObject (readonly)

Returns the value of attribute rec.



5
6
7
# File 'lib/mrb_parser/irep_section.rb', line 5

def rec
  @rec
end

Instance Method Details

#dumpObject



24
25
26
27
28
29
30
31
# File 'lib/mrb_parser/irep_section.rb', line 24

def dump
  printf "*** IREP SECTION ***\n"
  printf "secID : %s\n", @signature
  printf "size  : %s\n", @size
  printf "vm ver: %s\n", @vm_version
  @rec.dump
  printf "*** ***\n"
end

#parse_body(parser) ⇒ Object



11
12
13
14
15
16
# File 'lib/mrb_parser/irep_section.rb', line 11

def parse_body(parser)
  @vm_version = parser.read_chars(4)
  @rec = parse_record(parser)
  parser.irep_section = self
  self
end

#parse_record(parser) ⇒ Object



18
19
20
21
22
# File 'lib/mrb_parser/irep_section.rb', line 18

def parse_record(parser)
  rec = MrbParser::IrepRecord.new
  rec.parse_record(parser)
  rec
end