Thu Feb 14 11:49:30 CET 2002 Paolo Molaro <lupus@ximian.com>
[mono.git] / mono / monoburg / monoburg.h
1 #ifndef __MONO_MONOBURG_H__
2 #define __MONO_MONOBURG_H__
3
4 #include <glib.h>
5
6 void yyerror (char *fmt, ...);
7 int  yylex   (void);
8
9 extern FILE *inputfd;
10 extern FILE *outputfd;
11
12 typedef struct _Rule Rule;
13
14 typedef struct _Term Term;
15 struct _Term{
16         char *name;
17         int number;
18         int arity;
19         GList *rules; /* rules that start with this terminal */
20 };
21
22 typedef struct _NonTerm NonTerm;
23
24 struct _NonTerm {
25         char *name;
26         int number;
27         GList *rules; /* rules with this nonterm on the left side */
28         GList *chain;
29         gboolean reached;
30 };
31
32 typedef struct _Tree Tree;
33
34 struct _Tree {
35         Term *op;
36         Tree *left;
37         Tree *right;
38         NonTerm *nonterm; /* used by chain rules */
39 };
40
41 struct _Rule {
42         NonTerm *lhs;
43         Tree *tree;
44         char *code;
45         char *cost;
46         char *cfunc;
47 };
48
49
50 Tree    *create_tree    (char *id, Tree *left, Tree *right);
51
52 void     create_term    (char *id, int num);
53
54 NonTerm *nonterm        (char *id);
55
56 void     start_nonterm  (char *id);
57
58 void     create_rule    (char *id, Tree *tree, char *code, char *cost, 
59                          char *cfunc);
60
61 void     yyparsetail    (void);
62
63 #endif