ch3mon.c 471 B

123456789101112131415161718192021222324252627
  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. /* $Id$ */
  6. /* EVALUATION OF MONADIC OPERATORS */
  7. #include "Lpars.h"
  8. #include "arith.h"
  9. /*ARGSUSED2*/
  10. ch3mon(oper, pval, puns)
  11. register arith *pval;
  12. int *puns;
  13. {
  14. switch (oper) {
  15. case '~':
  16. *pval = ~(*pval);
  17. break;
  18. case '-':
  19. *pval = -(*pval);
  20. break;
  21. case '!':
  22. *pval = !(*pval);
  23. break;
  24. }
  25. }