parse_err.h
Go to the documentation of this file.
00001 /*   pomdp_err.h 
00002 
00003   *****
00004   Copyright 1994-1997, Brown University
00005   Copyright 1998, 1999, Anthony R. Cassandra
00006 
00007                            All Rights Reserved
00008                            
00009   Permission to use, copy, modify, and distribute this software and its
00010   documentation for any purpose other than its incorporation into a
00011   commercial product is hereby granted without fee, provided that the
00012   above copyright notice appear in all copies and that both that
00013   copyright notice and this permission notice appear in supporting
00014   documentation.
00015   
00016   ANTHONY CASSANDRA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
00017   INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ANY
00018   PARTICULAR PURPOSE.  IN NO EVENT SHALL ANTHONY CASSANDRA BE LIABLE FOR
00019   ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
00020   WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
00021   ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
00022   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
00023   *****
00024 
00025         This module contains all the constant and type definitions
00026 needed for the "pomdp_err.c" module. 
00027 */
00028 #ifndef PARSE_ERR_H
00029 
00030 #define PARSE_ERR_H
00031 
00032 /***********************************************************************/
00033 /****************************  CONSTANTS  ******************************/
00034 /***********************************************************************/
00035 
00036 #define DEBUG           1  /* set this constant to zero when not debugging */
00037 
00038 /* Special values */
00039 #define NO_LINE         -1      /* Value line number will take
00040                                 when a particular error message
00041                                 does not have an associated
00042                                 line number
00043                                 */
00044 
00045 #define ERR_META        '@'     /* Special character found in error messages
00046                                 that indicates an insertion point
00047                                 for another string.
00048                                 */
00049 
00050 /* Currently defined error messages */
00051 #define NBR_ERRORS      29
00052 
00053 #define ERROR_MSSG_0    "Illegal character @ in input."
00054 #define ERROR_MSSG_1    "Bad value for discount factor. Valid range is 0 to 1."
00055 #define ERROR_MSSG_2    "Bad number of states specified.  Must be > 0."
00056 #define ERROR_MSSG_3    "Bad number of actions specified.  Must be > 0."
00057 #define ERROR_MSSG_4    "Bad number of observations specified.  Must be > 0."
00058 #define ERROR_MSSG_5    "State number is out of range."
00059 #define ERROR_MSSG_6    "Action number is out of range."
00060 #define ERROR_MSSG_7    "Observation number is out of range."
00061 #define ERROR_MSSG_8    "No state with name @ found."
00062 #define ERROR_MSSG_9    "No action with name @ found."
00063 #define ERROR_MSSG_10   "No observation with name @ found."
00064 #define ERROR_MSSG_11   "Bad probability. Must be between 0 and 1."
00065 #define ERROR_MSSG_12   "Not enough matrix entries."
00066 #define ERROR_MSSG_13   "Unreckognized matrix context."
00067 #define ERROR_MSSG_14   "Duplicate name '@' in list."
00068 #define ERROR_MSSG_15   "Too many matrix entries."
00069 #define ERROR_MSSG_16   "Missing 'discount:' specification."
00070 #define ERROR_MSSG_17   "Missing 'values:' specification"
00071 #define ERROR_MSSG_18   "Missing 'states:' specification"
00072 #define ERROR_MSSG_19   "Missing 'actions:' specification"
00073 #define ERROR_MSSG_20   "Missing 'observations:' specification"
00074 #define ERROR_MSSG_21   "Bad probability sum for T: @."
00075 #define ERROR_MSSG_22   "Bad probability sum for O: @"
00076 #define ERROR_MSSG_23   "Syntax error."
00077 #define ERROR_MSSG_24   "Bad probability sum for start belief state"
00078 #define ERROR_MSSG_25   "The keyword 'reset' is not allowed in this context"
00079 #define ERROR_MSSG_26   "Observations not valid in MDP, or missing observations in POMDP"
00080 #define ERROR_MSSG_27   "This type of starting state specification is not valid for an MDP."
00081 #define ERROR_MSSG_28   "Not a valid reward syntax for this problem type."
00082 
00083 /* Corresponding values for each error type */
00084 #define ILL_CHAR_ERR                 0
00085 #define BAD_DISCOUNT_VAL             1
00086 #define BAD_NUM_STATES               2
00087 #define BAD_NUM_ACTIONS              3
00088 #define BAD_NUM_OBS                  4
00089 #define BAD_STATE_VAL                5
00090 #define BAD_ACTION_VAL               6
00091 #define BAD_OBS_VAL                  7
00092 #define BAD_STATE_STR                8
00093 #define BAD_ACTION_STR               9
00094 #define BAD_OBS_STR                 10
00095 #define BAD_PROB_VAL                11
00096 #define TOO_FEW_ENTRIES             12
00097 #define BAD_MATRIX_CONTEXT          13
00098 #define DUPLICATE_STRING            14
00099 #define TOO_MANY_ENTRIES            15
00100 #define MISSING_DISCOUNT            16
00101 #define MISSING_VALUES              17
00102 #define MISSING_STATES              18
00103 #define MISSING_ACTIONS             19
00104 #define MISSING_OBS                 20
00105 #define BAD_TRANS_PROB_SUM          21
00106 #define BAD_OBS_PROB_SUM            22
00107 #define PARSE_ERR                   23
00108 #define BAD_START_PROB_SUM          24
00109 #define BAD_RESET_USAGE             25
00110 #define OBS_IN_MDP_PROBLEM          26
00111 #define BAD_START_STATE_TYPE        27
00112 #define BAD_REWARD_SYNTAX           28
00113 
00114 /* Miscellaneous messages */
00115 #define OUT_OF_RANGE_MSSG "** ERROR ** ERR_enter: errorid of %d out of range\n"
00116 #define NO_ERRORS       "No Errors found.\n"
00117 #define NO_LINE_ERROR   "ERROR: "
00118 #define LINE_ERROR      "ERROR:   line %d: "
00119 #define NO_LINE_WARNING "WARNING:"
00120 #define LINE_WARNING    "WARNING: line %d: "
00121 
00122 /*************************************************************************/
00123 /******************************* TYPEDEFS  *******************************/
00124 /*************************************************************************/
00125 
00126 /*      The following structure definition is for the data structure that will
00127 hold the errors generated by the compiler.  This structure is needed so that
00128 a list of errors can be reported to the user while allowing as many errors
00129 as possible to be detected by the compiler before notifying user.
00130         The data structure will be a linked list of the nodes described
00131 below.
00132 */
00133 
00134 typedef struct enode
00135 {
00136         char *source;   /* what module and routine generated the error */
00137 
00138         int lineNumber; /* line number in source code of error */
00139 
00140         int errorNumber;        /* which error was it */
00141 
00142         char *modString;        /* additional information for output, to
00143                                 be inserted into error message where the
00144                                 ERR_META character is found  */
00145 
00146         struct enode *nextError;        /* pointer to next node */
00147 } Err_node;
00148 
00149 #ifdef __cplusplus
00150 extern "C" {
00151 #endif
00152 
00153 int ERR_dump(void);
00154 void ERR_enter( char    *source,
00155                         int     lineno,
00156                         int     errorid,
00157                         char    *modificationString );
00158 void ERR_initialize(void);
00159 void ERR_cleanUp(void);
00160 
00161 #ifdef __cplusplus
00162 }  /* extern "C" */
00163 #endif
00164 
00165 #endif
00166 /*************************************************************************/


appl
Author(s): petercai
autogenerated on Tue Jan 7 2014 11:02:29