public static void BoolOperator() { SAR y = SAS.Pop(); SAR x = SAS.Pop(); SAR z = new SAR(SAR.SARtype.Identifier, x.token, x.value, x.scope); string op = OS.Peek(); if (op == "==" || op == "!=") { if ((x.dataType != y.dataType) && (y.dataType != "null")) { SemanticOperationError(x, y, OS.Pop()); } } else if ((x.dataType != y.dataType)) { /*if(x.dataType == "int" || x.dataType == "char") * { * * } * else * {*/ SemanticOperationError(x, y, OS.Pop()); // } } z.symid = "t" + uniqueCounter++; z.value += "_" + y.value; z.scope = "t"; z.dataType = "bool"; string[] data = { "returnType:" + z.dataType, "accessMod:private" }; Symbol temp = new Symbol("t", z.symid, z.value, "tvar", data); SymbolTable.Add(temp); if (op == "<") { ICode.LT(x.symid, y.symid, z.symid); } else if (op == ">") { ICode.GT(x.symid, y.symid, z.symid); } else if (op == "!=") { ICode.NE(x.symid, y.symid, z.symid); } else if (op == "==") { ICode.EQ(x.symid, y.symid, z.symid); } else if (op == "<=") { ICode.LE(x.symid, y.symid, z.symid); } else if (op == ">=") { ICode.GE(x.symid, y.symid, z.symid); } SAS.Push(z); OS.Pop(); OSprecidence.Pop(); return; }