1 /* lex.h 2 * Tim Martin 3 * 9/21/99 4 */ 5 /* 6 * Copyright (c) 1994-2008 Carnegie Mellon University. All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 11 * 12 * 1. Redistributions of source code must retain the above copyright 13 * notice, this list of conditions and the following disclaimer. 14 * 15 * 2. Redistributions in binary form must reproduce the above copyright 16 * notice, this list of conditions and the following disclaimer in 17 * the documentation and/or other materials provided with the 18 * distribution. 19 * 20 * 3. The name "Carnegie Mellon University" must not be used to 21 * endorse or promote products derived from this software without 22 * prior written permission. For permission or any legal 23 * details, please contact 24 * Carnegie Mellon University 25 * Center for Technology Transfer and Enterprise Creation 26 * 4615 Forbes Avenue 27 * Suite 302 28 * Pittsburgh, PA 15213 29 * (412) 268-7393, fax: (412) 268-7395 30 * innovation@andrew.cmu.edu 31 * 32 * 4. Redistributions of any form whatsoever must retain the following 33 * acknowledgment: 34 * "This product includes software developed by Computing Services 35 * at Carnegie Mellon University (http://www.cmu.edu/computing/)." 36 * 37 * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO 38 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 39 * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE 40 * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 41 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 42 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 43 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 44 */ 45 46 #ifndef _LEX_H_ 47 #define _LEX_H_ 48 49 #include "util.h" 50 51 typedef struct lexstate_s { 52 char *str; 53 int number; 54 55 } lexstate_t; 56 57 int yylex(lexstate_t * lvalp, void * client); 58 59 enum { 60 TAG = 258, 61 EOL = 259, 62 STRING = 260, 63 NUMBER = 261, 64 65 TOKEN_OK = 280, 66 TOKEN_NO = 281, 67 TOKEN_BYE = 282, 68 69 TOKEN_ACTIVE = 291, 70 71 TOKEN_REFERRAL = 301, 72 TOKEN_SASL = 302, 73 RESP_CODE_QUOTA = 303, 74 RESP_CODE_QUOTA_MAXSCRIPTS = 304, 75 RESP_CODE_QUOTA_MAXSIZE = 305, 76 RESP_CODE_TRANSITION_NEEDED = 306, 77 RESP_CODE_TRYLATER = 307, 78 RESP_CODE_NONEXISTENT = 308, 79 RESP_CODE_ALREADYEXISTS = 309, 80 RESP_CODE_WARNINGS = 310, 81 RESP_CODE_TAG = 311 82 }; 83 84 enum { 85 LEXER_STATE_TAG = 60, 86 LEXER_STATE_RECOVER, 87 LEXER_STATE_RECOVER_CR, 88 LEXER_STATE_CR, 89 LEXER_STATE_QSTR, 90 LEXER_STATE_LITERAL, 91 LEXER_STATE_NUMBER, 92 LEXER_STATE_NORMAL, 93 LEXER_STATE_ATOM 94 }; 95 96 #endif /* _LEX_H_ */ 97