1 /**************************************************************************
3 orte-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: orte-idl-driver.c,v 1.2 2005/03/11 16:46:22 smolik Exp $
23 ***************************************************************************/
27 #include "orte-idl2.h"
28 #include "orte-idl-c-backend.h"
33 orte_idl_tree_fake_ops (IDL_tree tree, IDL_ns ns)
40 switch(IDL_NODE_TYPE(tree)) {
42 orte_idl_tree_fake_ops (IDL_MODULE (tree).definition_list, ns);
45 orte_idl_tree_fake_ops (IDL_INTERFACE (tree).body, ns);
48 for (node = tree; node; node = IDL_LIST (node).next)
49 orte_idl_tree_fake_ops (IDL_LIST (node).data, ns);
52 orte_idl_attr_fake_ops (tree, ns);
60 orte_idl_to_backend (const char *filename,
68 errcode = IDL_parse_filename (
69 filename, rinfo->cpp_args, NULL,
71 (rinfo->show_cpp_errors ? IDLF_SHOW_CPP_ERRORS : 0) |
72 (rinfo->is_pidl ? IDLF_XPIDL : 0) |
73 (rinfo->onlytop ? IDLF_INHIBIT_INCLUDES : 0) |
77 rinfo->idl_warn_level);
81 if (rinfo->debug_level > 3)
82 orte_idl_print_node (tree, 0);
84 if (errcode != IDL_SUCCESS) {
86 g_warning ("Parse of %s failed: %s", filename, g_strerror (errno));
91 orte_idl_tree_fake_ops (tree, ns);
93 if (!strcmp (rinfo->output_language, "c"))
94 retval = orte_idl_output_c (tree, rinfo);
96 retval = orte_idl_backend_output (rinfo, tree);