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.
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 |
#dump ⇒ Object
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 |
#each ⇒ Object
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_exec ⇒ Object
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 |