1 /** \file 2 * Copyright (c) 1999 Carlo Wood. All rights reserved. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program. If not, see <http://www.gnu.org/licenses/>. 16 */ 17 18 #ifndef INDENT_LEXI_H 19 #define INDENT_LEXI_H 20 21 #include "sys.h" /* for RCSTAG_H */ 22 23 RCSTAG_H (lexi, "$Id$"); 24 25 typedef enum rwcodes 26 { 27 rw_none, 28 rw_operator, /*!< For C++ operator overloading. */ 29 rw_break, 30 rw_switch, 31 rw_case, 32 rw_struct_like, /*!< struct, union */ 33 rw_enum, 34 rw_decl, 35 rw_sp_paren, /*!< if, while, for */ 36 rw_sp_nparen, /*!< do */ 37 rw_sp_else, /*!< else */ 38 rw_sizeof, 39 rw_return 40 } rwcodes_ty; 41 42 typedef enum codes 43 { 44 code_eof = 0, /*!< end of file */ 45 newline, 46 lparen, /*!< '(' or '['. Also '{' in an 47 initialization. */ 48 rparen, /*!< ')' or ']'. Also '}' in an 49 initialization. */ 50 start_token, 51 unary_op, 52 binary_op, 53 postop, 54 55 question, 56 casestmt, 57 colon, 58 doublecolon, /*!< For C++ class methods. */ 59 semicolon, 60 lbrace, 61 rbrace, 62 63 ident, /*!< string or char literal, 64 identifier, number */ 65 66 overloaded, /*!< For C++ overloaded operators (like +) */ 67 cpp_operator, 68 69 comma, 70 comment, /*!< A "slash-star" comment */ 71 cplus_comment, /*!< A C++ "slash-slash" */ 72 swstmt, 73 preesc, /*!< '#'. */ 74 75 form_feed, 76 decl, 77 78 sp_paren, /*!< if, for, or while token */ 79 sp_nparen, /*!< do */ 80 sp_else, /*!< else */ 81 ifstmt, 82 elseifstmt, 83 whilestmt, 84 85 forstmt, 86 stmt, 87 stmtl, 88 elselit, 89 dolit, 90 dohead, 91 dostmt, 92 ifhead, 93 94 elsehead, 95 struct_delim, /*!< '.' or "->" */ 96 97 attribute, /*!< The '__attribute__' qualifier */ 98 number_of_codes 99 } codes_ty; 100 101 extern void addkey( 102 char *key, 103 rwcodes_ty val); 104 105 extern codes_ty lexi(void); 106 extern void cleanup_user_specials(void); 107 108 #endif /* INDENT_LEXI_H */ 109