ScriptError.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:1k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. #ifndef f_SYLIA_SCRIPTERROR_H
  2. #define f_SYLIA_SCRIPTERROR_H
  3. class CScriptError {
  4. public:
  5. int err;
  6. enum {
  7. PARSE_ERROR=1,
  8. SEMICOLON_EXPECTED,
  9. IDENTIFIER_EXPECTED,
  10. TYPE_INT_REQUIRED,
  11. TYPE_ARRAY_REQUIRED,
  12. TYPE_FUNCTION_REQUIRED,
  13. TYPE_OBJECT_REQUIRED,
  14. OBJECT_MEMBER_NAME_REQUIRED,
  15. FUNCCALLEND_EXPECTED,
  16. TOO_MANY_PARAMS,
  17. DIVIDE_BY_ZERO,
  18. VAR_NOT_FOUND,
  19. MEMBER_NOT_FOUND,
  20. OVERLOADED_FUNCTION_NOT_FOUND,
  21. IDENT_TOO_LONG,
  22. OPERATOR_EXPECTED,
  23. CLOSEPARENS_EXPECTED,
  24. CLOSEBRACKET_EXPECTED,
  25. VAR_UNDEFINED,
  26. OUT_OF_STRING_SPACE,
  27. OUT_OF_MEMORY,
  28. INTERNAL_ERROR,
  29. EXTERNAL_ERROR,
  30. FCALL_OUT_OF_RANGE,
  31. FCALL_INVALID_PTYPE,
  32. FCALL_UNKNOWN_STR,
  33. };
  34. CScriptError(int err_num) : err(err_num) { }
  35. int getErr() { return err; }
  36. };
  37. #define SCRIPT_ERROR(x) throw CScriptError(CScriptError::##x)
  38. extern "C" __declspec(dllexport) char * __stdcall TranslateScriptError(int);
  39. char inline *TranslateScriptError(CScriptError cse) {
  40. return TranslateScriptError(cse.getErr());
  41. }
  42. #endif