private boolean differentTypeCompare1(ProgramParamExp programParamExp, VariableExp variableExp) { String paramExp = programParamExp.getName().toString(); String varName = variableExp.toString(); if (paramExp.equals(varName)) { return true; } // System.out.println("not equal"); return false; }
private boolean variableCompare(VariableExp variableExp, VariableExp variableExp2) { List<Exp> subExp1 = variableExp.getSubExpressions(); List<Exp> subExp2 = variableExp2.getSubExpressions(); String varName1 = variableExp2.toString(); String varName2 = variableExp.toString(); if (variableExp instanceof VariableNameExp) { // System.out.println(((VariableNameExp)variableExp).getName().toString()); } // System.out.println(subExp1.toString()); // System.out.println(subExp2.toString()); // System.out.println(varName1); // System.out.println(varName2); // System.out.println(variableExp.toString()); if (varName1.equals(varName2)) { // System.out.println("they are equal"); return true; } return false; }