-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCGOperandExpression.cpp
More file actions
101 lines (80 loc) · 3.08 KB
/
CGOperandExpression.cpp
File metadata and controls
101 lines (80 loc) · 3.08 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/****************************************************************************
* Modul: $RCSfile: CGOperandExpression.cpp,v $
*
* $Author: md $
* $Date: 1998/01/14 10:59:58 $
* $Revision: 1.2 $
*
* Aufgabe: Dieses Modul enthaelt Hilfsfunktionen
* Funktionen:
****************************************************************************/
#ifdef USE_PRAGMA
#pragma interface
#endif
/****************************************************************************
* Konstanten
****************************************************************************/
/****************************************************************************
* Include-Anweisungen
****************************************************************************/
#include <DS/DSExpression.h>
#include "CGFile.h"
#include "CGOperandExpression.h"
#ifdef DEBUG
#include <dmalloc.h>
#endif
/****************************************************************************
* Externe Variablen
****************************************************************************/
/****************************************************************************
* Globale Variablen
****************************************************************************/
/****************************************************************************
* Konstruktoren
****************************************************************************/
CGOperandExpression::CGOperandExpression(DSObject *father,
DSExpression *exp) :
DSOperandExpression(father, exp)
{
}
/****************************************************************************
* Destruktor
****************************************************************************/
CGOperandExpression::~CGOperandExpression(void)
{
}
DSObject *CGOperandExpression::New(DSObject *father) const
{
return new CGOperandExpression(father);
}
/****************************************************************************
* Write(): Oberfunktion der Codegenerierung fuer OperandExpression
* -> writer
* -> what
* Ergebnis: DS_OK oder DS_ERROR
* Seiteneffekte: Anlegen und Fuellen der .h und .cc-Files
****************************************************************************/
DSResult CGOperandExpression::Write(DSWriter *writer, DSCardinal what) const
{
DSResult result;
(void)what;
result = WriteImplementation((CGWriter *)writer);
if (result != DS_OK) return result;
return DS_OK;
}
/****************************************************************************
* WriteImplementation(): schreibt einen als Ausdruck gespeicherten Operanden
* -> writer
* Ergebnis: DS_OK,falls Aktion erfolgreich war, sonst DS_ERROR
* Seiteneffekte: Zieldatei wird gefuellt
****************************************************************************/
DSResult CGOperandExpression::WriteImplementation(CGWriter *writer) const
{
DSResult result;
result = GetExpression()->Write(writer);
if (result != DS_OK)
{
return result;
}
return DS_OK;
}