An emulator, assembler, and disassembler for the Sega Game Gear
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 

58 řádky
1.1 KiB

  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. } ASMErrorType;
  11. typedef enum {
  12. ED_INC_BAD_ARG,
  13. ED_INC_RECURSION,
  14. ED_INC_FILE_READ,
  15. ED_PP_UNKNOWN,
  16. ED_PP_DUPLICATE,
  17. ED_PP_NO_ARG,
  18. ED_PP_BAD_ARG,
  19. ED_PP_ARG_RANGE
  20. } ASMErrorDesc;
  21. /* Strings */
  22. static const char *asm_error_types[] = {
  23. "include directive",
  24. "preprocessor"
  25. };
  26. static const char *asm_error_descs[] = {
  27. "missing or invalid argument",
  28. "infinite recursion detected",
  29. "couldn't read included file",
  30. "unknown directive",
  31. "multiple values for directive",
  32. "missing argument for directive",
  33. "invalid argument for directive",
  34. "directive argument out of range"
  35. };
  36. /* Structs */
  37. typedef struct ErrorInfo ErrorInfo;
  38. /* Functions */
  39. ErrorInfo* error_info_create(const ASMLine*, ASMErrorType, ASMErrorDesc);
  40. void error_info_append(ErrorInfo*, const ASMLine*);
  41. void error_info_print(const ErrorInfo*, FILE*);
  42. void error_info_destroy(ErrorInfo*);