File: process.cc

package info (click to toggle)
icmake 13.05.01-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,132 kB
  • sloc: cpp: 11,595; fortran: 883; makefile: 853; sh: 546; pascal: 342
file content (48 lines) | stat: -rw-r--r-- 1,399 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
37
38
39
40
41
42
43
44
45
46
47
48
#define XERR
#include "scan.ih"

    // called by modules/inspect.cc

    // sourcePath the path to reach filename fm the project's top-level dir.

void Scan::process(std::string const &subdir, string const &filename)
{
    (d_sourcePath = subdir) /= filename;

    d_exportNeeded = false;         // set to true by defineModule
    d_nameIdx = ~0UL;               // reset the idx: no available module name
    d_currentIdx = ~0UL;            // reset the idx: no module defined yet
                                    // by this source

    imsg << "   scanning " << filename << endl;
    d_scanner.switchStreams(filename, "-");

    while (true)
    {
        switch (d_scanner.lex())
        {
            case 0:
            return;

            case Scanner::MODDEF:               // export module Name;
               defineModule();
            continue;

            case Scanner::PARTDEF:              // export module Name:Part;
                definePartition();
            continue;

            case Scanner::MODDECL:              // [export] import Other; 
                importModule();
            continue;

            case Scanner::PARTDECL:             // [export] import :Part;
                importPartition();
            continue;

            case Scanner::MODSRC:               // module Name;
                modSource();
            continue;      
        }
    }
}