]> sourceware.org Git - systemtap.git/blame - staptree.cxx
* parser prototype snapshot
[systemtap.git] / staptree.cxx
CommitLineData
2f1a1aea
FCE
1// toy driver
2// Copyright 2005 Red Hat Inc.
3// GPL
4
5#include "staptree.h"
6#include "parse.h"
7#include <iostream>
8
9
10
11expression::~expression () {}
12statement::~statement () {}
13
14
15int main (int argc, char *argv [])
16{
17 int rc = 0;
18
19 if (argc > 1)
20 {
21 // quietly parse all listed input files
22 for (int i = 1; i < argc; i ++)
23 {
24 parser p (argv[i]);
25 stapfile* f = p.parse ();
26 if (f)
27 cout << "file '" << argv[i] << "' parsed ok." << endl;
28 else
29 rc = 1;
30 }
31 }
32 else
33 {
34 // parse then print just stdin
35 parser p (cin);
36 stapfile* f = p.parse ();
37 if (f)
38 f->print (cout);
39 else
40 rc = 1;
41 }
42
43 return rc;
44}
This page took 0.024923 seconds and 5 git commands to generate.