File: setdeath.cc

package info (click to toggle)
simrisc 16.06.00-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,568 kB
  • sloc: cpp: 6,889; fortran: 669; makefile: 112; ansic: 112; sh: 107
file content (31 lines) | stat: -rw-r--r-- 789 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
#define XERR
#include "scenario.ih"

void Scenario::setDeath()
{
    LineInfo const *previous = 0;

    string cumDeath;
    if (cumDeath = Options::instance().cumDeathFile(); not cumDeath.empty())
        readCumDeath(cumDeath);
    else
    {
        d_base.back() = "death:";

        Parser::Lines lines = Parser::any(d_base);

        if (lines.size() == 1)
            readCumDeath(cumDeath = lines.get()->tail);
        else
        {
            cumDeath = "analysis specification";
            LineInfo const *ptr = lines.get();  // skip the first (empty) line
            do
                previous = ptr;                 // keep the previous line
            while ((ptr = lines.get()) and appendCumDeath(ptr->tail));
        }
    }

    checkCumDeath(cumDeath, previous);
}