mirror of
https://github.com/JonathanFleischmann/CompilerULTIMATE.git
synced 2024-12-27 07:18:03 +00:00
add performances and fix unary
This commit is contained in:
parent
e2937b13e5
commit
64c3ed6db3
@ -6,6 +6,13 @@
|
||||
- Code-Generierung: Simon Wittmann
|
||||
- Testen: Jonathan Fleischmann
|
||||
|
||||
# Erbrachte Leistungen
|
||||
- Laurenz Schleicher: Grammatik entwickeln, Records, Statements als Liste zurückgeben, Generator, Syntactic Sugar auflösen
|
||||
- Julian Kraus: Grammatik entwickeln, Generator, Syntactic Sugar auflösen
|
||||
- Ahmad Juha: Typcheck
|
||||
- Simon Wittmann: Codegen und Tool für ASM
|
||||
- Jonathan Fleischmann: Tests
|
||||
|
||||
# Fehlende Tests für Features (positive Tests):
|
||||
- Main-Methode
|
||||
- Klammern von Expressions
|
@ -35,14 +35,16 @@ public class TypedUnary implements TypedExpression {
|
||||
if (right.typeCheck(typedProgram) != Type.BOOL) {
|
||||
throw new RuntimeException("Not operator must be applied to boolean");
|
||||
}
|
||||
return Type.BOOL;
|
||||
type = Type.BOOL;
|
||||
return type;
|
||||
}
|
||||
|
||||
if (op == UnaryOperator.SUB) {
|
||||
if (right.typeCheck(typedProgram) != Type.INT) {
|
||||
throw new RuntimeException("Minus operator must be applied to int");
|
||||
}
|
||||
return Type.BOOL;
|
||||
type = Type.INT;
|
||||
return type;
|
||||
}
|
||||
throw new RuntimeException("Unknown unary operator");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user