ugl.h 989 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. proc <name>
  3. */
  4. #ifndef _UGL_H
  5. #define _UGL_H
  6. #include <stdint.h>
  7. #include <stdarg.h>
  8. #include <stdio.h>
  9. #define UGL_MAX_IDENTIFIER_LEN 63
  10. /* ugl_error.c */
  11. extern int ugl_current_input_line;
  12. extern int ugl_is_suppress_log;
  13. void ugl_err(const char *fmt, ...) __attribute__ ((noreturn));
  14. void ugl_plog(const char *fmt, ...);
  15. void ugl_glog(const char *fmt, ...);
  16. /* ugl_arrays.c */
  17. extern uint16_t ugl_bytecode_len;
  18. void ugl_InitBytecode(void);
  19. void ugl_AddBytecode(uint8_t x);
  20. void ugl_ExecBytecode(void);
  21. void ugl_ResolveSymbols(void);
  22. void ugl_WriteBytecodeCArray(FILE *fp, const char *name);
  23. int ugl_GetLabel(const char *name);
  24. void ugl_SetLabelBytecodePos(const char *name, uint16_t bytecode_pos);
  25. uint16_t ugl_GetLabelBytecodePos(int idx);
  26. /* ugl_parse.c */
  27. uint16_t uglStartNamelessProc(int args);
  28. int ugl_read_line(const char **s);
  29. int uglReadLine(const char **s);
  30. /* ugl_main.c */
  31. int ugl_read_fp(void);
  32. int ugl_read_filename(const char *name);
  33. #endif