summaryrefslogtreecommitdiff
path: root/src/ast/nodes/AugassignNode.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/ast/nodes/AugassignNode.java')
-rw-r--r--src/ast/nodes/AugassignNode.java42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/ast/nodes/AugassignNode.java b/src/ast/nodes/AugassignNode.java
new file mode 100644
index 0000000..3519b50
--- /dev/null
+++ b/src/ast/nodes/AugassignNode.java
@@ -0,0 +1,42 @@
+package com.clp.project.ast.nodes;
+
+import java.util.ArrayList;
+
+import com.clp.project.semanticanalysis.SemanticError;
+import com.clp.project.semanticanalysis.SymbolTable;
+
+import com.clp.project.ast.types.*;
+import org.antlr.v4.runtime.tree.TerminalNode;
+
+/**
+ * Node for the `augassign` statement of the grammar.
+ */
+public class AugassignNode implements Node {
+ private TerminalNode val;
+
+ public AugassignNode(TerminalNode val) {
+ this.val = val;
+ }
+
+ @Override
+ public ArrayList<SemanticError> checkSemantics(SymbolTable ST, int _nesting) {
+ return new ArrayList<SemanticError>();
+ }
+
+ // FIXME: use the right type
+ @Override
+ public Type typeCheck() {
+ return new VoidType();
+ }
+
+ // TODO: add code generation for augassign node
+ @Override
+ public String codeGeneration() {
+ return "";
+ }
+
+ @Override
+ public String toPrint(String prefix) {
+ return prefix + "Augassign(" + val + ")\n";
+ }
+}