xref: /illumos-gate/usr/src/tools/ndrgen/ndr_main.c (revision c4d175c6)
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 #include "ndrgen.h"
28*d0e51869Samw 
29*d0e51869Samw ndr_typeinfo_t	*typeinfo_list;
30*d0e51869Samw struct node	*construct_list;
31*d0e51869Samw 
32*d0e51869Samw int
main(void)33*d0e51869Samw main(void)
34*d0e51869Samw {
35*d0e51869Samw 	set_lex_input(stdin, "(stdin)");
36*d0e51869Samw 
37*d0e51869Samw 	if (yyparse() == 0) {
38*d0e51869Samw 		analyze();
39*d0e51869Samw 		generate();
40*d0e51869Samw 		if (n_compile_error) {
41*d0e51869Samw 			(void) printf("\n\n\n\n================\n\n\n\n");
42*d0e51869Samw 			tdata_dump();
43*d0e51869Samw 			show_typeinfo_list();
44*d0e51869Samw 		}
45*d0e51869Samw 	}
46*d0e51869Samw 
47*d0e51869Samw 	if (n_compile_error)
48*d0e51869Samw 		exit(1);
49*d0e51869Samw 
50*d0e51869Samw 	return (0);
51*d0e51869Samw }
52*d0e51869Samw 
53*d0e51869Samw int
yyerror(char * msg)54*d0e51869Samw yyerror(char *msg)
55*d0e51869Samw {
56*d0e51869Samw 	compile_error("%s", msg);
57*d0e51869Samw 	return (0);
58*d0e51869Samw }
59