An emulator, assembler, and disassembler for the Sega Game Gear
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

errors.h 1.3 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /* Copyright (C) 2014-2015 Ben Kurtovic <ben.kurtovic@gmail.com>
  2. Released under the terms of the MIT License. See LICENSE for details. */
  3. #pragma once
  4. #include <stdio.h>
  5. #include "state.h"
  6. /* Enums */
  7. typedef enum {
  8. ET_INCLUDE,
  9. ET_PREPROC,
  10. ET_LAYOUT,
  11. ET_SYMBOL,
  12. ET_PARSER
  13. } ASMErrorType;
  14. typedef enum {
  15. ED_NONE = 0,
  16. ED_INC_BAD_ARG,
  17. ED_INC_DEPTH,
  18. ED_INC_FILE_READ,
  19. ED_PP_UNKNOWN,
  20. ED_PP_DUPLICATE,
  21. ED_PP_NO_ARG,
  22. ED_PP_BAD_ARG,
  23. ED_PP_ARG_RANGE,
  24. ED_LYT_HEADER_RANGE,
  25. ED_LYT_DECL_RANGE,
  26. ED_LYT_BOUNDS,
  27. ED_LYT_BLOCK0,
  28. ED_LYT_SLOTS,
  29. ED_LYT_BLOCK_CROSS,
  30. ED_LYT_OVERLAP,
  31. ED_LYT_OVERLAP_HEAD,
  32. ED_SYM_DUPE_LABELS,
  33. ED_SYM_NO_LABEL,
  34. ED_SYM_TOO_LONG,
  35. ED_SYM_IS_REGISTER,
  36. ED_SYM_IS_CONDITION,
  37. ED_PS_OP_TOO_LONG,
  38. ED_PS_OP_TOO_SHORT,
  39. ED_PS_OP_INVALID,
  40. ED_PS_OP_UNKNOWN,
  41. ED_PS_TOO_FEW_ARGS,
  42. ED_PS_TOO_MANY_ARGS,
  43. ED_PS_ARG_SYNTAX,
  44. ED_PS_ARG0_TYPE,
  45. ED_PS_ARG0_BAD_REG,
  46. ED_PS_ARG1_TYPE,
  47. ED_PS_ARG1_BAD_REG,
  48. ED_PS_ARG1_RANGE
  49. } ASMErrorDesc;
  50. /* Structs */
  51. typedef struct ErrorInfo ErrorInfo;
  52. /* Functions */
  53. ErrorInfo* error_info_create(const ASMLine*, ASMErrorType, ASMErrorDesc);
  54. void error_info_append(ErrorInfo*, const ASMLine*);
  55. void error_info_print(const ErrorInfo*, FILE*);
  56. void error_info_destroy(ErrorInfo*);