File: readTreeWithComments.cpp

package info (click to toggle)
fastml 3.11-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,772 kB
  • sloc: cpp: 48,522; perl: 3,588; ansic: 819; makefile: 386; python: 83; sh: 55
file content (28 lines) | stat: -rw-r--r-- 638 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// $Id: readTreeWithComments.cpp 753 2006-06-29 14:41:56Z ninio $


#include <fstream>
#include <iostream>
#include <stdlib.h>
#include <string>
#include <iomanip>
using namespace std;

#include "logFile.h"
#include "tree.h"
//#include "readTree.h"

int main(int argc,char*argv[]) {
  if(argc<2) exit(1);
  if(argc>2) myLog::setLog("-",atoi(argv[2]));
  string treeName(argv[1]);
  tree t(treeName);
  t.output(cout);

  vector<tree::nodeP> nv;
  t.getAllNodes(nv, t.getRoot());
  cout <<"got "<<nv.size()<<" noded"<<endl;
  for (vector<tree::nodeP>::iterator i=nv.begin();i!=nv.end();++i)
	cout << (*i)->getComment()<<endl;
  exit(0);
}