blob: 3ad82dde8007c3392f72d016b37fe4ac2ca5ae83 (
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
|
package ast.nodes;
import ast.types.*;
/**
* Node for the `paramdef` statement of the grammar. Extends the `AtomNode`
* class.
*/
public class ParamdefNode extends AtomNode {
public ParamdefNode(String val) {
super(val);
}
@Override
public ArrayList<SemanticError> checkSemantics(SymbolTable ST, int _nesting) {
ST.insert(this.getId(), this.typeCheck(), _nesting, "");
return new ArrayList<SemanticError>();
}
// FIXME: it should returns the param' type
@Override
public Type typeCheck() {
return new VoidType();
}
@Override
public String toPrint(String prefix) {
return prefix + "Paramdef(" + val + ")\n";
}
}
|