home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / fweb153.zip / fweb-1.53 / web / ratfor0.web < prev    next >
Text File  |  1995-09-23  |  2KB  |  123 lines

  1. @z --- ratfor0.web ---
  2.  
  3. FWEB version 1.53 (September 23, 1995)
  4.  
  5. Based on version 0.5 of S. Levy's CWEB [copyright (C) 1987 Princeton University]
  6.  
  7. @x-----------------------------------------------------------------------------
  8.  
  9. \Title{RATFOR0}
  10.  
  11. @c
  12.  
  13. @* RATFOR0.  The following routines are dummies, used when the full
  14. \.{ratfor} package is't loaded.  To tell the make file not to load
  15. \.{ratfor}, you say ``\.{make LOAD\_RATFOR=0 ftangle}'', or put the line
  16. ``\.{LOAD\_RATFOR=0}'' into \.{default.mk}.
  17.  
  18. @a
  19. @<Include files@>@;
  20. @<Prototypes@>@;
  21. @<Global variables@>@;
  22.  
  23. @I typedefs.hweb
  24.  
  25. @
  26. @<Proto...@>=
  27.  
  28. #include "c_type.h"
  29.  
  30. @ The following are dummies to make \FTANGLE\ happy.
  31. @<Glob...@>=
  32.  
  33. sixteen_bits id_function,id_program,id_subroutine;
  34. boolean balanced = YES;
  35. ASCII cur_delim = '\0';
  36.  
  37.  
  38. @ |common_init| calls this routine to set the flag |Rat_is_loaded|.  Note
  39. that we allow \FWEAVE\ to process the |RATFOR| language even though
  40. \FTANGLE\ may not be able to.
  41. @a
  42. SRTN is_Rat_present(VOID)
  43. {
  44. Rat_is_loaded = BOOLEAN(program==weave);
  45. }
  46.  
  47. @ Various places in the code call this function to make sure we haven't
  48. somehow gotten into \Ratfor\ by mistake when it's not loaded.
  49. @a
  50. boolean Rat_OK FCN((msg))
  51.     outer_char *msg C1("")@;
  52. {
  53. if(Rat_is_loaded) return YES; /* We might get here by a call from
  54.                 \.{common} during \FWEAVE. */
  55.  
  56. err_print(R,"Ratfor is not loaded.  %s",msg);
  57. return NO;
  58. }
  59.  
  60. @ An error routine for this package; helps to trace confusion.
  61.  
  62. @d BAD_CALL(fcn_name) bad_call(OC(fcn_name))
  63.  
  64. @a
  65. SRTN bad_call FCN((fcn_name))
  66.     outer_char *fcn_name C1("")@;
  67. {
  68. CONFUSION(fcn_name,"This function shouldn't be called");
  69. }
  70.  
  71. @ No memory allocations are needed when not loaded.
  72. @a
  73. SRTN alloc_Rat(VOID)
  74. {}
  75.  
  76. @ Initializations are also moot.
  77. @a
  78. SRTN ini_Ratfor(VOID)
  79. {}
  80.  
  81. @ Reserved words are stored only when the language is |RATFOR|, so this
  82. shouldn't happen.
  83. @a
  84. SRTN ini_RAT_tokens FCN((language0))
  85.     LANGUAGE language0 C1("")@;
  86. {
  87. if(Rat_is_loaded) return;
  88. BAD_CALL("ini_RAT_tokens");
  89. }
  90.  
  91. @ Should never be called.
  92. @a
  93. SRTN cp_fcn_body(VOID)
  94. {
  95. BAD_CALL("cp_fcn_body");
  96. }
  97.  
  98. @ Likewise.
  99. @a
  100. int chk_lbl(VOID)
  101. {
  102. BAD_CALL("chk_lbl");
  103. return -1; // Avoids spurious compiler warning.
  104. }
  105.  
  106. @ Likewise.
  107. @a
  108. SRTN RAT_error(VOID)
  109. {
  110. BAD_CALL("RAT_error");
  111. }
  112.  
  113. @ The |_DO| macro ought to transcend |RATFOR|, but it uses a bunch of
  114. \Ratfor\ features.
  115. @a
  116. X_FCN x_unroll(VOID)
  117. {
  118. Rat_OK(OC("Therefore, the _DO macro cannot be used, since it relies on some \
  119. Ratfor features (sorry)"));
  120. }
  121.  
  122. @* INDEX.
  123.