1# -*- python -*-
2#                           Package   : omniidl
3# forward.py                Created on: 1999/12/1
4#			    Author    : David Scott (djs)
5#
6#    Copyright (C) 2003-2011 Apasphere Ltd
7#    Copyright (C) 1999 AT&T Laboratories Cambridge
8#
9#  This file is part of omniidl.
10#
11#  omniidl is free software; you can redistribute it and/or modify it
12#  under the terms of the GNU General Public License as published by
13#  the Free Software Foundation; either version 2 of the License, or
14#  (at your option) any later version.
15#
16#  This program is distributed in the hope that it will be useful,
17#  but WITHOUT ANY WARRANTY; without even the implied warranty of
18#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19#  General Public License for more details.
20#
21#  You should have received a copy of the GNU General Public License
22#  along with this program.  If not, see http://www.gnu.org/licenses/
23#
24# Description:
25#
26#   Produce ancillary forward declarations for the header file
27
28"""Produce ancillary forward declarations for the header file"""
29
30from omniidl_be.cxx import id, ast
31
32import sys
33self = sys.modules[__name__]
34
35def init(_):
36    return self
37
38
39# Control arrives here
40#
41def visitAST(node):
42    for n in node.declarations():
43        if ast.shouldGenerateCodeForDecl(n):
44            n.accept(self)
45
46def visitModule(node):
47    # again check what happens here wrt reopening modules spanning
48    # multiple files
49    for n in node.definitions():
50        n.accept(self)
51
52
53def visitStruct(node):
54    for n in node.members():
55        n.accept(self)
56
57def visitStructForward(node):
58    pass
59
60def visitUnion(node):
61    for n in node.cases():
62        if n.constrType():
63            n.caseType().decl().accept(self)
64
65def visitUnionForward(node):
66    pass
67
68def visitInterface(node):
69    for n in node.declarations():
70        n.accept(self)
71
72
73
74def visitException(node):
75    for n in node.members():
76        n.accept(self)
77
78def visitMember(node):
79    if node.constrType():
80        node.memberType().decl().accept(self)
81
82def visitEnum(node):
83    pass
84
85
86def visitTypedef(node):
87    if node.constrType():
88        node.aliasType().decl().accept(self)
89
90
91def visitForward(node):
92    pass
93def visitConst(node):
94    pass
95def visitDeclarator(node):
96    pass
97
98def visitValueForward(node):
99    pass
100def visitValue(node):
101    pass
102def visitValueAbs(node):
103    pass
104def visitValueBox(node):
105    pass
106