2 /********************************************
4 copyright 1991, Michael D. Brennan
6 This is a source file for mawk, an implementation of
7 the AWK programming language.
9 Mawk is distributed without warranty under the terms of
10 the GNU General Public License, version 2, 1991.
11 ********************************************/
15 * Revision 1.3 1995/06/18 19:42:26 mike
16 * Remove some redundant declarations and add some prototypes
18 * Revision 1.2 1994/09/23 00:20:06 mike
19 * minor bug fix: handle \ in eat_nl()
21 * Revision 1.1.1.1 1993/07/03 18:58:20 mike
24 * Revision 5.1 1991/12/05 07:59:33 brennan
32 #ifndef SCAN_H_INCLUDED
33 #define SCAN_H_INCLUDED 1
43 extern char scan_code[256] ;
45 /* the scan codes to compactify the main switch */
49 #define SC_SEMI_COLON 3
50 #define SC_FAKE_SEMI_COLON 4
80 #define SC_UNEXPECTED 34
84 void PROTO(eat_nl, (void) ) ;
87 void PROTO( unexpected_char, (void) ) ;
89 #define ct_ret(x) return current_token = (x)
91 #define next() (*buffp ? *buffp++ : slow_next())
92 #define un_next() buffp--
94 #define test1_ret(c,x,d) if ( next() == (c) ) ct_ret(x) ;\
95 else { un_next() ; ct_ret(d) ; }
97 #define test2_ret(c1,x1,c2,x2,d) switch( next() )\
98 { case c1: ct_ret(x1) ;\
99 case c2: ct_ret(x2) ;\
100 default: un_next() ;\
102 #endif /* ! MAKESCAN */