Add qemu 2.4.0
[kvmfornfv.git] / qemu / roms / SLOF / slof / fs / preprocessor.fs
1 \ *****************************************************************************
2 \ * Copyright (c) 2004, 2008 IBM Corporation
3 \ * All rights reserved.
4 \ * This program and the accompanying materials
5 \ * are made available under the terms of the BSD License
6 \ * which accompanies this distribution, and is available at
7 \ * http://www.opensource.org/licenses/bsd-license.php
8 \ *
9 \ * Contributors:
10 \ *     IBM Corporation - initial implementation
11 \ ****************************************************************************/
12
13 : ([IF])
14   BEGIN
15     BEGIN parse-word dup 0= WHILE
16       2drop refill
17     REPEAT
18
19     2dup s" [IF]" str= IF 1 throw THEN
20     2dup s" [ELSE]" str= IF 2 throw THEN
21     2dup s" [THEN]" str= IF 3 throw THEN
22     s" \" str= IF linefeed parse 2drop THEN
23   AGAIN
24   ;
25
26 : [IF] ( flag -- )
27   IF exit THEN
28   1 BEGIN
29     ['] ([IF]) catch 
30     CASE
31       1 OF 1+ ENDOF
32       2 OF dup 1 = if 1- then ENDOF
33       3 OF 1- ENDOF
34     ENDCASE
35     dup 0 <=
36   UNTIL drop
37 ; immediate
38
39 : [ELSE] 0 [COMPILE] [IF] ; immediate
40 : [THEN] ; immediate
41