00001
00002 #ifndef __ERRORS_H
00003 #define __ERRORS_H
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 namespace Aseba
00014 {
00015 enum ErrorCode
00016 {
00017
00018 ERROR_BROKEN_TARGET = 0,
00019 ERROR_STACK_OVERFLOW,
00020 ERROR_SCRIPT_TOO_BIG,
00021
00022 ERROR_VARIABLE_NOT_DEFINED,
00023 ERROR_VARIABLE_NOT_DEFINED_GUESS,
00024 ERROR_FUNCTION_NOT_DEFINED,
00025 ERROR_FUNCTION_NOT_DEFINED_GUESS,
00026 ERROR_CONSTANT_NOT_DEFINED,
00027 ERROR_CONSTANT_NOT_DEFINED_GUESS,
00028 ERROR_EVENT_NOT_DEFINED,
00029 ERROR_EVENT_NOT_DEFINED_GUESS,
00030 ERROR_EMIT_LOCAL_EVENT,
00031 ERROR_SUBROUTINE_NOT_DEFINED,
00032 ERROR_SUBROUTINE_NOT_DEFINED_GUESS,
00033
00034 ERROR_LINE,
00035 ERROR_COL,
00036 ERROR_UNBALANCED_COMMENT_BLOCK,
00037 ERROR_SYNTAX,
00038 ERROR_INVALID_IDENTIFIER,
00039 ERROR_INVALID_HEXA_NUMBER,
00040 ERROR_INVALID_BINARY_NUMBER,
00041 ERROR_NUMBER_INVALID_BASE,
00042 ERROR_IN_NUMBER,
00043
00044 ERROR_INTERNAL,
00045 ERROR_EXPECTING,
00046 ERROR_UINT12_OUT_OF_RANGE,
00047 ERROR_UINT16_OUT_OF_RANGE,
00048 ERROR_PINT16_OUT_OF_RANGE,
00049 ERROR_INT16_OUT_OF_RANGE,
00050 ERROR_PCONSTANT_OUT_OF_RANGE,
00051 ERROR_CONSTANT_OUT_OF_RANGE,
00052 ERROR_EXPECTING_ONE_OF,
00053 ERROR_NOT_ENOUGH_TEMP_SPACE,
00054 ERROR_MISPLACED_VARDEF,
00055 ERROR_EXPECTING_IDENTIFIER,
00056 ERROR_VAR_ALREADY_DEFINED,
00057 ERROR_VAR_CONST_COLLISION,
00058 ERROR_UNDEFINED_SIZE,
00059 ERROR_NOT_ENOUGH_SPACE,
00060 ERROR_EXPECTING_ASSIGNMENT,
00061 ERROR_FOR_NULL_STEPS,
00062 ERROR_FOR_START_HIGHER_THAN_END,
00063 ERROR_FOR_START_LOWER_THAN_END,
00064 ERROR_EVENT_ALREADY_IMPL,
00065 ERROR_EVENT_WRONG_ARG_SIZE,
00066 ERROR_SUBROUTINE_ALREADY_DEF,
00067 ERROR_INDEX_EXPECTING_CONSTANT,
00068 ERROR_INDEX_WRONG_END,
00069 ERROR_SIZE_IS_NEGATIVE,
00070 ERROR_SIZE_IS_NULL,
00071 ERROR_NOT_CONST_EXPR,
00072 ERROR_FUNCTION_HAS_NO_ARG,
00073 ERROR_FUNCTION_NO_ENOUGH_ARG,
00074 ERROR_FUNCTION_WRONG_ARG_SIZE,
00075 ERROR_FUNCTION_WRONG_ARG_SIZE_TEMPLATE,
00076 ERROR_FUNCTION_TOO_MANY_ARG,
00077
00078 ERROR_UNARY_ARITH_BUILD_UNEXPECTED,
00079
00080 ERROR_INCORRECT_LEFT_VALUE,
00081 ERROR_ARRAY_OUT_OF_BOUND,
00082 ERROR_ARRAY_SIZE_MISMATCH,
00083 ERROR_IF_VECTOR_CONDITION,
00084 ERROR_WHILE_VECTOR_CONDITION,
00085 ERROR_ARRAY_ILLEGAL_ACCESS,
00086
00087 ERROR_INFINITE_LOOP,
00088 ERROR_DIVISION_BY_ZERO,
00089 ERROR_ABS_NOT_POSSIBLE,
00090 ERROR_ARRAY_OUT_OF_BOUND_READ,
00091 ERROR_ARRAY_OUT_OF_BOUND_WRITE,
00092
00093 ERROR_EXPECTING_TYPE,
00094 ERROR_EXPECTING_CONDITION,
00095
00096 ERROR_TOKEN_END_OF_STREAM,
00097 ERROR_TOKEN_STR_when,
00098 ERROR_TOKEN_STR_emit,
00099 ERROR_TOKEN_STR_for,
00100 ERROR_TOKEN_STR_in,
00101 ERROR_TOKEN_STR_step,
00102 ERROR_TOKEN_STR_while,
00103 ERROR_TOKEN_STR_do,
00104 ERROR_TOKEN_STR_if,
00105 ERROR_TOKEN_STR_then,
00106 ERROR_TOKEN_STR_else,
00107 ERROR_TOKEN_STR_elseif,
00108 ERROR_TOKEN_STR_end,
00109 ERROR_TOKEN_STR_var,
00110 ERROR_TOKEN_STR_call,
00111 ERROR_TOKEN_STR_sub,
00112 ERROR_TOKEN_STR_callsub,
00113 ERROR_TOKEN_STR_onevent,
00114 ERROR_TOKEN_STR_abs,
00115 ERROR_TOKEN_STR_return,
00116 ERROR_TOKEN_STRING_LITERAL,
00117 ERROR_TOKEN_INT_LITERAL,
00118 ERROR_TOKEN_PAR_OPEN,
00119 ERROR_TOKEN_PAR_CLOSE,
00120 ERROR_TOKEN_BRACKET_OPEN,
00121 ERROR_TOKEN_BRACKET_CLOSE,
00122 ERROR_TOKEN_COLON,
00123 ERROR_TOKEN_COMMA,
00124 ERROR_TOKEN_ASSIGN,
00125 ERROR_TOKEN_OP_OR,
00126 ERROR_TOKEN_OP_AND,
00127 ERROR_TOKEN_OP_NOT,
00128 ERROR_TOKEN_OP_BIT_OR,
00129 ERROR_TOKEN_OP_BIT_XOR,
00130 ERROR_TOKEN_OP_BIT_AND,
00131 ERROR_TOKEN_OP_BIT_NOT,
00132 ERROR_TOKEN_OP_BIT_OR_EQUAL,
00133 ERROR_TOKEN_OP_BIT_XOR_EQUAL,
00134 ERROR_TOKEN_OP_BIT_AND_EQUAL,
00135 ERROR_TOKEN_OP_EQUAL,
00136 ERROR_TOKEN_OP_NOT_EQUAL,
00137 ERROR_TOKEN_OP_BIGGER,
00138 ERROR_TOKEN_OP_BIGGER_EQUAL,
00139 ERROR_TOKEN_OP_SMALLER,
00140 ERROR_TOKEN_OP_SMALLER_EQUAL,
00141 ERROR_TOKEN_OP_SHIFT_LEFT,
00142 ERROR_TOKEN_OP_SHIFT_RIGHT,
00143 ERROR_TOKEN_OP_SHIFT_LEFT_EQUAL,
00144 ERROR_TOKEN_OP_SHIFT_RIGHT_EQUAL,
00145 ERROR_TOKEN_OP_ADD,
00146 ERROR_TOKEN_OP_NEG,
00147 ERROR_TOKEN_OP_ADD_EQUAL,
00148 ERROR_TOKEN_OP_NEG_EQUAL,
00149 ERROR_TOKEN_OP_PLUS_PLUS,
00150 ERROR_TOKEN_OP_MINUS_MINUS,
00151 ERROR_TOKEN_OP_MULT,
00152 ERROR_TOKEN_OP_DIV,
00153 ERROR_TOKEN_OP_MOD,
00154 ERROR_TOKEN_OP_MULT_EQUAL,
00155 ERROR_TOKEN_OP_DIV_EQUAL,
00156 ERROR_TOKEN_OP_MOD_EQUAL,
00157 ERROR_TOKEN_UNKNOWN,
00158 ERROR_UNKNOWN_ERROR,
00159
00160 ERROR_END
00161 };
00162 };
00163
00164 #endif // __ERRORS_H