(file) Return to ifparser.h CVS log (file) (dir) Up to [XFree86 CVS] / xc / config / makedepend

File: [XFree86 CVS] / xc / config / makedepend / ifparser.h (download)
Revision: 3.3, Mon Oct 5 12:21:48 1998 UTC (14 years, 8 months ago) by dawes
Branch: MAIN
CVS Tags: xf-4_0g, xf-4_0f, xf-4_0e, xf-4_0d, xf-4_0c, xf-4_0b, xf-4_0a, xf-4_0_3b, xf-4_0_3a, xf-4_0_3, xf-4_0_2c, xf-4_0_2b, xf-4_0_2a, xf-4_0_2-branch, xf-4_0_2-bindist, xf-4_0_2, xf-4_0_1h, xf-4_0_1g, xf-4_0_1f, xf-4_0_1e, xf-4_0_1d, xf-4_0_1c, xf-4_0_1b, xf-4_0_1a, xf-4_0_1Zc, xf-4_0_1Zb, xf-4_0_1Za, xf-4_0_1Z, xf-4_0_1-bindist, xf-4_0_1, xf-4_0Z, xf-4_0-bindist, xf-4_0, xf-3_9_18b, xf-3_9_18a, xf-3_9_18Za, xf-3_9_18Z, xf-3_9_18, xf-3_9_17f, xf-3_9_17e, xf-3_9_17d, xf-3_9_17c, xf-3_9_17b, xf-3_9_17a, xf-3_9_17Z, xf-3_9_17, xf-3_9_16f, xf-3_9_16e, xf-3_9_16d, xf-3_9_16c, xf-3_9_16b, xf-3_9_16a, xf-3_9_16Za, xf-3_9_16Z, xf-3_9_16, xf-3_9_15d, xf-3_9_15c, xf-3_9_15b, xf-3_9_15a, xf-3_9_15, xf-3_9Py, xf-3_9Px, xf-3_9Pw, xf-3_9Pv, xf-3_9Pu, xf-3_9Pt, xf-3_9Ps, xf-3_9Pr, xf-3_9Pq, xf-3_9Pp, xf-3_9Po, xf-3_9Pn, xf-3_9Pm, xf-3_9Pl, xf-3_9Pk, xf-3_9Pj, xf-3_9Pi, xf-3_9Phb, xf-3_9Pha, xf-3_9Ph-branch, xf-3_9Ph, xf-3_9Pg, xf-3_9Pf, xf-3_9Pe, xf-3_9Pd, xf-3_9Pc, xf-3_9Pb, xf-3_9Pa, xf-3_9P, xf-3_9Nz, xf-3_9Ny, xf-3_9Nx, xf-3_9Nw, xf-3_9Nva, xf-3_9Nv-branch, xf-3_9Nv, xf-3_9Nu, xf-3_9Nt, xf-3_9Ns, xf-3_9Nr, xf-3_9Nq, xf-3_9Np, xf-3_9No, xf-3_9Nn, xf-3_9Nm, xf-3_9Nl, xf-3_9Nk, xf-3_9Nj, xf-3_9Ni, pre-R651-import
Changes since 3.2: +8 -6 lines
patches for 3.9Ni

/*
 * $XConsortium: ifparser.h /main/4 1996/09/28 16:15:24 rws $
 *
 * Copyright 1992 Network Computing Devices, Inc.
 * 
 * Permission to use, copy, modify, and distribute this software and its
 * documentation for any purpose and without fee is hereby granted, provided
 * that the above copyright notice appear in all copies and that both that
 * copyright notice and this permission notice appear in supporting
 * documentation, and that the name of Network Computing Devices may not be
 * used in advertising or publicity pertaining to distribution of the software
 * without specific, written prior permission.  Network Computing Devices makes
 * no representations about the suitability of this software for any purpose.
 * It is provided ``as is'' without express or implied warranty.
 * 
 * NETWORK COMPUTING DEVICES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
 * IN NO EVENT SHALL NETWORK COMPUTING DEVICES BE LIABLE FOR ANY SPECIAL,
 * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 * 
 * Author:  Jim Fulton
 *          Network Computing Devices, Inc.
 * 
 * Simple if statement processor
 *
 * This module can be used to evaluate string representations of C language
 * if constructs.  It accepts the following grammar:
 * 
 *     EXPRESSION	:=	VALUE
 * 			 |	VALUE  BINOP	EXPRESSION
 *			 |	VALUE	'?'	EXPRESSION ':'	EXPRESSION
 * 
 *     VALUE		:=	'('  EXPRESSION  ')'
 * 			 |	'!'  VALUE
 * 			 |	'-'  VALUE
 *			 |	'~'  VALUE
 * 			 |	'defined'  '('  variable  ')'
 * 			 |	variable
 * 			 |	number
 * 
 *     BINOP		:=	'*'	|  '/'	|  '%'
 * 			 |	'+'	|  '-'
 * 			 |	'<<'	|  '>>'
 * 			 |	'<'	|  '>'	|  '<='  |  '>='
 * 			 |	'=='	|  '!='
 * 			 |	'&'	|  '^'  |  '|'
 * 			 |	'&&'	|  '||'
 * 
 * The normal C order of precedence is supported.
 * 
 * 
 * External Entry Points:
 * 
 *     ParseIfExpression		parse a string for #if
 */

/* $XFree86: xc/config/makedepend/ifparser.h,v 3.2 1996/12/30 13:57:56 dawes Exp $ */

#include <stdio.h>

#ifndef __STDC__
#define const /**/
#endif
typedef int Bool;
#define False 0
#define True 1

typedef struct _if_parser {
    struct {				/* functions */
	const char *(*handle_error) (struct _if_parser *, const char *,
				     const char *);
	long (*eval_variable) (struct _if_parser *, const char *, int);
	int (*eval_defined) (struct _if_parser *, const char *, int);
    } funcs;
    char *data;
} IfParser;

const char *ParseIfExpression (
#ifdef __STDC__
    IfParser *, 
    const char *, 
    long *
#endif
);


Powered by
ViewCVS 0.9.2