@z --- macs.hweb ---

FWEB version 1.40 (October 30, 1993)

Based on version 0.5 of S. Levy's CWEB [copyright (C) 1987 Princeton University]

@x-----------------------------------------------------------------------------

@ Definitions for macros used in macro processing, especially in \.{macs.web}.

@d semi 01 /* Kludge! */

@d SILENT (boolean)NO
@d COMPLAIN (boolean)YES

@d OUTER_MACRO 0xFF
@d OUTER_UNMACRO 0xFE
@d UNDEFINED_MACRO 0xFD

@d MAX_XLEVELS 200

@d equiv equiv_or_xref // Info corresponding to names.
@d EQUIV ASCII HUGE * // For casting into the above field.

/* Note that the following function retrieves not only regular \WEB\
macros, but also built-in functions. */
@d MAC_LOOKUP(cur_val) (cur_val < MODULE_NAME ?
	(text_pointer)(name_dir+(cur_val))->equiv : NULL)

@d macro 0 // For appending a macro; distinguishes from a module.


/* The following are the values of the |macro_type| field of
|name_pointer|s. */
@d NOT_DEFINED 0
@d DEFERRED_MACRO 1 /* Numbers chosen so that |DEFERRED_MACRO +
	scanning_defn| gives the two choices. */
@d IMMEDIATE_MACRO 2
@d FILE_NAME 3 // Used to prevent truncations from affecting file names.

@d MAKE_RECURSIVE @'*' /* To allow a WEB macro to be recursive, preface its
	definition by this symbol, as in `\.{@@m *R R}'.  (Recursive macros
	are not presently implemented.) */

@d AUTO_INSERT @'['
@d END_AUTO_INSERT @']'

/* Guard against overflow of the macro buffer. */
@d MCHECK(n,reason) if(mp+(n) > macrobuf_end)
			mbuf_full((unsigned long)(n),(outer_char *)reason)

@#if 0
	@d MCHECK mcheck // This speeds things up a bit.
@#endif

@<Typedef...@>=

typedef struct
	{
	int token[MAX_XLEVELS];
	int level;
	} XIDS;

@
@<Glob...@>=

IN_COMMON STMT_LBL max_stmt; /* See \.{common.web}. */

EXTERN sixteen_bits outp_line[NUM_LANGUAGES]
#ifdef _FTANGLE_h
	#if(part == 0 || part == 1)
		= {1,1,1,1,1,1,1,1}
	#endif /* |part == 1| */
#endif /* |_FTANGLE_h| */
;
