| 1 | /* |
|---|
| 2 | * Copyright 1993, 2000 Christopher Seiwald. |
|---|
| 3 | * |
|---|
| 4 | * This file is part of Jam - see jam.c for Copyright information. |
|---|
| 5 | */ |
|---|
| 6 | |
|---|
| 7 | /* This file is ALSO: |
|---|
| 8 | * Copyright 2001-2004 David Abrahams. |
|---|
| 9 | * Distributed under the Boost Software License, Version 1.0. |
|---|
| 10 | * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) |
|---|
| 11 | */ |
|---|
| 12 | |
|---|
| 13 | #ifndef COMPILE_DWA20011022_H |
|---|
| 14 | # define COMPILE_DWA20011022_H |
|---|
| 15 | |
|---|
| 16 | # include "frames.h" |
|---|
| 17 | # include "parse.h" |
|---|
| 18 | # include "regexp.h" |
|---|
| 19 | |
|---|
| 20 | /* |
|---|
| 21 | * compile.h - compile parsed jam statements |
|---|
| 22 | */ |
|---|
| 23 | |
|---|
| 24 | void compile_builtins(); |
|---|
| 25 | |
|---|
| 26 | LIST *compile_append( PARSE *parse, FRAME *frame ); |
|---|
| 27 | LIST *compile_foreach( PARSE *parse, FRAME *frame ); |
|---|
| 28 | LIST *compile_if( PARSE *parse, FRAME *frame ); |
|---|
| 29 | LIST *compile_eval( PARSE *parse, FRAME *args ); |
|---|
| 30 | LIST *compile_include( PARSE *parse, FRAME *frame ); |
|---|
| 31 | LIST *compile_list( PARSE *parse, FRAME *frame ); |
|---|
| 32 | LIST *compile_local( PARSE *parse, FRAME *frame ); |
|---|
| 33 | LIST *compile_module( PARSE *parse, FRAME *frame ); |
|---|
| 34 | LIST *compile_class( PARSE *parse, FRAME *frame ); |
|---|
| 35 | LIST *compile_null( PARSE *parse, FRAME *frame ); |
|---|
| 36 | LIST *compile_on( PARSE *parse, FRAME *frame ); |
|---|
| 37 | LIST *compile_rule( PARSE *parse, FRAME *frame ); |
|---|
| 38 | LIST *compile_rules( PARSE *parse, FRAME *frame ); |
|---|
| 39 | LIST *compile_set( PARSE *parse, FRAME *frame ); |
|---|
| 40 | LIST *compile_setcomp( PARSE *parse, FRAME *frame ); |
|---|
| 41 | LIST *compile_setexec( PARSE *parse, FRAME *frame ); |
|---|
| 42 | LIST *compile_settings( PARSE *parse, FRAME *frame ); |
|---|
| 43 | LIST *compile_switch( PARSE *parse, FRAME *frame ); |
|---|
| 44 | LIST *compile_while( PARSE *parse, FRAME *frame ); |
|---|
| 45 | |
|---|
| 46 | LIST *evaluate_rule( char *rulename, FRAME *frame ); |
|---|
| 47 | LIST *call_rule( char *rulename, FRAME* caller_frame, ...); |
|---|
| 48 | |
|---|
| 49 | regexp* regex_compile( const char* pattern ); |
|---|
| 50 | |
|---|
| 51 | void profile_dump(); |
|---|
| 52 | |
|---|
| 53 | /* Flags for compile_set(), etc */ |
|---|
| 54 | |
|---|
| 55 | # define ASSIGN_SET 0x00 /* = assign variable */ |
|---|
| 56 | # define ASSIGN_APPEND 0x01 /* += append variable */ |
|---|
| 57 | # define ASSIGN_DEFAULT 0x02 /* set only if unset */ |
|---|
| 58 | |
|---|
| 59 | /* Flags for compile_setexec() */ |
|---|
| 60 | |
|---|
| 61 | # define EXEC_UPDATED 0x01 /* executes updated */ |
|---|
| 62 | # define EXEC_TOGETHER 0x02 /* executes together */ |
|---|
| 63 | # define EXEC_IGNORE 0x04 /* executes ignore */ |
|---|
| 64 | # define EXEC_QUIETLY 0x08 /* executes quietly */ |
|---|
| 65 | # define EXEC_PIECEMEAL 0x10 /* executes piecemeal */ |
|---|
| 66 | # define EXEC_EXISTING 0x20 /* executes existing */ |
|---|
| 67 | |
|---|
| 68 | /* Conditions for compile_if() */ |
|---|
| 69 | |
|---|
| 70 | # define EXPR_NOT 0 /* ! cond */ |
|---|
| 71 | # define EXPR_AND 1 /* cond && cond */ |
|---|
| 72 | # define EXPR_OR 2 /* cond || cond */ |
|---|
| 73 | |
|---|
| 74 | # define EXPR_EXISTS 3 /* arg */ |
|---|
| 75 | # define EXPR_EQUALS 4 /* arg = arg */ |
|---|
| 76 | # define EXPR_NOTEQ 5 /* arg != arg */ |
|---|
| 77 | # define EXPR_LESS 6 /* arg < arg */ |
|---|
| 78 | # define EXPR_LESSEQ 7 /* arg <= arg */ |
|---|
| 79 | # define EXPR_MORE 8 /* arg > arg */ |
|---|
| 80 | # define EXPR_MOREEQ 9 /* arg >= arg */ |
|---|
| 81 | # define EXPR_IN 10 /* arg in arg */ |
|---|
| 82 | |
|---|
| 83 | #endif |
|---|
| 84 | |
|---|