2 * Copyright 1993-2002 Christopher Seiwald and Perforce Software, Inc.
3 * This file is part of Jam - see jam.c for Copyright information.
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, version 3 of the License ONLY.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 * compile.h - compile parsed jam statements
20 #ifndef JAMH_COMPILE_H
21 #define JAMH_COMPILE_H
23 extern void compile_builtins (void);
25 extern LIST
*compile_append (PARSE
*parse
, LOL
*args
, int *jmp
);
26 extern LIST
*compile_break (PARSE
*parse
, LOL
*args
, int *jmp
);
27 extern LIST
*compile_foreach (PARSE
*parse
, LOL
*args
, int *jmp
);
28 extern LIST
*compile_if (PARSE
*parse
, LOL
*args
, int *jmp
);
29 extern LIST
*compile_eval (PARSE
*parse
, LOL
*args
, int *jmp
);
30 extern LIST
*compile_include (PARSE
*parse
, LOL
*args
, int *jmp
);
31 extern LIST
*compile_list (PARSE
*parse
, LOL
*args
, int *jmp
);
32 extern LIST
*compile_local (PARSE
*parse
, LOL
*args
, int *jmp
);
33 extern LIST
*compile_null (PARSE
*parse
, LOL
*args
, int *jmp
) JAMFA_CONST
;
34 extern LIST
*compile_on (PARSE
*parse
, LOL
*args
, int *jmp
);
35 extern LIST
*compile_rule (PARSE
*parse
, LOL
*args
, int *jmp
);
36 extern LIST
*compile_rules (PARSE
*parse
, LOL
*args
, int *jmp
);
37 extern LIST
*compile_set (PARSE
*parse
, LOL
*args
, int *jmp
);
38 extern LIST
*compile_setcomp (PARSE
*parse
, LOL
*args
, int *jmp
);
39 extern LIST
*compile_setexec (PARSE
*parse
, LOL
*args
, int *jmp
);
40 extern LIST
*compile_settings (PARSE
*parse
, LOL
*args
, int *jmp
);
41 extern LIST
*compile_switch (PARSE
*parse
, LOL
*args
, int *jmp
);
42 extern LIST
*compile_while (PARSE
*parse
, LOL
*args
, int *jmp
);
44 extern LIST
*evaluate_rule (const char *rulename
, LOL
*args
, LIST
*result
);
47 /* conditions for compile_if() */
49 EXPR_NOT
, /* ! cond */
50 EXPR_AND
, /* cond && cond */
51 EXPR_OR
, /* cond || cond */
53 EXPR_EXISTS
, /* arg */
54 EXPR_EQUALS
, /* arg = arg */
55 EXPR_NOTEQ
, /* arg != arg */
56 EXPR_LESS
, /* arg < arg */
57 EXPR_LESSEQ
, /* arg <= arg */
58 EXPR_MORE
, /* arg > arg */
59 EXPR_MOREEQ
, /* arg >= arg */
60 EXPR_IN
, /* arg in arg */
61 EXPR_ANYIN
, /* arg any-in arg */
62 EXPR_REXPEQ
/* arg ~= regexp */
66 /* Flags for compile_break() */
68 JMP_NONE
, /* flow continues */
69 JMP_BREAK
, /* break out of loop */
70 JMP_CONTINUE
, /* step to end of loop */
71 JMP_RETURN
/* return from rule */