~swisschili/toolchain-6502

ref: c382994c73972918bc7723b5b7836c74e8e92bd6 toolchain-6502/as/as.h -rw-r--r-- 533 bytes
c382994cswissChili Start work on preprocessor 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once

#include "map.h"

#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>

#define ERR "\033[31m"
#define GREEN "\033[32m"
#define RESET "\033[0m"

char *strtok_fix(char *string, const char *token);
uint32_t skip_ws(char **code);
char *parse_label_name(char **code);
bool ws_end(char **code);

/**
 * @returns 0 on success, error code otherwise
 */
int preproc(char *code, FILE *out, map_t *macros, int flags);

/**
 * @returns NULL on failure, printing info to stderr
 */
uint32_t assemble(char *code, FILE *out);