[BACK]Return to cond_int.h CVS log [TXT][DIR] Up to [local] / src / usr.bin / make

File: [local] / src / usr.bin / make / cond_int.h (download)

Revision 1.3, Tue Jun 11 21:12:11 2002 UTC (21 years, 11 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4, OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.2: +3 -1 lines

This is the first step in sanitizing the conditional parser.

Change the conditional recognition algorithm:
scan for a sequence of alphabetic characters, hash it, and compare it against
a small table (using ohash functions).
This makes Cond_Eval entry more logical, and allows for some shortcuts in
recognizing .include, .for, .undef.

This also means that conditionals must have an intervening blank between
the keyword and the actual test, e.g.,
.ifA
will no longer work.

(but no-one actually uses this, and it's highly obfuscated)

Okay miod@.

/* $OpenPackages$ */
/* $OpenBSD: cond_int.h,v 1.3 2002/06/11 21:12:11 espie Exp $ */

/* List of all keywords recognized by the make parser */
#define COND_IF		"if"
#define COND_IFDEF	"ifdef"
#define COND_IFNDEF	"ifndef"
#define COND_IFMAKE	"ifmake"
#define COND_IFNMAKE	"ifnmake"
#define COND_ELSE	"else"
#define COND_ELIF	"elif"
#define COND_ELIFDEF	"elifdef"
#define COND_ELIFNDEF	"elifndef"
#define COND_ELIFMAKE	"elifmake"
#define COND_ELIFNMAKE	"elifnmake"
#define COND_ENDIF	"endif"
#define COND_FOR	"for"
#define COND_ENDFOR	"endfor"
#define COND_INCLUDE	"include"
#define COND_UNDEF	"undef"