Class: Cfruby::Cfp_Codetree
- Inherits:
-
Object
- Object
- Cfruby::Cfp_Codetree
- Defined in:
- lib/libcfenjin/cfp_codetree.rb
Instance Method Summary collapse
-
#add(fn, num, action, args, linenum, sourcecode) ⇒ Object
Add a node to the codetree.
-
#dump ⇒ Object
See
Cfp_Code.dump
. -
#each ⇒ Object
Return the actual code snippet.
-
#each_exec ⇒ Object
Return the code snippets in execution order.
-
#initialize(cf) ⇒ Cfp_Codetree
constructor
A new instance of Cfp_Codetree.
Constructor Details
#initialize(cf) ⇒ Cfp_Codetree
Returns a new instance of Cfp_Codetree.
10 11 12 13 |
# File 'lib/libcfenjin/cfp_codetree.rb', line 10 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
16 17 18 19 |
# File 'lib/libcfenjin/cfp_codetree.rb', line 16 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 |
#dump ⇒ Object
See Cfp_Code.dump
36 37 38 39 40 |
# File 'lib/libcfenjin/cfp_codetree.rb', line 36 def dump @clist.each do | code | code.dump end end |
#each ⇒ Object
Return the actual code snippet
22 23 24 25 26 |
# File 'lib/libcfenjin/cfp_codetree.rb', line 22 def each @clist.each do | code | yield code end end |
#each_exec ⇒ Object
Return the code snippets in execution order
29 30 31 32 33 |
# File 'lib/libcfenjin/cfp_codetree.rb', line 29 def each_exec @clist.each do | code | yield code end end |