From bfdc8d2d843c08bd01517256a63518d03da236f6 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Tue, 27 Jul 2021 21:10:34 +0200 Subject: Started treeify --- src/inc/context.h | 23 ----------------------- src/inc/lib.h | 33 --------------------------------- src/inc/lint.h | 8 -------- src/inc/log.h | 9 --------- src/inc/preprocess.h | 8 -------- src/inc/tokenize.h | 35 ----------------------------------- 6 files changed, 116 deletions(-) delete mode 100644 src/inc/context.h delete mode 100644 src/inc/lib.h delete mode 100644 src/inc/lint.h delete mode 100644 src/inc/log.h delete mode 100644 src/inc/preprocess.h delete mode 100644 src/inc/tokenize.h (limited to 'src/inc') diff --git a/src/inc/context.h b/src/inc/context.h deleted file mode 100644 index 603f42e..0000000 --- a/src/inc/context.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef CONTEXT_H -#define CONTEXT_H - -#include - -struct ctx { - size_t line; - size_t column; - const char *path; - - char *raw; - char *data; - size_t size; - - size_t token_count; - struct token *tokens; -}; - -struct ctx *context_create(const char *path); -void context_destroy(struct ctx *ctx); -void context_rewind(struct ctx *ctx); - -#endif diff --git a/src/inc/lib.h b/src/inc/lib.h deleted file mode 100644 index 0402990..0000000 --- a/src/inc/lib.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef LIB_H -#define LIB_H - -// Compatibility imports (mainly for Melvix) - -#ifdef __melvix__ - -#include -#include -#include -#include -#include -#include -#include -typedef size_t u32; - -#elif defined(__linux__) || defined(unix) || defined(__unix__) || defined(__unix) || \ - defined(__APPLE__) || defined(__FreeBSD) - -#include -#include -#include -#include -#include -#include -#include -#include - -#else -#error "Unknown operating system" -#endif - -#endif diff --git a/src/inc/lint.h b/src/inc/lint.h deleted file mode 100644 index 9c3f808..0000000 --- a/src/inc/lint.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef LINT_H -#define LINT_H - -#include - -void lint(struct ctx *ctx); - -#endif diff --git a/src/inc/log.h b/src/inc/log.h deleted file mode 100644 index 4698f9c..0000000 --- a/src/inc/log.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef LOG_H -#define LOG_H - -#include - -__attribute__((noreturn)) void errln(struct ctx *ctx, const char *fmt, ...); -__attribute__((noreturn)) void err(const char *fmt, ...); - -#endif diff --git a/src/inc/preprocess.h b/src/inc/preprocess.h deleted file mode 100644 index e57af10..0000000 --- a/src/inc/preprocess.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef PREPROCESS_H -#define PREPROCESS_H - -#include - -void preprocess(struct ctx *ctx); - -#endif diff --git a/src/inc/tokenize.h b/src/inc/tokenize.h deleted file mode 100644 index 557da9c..0000000 --- a/src/inc/tokenize.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef TOKENIZE_H -#define TOKENIZE_H - -#include - -#define TOKENS_MAX 4096 - -enum token_type { - UNKNOWN, - - TYPE, - TYPEDELIM, - PARAM, - - IDENT, - OPERATOR, - - LPAREN, - RPAREN, - EQUAL, - - NEWLINE, - EOL, - END, -}; - -struct token { - enum token_type type; - size_t start, end; -}; - -void tokens_print(struct ctx *ctx); -void tokenize(struct ctx *ctx); - -#endif -- cgit v1.2.3