private boolean addToSymbolTable(String key, String name, String kind, IData data) {
        for (Symbol temp : symbolTable.values()) {
            if (temp.getValue().equals(name) && temp.getScope().equals(scope)) {

                if (kind.equals(LITERAL)) return true;

                errorList += "duplicate symbol: symbol: '" + name + "' already exists in symbol table." + LINE + lexicalAnalyzer.getToken().getLineNum() + "\n";
                return false;
            }
        }

        if (kind.equals(LITERAL)) {
            symbolTable.put(key + variableId, new Symbol(scope, key + variableId++, name, kind, data, ELEM_SIZE, 1));
        } else if (key.equals("M")) {
            symbolTable.put(key + methodId, new Symbol(scope, key + methodId, name, kind, data, 0, 1));
            symbolTable.get(key + methodId).setObjectSize(3);
            methodId++;
        } else if (key.equals("C")) {
            symbolTable.put(key + variableId, new Symbol(scope, key + variableId++, name, kind, data, 1, 0));
        } else {
            Symbol method = getMethodSymbol();
            if (key.equals("P")) {
                symbolTable.put(key + variableId, new Symbol(scope, key + variableId++, name, kind, data, method.getObjectSize(), 1));
                method.updateObjectSize(1);
            } else if (kind.equals("ivar")) {
                Symbol classObj = getClassSymbol();
                symbolTable.put(key + variableId, new Symbol(scope, key + variableId++, name, kind, data, classObj.getSize(), 1));
                classObj.updateSize(1);
            } else {
                symbolTable.put(key + variableId, new Symbol(scope, key + variableId++, name, kind, data, method.getSize(), 1));
                method.updateSize(1);
            }
        }
        return true;
    }