blob: e18063b772cf42e9cc2435f7f1184cd165165d8d (
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
|
package no.eliashaugsbakk.kompilator.parsing.node.expression;
import java.util.List;
import no.eliashaugsbakk.kompilator.parsing.Type;
/**
* Represents a function call statement (e.g., print("Hello, world")).
*/
public class FunctionCall extends Expression {
public final String functionName;
public final List<Expression> arguments;
public FunctionCall(String functionName, List<Expression> arguments) {
this.functionName = functionName;
this.arguments = arguments;
}
public Type getReturnType() {
if (functionName.equals("skriv")) {
return new Type("void", false);
}
// TODO: Look up return type in function table when you add more functions
return null;
}
}
|