00001 /* -*- coding:utf-8 -*- 00002 Copyright (c) 2009, Fixstars Corporation 00003 All rights reserved. 00004 00005 Redistribution and use in source and binary forms, with or without modification, 00006 are permitted provided that the following conditions are met: 00007 00008 * Redistributions of source code must retain the above copyright notice, 00009 this list of conditions and the following disclaimer. 00010 00011 * Redistributions in binary form must reproduce the above copyright notice, 00012 this list of conditions and the following disclaimer in the documentation 00013 and/or other materials provided with the distribution. 00014 00015 * Neither the name of Fixstars Corporation nor the names of its contributors 00016 may be used to endorse or promote products derived from this software 00017 without specific prior written permission. 00018 00019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 00020 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00021 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 00022 IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 00023 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00024 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00025 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 00026 AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00027 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 00028 THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00029 */ 00030 00036 #ifndef CTRUMP_PPRINT_FORMAT_H 00037 #define CTRUMP_PPRINT_FORMAT_H 00038 00042 struct ctrump_pprint_format { 00043 // must be >= 1 00044 int indentation_size; 00045 int num_blank_lines_after_func; 00046 00047 // 0 or 1 00048 int indentation_before_left_brace; //< indentation before "{" 00049 00050 // ex. void func(int x, int y) {...} 00051 int newline_after_declspec; //< newline between "void" and "func()" 00052 int newline_after_decl_params; //< newline between "int x," and "int y" 00053 int newline_after_declarator; //< newline between "func(...)" and "{" 00054 00055 // http://jalopy.sourceforge.net/existing/manual.html 00056 // 4.3.1.1.2. Wrapping 00057 int newline_before_left_brace; //< newline between "for (;;)" etc. and "{" 00058 int newline_after_right_brace; //< newline between "if () {...}" and "else" 00059 00060 // 4.3.2.1. Space before 00061 int space_before_statement_parens; //< space after for, if, while, do-while, switch 00062 int space_before_braces; //< space between "for (;;)" etc. and "{" 00063 // + space between "if (;;) {...}" and "else {}" 00064 // + space between "do {...}" and "while ()" 00065 int space_before_brackets; //< space before "[]" 00066 00067 // 4.3.2.2. Space after 00068 int space_after_comma; 00069 int space_after_semicolon; //< in "for(;;)" 00070 int space_after_type_cast; 00071 int space_after_negation; //< space after ! 00072 00073 // 4.3.2.3. Spaces around 00074 int spaces_around_assignment_op; //< =, +=, -=, *=, /=, %=, &=, |=, ^=, <<=, >>=, >>>= 00075 int spaces_around_logical_op; //< &&, || 00076 int spaces_around_relational_op; //< ==, !=, <, >, <=, >= 00077 // (+ conditional operator (? :) 00078 // space between string literals) 00079 int spaces_around_bitwise_op; //< &, |, ^ 00080 int spaces_around_math_op; //< +, -, *, /, % 00081 int spaces_around_shift_op; //< <<, >>, >>> 00082 00083 int padding_around_statement_parens; 00084 int padding_around_braces; 00085 int padding_around_brackets; 00086 int padding_around_type_cast; 00087 00088 // * "for (;;)" etc. 00089 // = for (;;), if (), while (), do, switch 00090 }; 00091 00092 #endif