Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / TAO_IDL / fe / fe_extern.cpp
blob440d81cdc3c6ae70b983e445421b092dc003bc3d
1 // This may look like C, but it's really -*- C++ -*-
2 /*
4 COPYRIGHT
6 Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United
7 States of America. All Rights Reserved.
9 This product is protected by copyright and distributed under the following
10 license restricting its use.
12 The Interface Definition Language Compiler Front End (CFE) is made
13 available for your use provided that you include this license and copyright
14 notice on all media and documentation and the software program in which
15 this product is incorporated in whole or part. You may copy and extend
16 functionality (but may not remove functionality) of the Interface
17 Definition Language CFE without charge, but you are not authorized to
18 license or distribute it to anyone else except as part of a product or
19 program developed by you or with the express written consent of Sun
20 Microsystems, Inc. ("Sun").
22 The names of Sun Microsystems, Inc. and any of its subsidiaries or
23 affiliates may not be used in advertising or publicity pertaining to
24 distribution of Interface Definition Language CFE as permitted herein.
26 This license is effective until terminated by Sun for failure to comply
27 with this license. Upon termination, you shall destroy or return all code
28 and documentation for the Interface Definition Language CFE.
30 INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF
31 ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS
32 FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF
33 DEALING, USAGE OR TRADE PRACTICE.
35 INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT
36 ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES
37 TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT.
39 SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH
40 RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY
41 INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF.
43 IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR
44 ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL
45 DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
47 Use, duplication, or disclosure by the government is subject to
48 restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
49 Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR
50 52.227-19.
52 Sun, Sun Microsystems and the Sun logo are trademarks or registered
53 trademarks of Sun Microsystems, Inc.
55 SunSoft, Inc.
56 2550 Garcia Avenue
57 Mountain View, California 94043
59 NOTE:
61 SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are
62 trademarks or registered trademarks of Sun Microsystems, Inc.
67 * fe_extern.cc - export FE interfaces to driver
70 #include "fe_extern.h"
72 #include "global_extern.h"
73 #include "utl_err.h"
74 #include "utl_indenter.h"
76 #include "ast_root.h"
78 #include "ace/UUID.h"
80 extern int tao_yyparse (void);
82 #ifdef USE_MCPP_BUFFER_LEXING
83 char *tao_preproc_buffer = 0;
84 int tao_preproc_buffer_length = 0;
85 int tao_preproc_buffer_pos = 0;
86 #else
87 extern FILE *tao_yyin;
88 #endif /* USE_MCPP_BUFFER_LEXING */
90 int
91 FE_yyparse (void)
93 int const result = tao_yyparse ();
95 #ifdef USE_MCPP_BUFFER_LEXING
96 ACE_OS::free (tao_preproc_buffer);
97 tao_preproc_buffer_length = 0;
98 tao_preproc_buffer_pos = 0;
99 #else
100 if (tao_yyin)
102 ACE_OS::fclose (tao_yyin);
104 #endif /* USE_MCPP_BUFFER_LEXING */
106 return result;
109 extern int tao_yydebug;
110 void FE_yydebug (bool value)
112 tao_yydebug = value;
115 #ifdef USE_MCPP_BUFFER_LEXING
116 void
117 FE_set_yyin (char * f)
119 tao_preproc_buffer = f;
120 tao_preproc_buffer_length = ACE_OS::strlen (f);
122 #else
123 void
124 FE_set_yyin (FILE * f)
126 tao_yyin = f;
128 #endif /* USE_MCPP_BUFFER_LEXING */
130 // Constructor interfaces.
132 UTL_Error *
133 FE_new_UTL_Error (void)
135 UTL_Error *retval = 0;
136 ACE_NEW_RETURN (retval,
137 UTL_Error,
140 return retval;
143 UTL_Indenter *
144 FE_new_UTL_Indenter (void)
146 UTL_Indenter *retval = 0;
147 ACE_NEW_RETURN (retval,
148 UTL_Indenter,
151 return retval;