1987-03-25 23:14:43 +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".
|
|
|
|
*/
|
1986-03-10 13:07:55 +00:00
|
|
|
/* $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.
|
|
|
|
*/
|
|
|
|
#define NOFLAG 0 /* no special flags */
|
|
|
|
#define FUNC 01 /* function attached */
|
1986-12-04 16:29:44 +00:00
|
|
|
#define NOREPLACE 02 /* don't replace */
|
1986-03-10 13:07:55 +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 */
|
1986-12-04 16:29:44 +00:00
|
|
|
int mc_nps; /* number of formal parameters */
|
1986-03-10 13:07:55 +00:00
|
|
|
int mc_length; /* length of replacement text */
|
1986-12-04 16:29:44 +00:00
|
|
|
int mc_count; /* # of "concurrent" invocations*/
|
1986-03-10 13:07:55 +00:00
|
|
|
char mc_flag; /* marking this macro */
|
|
|
|
};
|
|
|
|
|
1987-01-24 00:25:56 +00:00
|
|
|
/* ALLOCDEF "macro" 20 */
|
1986-03-10 13:07:55 +00:00
|
|
|
|
1987-02-09 23:19:42 +00:00
|
|
|
struct mlist {
|
|
|
|
struct mlist *next;
|
|
|
|
struct macro *m_mac;
|
|
|
|
char *m_repl;
|
1989-07-14 09:51:02 +00:00
|
|
|
int m_level;
|
1987-02-09 23:19:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* ALLOCDEF "mlist" 20 */
|
|
|
|
|
1986-03-10 13:07:55 +00:00
|
|
|
/* `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_IF 5
|
|
|
|
#define K_IFDEF 6
|
|
|
|
#define K_IFNDEF 7
|
|
|
|
#define K_INCLUDE 8
|
|
|
|
#define K_LINE 9
|
|
|
|
#define K_UNDEF 10
|
1989-03-31 11:47:12 +00:00
|
|
|
#define K_PRAGMA 11
|
1990-06-06 14:42:53 +00:00
|
|
|
#define K_FILE 100 /* for dependency generator */
|
1991-12-17 14:11:15 +00:00
|
|
|
#endif /* NOPP */
|