ch7mon.c 435 B

123456789101112131415161718192021222324
  1. /* $Id$ */
  2. /*
  3. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  4. * See the copyright notice in the ACK home directory, in the file "Copyright".
  5. */
  6. /* EVALUATION OF MONADIC OPERATORS */
  7. #include "Lpars.h"
  8. #include <em_arith.h>
  9. void ch7mon(int oper, arith *pval)
  10. {
  11. switch (oper) {
  12. case '~':
  13. *pval = ~(*pval);
  14. break;
  15. case '-':
  16. *pval = -(*pval);
  17. break;
  18. case '!':
  19. *pval = !(*pval);
  20. break;
  21. }
  22. }