fixed pkg-config rule
[k8jam.git] / src / compile.h
blob942e6ab27aa52a7882952a82e7fe4773e9a8889c
1 /*
2 * Copyright 1993-2002 Christopher Seiwald and Perforce Software, Inc.
4 * This file is part of Jam - see jam.c for Copyright information.
5 */
6 /*
7 * compile.h - compile parsed jam statements
9 * 01/22/01 (seiwald) - replace evaluate_if() with compile_eval()
10 * 01/24/01 (seiwald) - 'while' statement
11 * 03/02/02 (seiwald) - rules can be invoked via variable names
12 * 02/28/02 (seiwald) - merge EXEC_xxx flags in with RULE_xxx
13 * 10/22/02 (seiwald) - working return/break/continue statements
14 * 11/04/02 (seiwald) - const-ing for string literals
16 #ifndef JAMH_COMPILE_H
17 #define JAMH_COMPILE_H
19 extern void compile_builtins (void);
21 extern LIST *compile_append (PARSE *parse, LOL *args, int *jmp);
22 extern LIST *compile_break (PARSE *parse, LOL *args, int *jmp);
23 extern LIST *compile_foreach (PARSE *parse, LOL *args, int *jmp);
24 extern LIST *compile_if (PARSE *parse, LOL *args, int *jmp);
25 extern LIST *compile_eval (PARSE *parse, LOL *args, int *jmp);
26 extern LIST *compile_include (PARSE *parse, LOL *args, int *jmp);
27 extern LIST *compile_softinclude (PARSE *parse, LOL *args, int *jmp);
28 extern LIST *compile_list (PARSE *parse, LOL *args, int *jmp);
29 extern LIST *compile_local (PARSE *parse, LOL *args, int *jmp);
30 extern LIST *compile_null (PARSE *parse, LOL *args, int *jmp) JAMFA_CONST;
31 extern LIST *compile_on (PARSE *parse, LOL *args, int *jmp);
32 extern LIST *compile_rule (PARSE *parse, LOL *args, int *jmp);
33 extern LIST *compile_rules (PARSE *parse, LOL *args, int *jmp);
34 extern LIST *compile_set (PARSE *parse, LOL *args, int *jmp);
35 extern LIST *compile_setcomp (PARSE *parse, LOL *args, int *jmp);
36 extern LIST *compile_setexec (PARSE *parse, LOL *args, int *jmp);
37 extern LIST *compile_settings (PARSE *parse, LOL *args, int *jmp);
38 extern LIST *compile_switch (PARSE *parse, LOL *args, int *jmp);
39 extern LIST *compile_while (PARSE *parse, LOL *args, int *jmp);
41 extern LIST *evaluate_rule (const char *rulename, LOL *args, LIST *result);
44 /* conditions for compile_if() */
45 enum {
46 EXPR_NOT, /* ! cond */
47 EXPR_AND, /* cond && cond */
48 EXPR_OR, /* cond || cond */
50 EXPR_EXISTS, /* arg */
51 EXPR_EQUALS, /* arg = arg */
52 EXPR_NOTEQ, /* arg != arg */
53 EXPR_LESS, /* arg < arg */
54 EXPR_LESSEQ, /* arg <= arg */
55 EXPR_MORE, /* arg > arg */
56 EXPR_MOREEQ, /* arg >= arg */
57 EXPR_IN /* arg in arg */
61 /* Flags for compile_break() */
62 enum {
63 JMP_NONE, /* flow continues */
64 JMP_BREAK, /* break out of loop */
65 JMP_CONTINUE, /* step to end of loop */
66 JMP_RETURN /* return from rule */
70 #endif