summaryrefslogtreecommitdiffstats
path: root/parsetest.cxx
blob: 6293a2f5d155f56dff618209093ed1d6081975df (plain)
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
29
30
31
32
33
34
35
36
37
38
// toy driver
// Copyright 2005 Red Hat Inc.
// GPL


#include "staptree.h"
#include "parse.h"
#include <iostream>


int main (int argc, char *argv [])
{
  int rc = 0;

  if (argc > 1)
    {
      for (int i = 1; i < argc; i ++)
        {
          parser p (argv[i]);
          stapfile* f = p.parse ();
          if (f)
            f->print (cout);
          else
            rc = 1;
        }
    }
  else
    {
      parser p (cin);
      stapfile* f = p.parse ();
      if (f)
        f->print (cout);
      else
        rc = 1;
    }

  return rc;
}