swissChili | 97b5d8b | 2020-08-15 20:00:54 -0700 | [diff] [blame] | 1 | #pragma once |
| 2 | |
swissChili | c382994 | 2020-09-06 19:36:04 -0700 | [diff] [blame] | 3 | #include "map.h" |
| 4 | |
swissChili | 97b5d8b | 2020-08-15 20:00:54 -0700 | [diff] [blame] | 5 | #include <stdio.h> |
| 6 | #include <stdint.h> |
swissChili | c382994 | 2020-09-06 19:36:04 -0700 | [diff] [blame] | 7 | #include <stdbool.h> |
swissChili | 97b5d8b | 2020-08-15 20:00:54 -0700 | [diff] [blame] | 8 | |
swissChili | c382994 | 2020-09-06 19:36:04 -0700 | [diff] [blame] | 9 | #define ERR "\033[31m" |
| 10 | #define GREEN "\033[32m" |
| 11 | #define RESET "\033[0m" |
| 12 | |
| 13 | char *strtok_fix(char *string, const char *token); |
| 14 | uint32_t skip_ws(char **code); |
| 15 | char *parse_label_name(char **code); |
| 16 | bool ws_end(char **code); |
| 17 | |
| 18 | /** |
| 19 | * @returns 0 on success, error code otherwise |
| 20 | */ |
| 21 | int preproc(char *code, FILE *out, map_t *macros, int flags); |
| 22 | |
| 23 | /** |
swissChili | 97b5d8b | 2020-08-15 20:00:54 -0700 | [diff] [blame] | 24 | * @returns NULL on failure, printing info to stderr |
| 25 | */ |
| 26 | uint32_t assemble(char *code, FILE *out); |