private void setVariablesType(ArrayList<Node> variables) { variables.forEach( (v) -> { Node type = v.getChildren().get(1); Node listId = v.getChildren().get(0); listId .getChildren() .forEach( (id) -> { int tag = 0; if (type.getTag() == Tag.REAL) { tag = Tag.REAL_NUM; } else { if (type.getTag() == Tag.INTEGER) { tag = Tag.INT_NUM; } else { tag = Tag.BOOL_NUM; } } syntaxAnalyser.setVariableType(new Word(id.getStrValue(), id.getTag()), tag); }); }); }