outcalls.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. #ifndef NORCSID
  2. static char rcsidp4[] = "$Id$";
  3. #endif
  4. #include "parser.h"
  5. outputincalls()
  6. {
  7. struct idf *op;
  8. char *s;
  9. for(op=ops;op!=(struct idf *)NULL;op=op->id_nextidf) {
  10. s = op->id_text;
  11. switch(op->id_argfmt) {
  12. case NOARG:
  13. fprintf(ofile,"%s\t|\t|\n",s);
  14. if(op->id_used) {
  15. fprintf(ofile,"\tEM_Nop(op_%s);\n",s);
  16. fprintf(ofile,"\tOO_dfa(op_%s);\n",s);
  17. }
  18. else {
  19. fprintf(ofile,"\tFLUSHDFA();\n");
  20. fprintf(ofile,"\tC_%s();\n",s);
  21. }
  22. break;
  23. case CSTOPT:
  24. fprintf(ofile,"%s_narg\t|\t|\n",s);
  25. if(op->id_used) {
  26. fprintf(ofile,"\tEM_Nnarg(op_%s);\n",s);
  27. fprintf(ofile,"\tOO_dfa(op_%s);\n",s);
  28. }
  29. else {
  30. fprintf(ofile,"\tFLUSHDFA();\n");
  31. fprintf(ofile,"\tC_%s_narg();\n",s);
  32. }
  33. /* fall thru */
  34. case CST:
  35. fprintf(ofile,"%s\t| arith:n\t|\n",s);
  36. if(op->id_used) {
  37. fprintf(ofile,"\tEM_Ncst(op_%s,n);\n",s);
  38. fprintf(ofile,"\tOO_dfa(op_%s);\n",s);
  39. }
  40. else {
  41. fprintf(ofile,"\tFLUSHDFA();\n");
  42. fprintf(ofile,"\tC_%s(n);\n",s);
  43. }
  44. break;
  45. case DEFILB:
  46. fprintf(ofile,"df_ilb\t| label:l\t|\n");
  47. if(op->id_used) {
  48. fprintf(ofile,"\tEM_Ndefilb(op_%s,l);\n",s);
  49. fprintf(ofile,"\tOO_dfa(op_%s);\n",s);
  50. }
  51. else {
  52. fprintf(ofile,"\tFLUSHDFA();\n");
  53. fprintf(ofile,"\tC_df_ilb(l);\n",s);
  54. }
  55. break;
  56. case PNAM:
  57. fprintf(ofile,"%s\t| char *:s\t|\n",s);
  58. if(op->id_used) {
  59. fprintf(ofile,"\tEM_Npro(op_%s,s);\n",s);
  60. fprintf(ofile,"\tOO_dfa(op_%s);\n",s);
  61. }
  62. else {
  63. fprintf(ofile,"\tFLUSHDFA();\n");
  64. fprintf(ofile,"\tC_%s(s);\n",s);
  65. }
  66. break;
  67. case LAB:
  68. fprintf(ofile,"%s\t| label:l\t|\n",s);
  69. if(op->id_used) {
  70. fprintf(ofile,"\tEM_Nilb(op_%s,l);\n",s);
  71. fprintf(ofile,"\tOO_dfa(op_%s);\n",s);
  72. }
  73. else {
  74. fprintf(ofile,"\tFLUSHDFA();\n");
  75. fprintf(ofile,"\tC_%s(l);\n",s);
  76. }
  77. break;
  78. case EXT:
  79. fprintf(ofile,"%s\t| arith:n\t|\n",s);
  80. if(op->id_used) {
  81. fprintf(ofile,"\tEM_Ncst(op_%s,n);\n",s);
  82. fprintf(ofile,"\tOO_dfa(op_%s);\n",s);
  83. }
  84. else {
  85. fprintf(ofile,"\tFLUSHDFA();\n");
  86. fprintf(ofile,"\tC_%s(n);\n",s);
  87. }
  88. fprintf(ofile,"%s_dnam\t| char *:s arith:n\t|\n",s);
  89. if(op->id_used) {
  90. fprintf(ofile,"\tEM_Nsof(op_%s,s,n);\n",s);
  91. fprintf(ofile,"\tOO_dfa(op_%s);\n",s);
  92. }
  93. else {
  94. fprintf(ofile,"\tFLUSHDFA();\n");
  95. fprintf(ofile,"\tC_%s_dnam(s,n);\n",s);
  96. }
  97. fprintf(ofile,"%s_dlb\t| label:l arith:n\t|\n",s);
  98. if(op->id_used) {
  99. fprintf(ofile,"\tEM_Nnof(op_%s,l,n);\n",s);
  100. fprintf(ofile,"\tOO_dfa(op_%s);\n",s);
  101. }
  102. else {
  103. fprintf(ofile,"\tFLUSHDFA();\n");
  104. fprintf(ofile,"\tC_%s_dlb(l,n);\n",s);
  105. }
  106. break;
  107. }
  108. }
  109. }