public Type Visit(NotStatement notStatement, FunctionGeneratorEnvironment arg) { notStatement.s1.Accept(this, arg); Program.Emit(T42Instruction.NOT); return(new BoolType()); }
public IValue Visit(NotStatement notStatement) { IValue result = notStatement.s1.Accept(this); if (result.Type != ValueType.Bool) { var err = new ErrorMessage(); throw new EvaluationError(err.ErrorOutput(ErrorMessage.ErrorCode.UOP_1, notStatement)); } var x = ((BoolValue)result).Bool; return(new BoolValue(!x)); }
public Type Visit(NotStatement notStatement) { var type = notStatement.s1.Accept(this); var type_text = type.GetType().Name; if (IsVoidType(type_text)) { var err = new TypeErrorMessage(); throw new TypeException(err.ErrorOutput(TypeErrorMessage.ErrorCode.ASN_2, notStatement)); } if (type_text != "BoolType") { var err = new TypeErrorMessage(); throw new TypeException(err.ErrorOutput(TypeErrorMessage.ErrorCode.UOP_1, notStatement)); } return(type); }
public Statement Visit(NotStatement notStatement) { notStatement.s1.Accept(this); return(null); }
public Void Visit(NotStatement notStatement, SortedSet <string> free) { notStatement.s1.Accept(this, free); return(null); }