xref: /titanic_44/usr/src/tools/ndrgen/ndr_main.c (revision d0e518695adc90b82233b99af7dffbb3d3f92c00)
1*d0e51869Samw /*
2*d0e51869Samw  * CDDL HEADER START
3*d0e51869Samw  *
4*d0e51869Samw  * The contents of this file are subject to the terms of the
5*d0e51869Samw  * Common Development and Distribution License (the "License").
6*d0e51869Samw  * You may not use this file except in compliance with the License.
7*d0e51869Samw  *
8*d0e51869Samw  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*d0e51869Samw  * or http://www.opensolaris.org/os/licensing.
10*d0e51869Samw  * See the License for the specific language governing permissions
11*d0e51869Samw  * and limitations under the License.
12*d0e51869Samw  *
13*d0e51869Samw  * When distributing Covered Code, include this CDDL HEADER in each
14*d0e51869Samw  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*d0e51869Samw  * If applicable, add the following below this CDDL HEADER, with the
16*d0e51869Samw  * fields enclosed by brackets "[]" replaced with your own identifying
17*d0e51869Samw  * information: Portions Copyright [yyyy] [name of copyright owner]
18*d0e51869Samw  *
19*d0e51869Samw  * CDDL HEADER END
20*d0e51869Samw  */
21*d0e51869Samw 
22*d0e51869Samw /*
23*d0e51869Samw  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24*d0e51869Samw  * Use is subject to license terms.
25*d0e51869Samw  */
26*d0e51869Samw 
27*d0e51869Samw #pragma ident	"%Z%%M%	%I%	%E% SMI"
28*d0e51869Samw 
29*d0e51869Samw #include "ndrgen.h"
30*d0e51869Samw 
31*d0e51869Samw ndr_typeinfo_t	*typeinfo_list;
32*d0e51869Samw struct node	*construct_list;
33*d0e51869Samw 
34*d0e51869Samw int
main(void)35*d0e51869Samw main(void)
36*d0e51869Samw {
37*d0e51869Samw 	set_lex_input(stdin, "(stdin)");
38*d0e51869Samw 
39*d0e51869Samw 	if (yyparse() == 0) {
40*d0e51869Samw 		analyze();
41*d0e51869Samw 		generate();
42*d0e51869Samw 		if (n_compile_error) {
43*d0e51869Samw 			(void) printf("\n\n\n\n================\n\n\n\n");
44*d0e51869Samw 			tdata_dump();
45*d0e51869Samw 			show_typeinfo_list();
46*d0e51869Samw 		}
47*d0e51869Samw 	}
48*d0e51869Samw 
49*d0e51869Samw 	if (n_compile_error)
50*d0e51869Samw 		exit(1);
51*d0e51869Samw 
52*d0e51869Samw 	return (0);
53*d0e51869Samw }
54*d0e51869Samw 
55*d0e51869Samw int
yyerror(char * msg)56*d0e51869Samw yyerror(char *msg)
57*d0e51869Samw {
58*d0e51869Samw 	compile_error("%s", msg);
59*d0e51869Samw 	return (0);
60*d0e51869Samw }
61