1185377Ssam/*-
2187831Ssam * Copyright (c) 1988, 1989, 1990, 1993
3185377Ssam *	The Regents of the University of California.  All rights reserved.
4185377Ssam * Copyright (c) 1989 by Berkeley Softworks
5185377Ssam * All rights reserved.
6185377Ssam *
7185377Ssam * This code is derived from software contributed to Berkeley by
8185377Ssam * Adam de Boor.
9185377Ssam *
10185377Ssam * Redistribution and use in source and binary forms, with or without
11185377Ssam * modification, are permitted provided that the following conditions
12185377Ssam * are met:
13185377Ssam * 1. Redistributions of source code must retain the above copyright
14185377Ssam *    notice, this list of conditions and the following disclaimer.
15185377Ssam * 2. Redistributions in binary form must reproduce the above copyright
16185377Ssam *    notice, this list of conditions and the following disclaimer in the
17185907Ssam *    documentation and/or other materials provided with the distribution.
18185377Ssam * 3. All advertising materials mentioning features or use of this software
19185377Ssam *    must display the following acknowledgement:
20185377Ssam *	This product includes software developed by the University of
21185377Ssam *	California, Berkeley and its contributors.
22185377Ssam * 4. Neither the name of the University nor the names of its contributors
23185377Ssam *    may be used to endorse or promote products derived from this software
24185377Ssam *    without specific prior written permission.
25185377Ssam *
26185377Ssam * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27185377Ssam * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28185377Ssam * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29185377Ssam * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30185377Ssam * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31185377Ssam * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32185377Ssam * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33185377Ssam * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34185377Ssam * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35185377Ssam * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36185377Ssam * SUCH DAMAGE.
37185377Ssam *
38185377Ssam * $FreeBSD: releng/10.3/usr.bin/make/parse.h 146177 2005-05-13 08:53:00Z harti $
39185377Ssam */
40185377Ssam
41185377Ssam#ifndef parse_h_470eeb9a
42185377Ssam#define	parse_h_470eeb9a
43185377Ssam
44185377Ssam#include <stdio.h>
45185377Ssam
46185377Ssam#include "util.h"
47185377Ssam
48185377Ssamstruct GNode;
49185377Ssamstruct Lst;
50185377Ssam
51185377Ssam/*
52185377Ssam * Error levels for parsing. PARSE_FATAL means the process cannot continue
53185377Ssam * once the makefile has been parsed. PARSE_WARNING means it can. Passed
54185377Ssam * as the first argument to Parse_Error.
55185377Ssam */
56185377Ssam#define	PARSE_WARNING	2
57185377Ssam#define	PARSE_FATAL	1
58185377Ssam
59185377Ssam/*
60185377Ssam * Definitions for the "local" variables. Used only for clarity.
61185377Ssam */
62185377Ssam#define	TARGET		"@"	/* Target of dependency */
63185377Ssam#define	OODATE		"?"	/* All out-of-date sources */
64185377Ssam#define	ALLSRC		">"	/* All sources */
65185377Ssam#define	IMPSRC		"<"	/* Source implied by transformation */
66185377Ssam#define	PREFIX		"*"	/* Common prefix */
67185377Ssam#define	ARCHIVE		"!"	/* Archive in "archive(member)" syntax */
68185377Ssam#define	MEMBER		"%"	/* Member in "archive(member)" syntax */
69185377Ssam
70185377Ssam#define	FTARGET		"@F"	/* file part of TARGET */
71185377Ssam#define	DTARGET		"@D"	/* directory part of TARGET */
72185377Ssam#define	FIMPSRC		"<F"	/* file part of IMPSRC */
73185377Ssam#define	DIMPSRC		"<D"	/* directory part of IMPSRC */
74185377Ssam#define	FPREFIX		"*F"	/* file part of PREFIX */
75185377Ssam#define	DPREFIX		"*D"	/* directory part of PREFIX */
76185380Ssam
77185380Ssamvoid Parse_Error(int, const char *, ...);
78185380SsamBoolean Parse_AnyExport(void);
79185380SsamBoolean Parse_IsVar(char *);
80185380Ssamvoid Parse_DoVar(char *, struct GNode *);
81185380Ssamvoid Parse_AddIncludeDir(char *);
82185380Ssamvoid Parse_File(const char *, FILE *);
83185380Ssamvoid Parse_FromString(char *, int);
84185380Ssamvoid Parse_MainName(struct Lst *);
85185380Ssam
86185380Ssam#endif /* parse_h_470eeb9a */
87185380Ssam