"Fossies" - the Fresh Open Source Software Archive 
Member "teapot-2.3.0/scanner.h" (6 Feb 2012, 743 Bytes) of package /linux/privat/old/teapot-2.3.0.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
For more information about "scanner.h" see the
Fossies "Dox" file reference documentation.
1 #ifndef SCANNER_H
2 #define SCANNER_H
3
4 #include <sys/types.h>
5
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9
10 typedef enum {
11 EMPTY
12 #ifndef __cplusplus
13 , STRING, FLOAT, INT, OPERATOR, LIDENT, FIDENT, LOCATION, EEK
14 #endif
15 } Type;
16
17 typedef enum { PLUS, MINUS, MUL, DIV, OP, CP, COMMA, LT, LE, GE, GT, ISEQUAL, ABOUTEQ, NE, POW, MOD } Operator;
18
19 typedef struct
20 {
21 Type type;
22 union
23 {
24 char *string;
25 double flt;
26 long integer;
27 Operator op;
28 char *lident;
29 int fident;
30 int location[3];
31 char *err;
32 } u;
33 } Token;
34
35 int identcode(const char *s, size_t len);
36 Token **scan(const char **s);
37 void print(char *s, size_t size, size_t chars, int quote, int scientific, int precision, Token **n);
38
39 #ifdef __cplusplus
40 }
41 #endif
42
43 #endif