Class: Crokus::CFG

Inherits:
Object
  • Object
show all
Defined in:
lib/crokus/cfg.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ CFG

Returns a new instance of CFG.



19
20
21
22
23
24
# File 'lib/crokus/cfg.rb', line 19

def initialize name
  @name=name
  @bbs=[]
  @infos={}
  @bbs << @starter=BasicBlock.new
end

Instance Attribute Details

#bbsObject

Returns the value of attribute bbs.



17
18
19
# File 'lib/crokus/cfg.rb', line 17

def bbs
  @bbs
end

#infosObject

Returns the value of attribute infos.



18
19
20
# File 'lib/crokus/cfg.rb', line 18

def infos
  @infos
end

#nameObject

Returns the value of attribute name.



17
18
19
# File 'lib/crokus/cfg.rb', line 17

def name
  @name
end

#starterObject

Returns the value of attribute starter.



17
18
19
# File 'lib/crokus/cfg.rb', line 17

def starter
  @starter
end

Instance Method Details

#<<(bb) ⇒ Object



34
35
36
# File 'lib/crokus/cfg.rb', line 34

def <<(bb)
  @bbs << bb
end

#each(&block) ⇒ Object



26
27
28
# File 'lib/crokus/cfg.rb', line 26

def each &block
  @bbs.each &block
end


38
39
40
# File 'lib/crokus/cfg.rb', line 38

def print versbose=false
  CFGPrinter.new.print(self,5)
end

#sizeObject



30
31
32
# File 'lib/crokus/cfg.rb', line 30

def size
  @bbs.size
end