nopt.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /* $Header$ */
  2. #include <stdio.h>
  3. #include <em_spec.h>
  4. #include <em_mnem.h>
  5. #include <em_pseu.h>
  6. #include <em_flag.h>
  7. #include <em_ptyp.h>
  8. #include <em_mes.h>
  9. #include <alloc.h>
  10. #include <em.h>
  11. #include <em_comp.h>
  12. #include <system.h>
  13. #include <emO_code.h>
  14. #include <ansi.h>
  15. #define MAXBUFFER 200
  16. #define MAXSTRING 1000
  17. #define OTHER 0
  18. #define op_lab sp_fpseu
  19. typedef struct e_instr *p_instr;
  20. struct dfa {
  21. short check;
  22. short next;
  23. };
  24. struct dodefault {
  25. short numout;
  26. short next;
  27. };
  28. extern p_instr OO_buffer;
  29. extern p_instr OO_patternqueue;
  30. extern p_instr OO_nxtpatt;
  31. extern p_instr OO_endbackup;
  32. extern p_instr OO_nxtrepl;
  33. p_instr OO_halfflush();
  34. # define GETNXTPATT() (OO_nxtpatt>=&OO_buffer[MAXBUFFER]?OO_halfflush():OO_nxtpatt++)
  35. # define GETNXTREPL() (OO_nxtrepl++)
  36. # define FLUSHDFA() (GETNXTPATT())->em_opcode=OTHER;\
  37. if (OO_state) OO_dfa(OTHER); else OO_flush()
  38. extern int OO_state;
  39. extern arith OO_WSIZE; /* wordlength */
  40. extern arith OO_DWSIZE; /* 2*wordlength */
  41. extern arith OO_PSIZE; /* pointer length */
  42. #ifdef STATS
  43. extern int OO_wrstats; /* statistics output */
  44. #endif
  45. #define CST(p) (p.em_cst)
  46. #define PNAM(p) (p.em_pnam)
  47. #define LAB(p) (p.em_ilb)
  48. #define DEFILB(p) (p.em_ilb)
  49. #define DEFINED(p) (p.em_argtype)
  50. _PROTOTYPE(void EM_mkop, (p_instr, int));
  51. _PROTOTYPE(void EM_mknarg, (p_instr, int));
  52. _PROTOTYPE(void EM_mkilb, (p_instr, int, label));
  53. _PROTOTYPE(void EM_mknof, (p_instr, int, label, arith));
  54. _PROTOTYPE(void EM_mksof, (p_instr, int, char *, arith));
  55. _PROTOTYPE(void EM_mkcst, (p_instr, int, arith));
  56. _PROTOTYPE(void EM_mkpro, (p_instr, int, char *));
  57. _PROTOTYPE(void EM_mkdefilb, (p_instr, int, label));
  58. _PROTOTYPE(void EM_Nop, (int));
  59. _PROTOTYPE(void EM_Nnarg, (int));
  60. _PROTOTYPE(void EM_Nilb, (int, label));
  61. _PROTOTYPE(void EM_Nnof, (int, label, arith));
  62. _PROTOTYPE(void EM_Nsof, (int, char *, arith));
  63. _PROTOTYPE(void EM_Ncst, (int, arith));
  64. _PROTOTYPE(void EM_Npro, (int, char *));
  65. _PROTOTYPE(void EM_Ndefilb, (int, label));
  66. _PROTOTYPE(void EM_Rop, (int));
  67. _PROTOTYPE(void EM_Rnarg, (int));
  68. _PROTOTYPE(void EM_Rilb, (int, label));
  69. _PROTOTYPE(void EM_Rnof, (int, label, arith));
  70. _PROTOTYPE(void EM_Rsof, (int, char *, arith));
  71. _PROTOTYPE(void EM_Rcst, (int, arith));
  72. _PROTOTYPE(void EM_Rpro, (int, char *));
  73. _PROTOTYPE(void EM_Rdefilb, (int, label));
  74. _PROTOTYPE(arith OO_rotate, (arith, arith));
  75. _PROTOTYPE(int OO_signsame, (arith, arith));
  76. _PROTOTYPE(int OO_sfit, (arith, arith));
  77. _PROTOTYPE(int OO_ufit, (arith, arith));
  78. _PROTOTYPE(int OO_extsame, (p_instr, p_instr));
  79. _PROTOTYPE(int OO_namsame, (p_instr, p_instr));
  80. _PROTOTYPE(arith OO_offset, (p_instr));
  81. _PROTOTYPE(char *OO_freestr, (char *));
  82. _PROTOTYPE(void OO_dfa, (int));
  83. _PROTOTYPE(void OO_flush, (void));
  84. _PROTOTYPE(p_instr OO_halfflush, (void));
  85. _PROTOTYPE(void OO_mkext, (p_instr, int, p_instr, arith));
  86. _PROTOTYPE(void OO_mkrepl, (int, int, int));
  87. #ifdef DEBUG
  88. _PROTOTYPE(void dumpstate, (char *));
  89. _PROTOTYPE(void prtinst, (p_instr));
  90. #endif