instructions.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* Copyright (C) 2001, 2009 Free Software Foundation, Inc.
  2. *
  3. * This library is free software; you can redistribute it and/or
  4. * modify it under the terms of the GNU Lesser General Public License
  5. * as published by the Free Software Foundation; either version 3 of
  6. * the License, or (at your option) any later version.
  7. *
  8. * This library is distributed in the hope that it will be useful, but
  9. * WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. * Lesser General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU Lesser General Public
  14. * License along with this library; if not, write to the Free Software
  15. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  16. * 02110-1301 USA
  17. */
  18. #ifndef _SCM_INSTRUCTIONS_H_
  19. #define _SCM_INSTRUCTIONS_H_
  20. #include <libguile.h>
  21. #define SCM_VM_NUM_INSTRUCTIONS (1<<8)
  22. #define SCM_VM_INSTRUCTION_MASK (SCM_VM_NUM_INSTRUCTIONS-1)
  23. enum scm_opcode {
  24. #define VM_INSTRUCTION_TO_OPCODE 1
  25. #include <libguile/vm-expand.h>
  26. #include <libguile/vm-i-system.i>
  27. #include <libguile/vm-i-scheme.i>
  28. #include <libguile/vm-i-loader.i>
  29. #undef VM_INSTRUCTION_TO_OPCODE
  30. };
  31. SCM_API SCM scm_instruction_list (void);
  32. SCM_API SCM scm_instruction_p (SCM obj);
  33. SCM_API SCM scm_instruction_length (SCM inst);
  34. SCM_API SCM scm_instruction_pops (SCM inst);
  35. SCM_API SCM scm_instruction_pushes (SCM inst);
  36. SCM_API SCM scm_instruction_to_opcode (SCM inst);
  37. SCM_API SCM scm_opcode_to_instruction (SCM op);
  38. SCM_INTERNAL void scm_bootstrap_instructions (void);
  39. SCM_INTERNAL void scm_init_instructions (void);
  40. #endif /* _SCM_INSTRUCTIONS_H_ */
  41. /*
  42. Local Variables:
  43. c-file-style: "gnu"
  44. End:
  45. */