27 lines
655 B
C
27 lines
655 B
C
#ifndef __FRONTEND_H__
|
|
#define __FRONTEND_H__
|
|
|
|
#ifndef error
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <assert.h>
|
|
#define STD_LIBRARY
|
|
#define error(...) do { fprintf(stderr, __VA_ARGS__); assert(0); } while (0)
|
|
#endif
|
|
#ifndef warn
|
|
#include <stdio.h>
|
|
#define STD_LIBRARY
|
|
#define warn(...) do { fprintf(stdout, __VA_ARGS__); } while (0)
|
|
#endif
|
|
|
|
#define xmalloc(size) malloc(size)
|
|
|
|
#ifndef FRONTEND_IMPLEMENTATION
|
|
#include "parser/parser.h"
|
|
#include "parser/ast/ast.h"
|
|
|
|
typedef int (*sread_fn)(void *dst_buf, int dst_size, int elem_size, int count, void *stream);
|
|
struct ASTNode* frontend(const char* file, void* stream, sread_fn sread);
|
|
#endif
|
|
|
|
#endif |