00001
00032 #ifndef LL_LSCRIPT_TYPECHECK_H
00033 #define LL_LSCRIPT_TYPECHECK_H
00034
00035 #include "lscript_error.h"
00036
00037 LSCRIPTType implicit_casts(LSCRIPTType left_side, LSCRIPTType right_side);
00038 BOOL legal_casts(LSCRIPTType cast, LSCRIPTType base);
00039 LSCRIPTType promote(LSCRIPTType left_side, LSCRIPTType right_side);
00040 BOOL legal_assignment(LSCRIPTType left_side, LSCRIPTType right_side);
00041
00042 typedef enum e_lscript_expression_types
00043 {
00044 LET_NULL,
00045 LET_ASSIGNMENT,
00046 LET_ADD_ASSIGN,
00047 LET_SUB_ASSIGN,
00048 LET_MUL_ASSIGN,
00049 LET_DIV_ASSIGN,
00050 LET_MOD_ASSIGN,
00051 LET_EQUALITY,
00052 LET_NOT_EQUALS,
00053 LET_LESS_EQUALS,
00054 LET_GREATER_EQUALS,
00055 LET_LESS_THAN,
00056 LET_GREATER_THAN,
00057 LET_PLUS,
00058 LET_MINUS,
00059 LET_TIMES,
00060 LET_DIVIDE,
00061 LET_MOD,
00062 LET_BIT_AND,
00063 LET_BIT_OR,
00064 LET_BIT_XOR,
00065 LET_BOOLEAN_AND,
00066 LET_BOOLEAN_OR,
00067 LET_PARENTHESIS,
00068 LET_UNARY_MINUS,
00069 LET_BOOLEAN_NOT,
00070 LET_BIT_NOT,
00071 LET_PRE_INCREMENT,
00072 LET_PRE_DECREMENT,
00073 LET_CAST,
00074 LET_VECTOR_INITIALIZER,
00075 LET_QUATERNION_INITIALIZER,
00076 LET_LIST_INITIALIZER,
00077 LET_LVALUE,
00078 LET_POST_INCREMENT,
00079 LET_POST_DECREMENT,
00080 LET_FUNCTION_CALL,
00081 LET_CONSTANT,
00082 LET_FOR_EXPRESSION_LIST,
00083 LET_FUNC_EXPRESSION_LIST,
00084 LET_LIST_EXPRESSION_LIST,
00085 LET_PRINT,
00086 LET_SHIFT_LEFT,
00087 LET_SHIFT_RIGHT,
00088 LET_EOF
00089 } LSCRIPTExpressionType;
00090
00091 BOOL legal_binary_expression(LSCRIPTType &result, LSCRIPTType left_side, LSCRIPTType right_side, LSCRIPTExpressionType expression);
00092 BOOL legal_unary_expression(LSCRIPTType &result, LSCRIPTType left_side, LSCRIPTExpressionType expression);
00093
00094 void init_supported_expressions(void);
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123 #endif