Class: RegularExpression::CFG::ExtendedBasicBlock
- Inherits:
-
Object
- Object
- RegularExpression::CFG::ExtendedBasicBlock
- Defined in:
- lib/regular_expression/cfg.rb
Overview
An Extended Basic Block is a linear sequence of instructions with one entry point and zero or more exit points.
Instance Attribute Summary collapse
-
#exits ⇒ Object
readonly
Returns the value of attribute exits.
-
#insns ⇒ Object
readonly
Returns the value of attribute insns.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #dump(exit_map, io: $stdout) ⇒ Object
-
#initialize(name, insns, exits) ⇒ ExtendedBasicBlock
constructor
A new instance of ExtendedBasicBlock.
Constructor Details
#initialize(name, insns, exits) ⇒ ExtendedBasicBlock
Returns a new instance of ExtendedBasicBlock.
101 102 103 104 105 |
# File 'lib/regular_expression/cfg.rb', line 101 def initialize(name, insns, exits) @name = name @insns = insns @exits = exits end |
Instance Attribute Details
#exits ⇒ Object (readonly)
Returns the value of attribute exits.
99 100 101 |
# File 'lib/regular_expression/cfg.rb', line 99 def exits @exits end |
#insns ⇒ Object (readonly)
Returns the value of attribute insns.
99 100 101 |
# File 'lib/regular_expression/cfg.rb', line 99 def insns @insns end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
99 100 101 |
# File 'lib/regular_expression/cfg.rb', line 99 def name @name end |
Instance Method Details
#dump(exit_map, io: $stdout) ⇒ Object
107 108 109 110 111 |
# File 'lib/regular_expression/cfg.rb', line 107 def dump(exit_map, io: $stdout) io.puts("#{name}:") insns.each { |insn| io.puts(" #{insn}") } exits.each { |exit| io.puts(" #{exit} -> #{exit_map[exit].name}") } end |