File: setanalysissource.cc

package info (click to toggle)
simrisc 16.05.00-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,568 kB
  • sloc: cpp: 6,877; fortran: 665; makefile: 112; ansic: 112; sh: 107
file content (36 lines) | stat: -rw-r--r-- 1,097 bytes parent folder | download | duplicates (2)
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
#define XERR
#include "simulator.ih"

void Simulator::setAnalysisSource()
{
    Arg const &arg = Arg::instance();

    if (arg.option('o'))                            // -o -> specs from
    {
        d_next = true;
        d_nextSpecs = &Simulator::cmdLineAnalysis;  //       cmd line args
    }
    else
    {                                   // otherwise find the (next) Analysis:
                                        // line in the analysis file
        d_ifstream = Exception::factory<ifstream>(arg[0]);
        string line;
        while (getline(d_ifstream, line))
        {
            ++d_lineNr;
            size_t pos = line.find_first_not_of(" \t\r");
            if (pos == string::npos)
                continue;
            if (line.find("Analysis:", pos) == pos) // analysis up to EOF of
            {
                d_next = true;
                break;                              // the next analysis
            }
        }

        if (d_next == 0)
            wmsg << "No Analysis: specification found" << endl;

        d_nextSpecs = &Simulator::fileAnalysis;
    }
}