class ClassDeclaration extends Declaration
Modifier and Type | Field and Description |
---|---|
(package private) java.util.LinkedList<VarDeclaration> |
attributes
Die Attribute dieser Klasse.
|
(package private) static ClassDeclaration |
boolType
Der interne Basisdatentyp für Wahrheitswerte.
|
(package private) Declarations |
declarations
Die innerhalb dieser Klasse sichtbaren Deklarationen.
|
(package private) static int |
HEADERSIZE
Konstante für die Größe der Verwaltungsinformation am Anfang eines jeden Objekts.
|
(package private) static ClassDeclaration |
intClass
Die Klasse Integer.
|
(package private) static ClassDeclaration |
intType
Der interne Basisdatentyp für Zahlen.
|
(package private) java.util.LinkedList<MethodDeclaration> |
methods
Die Methoden dieser Klasse.
|
(package private) static ClassDeclaration |
nullType
Ein interner Typ für null.
|
(package private) int |
objectSize
Die Größe eines Objekts dieser Klasse.
|
(package private) static ClassDeclaration |
voidType
Ein interner Typ für das Ergebnis von Methoden.
|
identifier
Constructor and Description |
---|
ClassDeclaration(Identifier name)
Konstruktor.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
check(ClassDeclaration expected,
Position position)
Die Methode prüft, ob dieser Typ kompatibel mit einem anderen Typ ist.
|
(package private) void |
contextAnalysis(Declarations declarations)
Die Methode führt die Kontextanalyse für diese Klassen-Deklaration durch.
|
(package private) void |
generateCode(CodeStream code)
Generiert den Assembler-Code für diese Klasse.
|
(package private) boolean |
isA(ClassDeclaration expected)
Die Methode prüft, ob dieser Typ kompatibel mit einem anderen Typ ist.
|
(package private) void |
print(TreeStream tree)
Die Methode gibt diese Deklaration in einer Baumstruktur aus.
|
(package private) static void |
typeError(ClassDeclaration expected,
Position position)
Die Methode erzeugt eine Ausnahme für einen Typfehler.
|
static final int HEADERSIZE
static final ClassDeclaration voidType
static final ClassDeclaration nullType
static final ClassDeclaration intType
static final ClassDeclaration boolType
static final ClassDeclaration intClass
java.util.LinkedList<VarDeclaration> attributes
java.util.LinkedList<MethodDeclaration> methods
Declarations declarations
int objectSize
contextAnalysis
bestimmt.ClassDeclaration(Identifier name)
name
- Der Name der deklarierten Klasse.void contextAnalysis(Declarations declarations) throws CompileException
contextAnalysis
in class Declaration
declarations
- Die an dieser Stelle gültigen Deklarationen.CompileException
- Während der Kontextanylyse wurde ein Fehler
gefunden.boolean isA(ClassDeclaration expected)
expected
- Der Typ, mit dem verglichen wird.static void typeError(ClassDeclaration expected, Position position) throws CompileException
expected
- Der Typ, der nicht kompatibel ist.position
- Die Stelle im Quelltext, an der der Typfehler gefunden wurde.CompileException
- Die Meldung über den Typfehler.void check(ClassDeclaration expected, Position position) throws CompileException
expected
- Der Typ, mit dem verglichen wird.position
- Die Position im Quelltext, an der diese Überprüfung
relevant ist. Die Position wird in der Fehlermeldung verwendet.CompileException
- Die Typen sind nicht kompatibel.void print(TreeStream tree)
print
in class Declaration
tree
- Der Strom, in den die Ausgabe erfolgt.void generateCode(CodeStream code)
code
- Der Strom, in den die Ausgabe erfolgt.