summaryrefslogtreecommitdiffstats
path: root/ue3/mycpu/cprogram.h
blob: bf161b84d228a1491840ae86f0da7354e35c3331 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/**
 * @module cprogram
 * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348)
 * @brief  TODO
 * @date   10.05.2009
 */

#ifndef CPROGRAM_H
#define CPROGRAM_H 1

#include <vector>
#include <set>
#include "cinstruction.h"

/**
 * @class CProgram
 *
 * TODO
 */
class CProgram
  : public std::vector<CInstruction *>
{
  public:
    /**
     * @method CProgram
     * @brief  Default ctor
     * @param  -
     * @return -
     * @globalvars none
     * @exception  none
     * @conditions none
     */
    CProgram();

    /**
     * @method ~CProgram
     * @brief  Default dtor
     * @param  -
     * @return -
     * @globalvars none
     * @exception  none
     * @conditions none
     */
    ~CProgram();

    /**
     * @method compile
     * @brief  create instructions from parsing stream
     * @param  in  inputstream to read from
     * @return void
     * @globalvars none
     * @exception  std::runtime_error
     * @conditions none
     */
    void compile(std::istream& in);

#if DEBUG
    /**
     * @method dump
     * @brief  dumps contents to outputstream
     * @param  out  outputstream to write to
     * @return void
     * @globalvars none
     * @exception  none
     * @conditions none
     */
    void dump(std::ostream& out);
#endif

  private:
    /* members */
    /** set of known instructions */
    std::set<CInstruction *> m_instrset;
};

#endif

/* vim: set et sw=2 ts=2: */