Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
[fw/altos] / src / scheme / ao_scheme_read.h
1 /*
2  * Copyright © 2016 Keith Packard <keithp@keithp.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * General Public License for more details.
13  */
14
15 #ifndef _AO_SCHEME_READ_H_
16 #define _AO_SCHEME_READ_H_
17
18 /*
19  * token classes
20  */
21
22 # define END                    0
23 # define NAME                   1
24 # define OPEN                   2
25 # define CLOSE                  3
26 # define QUOTE                  4
27 # define QUASIQUOTE             5
28 # define UNQUOTE                6
29 # define UNQUOTE_SPLICING       7
30 # define STRING                 8
31 # define NUM                    9
32 # define FLOAT                  10
33 # define DOT                    11
34 # define BOOL                   12
35
36 /*
37  * character classes
38  */
39
40 # define PRINTABLE      0x0001  /* \t \n ' ' - ~ */
41 # define SPECIAL        0x0002  /* ( [ { ) ] } ' ` , */
42 # define DOTC           0x0004  /* . */
43 # define WHITE          0x0008  /* ' ' \t \n */
44 # define DIGIT          0x0010  /* [0-9] */
45 # define SIGN           0x0020  /* +- */
46 # define FLOATC         0x0040  /* . e E */
47 # define ENDOFFILE      0x0080  /* end of file */
48 # define COMMENT        0x0100  /* ; */
49 # define IGNORE         0x0200  /* \0 - ' ' */
50 # define BACKSLASH      0x0400  /* \ */
51 # define STRINGC        0x0800  /* " */
52 # define POUND          0x1000  /* # */
53
54 # define NOTNAME        (STRINGC|COMMENT|ENDOFFILE|WHITE|SPECIAL)
55 # define INTEGER        (DIGIT|SIGN)
56 # define NUMBER         (INTEGER|FLOATC)
57
58 #endif /* _AO_SCHEME_READ_H_ */