1 /* $NetBSD: syntax.c,v 1.1 2004/01/17 17:38:12 dsl Exp $ */
11 #error initialisation assumes 'CWORD' is zero
14 #define ndx(ch) (ch + 1 - CHAR_MIN)
15 #define set(ch, val) [ndx(ch)] = val,
16 #define set_range(s, e, val) [ndx(s) ... ndx(e)] = val,
18 /* syntax table used when not in quotes */
19 const char basesyntax
[257] = { CEOF
,
20 set_range(CTL_FIRST
, CTL_LAST
, CCTL
)
39 /* syntax table used when in double quotes */
40 const char dqsyntax
[257] = { CEOF
,
41 set_range(CTL_FIRST
, CTL_LAST
, CCTL
)
48 /* ':/' for tilde expansion, '-' for [a\-x] pattern ranges */
60 /* syntax table used when in single quotes */
61 const char sqsyntax
[257] = { CEOF
,
62 set_range(CTL_FIRST
, CTL_LAST
, CCTL
)
65 /* ':/' for tilde expansion, '-' for [a\-x] pattern ranges */
77 /* syntax table used when in arithmetic */
78 const char arisyntax
[257] = { CEOF
,
79 set_range(CTL_FIRST
, CTL_LAST
, CCTL
)
91 /* character classification table */
92 const char is_type
[257] = { 0,
93 set_range('0', '9', ISDIGIT
)
94 set_range('a', 'z', ISLOWER
)
95 set_range('A', 'Z', ISUPPER
)