Class: Cfruby::Cfp_Codetree

Inherits:
Object
  • Object
show all
Defined in:
lib/libcfenjin/cfp_codetree.rb

Instance Method Summary collapse

Constructor Details

#initialize(cf) ⇒ Cfp_Codetree



14
15
16
17
# File 'lib/libcfenjin/cfp_codetree.rb', line 14

def initialize cf
  @cf = cf
  @clist = Array.new
end

Instance Method Details

#add(fn, num, action, args, linenum, sourcecode) ⇒ Object

Add a node to the codetree



20
21
22
23
# File 'lib/libcfenjin/cfp_codetree.rb', line 20

def add fn,num,action,args,linenum,sourcecode
  @cf.cfp_logger.trace TRACE_ENGINE,"Adding #{fn} action #{action}"
  @clist.push Cfp_Code.new(fn,num,action,args,linenum,sourcecode)
end

#dumpObject

See Cfp_Code.dump



40
41
42
43
44
# File 'lib/libcfenjin/cfp_codetree.rb', line 40

def dump
  @clist.each do | code |
    code.dump
  end
end

#eachObject

Return the actual code snippet



26
27
28
29
30
# File 'lib/libcfenjin/cfp_codetree.rb', line 26

def each
  @clist.each do | code |
    yield code
  end
end

#each_execObject

Return the code snippets in execution order



33
34
35
36
37
# File 'lib/libcfenjin/cfp_codetree.rb', line 33

def each_exec
  @clist.each do | code |
    yield code
  end
end