summaryrefslogtreecommitdiff
path: root/src/ast/nodes/DottedNameNode.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/ast/nodes/DottedNameNode.java')
-rw-r--r--src/ast/nodes/DottedNameNode.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ast/nodes/DottedNameNode.java b/src/ast/nodes/DottedNameNode.java
index 46d1b61..23f14c1 100644
--- a/src/ast/nodes/DottedNameNode.java
+++ b/src/ast/nodes/DottedNameNode.java
@@ -11,6 +11,7 @@ import org.antlr.v4.runtime.tree.TerminalNode;
* Node for the `dooted_name` statement of the grammar.
*/
public class DottedNameNode implements Node {
+
protected ArrayList<TerminalNode> names;
public DottedNameNode(ArrayList<TerminalNode> names) {
@@ -19,14 +20,18 @@ public class DottedNameNode implements Node {
@Override
public ArrayList<SemanticError> checkSemantics(SymbolTable ST, int _nesting) {
- ArrayList<SemanticError> errors = new ArrayList<SemanticError>();
+ ArrayList<SemanticError> errors = new ArrayList();
+
+ for (int i = 0; i < names.size(); ++i) {
+ ST.insert(names.get(i).toString(), this.typeCheck(), _nesting, null);
+ }
return errors;
}
@Override
public Type typeCheck() {
- return new VoidType();
+ return new ImportType();
}
// NOTE: we do not provide code generation for this node in the same way