1989-02-07 11:04:05 +00:00
|
|
|
/*
|
|
|
|
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
|
|
|
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
|
|
|
*/
|
|
|
|
/* $Header$ */
|
|
|
|
/* PREPROCESSOR: DEFINITION OF MACRO DESCRIPTOR */
|
|
|
|
|
|
|
|
#include "nopp.h"
|
|
|
|
|
|
|
|
#ifndef NOPP
|
|
|
|
/* The flags of the mc_flag field of the macro structure. Note that
|
|
|
|
these flags can be set simultaneously.
|
|
|
|
*/
|
1989-09-29 16:20:38 +00:00
|
|
|
#define NOFLAG 0 /* no special flags */
|
1989-09-19 16:13:23 +00:00
|
|
|
#define FUNC 0x1 /* function attached */
|
1989-09-29 16:20:38 +00:00
|
|
|
#define NOUNDEF 0x2 /* reserved macro */
|
|
|
|
#define NOREPLACE 0x4 /* prevent recursion */
|
1989-02-07 11:04:05 +00:00
|
|
|
|
|
|
|
#define FORMALP 0200 /* mask for creating macro formal parameter */
|
|
|
|
|
|
|
|
/* The macro descriptor is very simple, except the fact that the
|
|
|
|
mc_text, which points to the replacement text, contains the
|
|
|
|
non-ascii characters \201, \202, etc, indicating the position of a
|
|
|
|
formal parameter in this text.
|
|
|
|
*/
|
|
|
|
struct macro {
|
|
|
|
struct macro *next;
|
|
|
|
char * mc_text; /* the replacement text */
|
|
|
|
int mc_nps; /* number of formal parameters */
|
|
|
|
int mc_length; /* length of replacement text */
|
|
|
|
char mc_flag; /* marking this macro */
|
|
|
|
};
|
|
|
|
|
|
|
|
/* ALLOCDEF "macro" 20 */
|
|
|
|
|
|
|
|
/* `token' numbers of keywords of command-line processor
|
|
|
|
*/
|
|
|
|
#define K_UNKNOWN 0
|
|
|
|
#define K_DEFINE 1
|
|
|
|
#define K_ELIF 2
|
|
|
|
#define K_ELSE 3
|
|
|
|
#define K_ENDIF 4
|
|
|
|
#define K_ERROR 5
|
|
|
|
#define K_IF 6
|
|
|
|
#define K_IFDEF 7
|
|
|
|
#define K_IFNDEF 8
|
|
|
|
#define K_INCLUDE 9
|
|
|
|
#define K_LINE 10
|
|
|
|
#define K_PRAGMA 11
|
|
|
|
#define K_UNDEF 12
|
1990-06-08 10:03:47 +00:00
|
|
|
#define K_FILE 100 /* for dependency generator */
|
1991-12-17 13:12:22 +00:00
|
|
|
#endif /* NOPP */
|