1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22 23 /* 24 * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 25 * Use is subject to license terms. 26 */ 27 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */ 28 /* All Rights Reserved */ 29 /* 30 * University Copyright- Copyright (c) 1982, 1986, 1988 31 * The Regents of the University of California 32 * All Rights Reserved 33 * 34 * University Acknowledgment- Portions of this document are derived from 35 * software developed by the University of California, Berkeley, and its 36 * contributors. 37 */ 38 39 #ifndef _RPC_SCAN_H 40 #define _RPC_SCAN_H 41 42 #pragma ident "%Z%%M% %I% %E% SMI" 43 44 /* 45 * rpc_scan.h, Definitions for the RPCL scanner 46 */ 47 48 #ifdef __cplusplus 49 extern "C" { 50 #endif 51 52 /* 53 * kinds of tokens 54 */ 55 enum tok_kind { 56 TOK_IDENT, 57 TOK_CHARCONST, 58 TOK_STRCONST, 59 TOK_LPAREN, 60 TOK_RPAREN, 61 TOK_LBRACE, 62 TOK_RBRACE, 63 TOK_LBRACKET, 64 TOK_RBRACKET, 65 TOK_LANGLE, 66 TOK_RANGLE, 67 TOK_STAR, 68 TOK_COMMA, 69 TOK_EQUAL, 70 TOK_COLON, 71 TOK_SEMICOLON, 72 TOK_CONST, 73 TOK_STRUCT, 74 TOK_UNION, 75 TOK_SWITCH, 76 TOK_CASE, 77 TOK_DEFAULT, 78 TOK_ENUM, 79 TOK_TYPEDEF, 80 TOK_INT, 81 TOK_SHORT, 82 TOK_LONG, 83 TOK_HYPER, 84 TOK_UNSIGNED, 85 TOK_FLOAT, 86 TOK_DOUBLE, 87 TOK_QUAD, 88 TOK_OPAQUE, 89 TOK_CHAR, 90 TOK_STRING, 91 TOK_BOOL, 92 TOK_VOID, 93 TOK_ONEWAY, 94 TOK_PROGRAM, 95 TOK_VERSION, 96 TOK_EOF 97 }; 98 typedef enum tok_kind tok_kind; 99 100 /* 101 * a token 102 */ 103 struct token { 104 tok_kind kind; 105 char *str; 106 }; 107 typedef struct token token; 108 109 /* 110 * routine interface 111 */ 112 extern void scan(tok_kind, token *); 113 extern void scan2(tok_kind, tok_kind, token *); 114 extern void scan3(tok_kind, tok_kind, tok_kind, token *); 115 extern void scan_num(token *); 116 extern void peek(token *); 117 extern int peekscan(tok_kind, token *); 118 extern void get_token(token *); 119 120 #ifdef __cplusplus 121 } 122 #endif 123 124 #endif /* _RPC_SCAN_H */ 125