[Compbench-devel] CompBenchmarks++/libcompbenchmarks/CEL CEL-Atom.cpp, 1.4, 1.5
Brought to you by:
xfred
From: Frederic T. <xf...@us...> - 2007-03-11 18:50:50
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/CEL In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv22763 Modified Files: CEL-Atom.cpp Log Message: Evaluate() renamed to evaluate(); <cel-block/> not variable owner anymore. celDebug and Evaluate() introduced. Index: CEL-Atom.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/CEL/CEL-Atom.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CEL-Atom.cpp 8 Mar 2007 17:09:18 -0000 1.4 --- CEL-Atom.cpp 11 Mar 2007 18:50:47 -0000 1.5 *************** *** 7,13 **** ------------------------------------------------------------------------- */ #include <CEL/CEL-Atom.h> ! #include <stdlib.h> using namespace CBM; --- 7,15 ---- ------------------------------------------------------------------------- */ #include <CEL/CEL-Atom.h> ! #include <iostream> #include <stdlib.h> + int celDebug = 0; + using namespace CBM; *************** *** 67,71 **** e=ptr->xmlEntityName(); if ((e=="cel-function-def") || ! (e=="cel-block") || (e=="cel")) { return(ptr); --- 69,73 ---- e=ptr->xmlEntityName(); if ((e=="cel-function-def") || ! /* (e=="cel-block") || */ (e=="cel")) { return(ptr); *************** *** 242,245 **** --- 244,281 ---- } + std::string CelAtom::Evaluate(void) + { + std::string r; + CelAtom *P = parent; + int n = 0; + int i = 0; + + + if (celDebug) { + while (P) { + n++; + P=P->parent; + } + i = n; + + while (i--) { + std::cerr << " "; + } + std::cerr << "Evaluating " << xmlEntityName() << std::endl; + } + + r=evaluate(); + + if (celDebug) { + i = n; + while (i--) { + std::cerr << " "; + } + std::cerr << "~Evaluating " << xmlEntityName() << " '" << r << "'" << std::endl; + } + + return(r); + } + std::string CelAtom::str(int _indent) { *************** *** 305,314 **** } ! std::string CelContainer::xmlEntityName(void) ! { ! return("cel"); ! } ! ! std::string CelContainer::Evaluate(void) { int i; --- 341,345 ---- } ! std::string CelContainer::evaluate(void) { int i; *************** *** 326,329 **** --- 357,365 ---- } + std::string CelContainer::xmlEntityName(void) + { + return("cel"); + } + CelContainer::~CelContainer() { |