From b12c01732860f9727626829e0b25a273de5fe5c7 Mon Sep 17 00:00:00 2001 From: geno Date: Tue, 25 Jun 2024 16:04:07 +0200 Subject: check semantic of defined and undefined variables implemented do not check for built-in function works on the example --- src/semanticanalysis/SymbolTable.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/semanticanalysis/SymbolTable.java') diff --git a/src/semanticanalysis/SymbolTable.java b/src/semanticanalysis/SymbolTable.java index 8193d5e..617b48a 100644 --- a/src/semanticanalysis/SymbolTable.java +++ b/src/semanticanalysis/SymbolTable.java @@ -126,15 +126,18 @@ public class SymbolTable { // We always increment the offset by 1 otherwise we need ad-hoc bytecode // operations // FIXME: wtf is that? - if (type.getClass().equals((new BoolType()).getClass())) { - offs = offs + 1; - } else if (type.getClass().equals((new IntType()).getClass())) { - offs = offs + 1; - } else { - offs = offs + 1; - } + // if (type.getClass().equals((new BoolType()).getClass())) { + // offs = offs + 1; + // } else if (type.getClass().equals((new IntType()).getClass())) { + // offs = offs + 1; + // } else { + // offs = offs + 1; + // } + offs = offs + 1; this.offset.add(offs); + + // System.out.println("Insert " + id + " of type " + type.toString() + " with nesting " + String.valueOf(_nesting)); } /** -- cgit v1.2.3-18-g5258