1 /**************************************************************************
3 forb-idl-driver.c (Dispatch parsed tree to various backends)
5 Copyright (C) 1999 Elliot Lee
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 $Id: forb-idl-driver.c 1302 2002-09-04 10:38:18Z mmclouglin $
23 ***************************************************************************/
27 #include "forb-idl2.h"
28 #include "forb-idl-backend.h"
29 #include "forb-idl-c-backend.h"
34 forb_idl_tree_fake_ops (IDL_tree tree, IDL_ns ns)
41 switch(IDL_NODE_TYPE(tree)) {
43 forb_idl_tree_fake_ops (IDL_MODULE (tree).definition_list, ns);
46 forb_idl_tree_fake_ops (IDL_INTERFACE (tree).body, ns);
49 for (node = tree; node; node = IDL_LIST (node).next)
50 forb_idl_tree_fake_ops (IDL_LIST (node).data, ns);
53 forb_idl_attr_fake_ops (tree, ns);
61 forb_idl_to_backend (const char *filename,
69 errcode = IDL_parse_filename (
70 filename, rinfo->cpp_args, NULL,
72 (rinfo->show_cpp_errors ? IDLF_SHOW_CPP_ERRORS : 0) |
73 (rinfo->is_pidl ? IDLF_XPIDL : 0) |
74 (rinfo->onlytop ? IDLF_INHIBIT_INCLUDES : 0) |
78 rinfo->idl_warn_level);
82 if (rinfo->debug_level > 3)
83 forb_idl_print_node (tree, 0);
85 if (errcode != IDL_SUCCESS) {
87 g_warning ("Parse of %s failed: %s", filename, g_strerror (errno));
92 forb_idl_tree_fake_ops (tree, ns);
94 if (!strcmp (rinfo->output_language, "c"))
95 retval = forb_idl_output_c (tree, rinfo);
97 // retval = forb_idl_backend_output (rinfo, tree);