1 /*
2  * This file was generated by the mksyntax program.
3  */
4 
5 #include <ctype.h>
6 
7 #ifdef CEOF
8 #undef CEOF
9 #endif
10 
11 /* Syntax classes */
12 #define CWORD 0			/* character is nothing special */
13 #define CNL 1			/* newline character */
14 #define CBACK 2			/* a backslash character */
15 #define CSQUOTE 3		/* single quote */
16 #define CDQUOTE 4		/* double quote */
17 #define CENDQUOTE 5		/* a terminating quote */
18 #define CBQUOTE 6		/* backwards single quote */
19 #define CVAR 7			/* a dollar sign */
20 #define CENDVAR 8		/* a '}' character */
21 #define CLP 9			/* a left paren in arithmetic */
22 #define CRP 10			/* a right paren in arithmetic */
23 #define CEOF 11			/* end of file */
24 #define CCTL 12			/* like CWORD, except it must be escaped */
25 #define CSPCL 13		/* these terminate a word */
26 #define CIGN 14			/* character should be ignored */
27 
28 /* Syntax classes for is_ functions */
29 #define ISDIGIT 01		/* a digit */
30 #define ISUPPER 02		/* an upper case letter */
31 #define ISLOWER 04		/* a lower case letter */
32 #define ISUNDER 010		/* an underscore */
33 #define ISSPECL 020		/* the name of a special parameter */
34 
35 #define SYNBASE 130
36 #define PEOF -130
37 
38 #define PEOA -129
39 
40 
41 #define BASESYNTAX (basesyntax + SYNBASE)
42 #define DQSYNTAX (dqsyntax + SYNBASE)
43 #define SQSYNTAX (sqsyntax + SYNBASE)
44 #define ARISYNTAX (arisyntax + SYNBASE)
45 
46 #define is_digit(c)	((unsigned)((c) - '0') <= 9)
47 #define is_alpha(c)	isalpha((unsigned char)(c))
48 #define is_name(c)	((c) == '_' || isalpha((unsigned char)(c)))
49 #define is_in_name(c)	((c) == '_' || isalnum((unsigned char)(c)))
50 #define is_special(c)	((is_type+SYNBASE)[(signed char)(c)] & (ISSPECL|ISDIGIT))
51 #define digit_val(c)	((c) - '0')
52 
53 extern const char basesyntax[];
54 extern const char dqsyntax[];
55 extern const char sqsyntax[];
56 extern const char arisyntax[];
57 extern const char is_type[];
58