xref: /titanic_51/usr/src/cmd/rpcgen/rpc_scan.h (revision 61961e0f20c7637a3846bb39786bb9dffa91dfb9)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
57c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate  * with the License.
87c478bd9Sstevel@tonic-gate  *
97c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate  * and limitations under the License.
137c478bd9Sstevel@tonic-gate  *
147c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*61961e0fSrobinson  */
22*61961e0fSrobinson 
23*61961e0fSrobinson /*
24*61961e0fSrobinson  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
257c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
267c478bd9Sstevel@tonic-gate  */
277c478bd9Sstevel@tonic-gate /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
287c478bd9Sstevel@tonic-gate /* All Rights Reserved */
297c478bd9Sstevel@tonic-gate /*
307c478bd9Sstevel@tonic-gate  * University Copyright- Copyright (c) 1982, 1986, 1988
317c478bd9Sstevel@tonic-gate  * The Regents of the University of California
327c478bd9Sstevel@tonic-gate  * All Rights Reserved
337c478bd9Sstevel@tonic-gate  *
347c478bd9Sstevel@tonic-gate  * University Acknowledgment- Portions of this document are derived from
357c478bd9Sstevel@tonic-gate  * software developed by the University of California, Berkeley, and its
367c478bd9Sstevel@tonic-gate  * contributors.
377c478bd9Sstevel@tonic-gate  */
387c478bd9Sstevel@tonic-gate 
39*61961e0fSrobinson #ifndef _RPC_SCAN_H
40*61961e0fSrobinson #define	_RPC_SCAN_H
41*61961e0fSrobinson 
427c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
437c478bd9Sstevel@tonic-gate 
447c478bd9Sstevel@tonic-gate /*
457c478bd9Sstevel@tonic-gate  * rpc_scan.h, Definitions for the RPCL scanner
467c478bd9Sstevel@tonic-gate  */
477c478bd9Sstevel@tonic-gate 
48*61961e0fSrobinson #ifdef __cplusplus
49*61961e0fSrobinson extern "C" {
50*61961e0fSrobinson #endif
51*61961e0fSrobinson 
527c478bd9Sstevel@tonic-gate /*
537c478bd9Sstevel@tonic-gate  * kinds of tokens
547c478bd9Sstevel@tonic-gate  */
557c478bd9Sstevel@tonic-gate enum tok_kind {
567c478bd9Sstevel@tonic-gate 	TOK_IDENT,
577c478bd9Sstevel@tonic-gate 	TOK_CHARCONST,
587c478bd9Sstevel@tonic-gate 	TOK_STRCONST,
597c478bd9Sstevel@tonic-gate 	TOK_LPAREN,
607c478bd9Sstevel@tonic-gate 	TOK_RPAREN,
617c478bd9Sstevel@tonic-gate 	TOK_LBRACE,
627c478bd9Sstevel@tonic-gate 	TOK_RBRACE,
637c478bd9Sstevel@tonic-gate 	TOK_LBRACKET,
647c478bd9Sstevel@tonic-gate 	TOK_RBRACKET,
657c478bd9Sstevel@tonic-gate 	TOK_LANGLE,
667c478bd9Sstevel@tonic-gate 	TOK_RANGLE,
677c478bd9Sstevel@tonic-gate 	TOK_STAR,
687c478bd9Sstevel@tonic-gate 	TOK_COMMA,
697c478bd9Sstevel@tonic-gate 	TOK_EQUAL,
707c478bd9Sstevel@tonic-gate 	TOK_COLON,
717c478bd9Sstevel@tonic-gate 	TOK_SEMICOLON,
727c478bd9Sstevel@tonic-gate 	TOK_CONST,
737c478bd9Sstevel@tonic-gate 	TOK_STRUCT,
747c478bd9Sstevel@tonic-gate 	TOK_UNION,
757c478bd9Sstevel@tonic-gate 	TOK_SWITCH,
767c478bd9Sstevel@tonic-gate 	TOK_CASE,
777c478bd9Sstevel@tonic-gate 	TOK_DEFAULT,
787c478bd9Sstevel@tonic-gate 	TOK_ENUM,
797c478bd9Sstevel@tonic-gate 	TOK_TYPEDEF,
807c478bd9Sstevel@tonic-gate 	TOK_INT,
817c478bd9Sstevel@tonic-gate 	TOK_SHORT,
827c478bd9Sstevel@tonic-gate 	TOK_LONG,
837c478bd9Sstevel@tonic-gate 	TOK_HYPER,
847c478bd9Sstevel@tonic-gate 	TOK_UNSIGNED,
857c478bd9Sstevel@tonic-gate 	TOK_FLOAT,
867c478bd9Sstevel@tonic-gate 	TOK_DOUBLE,
877c478bd9Sstevel@tonic-gate 	TOK_QUAD,
887c478bd9Sstevel@tonic-gate 	TOK_OPAQUE,
897c478bd9Sstevel@tonic-gate 	TOK_CHAR,
907c478bd9Sstevel@tonic-gate 	TOK_STRING,
917c478bd9Sstevel@tonic-gate 	TOK_BOOL,
927c478bd9Sstevel@tonic-gate 	TOK_VOID,
937c478bd9Sstevel@tonic-gate 	TOK_ONEWAY,
947c478bd9Sstevel@tonic-gate 	TOK_PROGRAM,
957c478bd9Sstevel@tonic-gate 	TOK_VERSION,
967c478bd9Sstevel@tonic-gate 	TOK_EOF
977c478bd9Sstevel@tonic-gate };
987c478bd9Sstevel@tonic-gate typedef enum tok_kind tok_kind;
997c478bd9Sstevel@tonic-gate 
1007c478bd9Sstevel@tonic-gate /*
1017c478bd9Sstevel@tonic-gate  * a token
1027c478bd9Sstevel@tonic-gate  */
1037c478bd9Sstevel@tonic-gate struct token {
1047c478bd9Sstevel@tonic-gate 	tok_kind kind;
1057c478bd9Sstevel@tonic-gate 	char *str;
1067c478bd9Sstevel@tonic-gate };
1077c478bd9Sstevel@tonic-gate typedef struct token token;
1087c478bd9Sstevel@tonic-gate 
1097c478bd9Sstevel@tonic-gate /*
1107c478bd9Sstevel@tonic-gate  * routine interface
1117c478bd9Sstevel@tonic-gate  */
112*61961e0fSrobinson extern void scan(tok_kind, token *);
113*61961e0fSrobinson extern void scan2(tok_kind, tok_kind, token *);
114*61961e0fSrobinson extern void scan3(tok_kind, tok_kind, tok_kind, token *);
115*61961e0fSrobinson extern void scan_num(token *);
116*61961e0fSrobinson extern void peek(token *);
117*61961e0fSrobinson extern int peekscan(tok_kind, token *);
118*61961e0fSrobinson extern void get_token(token *);
119*61961e0fSrobinson 
120*61961e0fSrobinson #ifdef __cplusplus
121*61961e0fSrobinson }
122*61961e0fSrobinson #endif
123*61961e0fSrobinson 
124*61961e0fSrobinson #endif /* _RPC_SCAN_H */
125