]> git.buserror.net Git - polintos/scott/priv.git/blob - idlcomp/lang.h
Add first draft of marshalling spec
[polintos/scott/priv.git] / idlcomp / lang.h
1 // Definitions used with language bindings
2
3 #ifndef IDLC_LANG_H
4 #define IDLC_LANG_H
5
6 #include <idlc.h>
7
8 // A subclass of this interface is passed to Symbol::output_lang(),
9 // which calls the appropriate type-specific method here.  If the
10 // sym is a Datum, Method, or Param, no callback is made; the language
11 // binding is expected to handle it when iterating over the containing
12 // type's element list.
13
14 class LangCallback {
15 public:
16         virtual ~LangCallback()
17         {
18         }
19
20         virtual void output(UserNameSpace *sym, int arg1, void *arg2) = 0;
21         virtual void output(Struct *sym, int arg1, void *arg2) = 0;
22         virtual void output(Interface *sym, int arg1, void *arg2) = 0;
23         virtual void output(BitField *sym, int arg1, void *arg2) = 0;
24         virtual void output(Enum *sym, int arg1, void *arg2) = 0;
25         virtual void output(BasicType *sym, int arg1, void *arg2) = 0;
26         virtual void output(Alias *sym, int arg1, void *arg2) = 0;
27         virtual void output(TypeDef *sym, int arg1, void *arg2) = 0;
28         virtual void output(Datum *sym, int arg1, void *arg2) = 0; // const only
29 };
30
31 class Language {
32 public:
33         const char *name;
34         Language *next;
35
36         virtual ~Language()
37         {
38         }
39         
40         virtual void output_root(UserNameSpace *ns, const char *dir) = 0;
41         virtual void output_server(UserNameSpace *ns, const char *dir) = 0;
42 };
43
44 extern Language *first_lang;
45
46 #endif