ch3mon.c 443 B

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