block: don't put spaces around :
[ironout.git] / ast.h
blob6bf10dfdedde02dba0f754c4a861bd1114989759
1 #ifndef _AST_H
2 #define _AST_H
4 enum nodetype {
5 AST_ADECL,
6 AST_ADIRDECL,
7 AST_ARGLIST,
8 AST_ASSIGN,
9 AST_ATYPE,
10 AST_AUTOKW,
11 AST_BINARY,
12 AST_BLOCK,
13 AST_BLOCKLIST,
14 AST_BODY,
15 AST_BREAK,
16 AST_C99INIT,
17 AST_CALL,
18 AST_CASED,
19 AST_CAST,
20 AST_CONDITIONAL,
21 AST_CONTINUE,
22 AST_DECL,
23 AST_DIRDECL,
24 AST_DECLLIST,
25 AST_DECLSPEC,
26 AST_DECLSTMT,
27 AST_DEFAULTED,
28 AST_DEREF,
29 AST_DESIGLIST,
30 AST_DESIGNATION,
31 AST_DESIGNATOR,
32 AST_DO,
33 AST_ENUM,
34 AST_ENUMLIST,
35 AST_ENUMVAL,
36 AST_EXPRLIST,
37 AST_EXTERNKW,
38 AST_FILE,
39 AST_FOR,
40 AST_FUNCSPEC,
41 AST_FUNCTION,
42 AST_GETATTR,
43 AST_GETINDEX,
44 AST_GOTO,
45 AST_IDENTIFIER,
46 AST_IDLIST,
47 AST_IF,
48 AST_INIT,
49 AST_INITIALIZER,
50 AST_INITIALIZERLIST,
51 AST_INITLIST,
52 AST_INTEGER,
53 AST_LABELED,
54 AST_MACRO,
55 AST_PARAMDECL,
56 AST_PARAMLIST,
57 AST_PTR,
58 AST_REGISTERKW,
59 AST_RETURN,
60 AST_SIZEOF,
61 AST_STATICKW,
62 AST_STMT,
63 AST_STRING,
64 AST_STRUCT,
65 AST_STRUCTBITS,
66 AST_STRUCTDECL,
67 AST_STRUCTDECLLIST,
68 AST_STRUCTKW,
69 AST_STRUCTLIST,
70 AST_STRUCTQUALLIST,
71 AST_STRUCTSTMT,
72 AST_SWITCH,
73 AST_TYPE,
74 AST_TYPEDEFKW,
75 AST_TYPENAME,
76 AST_TYPEQUAL,
77 AST_TYPEQUALLIST,
78 AST_UNARY,
79 AST_UNARYOP,
80 AST_UNIONKW,
81 AST_WHILE
84 enum decltype {
85 DECL_ID,
86 DECL_INPARENS,
87 DECL_PARENS,
88 DECL_PARENS_TYPE,
89 DECL_PARENS_ID,
90 DECL_BRACS,
91 DECL_BRACS_TYPE,
92 DECL_BRACS_ASSIGN,
93 DECL_BRACS_BOTH,
94 DECL_BRACS_STATIC_ASSIGN,
95 DECL_BRACS_STATIC_BOTH,
96 DECL_BRACS_BOTH_STATIC,
97 DECL_BRACS_STAR,
98 DECL_BRACS_TYPE_STAR
101 struct node {
102 enum nodetype type;
103 long start, end;
104 struct node **children;
105 struct node *parent;
106 int count;
107 void *data;
110 struct node *parse(char *filename);
111 void node_free(struct node *node);
112 struct node *node_find(struct node *node, long offset);
113 void node_walk(struct node *, int (*) (struct node *, void *), void *);
114 int node_cmp(struct node *n1, struct node *n2);
115 struct node *declarator_name(struct node *node);
117 #endif