/* Objective Modula-2 Compiler (objm2c) * * @file objm2_build_params.h * * User definable build parameters for the compiler * * Author: Benjamin Kowarsch * * Copyright (C) 2009 The Objective Modula-2 Project. All rights reserved. * * License: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met * * 1) This file, or any part thereof, may NOT be hosted on websites which * contain advertising, unless specific prior written permission has been * obtained. The licensor will grant such permission upon request at its * sole discretion to websites the licensor does NOT consider abusive in * their use of advertising. Small notices in the footer of a website * naming corporate rights holders, infrastructure providers or sponsors * are not considered advertising in the context of this license. * * 2) Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 3) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and other materials provided with the distribution. * * 4) Neither the author's name nor the names of any contributors may be used * to endorse or promote products derived from this software without * specific prior written permission. * * 5) Where this list of conditions or the following disclaimer, in part or * as a whole is overruled or nullified by applicable law, no permission * is granted to use the software. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * Version history: * * 2.00 2009-03-27 BK new file * 2009-07-30 BK changed default values * 2009-08-19 BK removed pathname length * */ #ifndef OBJM2_BUILD_PARAMS_H #define OBJM2_BUILD_PARAMS_H #include "common_types.h" // =========================================================================== // P U B L I C S E C T I O N - U S E R D E F I N A B L E V A L U E S // =========================================================================== // --------------------------------------------------------------------------- // User definable parameters // --------------------------------------------------------------------------- // build version #define BUILD_VERSION "(0000)" // maximum length allowed for identifiers #define OBJM2_MAX_IDENT_LENGTH 32 // maximum length allowed for number literals #define OBJM2_MAX_NUM_LENGTH 32 // maximum length allowed for string literals #define OBJM2_MAX_STRING_LENGTH 1024 // maximum length allowed for tokenised comments #define OBJM2_MAX_COMMENT_LENGTH 2048 // maximum nesting level for nested comments #define OBJM2_MAX_NESTED_COMMENTS 10 // =========================================================================== // P R I V A T E S E C T I O N - D O N O T M O D I F Y ! ! ! // =========================================================================== // --------------------------------------------------------------------------- // Parameter integrity checks // --------------------------------------------------------------------------- #if (OBJM2_MAX_IDENT_LENGTH <= 1) #error "illegal value for OBJM2_MAX_IDENT_LENGTH" #elif (OBJM2_MAX_IDENT_LENGTH < 8) #warning "unreasonably low value for OBJM2_MAX_IDENT_LENGTH" #elif (OBJM2_MAX_IDENT_LENGTH > 80) #warning "unreasonably high value for OBJM2_MAX_IDENT_LENGTH" #endif #if (OBJM2_MAX_NUM_LENGTH <= 1) #error "illegal value for OBJM2_MAX_NUM_LENGTH" #elif (OBJM2_MAX_NUM_LENGTH < 8) #warning "unreasonably low value for OBJM2_MAX_NUM_LENGTH" #elif (OBJM2_MAX_NUM_LENGTH > 80) #warning "unreasonably high value for OBJM2_MAX_NUM_LENGTH" #endif #if (OBJM2_MAX_STRING_LENGTH <= 3) #error "illegal value for OBJM2_MAX_STRING_LENGTH" #elif (OBJM2_MAX_STRING_LENGTH < 80) #warning "unreasonably low value for OBJM2_MAX_STRING_LENGTH" #elif (OBJM2_MAX_STRING_LENGTH > 4096) #warning "unreasonably high value for OBJM2_MAX_STRING_LENGTH" #endif #if (OBJM2_MAX_COMMENT_LENGTH <= 5) #error "illegal value for OBJM2_MAX_COMMENT_LENGTH" #elif (OBJM2_MAX_COMMENT_LENGTH < 80) #warning "unreasonably high value for OBJM2_MAX_COMMENT_LENGTH" #elif (OBJM2_MAX_COMMENT_LENGTH > 4096) #warning "unreasonably high value for OBJM2_MAX_COMMENT_LENGTH" #endif #if (OBJM2_MAX_NESTED_COMMENTS <= 1) #error "illegal value for OBJM2_MAX_NESTED_COMMENTS" #elif (OBJM2_MAX_NESTED_COMMENTS < 3) #warning "unreasonably low value for OBJM2_MAX_NESTED_COMMENTS" #elif (OBJM2_MAX_NESTED_COMMENTS > 32) #warning "unreasonably high value for OBJM2_MAX_NESTED_COMMENTS" #endif // --------------------------------------------------------------------------- // Index type for identifier lexeme iteration // --------------------------------------------------------------------------- #if (OBJM2_MAX_IDENT_LENGTH >= 0xffff) #error "illegal value for OBJM2_MAX_IDENT_LENGTH" #elif (OBJM2_MAX_IDENT_LENGTH >= 0xff) typedef uint16_t ident_index_t; #else typedef uint8_t ident_index_t; #endif // --------------------------------------------------------------------------- // Index type for numeric literal iteration // --------------------------------------------------------------------------- #if (OBJM2_MAX_NUM_LENGTH >= 0xffff) #error "illegal value for OBJM2_MAX_NUM_LENGTH" #elif (OBJM2_MAX_NUM_LENGTH >= 0xff) typedef uint16_t num_index_t; #else typedef uint8_t num_index_t; #endif // --------------------------------------------------------------------------- // Index type for string literal iteration // --------------------------------------------------------------------------- #if (OBJM2_MAX_STRING_LENGTH >= 0xffff) #error "illegal value for OBJM2_MAX_STRING_LENGTH" #elif (OBJM2_MAX_STRING_LENGTH >= 0xff) typedef uint16_t string_index_t; #else typedef uint8_t string_index_t; #endif // --------------------------------------------------------------------------- // Index type for comment iteration // --------------------------------------------------------------------------- #if (OBJM2_MAX_COMMENT_LENGTH >= 0xffff) #error "illegal value for OBJM2_MAX_COMMENT_LENGTH" #elif (OBJM2_MAX_COMMENT_LENGTH >= 0xff) typedef uint16_t comment_index_t; #else typedef uint8_t comment_index_t; #endif #endif /* OBJM2_BUILD_PARAMS_H */ // END OF FILE